cmProc.h/c: cmAudioFileRd now recognizes 'endSmpIdx' == 0 as an indication to
read 'procSmpCnt' blocks until the end-of-file is reached.
This commit is contained in:
parent
c79a1d592a
commit
b05255c443
2
cmProc.c
2
cmProc.c
@ -124,7 +124,7 @@ cmRC_t cmAudioFileRdOpen( cmAudioFileRd* p, unsigned procSmpCnt,
|
|||||||
p->lastReadFrmCnt = 0;
|
p->lastReadFrmCnt = 0;
|
||||||
p->eofFl = false;
|
p->eofFl = false;
|
||||||
p->begFrmIdx = begFrmIdx;
|
p->begFrmIdx = begFrmIdx;
|
||||||
p->endFrmIdx = endFrmIdx;
|
p->endFrmIdx = endFrmIdx==0 ? p->info.frameCnt : endFrmIdx;
|
||||||
p->curFrmIdx = p->begFrmIdx;
|
p->curFrmIdx = p->begFrmIdx;
|
||||||
|
|
||||||
if( p->begFrmIdx > 0 )
|
if( p->begFrmIdx > 0 )
|
||||||
|
3
cmProc.h
3
cmProc.h
@ -26,7 +26,8 @@ extern "C" {
|
|||||||
/// set p to NULL to dynamically allocate the object
|
/// set p to NULL to dynamically allocate the object
|
||||||
/// fn and chIdx are optional - set fn to NULL to allocate the reader without opening a file.
|
/// fn and chIdx are optional - set fn to NULL to allocate the reader without opening a file.
|
||||||
/// If fn is valid then chIdx must also be valid.
|
/// If fn is valid then chIdx must also be valid.
|
||||||
/// Set 'endSmpIdx' to cmInvalidIdx to not limit the range of samples returned.
|
/// Set 'endSmpIdx' to cmInvalidIdx to return the entire signal in cmAudioFileRdRead().
|
||||||
|
/// Set 'endSmpIdx' to 0 to return all samples between 0 and the end of the file.
|
||||||
cmAudioFileRd* cmAudioFileRdAlloc( cmCtx* c, cmAudioFileRd* p, unsigned procSmpCnt, const char* fn, unsigned chIdx, unsigned begSmpIdx, unsigned endSmpIdx );
|
cmAudioFileRd* cmAudioFileRdAlloc( cmCtx* c, cmAudioFileRd* p, unsigned procSmpCnt, const char* fn, unsigned chIdx, unsigned begSmpIdx, unsigned endSmpIdx );
|
||||||
cmRC_t cmAudioFileRdFree( cmAudioFileRd** p );
|
cmRC_t cmAudioFileRdFree( cmAudioFileRd** p );
|
||||||
cmRC_t cmAudioFileRdOpen( cmAudioFileRd* p, unsigned procSmpCnt, const cmChar_t* fn, unsigned chIdx, unsigned begSmpIdx, unsigned endSmpIdx );
|
cmRC_t cmAudioFileRdOpen( cmAudioFileRd* p, unsigned procSmpCnt, const cmChar_t* fn, unsigned chIdx, unsigned begSmpIdx, unsigned endSmpIdx );
|
||||||
|
Loading…
Reference in New Issue
Block a user