@ -99,21 +99,21 @@ public:
//@{
//\name ***deprecated***
/// Set the sample format. Example: freq=44100. ***deprecated***
void setFormat ( TSampleFormat format , uint freq ) ;
NLSOUND_LOWLEVEL_API void setFormat ( TSampleFormat format , uint freq ) ;
/// Return the format and frequency. ***deprecated***
void getFormat ( TSampleFormat & format , uint & freq ) const ;
NLSOUND_LOWLEVEL_API void getFormat ( TSampleFormat & format , uint & freq ) const ;
/// Convert old sample format to new buffer format
static void sampleFormatToBufferFormat ( TSampleFormat sampleFormat , TBufferFormat & bufferFormat , uint8 & channels , uint8 & bitsPerSample ) ;
NLSOUND_LOWLEVEL_API static void sampleFormatToBufferFormat ( TSampleFormat sampleFormat , TBufferFormat & bufferFormat , uint8 & channels , uint8 & bitsPerSample ) ;
/// Convert new buffer format to old sample format
static void bufferFormatToSampleFormat ( TBufferFormat bufferFormat , uint8 channels , uint8 bitsPerSample , TSampleFormat & sampleFormat ) ;
NLSOUND_LOWLEVEL_API static void bufferFormatToSampleFormat ( TBufferFormat bufferFormat , uint8 channels , uint8 bitsPerSample , TSampleFormat & sampleFormat ) ;
//@}
//@{
//\name Utility functions
/// Return pcm size in bytes from duration in seconds.
static uint getPCMSizeFromDuration ( float duration , uint8 channels , uint8 bitsPerSample , uint32 frequency ) ;
NLSOUND_LOWLEVEL_API static uint getPCMSizeFromDuration ( float duration , uint8 channels , uint8 bitsPerSample , uint32 frequency ) ;
/// Return duration in seconds from pcm size in bytes.
static float getDurationFromPCMSize ( uint size , uint8 channels , uint8 bitsPerSample , uint32 frequency ) ;
NLSOUND_LOWLEVEL_API static float getDurationFromPCMSize ( uint size , uint8 channels , uint8 bitsPerSample , uint32 frequency ) ;
//@}
//@{
@ -126,17 +126,17 @@ public:
uint8 StepIndex ;
} ;
/// Encode 16bit Mono PCM buffer into Mono ADPCM.
static void encodeADPCM ( const sint16 * indata , uint8 * outdata , uint nbSample , TADPCMState & state ) ;
NLSOUND_LOWLEVEL_API static void encodeADPCM ( const sint16 * indata , uint8 * outdata , uint nbSample , TADPCMState & state ) ;
/// Decode Mono ADPCM into 16bit Mono PCM.
static void decodeADPCM ( const uint8 * indata , sint16 * outdata , uint nbSample , TADPCMState & state ) ;
NLSOUND_LOWLEVEL_API static void decodeADPCM ( const uint8 * indata , sint16 * outdata , uint nbSample , TADPCMState & state ) ;
/// Read a wav file. Data type uint8 is used as unspecified buffer format.
static bool readWav ( const uint8 * wav , uint size , std : : vector < uint8 > & result , TBufferFormat & bufferFormat , uint8 & channels , uint8 & bitsPerSample , uint32 & frequency ) ;
NLSOUND_LOWLEVEL_API static bool readWav ( const uint8 * wav , uint size , std : : vector < uint8 > & result , TBufferFormat & bufferFormat , uint8 & channels , uint8 & bitsPerSample , uint32 & frequency ) ;
/// Write a wav file. Data type uint8 does not imply a buffer of any format.
static bool writeWav ( const uint8 * buffer , uint size , TBufferFormat bufferFormat , uint8 channels , uint8 bitsPerSample , uint32 frequency , NLMISC : : IStream & out ) ;
NLSOUND_LOWLEVEL_API static bool writeWav ( const uint8 * buffer , uint size , TBufferFormat bufferFormat , uint8 channels , uint8 bitsPerSample , uint32 frequency , NLMISC : : IStream & out ) ;
/// Convert buffer data to 16bit Mono PCM. Resulting vector size is in samples.
static bool convertToMono16PCM ( const uint8 * buffer , uint size , std : : vector < sint16 > & result , TBufferFormat bufferFormat , uint8 channels , uint8 bitsPerSample ) ;
NLSOUND_LOWLEVEL_API static bool convertToMono16PCM ( const uint8 * buffer , uint size , std : : vector < sint16 > & result , TBufferFormat bufferFormat , uint8 channels , uint8 bitsPerSample ) ;
/// Convert 16bit Mono PCM buffer data to ADPCM.
static bool convertMono16PCMToMonoADPCM ( const sint16 * buffer , uint samples , std : : vector < uint8 > & result ) ;
NLSOUND_LOWLEVEL_API static bool convertMono16PCMToMonoADPCM ( const sint16 * buffer , uint samples , std : : vector < uint8 > & result ) ;
//@}
private :