WavFileAudioSink class final
A single-use, bounded-memory WAV AudioSink backed by a local file.
prepare creates or truncates path and writes a placeholder canonical
WAV header. Every write encodes directly to the file in bounded chunks;
callers must honor AudioSinkCapabilities.requiresSequentialWrites.
Constructors
- WavFileAudioSink({required String path, WavSampleEncoding encoding = WavSampleEncoding.pcm16, WavGapPolicy gapPolicy = WavGapPolicy.reject, WavFileAbortPolicy abortPolicy = WavFileAbortPolicy.finalizeAcceptedAudio, int encodingBufferBytes = 64 * 1024})
- Creates a file-backed sink.
Properties
- abortPolicy → WavFileAbortPolicy
-
Cleanup behavior for an aborted or failed session.
final
- encoding → WavSampleEncoding
-
PCM representation stored in the WAV data chunk.
final
- encodingBufferBytes → int
-
Maximum temporary encoding allocation per file write.
final
- gapPolicy → WavGapPolicy
-
How source timeline gaps are handled.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- path → String
-
Destination file path.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
prepare(
AudioFormat format, {AudioCancellationToken? cancellationToken}) → Future< WavFileAudioSinkSession> -
Allocates a sink for
formatwithout accepting frames yet. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited