ADC Home > Reference Library > Technical Q&As > Legacy Documents > Audio >
Important: This document is part of the Legacy section of the ADC Reference Library. This information should not be used for new development.
Current information on this Reference Library topic can be found here:
|
Q Can I play an uncompressed WAVE file via the
Sound Manager? A Yes, this is easy, you only need to parse the sound's header and then give the Sound Manager buffers of properly formatted data to play. The AIFF and WAVE file formats are very similar and the data is stored in very much the same way in both files. Parsing a WAVE header is no more difficult than parsing an AIFF header. Microsoft documents the format in Multimedia Programming Interface and Data Specification v1.0 and in the SndPlayDoubleBuffer sample code (on the Developer ToolChest CDs) there is quick and dirty code that shows how to parse a WAVE header. Once you have parsed the WAVE header you can play the data in much the same way you would play AIFF data. However, the WAVE file's data is stored little-endian, but if you have 8 bit (mono or stereo) sounds that means nothing, a byte in little-endian is the same as a byte in big-endian. If, however, you use 16 bit (mono or stereo) sound then an endian conversion will have to take place before before you play the sound. Sound Manager 3.1 and later offer the 'sowt' ("twos" spelled backwards) decompressor which doesn't decompress the sound but instead does the required endian conversion. Simply say that the data from the WAVE file is compressed using this compressor and the Sound Manager willl use this decompressor to play the data without a problem. See Q&A SND-08 for information about playing compressed WAVE files. [Sep 27 1996] |
|