Multi-channel audio playback
Multimedia application or game developers may want to play multiple sound effects at the same time. Using CMdaAudioOutputStream class, it is possible to set up multi-channel sound playback with low latency. The linked sample application implements multi-channel audio playback. It plays a sound sample every time user selects Options -> Play menu option.
- The application uses client-server framework. The server is responsible to maintain a sound stream ( CMdaAudioOutputStream) and mix pre-loaded samples.
- The server thread is created in the same process as the client to make sound sample access fast. (Client is responsible to maintain sound samples.)
Server class that is responsible to create a server session. See Client-Server Framework to learn more about Client-Server infrastructure.
Owns a CMdaAudioOutputStream and constantly mixes sound samples. Implements MMdaAudioOutputStreamCallback interface. CMultiChannelSoundServerSession provides steam data every time CMdaAudioOutputStream requests it.
Client side helper class to access server functions conveniently. See Client-Server Framework to learn more about Client-Server infrastructure.
Represents one sound channel. It mixes the sample to the stream.
Represents one sound sample. The sample must be in 8 bit PCM format.
Responsible to manage sound channels. If all the channels are being used while a new sample is being attempted to play, then it reuses the channel that is started playing sample earliest.
This is the API for the sound system's client. It sets up multi-channel sound system, loads sound samples and allows its clients to initiate playback.