Game Development Reference
In-Depth Information
#endif
FChannels = H.Channels;
FSamplesPerSec = H.SampleRate;
FBitsPerSample = H.nBitsperSample;
}
Here we use the __BIG_ENDIAN__ preprocessor symbol provided by the GCC compiler to
detect the big-endian CPU. The two SwapBytes() functions change the order of the bytes in
the unsigned word and double word:
unsigned short SwapBytes16( unsigned short Val )
{
return (Val >> 8) | ((Val & 0xFF) << 8);
}
unsigned int SwapBytes32( unsigned int Val )
{
return (( Val & 0xFF ) << 24 ) |
(( Val & 0xFF00 ) << 8 ) |
(( Val & 0xFF0000 ) >> 8 ) |
( Val >> 24);
}
See also
F Decoding Ogg Vorbis iles
Streaming sounds
We have learned how to play short audio samples, and now we are ready to organize sound
streaming. This recipe explains how to organize a buffer queue to allow on-the-ly sound
generation and streaming.
Getting ready
We suppose that the reader is already familiar with our AudioSource and
iWaveDataProvider classes described in the previous recipe.
 
Search WWH ::




Custom Search