-
Notifications
You must be signed in to change notification settings - Fork 282
Closed
Description
Package version
- record: ^5.2.0 (tried with 5.1.2 - same problem)
Environment
- OS: Android
- Device: Emulator android-arm64 Pixel 4 API 34 / Samsung A54 / Xiaomi 12T
Describe the bug
We need to have opportunity to stop the recorder immediately after the start.
iOS works fine, but android has the problem with it.
If we try to stop immediately after startStream - stop does not complete
Tried to add 50ms delay before the stop, but it doesn't work for all devices.
This issue seems very similar, but fix didn't help
To Reproduce
Steps to reproduce the behavior:
- Run the project with this code
void main() {
runApp(_App());
}
class _App extends StatelessWidget {
const _App({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
home: _TestRecorder(),
);
}
}
class _TestRecorder extends StatefulWidget {
const _TestRecorder({super.key});
@override
State<_TestRecorder> createState() => _TestRecorderState();
}
class _TestRecorderState extends State<_TestRecorder> {
final _recorder = AudioRecorder();
@override
Widget build(BuildContext context) {
return Scaffold(
body: Center(
child: ElevatedButton(
onPressed: () async {
print('START');
await _recorder.startStream(const RecordConfig(
encoder: AudioEncoder.pcm16bits,
sampleRate: 16000,
numChannels: 1,
noiseSuppress: true,
androidConfig: AndroidRecordConfig(manageBluetooth: false),
));
print('START FINISHED');
await _recorder.stop();
print('STOP FINISHED');
},
child: const Text('TEST'),
),
),
);
}
}
- Tap 'test' button
- 'STOP FINISHED' doesn't appear
Expected behavior
Should stop like in iOS
Thinout, lamniskata and Glebosik
Metadata
Metadata
Assignees
Labels
No labels