AudioStreamFormat class
Represents audio stream format used for custom audio input configurations.
Methods
close() | Explicitly frees any external resource attached to the object |
get |
Creates an audio stream format object representing the default audio stream format (16KHz 16bit mono PCM). |
get |
Creates an audio stream format object with the specified format characteristics. |
get |
Creates an audio stream format object with the specified pcm waveformat characteristics. |
Method Details
close()
Explicitly frees any external resource attached to the object
function close()
getDefaultInputFormat()
Creates an audio stream format object representing the default audio stream format (16KHz 16bit mono PCM).
static function getDefaultInputFormat(): AudioStreamFormat
Returns
The audio stream format being created.
getWaveFormat(number, number, number, AudioFormatTag)
Creates an audio stream format object with the specified format characteristics.
static function getWaveFormat(samplesPerSecond: number, bitsPerSample: number, channels: number, format: AudioFormatTag): AudioStreamFormat
Parameters
- samplesPerSecond
-
number
Sample rate, in samples per second (Hertz).
- bitsPerSample
-
number
Bits per sample, typically 16.
- channels
-
number
Number of channels in the waveform-audio data. Monaural data uses one channel and stereo data uses two channels.
- format
- AudioFormatTag
Audio format (PCM, alaw or mulaw).
Returns
The audio stream format being created.
getWaveFormatPCM(number, number, number)
Creates an audio stream format object with the specified pcm waveformat characteristics.
static function getWaveFormatPCM(samplesPerSecond: number, bitsPerSample: number, channels: number): AudioStreamFormat
Parameters
- samplesPerSecond
-
number
Sample rate, in samples per second (Hertz).
- bitsPerSample
-
number
Bits per sample, typically 16.
- channels
-
number
Number of channels in the waveform-audio data. Monaural data uses one channel and stereo data uses two channels.
Returns
The audio stream format being created.