startRecorder method
Future<void>
startRecorder(
- FlutterSoundRecorderCallback callback, {
- String? path,
- Codec? codec,
- StreamSink<
Uint8List> ? toStream, - StreamSink<
List< ? toStreamFloat32,Float32List> > - StreamSink<
List< ? toStreamInt16,Int16List> > - AudioSource? audioSource,
- Duration timeSlice = Duration.zero,
- int sampleRate = 16000,
- int numChannels = 1,
- int bitRate = 16000,
- int bufferSize = 8192,
- bool enableVoiceProcessing = false,
override
Implementation
@override
Future<void> startRecorder(
FlutterSoundRecorderCallback callback, {
String? path,
Codec? codec,
StreamSink<Uint8List>? toStream,
StreamSink<List<Float32List>>? toStreamFloat32,
StreamSink<List<Int16List>>? toStreamInt16,
AudioSource? audioSource,
Duration timeSlice = Duration.zero,
int sampleRate = 16000,
int numChannels = 1,
int bitRate = 16000,
int bufferSize = 8192,
bool enableVoiceProcessing = false,
}) async {
mediaRecorderWeb = null;
/*
if (toStream != null || toStreamFloat32 != null || toStreamInt16 != null) {
return startRecorderToStream(
callback,
codec: codec!,
toStream: toStream,
toStreamFloat32: toStreamFloat32,
toStreamInt16: toStreamInt16,
audioSource: audioSource,
timeSlice: timeSlice,
sampleRate: sampleRate,
numChannels: numChannels,
bufferSize: bufferSize,
);
} else */
{
assert(codec != Codec.pcmFloat32 && codec != Codec.pcm16);
getWebSession(callback)!.startRecorder(
path,
sampleRate,
numChannels,
bitRate,
bufferSize,
enableVoiceProcessing,
codec!.index,
toStream != null,
audioSource!.index,
);
//_recorderState = RecorderState.isRecording;
}
}