Location: Main > Module Types > View Module Type

Sound Module

Engine Module Type StringSound
Module Type UsageMultiple Type


Sound Modules enable the Drag[en]gine to load a mono sound from a file or to save a mono sound to a file. Sound modules are Multiple Type Modules hence you can install more than one Sound module at the same time. Launchers typically search missing Sound modules for you so you have only those installed that your games really use.

Module Developer Informations

Sound resources store a mono sound in PCM format. Supported is only one channel since sounds are supposed to be played in a 3D environment where multiple channels have no sense. The sample rate is free to choose and not limited.

Sound modules contain in contrary to other resource loader module three functions. This is since the engine has to allocate memory for the sound while constructing a new Sound resource. For this first the InitLoadSound function is called. The Sound module has to store the required informations about the sound sample rate and bytes per sample in a deBaseSoundInfo which the module creates itself. The engine then creates the Sound resource and passes it finally to the LoadSound function. During the two calls the file pointer is not changed hence you can read on from where you left off in the InitLoadSound function. Most of sound files are composed in a way that the sound data follows the sound header hence after reading the header you are already in the right position to read the sound data. For saving there is only one function since all informations are present already.

See the following classes to get started with Sound modules: