Struct creek_core::write::WriteDiskStream[][src]

pub struct WriteDiskStream<E: Encoder> { /* fields omitted */ }
Expand description

A realtime-safe disk-streaming writer of audio files.

Implementations

Open a new realtime-safe disk-streaming writer.

  • file - The path to the file to open.
  • num_channels - The number of channels in the file.
  • sample_rate - The sample rate of the file.
  • stream_opts - Additional stream options.

Returns true if the stream is ready for writing, false otherwise.

This is realtime-safe.

In theory this should never return false, but this function is here as a sanity-check.

Blocks the current thread until the stream is ready to be written to.

NOTE: This is note realtime-safe.

In theory you shouldn’t need this, but this function is here as a sanity-check.

Write the buffer of frames into the file.

This is realtime-safe.

Some codecs (like WAV) have a maximum size of 4GB. If more than 4GB of data is pushed to this stream, then a new file will automatically be created to hold more data. The name of this file will be the same name as the main file with “_XXX” appended to the end (i.e. “_001”, “_002”, etc.). WriteDiskStream::num_files() can be used to get the total numbers of files that have been created.

Finish the file and close the stream. The stream cannot be used after calling this.

This is realtime-safe.

WriteDiskStream.finish_complete() will return true once the file has been successfully finished and closed.

Delete all files created by this stream and close the stream. The stream cannot be used after calling this.

This is realtime-safe.

Delete all files created by this stream and start over. This stream can continue to be written to after calling this.

This is realtime-safe.

Returns true when the file has been successfully finished and closed, false otherwise.

This is realtime-safe.

Return info about the file.

This is realtime-safe.

Returns the total number of files created by this stream. This can be more than one depending on the codec and the number of written frames.

This is realtime-safe.

Trait Implementations

Executes the destructor for this type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.