-
Notifications
You must be signed in to change notification settings - Fork 282
Open
Description
Package version
6.1.2
Environment
- OS: ios
Describe the bug
Trying to resume recording and i keep getting this error preventing me from being able to record again. It only happens after I've been recording for a bit and then stop, and maybe do this a couple times, and then it breaks and is unresumable.
return RecordConfig(
encoder: AudioEncoder.pcm16bits,
sampleRate: sampleRate,
numChannels: 1,
androidConfig: const AndroidRecordConfig(
manageBluetooth: true,
audioSource: AndroidAudioSource.defaultSource,
audioManagerMode: AudioManagerMode.modeNormal,
),
iosConfig: const IosRecordConfig(
categoryOptions: [
IosAudioCategoryOption.allowBluetooth,
IosAudioCategoryOption.allowBluetoothA2DP,
IosAudioCategoryOption.defaultToSpeaker,
],
),
);
NOTE: i also use a managed audio session with these settings:
_session = await AudioSession.instance;
await _session.configure(
AudioSessionConfiguration(
avAudioSessionCategory: AVAudioSessionCategory.playAndRecord,
avAudioSessionCategoryOptions:
AVAudioSessionCategoryOptions.mixWithOthers |
AVAudioSessionCategoryOptions.allowBluetooth,
avAudioSessionMode:
AVAudioSessionMode.spokenAudio,
androidAudioAttributes: const AndroidAudioAttributes(
usage: AndroidAudioUsage.voiceCommunication,
contentType: AndroidAudioContentType.speech,
),
),
To Reproduce
Steps to reproduce the behavior:
final config = _buildRecordConfig(sampleRate);
Stream<Uint8List> stream;
try {
stream = await _audioRecorder.startStream(config);
} catch (e, stack) {
logger.severe('Failed to start audio recorder stream');
logger.severe('Error: $e');
logger.severe('Stack trace: $stack');
await _stopRecorderStream(state);
rethrow;
}
Expected behavior
I expect to be able to resume a recording, this worked with flutter sound, exact same setup - I've only started seeing this issue after switching to your package.
Additional context
Add any other context about the problem here.
Metadata
Metadata
Assignees
Labels
No labels