WAVRecorder
class NatML.Recorders.WAVRecorder : IMediaRecorder
The
WAVRecorder
records audio to *.wav
waveform files./// <summary>
/// Create an WAV recorder.
/// </summary>
/// <param name="sampleRate">Audio sample rate.</param>
/// <param name="channelCount">Audio channel count.</param>
WAVRecorder (int sampleRate, int channelCount);
You will provide the audio
sampleRate
and channelCount
in order to specify the audio format of the audio sample buffers that will be committed to the recorder.- Set the
sampleRate
toAudioSettings.outputSampleRate.
- Set the
channelCount
to(int)AudioSettings.speakerMode
.
/// <summary>
/// Commit an audio sample buffer for encoding.
/// </summary>
/// <param name="sampleBuffer">Linear PCM audio sample buffer, interleaved by channel.</param>
/// <param name="timestamp">Not used.</param>
void CommitSamples (float[] sampleBuffer, long timestamp = ...);
The
WAVRecorder
does not use timestamps on committed frames.The
WAVRecorder
does not support committing video frames. Doing so is a null operation./// <summary>
/// Finish writing and return the path to the recorded media file.
/// </summary>
Task<string> FinishWriting ();
Last modified 6mo ago