Platform_Sound Class Reference
[Platform]
Platform independent abstraction of sound playback.
More...

Public Member Functions | |
| virtual | ~Platform_Sound () |
| virtual Platform_Sound_SoundStream * | CreateSoundStream (int channels, int frequency, int bitsPerSample, int size)=0 |
Detailed Description
Platform independent abstraction of sound playback.The platform system is simple but powerful - all it provides is functionality to create a SoundStream object, which can be used to play streaming sounds. You can create several sound streams, and they can be played independently. The idea is to create a few streams to use as sound channels, and then keep streaming sounds to them as necessary, rather than creating indidividual full sounds. The Audio module in the Pixie engine implements a more user-friendly sound system built on top of this, which allows for playing of music and sound in a more traditional way.
Definition at line 30 of file Platform_Sound.h.
Constructor & Destructor Documentation
| virtual Platform_Sound::~Platform_Sound | ( | ) | [virtual] |
Destructor
Definition at line 36 of file Platform_Sound.h.
Member Function Documentation
| virtual Platform_Sound_SoundStream* Platform_Sound::CreateSoundStream | ( | int | channels, | |
| int | frequency, | |||
| int | bitsPerSample, | |||
| int | size | |||
| ) | [pure virtual] |
Creates a Platform_Sound_SoundStream instance, with the specified number of channels (1=mono, 2=stereo), frequency (number of samples per second) and bits per sample (8 or 16), and of the specified size in bytes. A sound stream provides basic functionality for streaming sound data to the sound card, and works by having the calling application fill and refill the sound-stream buffer with new sound data as needed. The returned instance should be destroyed by the caller (using the delete keyword). when it is no longer needed.
See the documentation for Platform_Sound_SoundStream for further information.
- Returns:
- A new sound stream object, or 0 if no more sound streams could be created.
- Parameters:
-
channels The number of channels. Use 1 for mono, 2 for stereo frequency The frequency, in Hz (number of samples per second) bitsPerSample Number of bits per sample, typically 8 or 16 size The size, in bytes, of the sound stream buffer
Implemented in Platform_NULL_Sound, and Platform_Win32_Sound.
Reproduction/republishing of any material on this site without permission is strictly prohibited.
