About me

Vladimir Nabokov

Books
Programming
Biochemistry
Aim | Communicate

Search
 


 
   
Letters from Terra - Life in water warmed by sunlight
 
 

     
 
 

     
An impressive image of a pollen grain as editted in Canvas - click here for more info,
 
 
     

RAW sound engine

One of the most difficult aspects of modern programming for a novice to integrate within their programs is the use of real recorded sound. This is due top a number of factors: firstly, the inpenetrability of the soudn file formate makes even experimentation extremely difficult; secondly, the storage of such large amounts of data requires a working knowledge of XMS memory and a proficiency in the rapid transport and execution of this data; and thirdly because the configuration of the sound card is an unimaginably complex task for many novices. Another complicating factor is the fact that every different sound card functions in a different way, and compatability is always an issue. Solving these problems required the assessment of many example programs obtained from other sites, and the eventual conversion of their engines to my needs. The RAW sound engine that is available here is effectively the same as released by Ethan Brodsky, and I have maintained much of his code as well as leaving him the credit for his very easy to use and effective program. This unit, which was included in Trooper II as the general sound engine, is simple to use and install within your own programs, and automatically loads any sounds in use into the XMS memory, effectively causing no perturbation to your running program. WAV or VOC sounds, obtained from other sources, are converted into RAW formate using the conversion tools included in the package, and are then further compiled into a sound library using the useful and efficient utility included. These sound libraries can then be loaded directly into the memory on runtime, or specific sounds extracted. Sounds can then be played on demand, and run in the background whilst your program continues to process; otherwise sounds can be put onto a loop to allow effective background noise to be generated. The pitch and various other variables concerned with the playback can be altered, and the sounds in the library derived from 8 or 16-bit WAV files, at various different frequencies (22 Khz or 44 Khz, if my memory serves me correctly). Sounds can be started or stopped at any time, and there is even the capacity to play up to eight sounds at the same time, which creates a genuine commotion of sound if you attatch certain sounds to certain events in a action game. This resource is easy to use and indispensible for anyone that wants to include real WAV sound into their programs with the minimum of fuss, or effort for that matter. The unit is supplied with full source, including seperate XMS drivers that will not conflict with the other XMS units available on this site, as well as emplarary programs and sound files. Have fun experimenting, Jon

Download the RAW sound engine (96 Kb, zipped) | Back to Units & Tools

 
 
Letters from Terra | Updated 15th December 2004 | By Jonathan Ayling