Share via


AudioFile.WritePackets Method

Definition

Overloads

Name Description
WritePackets(Boolean, Int64, AudioStreamPacketDescription[], IntPtr, Int32)

Write audio packets to the audio file.

WritePackets(Boolean, Int64, Int32, IntPtr, Int32)

Write audio packets to the audio file.

WritePackets(Boolean, Int32, AudioStreamPacketDescription[], Int64, Int32, IntPtr)

Write audio packets to the audio file.

WritePackets(Boolean, Int64, AudioStreamPacketDescription[], Byte[], Int32, Int32)

Write audio packets to the audio file.

WritePackets(Boolean, Int64, AudioStreamPacketDescription[], IntPtr, Int32, AudioFileError)

Write audio packets to the audio file.

WritePackets(Boolean, Int64, AudioStreamPacketDescription[], IntPtr, Int32, Int32)
Obsolete.

Write audio packets to the audio file.

WritePackets(Boolean, AudioStreamPacketDescription[], AudioStreamPacketDependencyDescription[], Int64, Int32, IntPtr, Int32)

Writes audio packets to the file.

WritePackets(Boolean, Int64, AudioStreamPacketDescription[], Byte[], Int32, Int32, AudioFileError)

Write audio packets to the audio file.

WritePackets(Boolean, Int64, AudioStreamPacketDescription[], Byte[], Int32, Int32, Int32)
Obsolete.

Write audio packets to the audio file.

WritePackets(Boolean, AudioStreamPacketDescription[], AudioStreamPacketDependencyDescription[], Int64, Int32, Byte[], Int32, Int32)

Writes audio packets to the file.

WritePackets(Boolean, Int64, AudioStreamPacketDescription[], IntPtr, Int32)

Write audio packets to the audio file.

public int WritePackets(bool useCache, long startingPacket, AudioToolbox.AudioStreamPacketDescription[] packetDescriptions, IntPtr buffer, int byteCount);
member this.WritePackets : bool * int64 * AudioToolbox.AudioStreamPacketDescription[] * nativeint * int -> int

Parameters

useCache
Boolean

Whether the data should be kept in the cache.

startingPacket
Int64

The starting packet in the packetDescriptions that should be written.

packetDescriptions
AudioStreamPacketDescription[]

An array of packet descriptions that describe the content of the buffer.

buffer
IntPtr

nativeint

The buffer containing the audio data.

byteCount
Int32

The number of bytes to write.

Returns

The number of packets written or -1 on error.

Applies to

WritePackets(Boolean, Int64, Int32, IntPtr, Int32)

Write audio packets to the audio file.

public int WritePackets(bool useCache, long startingPacket, int numPackets, IntPtr buffer, int byteCount);
member this.WritePackets : bool * int64 * int * nativeint * int -> int

Parameters

useCache
Boolean

Whether the data should be kept in the cache.

startingPacket
Int64

The starting packet that should be written.

numPackets
Int32

The number of packets to write.

buffer
IntPtr

nativeint

The buffer containing the audio data.

byteCount
Int32

The number of bytes to write.

Returns

The number of packets written or -1 on error.

Applies to

WritePackets(Boolean, Int32, AudioStreamPacketDescription[], Int64, Int32, IntPtr)

Write audio packets to the audio file.

public AudioToolbox.AudioFileError WritePackets(bool useCache, int numBytes, AudioToolbox.AudioStreamPacketDescription[] packetDescriptions, long startingPacket, ref int numPackets, IntPtr buffer);
member this.WritePackets : bool * int * AudioToolbox.AudioStreamPacketDescription[] * int64 * int * nativeint -> AudioToolbox.AudioFileError

Parameters

useCache
Boolean

Whether the data should be kept in the cache.

numBytes
Int32

The number of bytes to write.

packetDescriptions
AudioStreamPacketDescription[]

An array of packet descriptions that describe the content of the buffer.

startingPacket
Int64

The starting packet in the packetDescriptions that should be written.

numPackets
Int32

On input the number of packets to write, upon return the number of packets actually written.

buffer
IntPtr

nativeint

The buffer containing the audio data.

Returns

Success if successful, or an error code otherwise.

Applies to

WritePackets(Boolean, Int64, AudioStreamPacketDescription[], Byte[], Int32, Int32)

