AudioFile.Write Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
| Name | Description |
|---|---|
| Write(Int64, Byte[], Int32, Int32, Boolean) |
Writes a block of data to the audio file. |
| Write(Int64, Byte[], Int32, Int32, Boolean, AudioFileError) |
Writes a block of data to the audio file. |
| Write(Int64, Byte[], Int32, Int32, Boolean, Int32) |
Obsolete.
Writes a block of data to the audio file. |
Write(Int64, Byte[], Int32, Int32, Boolean)
Writes a block of data to the audio file.
public int Write(long startingByte, byte[] buffer, int offset, int count, bool useCache);
member this.Write : int64 * byte[] * int * int * bool -> int
Parameters
- startingByte
- Int64
The starting byte in the file where the data will be written.
- buffer
- Byte[]
The buffer that holds the data.
- offset
- Int32
The offset within the buffer where the data to be saved starts.
- count
- Int32
The number of bytes to write to the file.
- useCache
- Boolean
Whether the data should be cached.
Returns
The number of bytes written to the stream, or -1 on error.
Remarks
This API merely writes bytes to the file without any encoding. Use any of the WritePackets overloads to write with encoding.
Applies to
Write(Int64, Byte[], Int32, Int32, Boolean, AudioFileError)
Writes a block of data to the audio file.
public int Write(long startingByte, byte[] buffer, int offset, int count, bool useCache, out AudioToolbox.AudioFileError errorCode);
member this.Write : int64 * byte[] * int * int * bool * AudioFileError -> int
Parameters
- startingByte
- Int64
The starting byte in the file where the data will be written.
- buffer
- Byte[]
The buffer that holds the data.
- offset
- Int32
The offset within the buffer where the data to be saved starts.
- count
- Int32
The number of bytes to write to the file.
- useCache
- Boolean
Whether the data should be cached.
- errorCode
- AudioFileError
Success if successful, or an error code otherwise.
Returns
The number of bytes written to the stream, or -1 on error.
Remarks
This API merely writes bytes to the file without any encoding. Use any of the WritePackets overloads to write with encoding.
Applies to
Write(Int64, Byte[], Int32, Int32, Boolean, Int32)
Caution
Use 'Write (long, byte[], int, int, bool, out AudioFileError)' instead.
Writes a block of data to the audio file.
[System.Obsolete("Use 'Write (long, byte[], int, int, bool, out AudioFileError)' instead.")]
public int Write(long startingByte, byte[] buffer, int offset, int count, bool useCache, out int errorCode);
[<System.Obsolete("Use 'Write (long, byte[], int, int, bool, out AudioFileError)' instead.")>]
member this.Write : int64 * byte[] * int * int * bool * int -> int
Parameters
- startingByte
- Int64
The starting byte in the file where the data will be written.
- buffer
- Byte[]
The buffer that holds the data.
- offset
- Int32
The offset within the buffer where the data to be saved starts.
- count
- Int32
The number of bytes to write to the file.
- useCache
- Boolean
Whether the data should be cached.
Returns
The number of bytes written to the stream, or -1 on error.
- Attributes