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
파일 보기 프로젝트 열기: gregzo/G-Audio 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
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