Write audio packets to the audio file.

public int WritePackets(bool useCache, long startingPacket, AudioToolbox.AudioStreamPacketDescription[] packetDescriptions, byte[] buffer, int offset, int byteCount);
member this.WritePackets : bool * int64 * AudioToolbox.AudioStreamPacketDescription[] * byte[] * int * int -> int

Parameters

useCache
Boolean

Whether the data should be kept in the cache.

startingPacket
Int64

The starting packet in the packetDescriptions that should be written.

packetDescriptions
AudioStreamPacketDescription[]

An array of packet descriptions that describe the content of the buffer.

buffer
Byte[]

The buffer containing the audio data.

offset
Int32

The offset in the output buffer where to start writing packets to.

byteCount
Int32

The number of bytes to write.

Returns

The number of packets written or -1 on error.

Applies to

WritePackets(Boolean, Int64, AudioStreamPacketDescription[], IntPtr, Int32, AudioFileError)

Write audio packets to the audio file.

public int WritePackets(bool useCache, long startingPacket, AudioToolbox.AudioStreamPacketDescription[] packetDescriptions, IntPtr buffer, int byteCount, out AudioToolbox.AudioFileError errorCode);
member this.WritePackets : bool * int64 * AudioToolbox.AudioStreamPacketDescription[] * nativeint * int * AudioFileError -> int

Parameters

useCache
Boolean

Whether the data should be kept in the cache.

startingPacket
Int64

The starting packet in the packetDescriptions that should be written.

packetDescriptions
AudioStreamPacketDescription[]

An array of packet descriptions that describe the content of the buffer.

buffer
IntPtr

nativeint

The buffer containing the audio data.

byteCount
Int32

The number of bytes to write.

errorCode
AudioFileError

Success if successful, or an error code otherwise.

Returns

The number of packets written or -1 on error.

Applies to

WritePackets(Boolean, Int64, AudioStreamPacketDescription[], IntPtr, Int32, Int32)

Caution

Use 'WritePackets (bool, long, AudioStreamPacketDescription[], IntPtr, int, out AudioFileError)' instead.

Write audio packets to the audio file.

[System.Obsolete("Use 'WritePackets (bool, long, AudioStreamPacketDescription[], IntPtr, int, out AudioFileError)' instead.")]
public int WritePackets(bool useCache, long startingPacket, AudioToolbox.AudioStreamPacketDescription[] packetDescriptions, IntPtr buffer, int byteCount, out int errorCode);
[<System.Obsolete("Use 'WritePackets (bool, long, AudioStreamPacketDescription[], IntPtr, int, out AudioFileError)' instead.")>]
member this.WritePackets : bool * int64 * AudioToolbox.AudioStreamPacketDescription[] * nativeint * int * int -> int

Parameters

useCache
Boolean

Whether the data should be kept in the cache.

startingPacket
Int64

The starting packet in the packetDescriptions that should be written.

packetDescriptions
AudioStreamPacketDescription[]

An array of packet descriptions that describe the content of the buffer.

buffer
IntPtr

nativeint

The buffer containing the audio data.

byteCount
Int32

The number of bytes to write.

errorCode
Int32

Success if successful, or an error code otherwise.

Returns

The number of packets written or -1 on error.

Attributes

Applies to

WritePackets(Boolean, AudioStreamPacketDescription[], AudioStreamPacketDependencyDescription[], Int64, Int32, IntPtr, Int32)

Writes audio packets to the file.

public AudioToolbox.AudioFileError WritePackets(bool useCache, AudioToolbox.AudioStreamPacketDescription[]? packetDescriptions, AudioToolbox.AudioStreamPacketDependencyDescription[] packetDependencies, long startingPacket, ref int numPackets, IntPtr buffer, int numBytes);
member this.WritePackets : bool * AudioToolbox.AudioStreamPacketDescription[] * AudioToolbox.AudioStreamPacketDependencyDescription[] * int64 * int * nativeint * int -> AudioToolbox.AudioFileError

Parameters

useCache
Boolean

Whether the data should be kept in the cache.

packetDescriptions
AudioStreamPacketDescription[]

An array of packet descriptions that describe the content of the buffer.

packetDependencies
AudioStreamPacketDependencyDescription[]

An array of packet dependencies for the audio data.

startingPacket
Int64

