Description | Hierarchy | Fields | Methods | Properties |
type unaRiffStream = class(unaWaveSoftwareDevice)
RIFF WAVE stream. Use this class to read or create RIFF WAVE files. Non-PCM files will be automatically converted to PCM format when possible. Creation of non-PCM files is also possible.
constructor create(const fileName: wString; realTime: bool = false; loop: bool = false; acm: unaMsAcm = nil); |
|
constructor createNew(const fileName: wString; const srcFormat: WAVEFORMATEX; dstFormatTag: unsigned = WAVE_FORMAT_PCM; acm: unaMsAcm = nil); |
|
constructor createNewExt(const fileName: wString; srcFormat: pWAVEFORMATEXTENSIBLE; dstFormatTag: unsigned = WAVE_FORMAT_PCM; acm: unaMsAcm = nil); |
|
destructor Destroy(); override; |
|
function assignRIFile(const fileName: wString): int; |
|
function assignRIFileWriteDst(const fileName: wString; dstFormat: pWAVEFORMATEX): int; |
|
function assignRIFileWriteSrc(const fileName: wString; srcFormat: pWAVEFORMATEX; dstFormatTag: unsigned = WAVE_FORMAT_PCM): int; |
|
function readData(buf: pointer; maxSize: unsigned): unsigned; |
|
function afterOpen(): MMRESULT; override; |
|
function doGetPosition(): int64; override; |
|
function doWrite(buf: pointer; size: unsigned): unsigned; override; |
|
function flush2(waitForComplete: bool = true): bool; override; |
|
function onHeaderDone(header: unaWaveHeader; wakeUpByHeaderDone: bool): bool; override; |
|
procedure AfterConstruction(); override; |
|
procedure passiveOpen(); |
|
procedure afterClose(closeResult: MMRESULT); override; |
property codec: unaMsAcmCodec read f_codec; |
|
property factSize: unsigned read f_factSize; |
|
property fileName: wString read f_fileName; |
|
property fileType: int read f_fileType; |
|
property loop: bool read f_loop write f_loop; |
|
property mpegFrameSize: int read getMpegFS; |
|
property onStreamIsDone: unaOnRiffStreamIsDone read f_onStreamIsDone write f_onStreamIsDone; |
|
property status: int read f_status; |
|
property streamIsDone: bool read f_streamIsDone; |
|
property streamPosition: unsigned read f_streamPos write setStreamPos; |
|
property streamSize: unsigned read f_streamSize; |
constructor create(const fileName: wString; realTime: bool = false; loop: bool = false; acm: unaMsAcm = nil); |
|
Opens existing file for reading. |
constructor createNew(const fileName: wString; const srcFormat: WAVEFORMATEX; dstFormatTag: unsigned = WAVE_FORMAT_PCM; acm: unaMsAcm = nil); |
|
Creates new RIFF WAVE file for writing. |
constructor createNewExt(const fileName: wString; srcFormat: pWAVEFORMATEXTENSIBLE; dstFormatTag: unsigned = WAVE_FORMAT_PCM; acm: unaMsAcm = nil); |
|
destructor Destroy(); override; |
|
function assignRIFile(const fileName: wString): int; |
|
Assigns new existing file for reading. |
function assignRIFileWriteDst(const fileName: wString; dstFormat: pWAVEFORMATEX): int; |
|
Assigns ouput file for writing. |
function assignRIFileWriteSrc(const fileName: wString; srcFormat: pWAVEFORMATEX; dstFormatTag: unsigned = WAVE_FORMAT_PCM): int; |
|
Assigns ouput file for writing. |
function readData(buf: pointer; maxSize: unsigned): unsigned; |
|
function afterOpen(): MMRESULT; override; |
|
function doGetPosition(): int64; override; |
|
Returns current position in wav stream. |
function doWrite(buf: pointer; size: unsigned): unsigned; override; |
|
function flush2(waitForComplete: bool = true): bool; override; |
|
Forces all awaiting data to be resampled. |
function onHeaderDone(header: unaWaveHeader; wakeUpByHeaderDone: bool): bool; override; |
|
procedure AfterConstruction(); override; |
|
procedure passiveOpen(); |
|
procedure afterClose(closeResult: MMRESULT); override; |
|
property codec: unaMsAcmCodec read f_codec; |
|
Codec used for compression or decompression. |
property factSize: unsigned read f_factSize; |
|
Number of bytes indicated in 'fact' chunk. |
property fileName: wString read f_fileName; |
|
WAV file name. |
property fileType: int read f_fileType; |
|
Type of file (RIFF/MP3, etc), see c_unaRiffFileType_XXXX constants. |
property loop: bool read f_loop write f_loop; |
|
Set this property to true if you wish to loop the file reading operation from end to beginning. |
property mpegFrameSize: int read getMpegFS; |
|
Frame saze (in samples) of mpeg audio stream. |
property onStreamIsDone: unaOnRiffStreamIsDone read f_onStreamIsDone write f_onStreamIsDone; |
|
This event is fired when reading from file is done. |
property status: int read f_status; |
|
5 - output riff: no filename was specified 4 - output riff: cannot locate required codec format 3 - output riff: cannot locate required codec 2 - output riff: cannot create output stream 1 - output riff: OK ——- 0 - input riff: OK -1 - input riff: file is not valid RIFF -2 - input riff: file is valid RIFF file, but is not a valid WAVE file -3 - input riff: not acm was specified (but it is required for conversion) -4 - input riff: unknown driver (cannot locate MS ACM codec) -5 - input riff: unknown format (for selected MS ACM codec) $0FFFFFFF - no init |
property streamIsDone: bool read f_streamIsDone; |
|
True when no more data can be read from stream (and loop = false). |
property streamPosition: unsigned read f_streamPos write setStreamPos; |
|
Current position in WAVe stream in bytes. |
property streamSize: unsigned read f_streamSize; |
|
WAVe stream size in bytes. |
(c) 2012 Lake of Soft