saveRecFile method

Future<FileRec> saveRecFile(
  1. String filePath, {
  2. AudioEncoding encoding = AudioEncoding.wav,
  3. SampleFormat? sampleFormat,
  4. int? channelCount,
  5. int? sampleRate,
})

Creates a file and starts recording into it.

Parameters directly influence the resulting file size. If any are absent, they take values from the device, which is a bit faster.

encoding - currently only WAV is supported, so there's no need in this parameter. sampleFormat - the amount of different amplitude levels of the data. channelCount - must be in range 1..254 inclusive. sampleRate - controls sound frequencies that can be properly captured in a recording. Must be in range 1000..384000 inclusive.

Implementation

Future<FileRec> saveRecFile(
  String filePath, {
  AudioEncoding encoding = AudioEncoding.wav,
  SampleFormat? sampleFormat,
  int? channelCount,
  int? sampleRate,
}) =>
    _saveRec(
      (recorder) => FileRec._(File(filePath), recorder),
      encoding: encoding,
      sampleFormat: sampleFormat,
      channelCount: channelCount,
      sampleRate: sampleRate,
    );