The index the first packet in the buffer to write.

numPackets
Int32

The number of packets to write replaced with the number of packets actually written.

buffer
IntPtr

nativeint

The buffer containing the audio data to write.

numBytes
Int32

The number of bytes to write.

Returns

Success if successful, otherwise a status error code.

Applies to

WritePackets(Boolean, Int64, AudioStreamPacketDescription[], Byte[], Int32, Int32, AudioFileError)

Write audio packets to the audio file.

public int WritePackets(bool useCache, long startingPacket, AudioToolbox.AudioStreamPacketDescription[] packetDescriptions, byte[] buffer, int offset, int byteCount, out AudioToolbox.AudioFileError errorCode);
member this.WritePackets : bool * int64 * AudioToolbox.AudioStreamPacketDescription[] * byte[] * int * int * AudioFileError -> int

Parameters

useCache
Boolean

Whether the data should be kept in the cache.

startingPacket
Int64

The starting packet in the packetDescriptions that should be written.

packetDescriptions
AudioStreamPacketDescription[]

An array of packet descriptions that describe the content of the buffer.

buffer
Byte[]

The buffer containing the audio data.

offset
Int32

The offset in the output buffer where to start writing packets to.

byteCount
Int32

The number of bytes to write.

errorCode
AudioFileError

Success if successful, or an error code otherwise.

Returns

The number of packets written or -1 on error.

Applies to

WritePackets(Boolean, Int64, AudioStreamPacketDescription[], Byte[], Int32, Int32, Int32)

Caution

Use 'WritePackets (bool, long, AudioStreamPacketDescription[], byte[], int, int, out AudioFileError)' instead.

Write audio packets to the audio file.

[System.Obsolete("Use 'WritePackets (bool, long, AudioStreamPacketDescription[], byte[], int, int, out AudioFileError)' instead.")]
public int WritePackets(bool useCache, long startingPacket, AudioToolbox.AudioStreamPacketDescription[] packetDescriptions, byte[] buffer, int offset, int byteCount, out int errorCode);
[<System.Obsolete("Use 'WritePackets (bool, long, AudioStreamPacketDescription[], byte[], int, int, out AudioFileError)' instead.")>]
member this.WritePackets : bool * int64 * AudioToolbox.AudioStreamPacketDescription[] * byte[] * int * int * int -> int

Parameters

useCache
Boolean

Whether the data should be kept in the cache.

startingPacket
Int64

The starting packet in the packetDescriptions that should be written.

packetDescriptions
AudioStreamPacketDescription[]

An array of packet descriptions that describe the content of the buffer.

buffer
Byte[]

The buffer containing the audio data.

offset
Int32

The offset in the output buffer where to start writing packets to.

byteCount
Int32

The number of bytes to write.

errorCode
Int32

Success if successful, or an error code otherwise.

Returns

The number of packets written or -1 on error.

Attributes

Applies to

WritePackets(Boolean, AudioStreamPacketDescription[], AudioStreamPacketDependencyDescription[], Int64, Int32, Byte[], Int32, Int32)

Writes audio packets to the file.

public AudioToolbox.AudioFileError WritePackets(bool useCache, AudioToolbox.AudioStreamPacketDescription[]? packetDescriptions, AudioToolbox.AudioStreamPacketDependencyDescription[] packetDependencies, long startingPacket, ref int numPackets, byte[] buffer, int offset, int numBytes);
member this.WritePackets : bool * AudioToolbox.AudioStreamPacketDescription[] * AudioToolbox.AudioStreamPacketDependencyDescription[] * int64 * int * byte[] * int * int -> AudioToolbox.AudioFileError

Parameters

useCache
Boolean

Whether the data should be kept in the cache.

packetDescriptions
AudioStreamPacketDescription[]

An array of packet descriptions that describe the content of the buffer.

packetDependencies
AudioStreamPacketDependencyDescription[]

An array of packet dependencies for the audio data.

startingPacket
Int64

The index the first packet in the buffer to write.

numPackets
Int32

The number of packets to write replaced with the number of packets actually written.

buffer
Byte[]

The buffer containing the audio data to write.

offset
Int32

An offset into buffer where the audio data to write starts.

numBytes
Int32

The number of bytes to write.

Returns

Success if successful, otherwise a status error code.

Applies to