Description | Hierarchy | Fields | Methods | Properties |
type unavclWaveRiff = class(unavclInOutWavePipe)
Reads audio stream from a WAV file, producing PCM stream, or creates and writes new WAV file.
Usage: set fileName property to specify the file to use. Set isInput to true if you wish to read from WAV file. Set isInput to false if you wish to create and write into WAV file. Set active to true, or call the open() method to start reading or writing. Set active to false, or call the close() method to stop reading, or close the produced WAV file. Set realTime to true if you wish the stream read from WAV file will be available in real time manner.
Example reading: refer to the vcWavePlayer demo. Look for wavIn component, which is used to read the stream from WAV file. It has waveResampler as a consumer, that means read audio stream will be passed to waveResampler automatically.
Example writing: refer to the voiceRecDemo sample. Look for waveRiff component, which is a consumer of waveIn component. That means PCM stream, produced by waveIn will be passed to waveRiff automatically. In this demo waveRiff component is used to create the WAV file.
function loadFromFile(const fileName: wString; asynchronous: bool = false): bool; |
|
function loadFromStream(stream: tStream; asynchronous: bool = false): bool; |
|
function saveToFile(const fileName: wString; data: pointer; size: uint; asynchronous: bool = false): bool; |
|
function applyDeviceFormat(format: PWAVEFORMATEXTENSIBLE; isSrc: bool = true): bool; override; |
|
function getFormatExchangeData(out data: pointer): uint; override; |
|
procedure AfterConstruction(); override; |
|
procedure createNewDevice(); override; |
|
procedure doSetLoop(value: boolean); override; |
property autoCloseOnDone: boolean read f_acod write f_acod default true; |
|
property calcVolume; |
|
property enableDataProcessing; |
|
property fileName: wString read f_fileName write setFileName; |
|
property formatTag; |
|
property formatTagImmunable default true; |
|
property isInput: boolean read f_isInput write setIsInput default true; |
|
property loop; |
|
property onStreamIsDone: unaOnRiffStreamIsDone read f_onStreamIsDone write f_onStreamIsDone; |
|
property realTime; |
|
property silenceDetectionMode; |
|
property waveStream: unaRiffStream read getRiff; |
function loadFromFile(const fileName: wString; asynchronous: bool = false): bool; |
|
Loads data from specified WAV file. If asynchronous = false (default), does not return until whole file is loaded, and closes the device after that. Otherwise returns immediately after opening the device. If autoCloseOnDone property is true (default) device will be closed automatically when reading from file is complete. Otherwise use onStreamIsDone() event to be notified when reading from file is complete. This function sets realTime property to false and isInput property to true. |
function loadFromStream(stream: tStream; asynchronous: bool = false): bool; |
|
Loads data from specified stream. If asynchronous = false (default), does not return until whole file is loaded, and closes the device after that. Otherwise returns immediately after opening the device. If autoCloseOnDone property is true (default) device will be closed automatically when reading from file is complete. Otherwise use onStreamIsDone() event to be notified when reading from file is complete. This function sets realTime property to false and isInput property to true. |
function saveToFile(const fileName: wString; data: pointer; size: uint; asynchronous: bool = false): bool; |
|
Saves data into specified WAV file. If asynchronous = false (default), does not return until whole data block is written, and closes the device after that. Otherwise returns immediately after opening the device and writing the data into it. Use the following code to verify if writing is complete: <CODE>if (waveStream.getDataAvailable(true) > chunkSize) then ...</CODE> This function sets realTime and isInput properties to false. |
function applyDeviceFormat(format: PWAVEFORMATEXTENSIBLE; isSrc: bool = true): bool; override; |
|
This method is supported in WAV-writing mode only (isInput = false), and only PCM formats are supported. |
function getFormatExchangeData(out data: pointer): uint; override; |
|
procedure AfterConstruction(); override; |
|
Creates Riff wave device. |
procedure createNewDevice(); override; |
|
Creates Riff wave device. |
procedure doSetLoop(value: boolean); override; |
|
property autoCloseOnDone: boolean read f_acod write f_acod default true; |
|
When true, closes the device automatically when reading from file is complete. |
property calcVolume; |
|
property enableDataProcessing; |
|
Specifies whether the component would produce or accept any data. |
property fileName: wString read f_fileName write setFileName; |
|
Specifies file to use with Riff wave device. |
property formatTag; |
|
Use this property to specify wave format of non-PCM WAVe files you wish to create. |
property formatTagImmunable default true; |
|
WaveWriter usually does not use the format tag provided by other PCM devices. |
property isInput: boolean read f_isInput write setIsInput default true; |
|
Specifies whether Riff wave device is used for reading or writing the audio. |
property loop; |
|
Specifies whether reading should continue from the start upon reaching the end of file. |
property onStreamIsDone: unaOnRiffStreamIsDone read f_onStreamIsDone write f_onStreamIsDone; |
|
Fired when reading from file is complete. Never fired if loop property is set to true. |
property realTime; |
|
Specifies whether reading and writing should be done in real time. |
property silenceDetectionMode; |
|
property waveStream: unaRiffStream read getRiff; |
|
Returns Riff wave device. |
(c) 2012 Lake of Soft