C# Класс GAudio.GATAsyncWavWriter

Creates or overwrites a wav file. Writing to the file and finalizing the header is done on a seperate thread. Input is cached in a ring buffer, and written in chunks of size AudioSettings.dspBufferSize. Note: this class is lockless.
Наследование: IDisposable
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
WriteChunkFrames int

Открытые методы

Метод Описание
Dispose ( ) : void

Releases all resource used by the GATAsyncWavWriter object.

Call Dispose when you are finished using the GATAsyncWavWriter. The Dispose method leaves the GATAsyncWavWriter in an unusable state. After calling Dispose, you must release all references to the GATAsyncWavWriter so the garbage collector can reclaim the memory that the GATAsyncWavWriter was occupying.

GATAsyncWavWriter ( string filePath, int numChannels, bool overwrite ) : System

filePath should be absolute and valid. If the file doesn't exist, it will be immediately created.

PrepareToWrite ( ) : void

You must call PrepareToWrite before the first WriteStreamAsync call. This starts a thread which waits for input and writes to disk when enough data has been received.

StopAndFinalize ( ) : void

Blocks further input, flushes what is left in the ring buffer to disk, and finalizes the header. As these operations are async, the file will not be immediately ready to be opened.

WriteStreamAsync ( float data, int offset, int numFrames ) : void

Hand out data here sequentially. If PrepareToWrite has not been called before, this method will have no effect. Note that numFrames should not exceed WriteChunkFrames.

Защищенные методы

Метод Описание
Dispose ( bool explicitly ) : void

Приватные методы

Метод Описание
AsyncWriteLoop ( ) : void
ConvertAndWriteChunk ( int numFrames ) : void

Описание методов

Dispose() публичный Метод

Releases all resource used by the GATAsyncWavWriter object.
Call Dispose when you are finished using the GATAsyncWavWriter. The Dispose method leaves the GATAsyncWavWriter in an unusable state. After calling Dispose, you must release all references to the GATAsyncWavWriter so the garbage collector can reclaim the memory that the GATAsyncWavWriter was occupying.
public Dispose ( ) : void
Результат void

Dispose() защищенный Метод

protected Dispose ( bool explicitly ) : void
explicitly bool
Результат void

GATAsyncWavWriter() публичный Метод

filePath should be absolute and valid. If the file doesn't exist, it will be immediately created.
public GATAsyncWavWriter ( string filePath, int numChannels, bool overwrite ) : System
filePath string
numChannels int
overwrite bool
Результат System

PrepareToWrite() публичный Метод

You must call PrepareToWrite before the first WriteStreamAsync call. This starts a thread which waits for input and writes to disk when enough data has been received.
public PrepareToWrite ( ) : void
Результат void

StopAndFinalize() публичный Метод

Blocks further input, flushes what is left in the ring buffer to disk, and finalizes the header. As these operations are async, the file will not be immediately ready to be opened.
public StopAndFinalize ( ) : void
Результат void

WriteStreamAsync() публичный Метод

Hand out data here sequentially. If PrepareToWrite has not been called before, this method will have no effect. Note that numFrames should not exceed WriteChunkFrames.
public WriteStreamAsync ( float data, int offset, int numFrames ) : void
data float
offset int
numFrames int
Результат void

Описание свойств

WriteChunkFrames публичное свойство

How many frames maximum are written at a time?
public int WriteChunkFrames
Результат int