Class ExtendedAudioFileWriter
Provides a writer that can create audio files.
Uses the Audio Toolbox framework Extended Audio File Services API to write the file.
public class ExtendedAudioFileWriter : ExtendedAudioFileServicesWriter, IAsyncDisposable, IDisposable
- Inheritance
-
ExtendedAudioFileWriter
- Implements
- Inherited Members
Methods
CreateToFilePath(string, ExtendedAudioFileWriterSettings, bool)
Constructs a new instance of the ExtendedAudioFileWriter class, providing the file path where the new produced file will be located to.
public static ExtendedAudioFileWriter CreateToFilePath(string filePath, ExtendedAudioFileWriterSettings settings, bool overwriteIfExists = false)
Parameters
filePathstringThe path of the file to write
settingsExtendedAudioFileWriterSettingsSettings for the writer to use.
overwriteIfExistsboolIf the file is existing, when specified to true, it overwrites the file instead of throwing an exception.
Returns
- ExtendedAudioFileWriter
A new instance of the ExtendedAudioFileWriter class.
Exceptions
- ArgumentException
The specified settings object does not define the minimal requirements for writing a file.
- ArgumentNullException
filePathand/orsettingsare null.
CreateToStream(Stream, ExtendedAudioFileWriterSettings)
Constructs a new instance of the ExtendedAudioFileWriter class, providing the data stream where the encoded data will be placed to.
public static ExtendedAudioFileWriter CreateToStream(Stream writeableStream, ExtendedAudioFileWriterSettings settings)
Parameters
writeableStreamStreamThe data stream where to write data to
settingsExtendedAudioFileWriterSettingsSettings for the writer to use.
Returns
- ExtendedAudioFileWriter
A new instance of the ExtendedAudioFileWriter class.
Remarks
The native API requires that all the basic Stream implementations are functional - that is, the stream must be able to be read, written and sought. If you want to write to a stream that is not that capable, use an intermediate MemoryStream instance to make sure the writer can work with it, then copy the data written to it to your target stream.
Exceptions
- ArgumentException
The specified settings object does not define the minimal requirements for writing a file.
-or-
The stream is not writeable, seekable and readable.
- ArgumentNullException
writeableStreamand/orsettingsare null.
CreateToURL(Uri, ExtendedAudioFileWriterSettings, bool)
Constructs a new instance of the ExtendedAudioFileWriter class, providing the URL where the new produced file will be located to.
public static ExtendedAudioFileWriter CreateToURL(Uri url, ExtendedAudioFileWriterSettings settings, bool overwriteIfExists = false)
Parameters
urlUriThe URL of the file to write
settingsExtendedAudioFileWriterSettingsSettings for the writer to use.
overwriteIfExistsboolIf the file is existing, when specified to true, it overwrites the file instead of throwing an exception.
Returns
- ExtendedAudioFileWriter
A new instance of the ExtendedAudioFileWriter class.
Exceptions
- ArgumentException
The specified settings object does not define the minimal requirements for writing a file.
- ArgumentNullException
urland/orsettingsare null.