cocos2d/cocos/audio/android/AudioResamplerPublic.h
static inline size_t destinationFramesPossible(size_t srcFrames, uint32_t srcSampleRate,
        uint32_t dstSampleRate) {
    if (srcSampleRate == dstSampleRate) {
        return srcFrames;
    }
    uint64_t dstFrames = (uint64_t)srcFrames * dstSampleRate / srcSampleRate;
    return dstFrames > 2 ? dstFrames - 2 : 0;
}
// An upper bound for the number of destination frames possible from srcFrames
// after sample rate conversion.  This may be used for buffer sizing.
An upper bound for the number of destination frames possible from srcFrames
after sample rate conversion.  This may be used for buffer sizing.
An upper bound for the number of destination frames possible from srcFrames after sample rate conversion . This may be used for buffer sizing .
static inline size_t destinationFramesPossible(size_t srcFrames, uint32_t srcSampleRate,
        uint32_t dstSampleRate) {
    if (srcSampleRate == dstSampleRate) {
        return srcFrames;
    }
    uint64_t dstFrames = (uint64_t)srcFrames * dstSampleRate / srcSampleRate;
    return dstFrames > 2 ? dstFrames - 2 : 0;
}
static inline size_t destinationFramesPossible ( size_t srcFrames , uint32_t srcSampleRate , uint32_t dstSampleRate ) { if ( srcSampleRate == dstSampleRate ) { return srcFrames ; } uint64_t dstFrames = ( uint64_t ) srcFrames * dstSampleRate / srcSampleRate ; return dstFrames > 2 ? dstFrames - 2 : 0 ; }
An upper bound for the number of destination frames possible from srcFrames
after sample rate conversion.
An upper bound for the number of destination frames possible from srcFrames after sample rate conversion .