C# Class GAudio.StreamToWavModule

Component for safe writing of wav files from audio streams. Writing occurs in a seperate thread so as not to burden the audio thread. Supports sample accurate start and duration.
Inheritance: AGATStreamObserver, IGATAudioThreadStreamClient
Exibir arquivo Open project: gregzo/G-Audio

Public Properties

Property Type Description
path string
pathType PathRelativeType

Public Methods

Method Description
EndWriting ( ) : void

Stops writing and finalizes the file's header. As this occurs on a seperate thread, you should not assume that the file is ready to be opened immediately.

IGATAudioThreadStreamClient ( float data, int offset, bool emptyData, IGATAudioThreadStream stream ) : void
OnDestroy ( ) : void
OnDisable ( ) : void
SetPath ( string newPath, PathRelativeType newPathType ) : string

Sets the path to which to write to. If the path contains a non-existent directory, it will be created.

StartWriting ( double targetDspTime = 0d, int recNumFrames = -1 ) : void

Starts writing the stream at precise dspTime if one is specified. If no dspTime is specified, or if the specified dspTime is too soon, starts writing asap. If recNumFrames is specified, writing will automatically stop once the precise number of frames has been written, else you should call EndWriting.

Protected Methods

Method Description
Start ( ) : void

Method Details

EndWriting() public method

Stops writing and finalizes the file's header. As this occurs on a seperate thread, you should not assume that the file is ready to be opened immediately.
public EndWriting ( ) : void
return void

IGATAudioThreadStreamClient() public method

public IGATAudioThreadStreamClient ( float data, int offset, bool emptyData, IGATAudioThreadStream stream ) : void
data float
offset int
emptyData bool
stream IGATAudioThreadStream
return void

OnDestroy() public method

public OnDestroy ( ) : void
return void

OnDisable() public method

public OnDisable ( ) : void
return void

SetPath() public method

Sets the path to which to write to. If the path contains a non-existent directory, it will be created.
public SetPath ( string newPath, PathRelativeType newPathType ) : string
newPath string
newPathType PathRelativeType
return string

Start() protected method

protected Start ( ) : void
return void

StartWriting() public method

Starts writing the stream at precise dspTime if one is specified. If no dspTime is specified, or if the specified dspTime is too soon, starts writing asap. If recNumFrames is specified, writing will automatically stop once the precise number of frames has been written, else you should call EndWriting.
public StartWriting ( double targetDspTime = 0d, int recNumFrames = -1 ) : void
targetDspTime double
recNumFrames int
return void

Property Details

path public_oe property

The path at which to write the file. The path will be processed occording to pathType. To change paths at runtime, use SetPath.
public string path
return string

pathType public_oe property

Type of path: relative to Application.dataPath or persistentDataPath, or absolute.
public PathRelativeType pathType
return PathRelativeType