Logo Search packages:      
Sourcecode: pwlib version File versions  Download package

PSound Class Reference

#include <sound.h>

List of all members.


Detailed Description

A class representing a sound. A sound is a highly platform dependent entity that is abstracted for use here. Very little manipulation of the sounds are possible.

The most common sound to use is the static function Beep()# which emits the system standard "warning" or "attention" sound.

Definition at line 178 of file sound.h.


Public Member Functions

Access functions
unsigned GetChannels () const
 Get the number of channels (mono/stereo) in the sound.
unsigned GetEncoding () const
DWORD GetErrorCode () const
 Get the platform dependent error code from the last file load.
const void * GetFormatInfoData () const
 Get pointer to the platform dependent format info.
PINDEX GetFormatInfoSize () const
 Get the size of the platform dependent format info.
unsigned GetSampleRate () const
 Get the sample rate in samples per second.
unsigned GetSampleSize () const
 Get the sample size in bits per sample.
BOOL Play (const PString &device)
 Play the sound to the specified sound device.
BOOL Play ()
 Play the sound on the default sound device.
void SetFormat (unsigned numChannels, unsigned sampleRate, unsigned bitsPerSample)
File functions
BOOL Load (const PFilePath &filename)
BOOL Save (const PFilePath &filename)
Construction
PSoundoperator= (const PBYTEArray &data)
 PSound (const PFilePath &filename)
 PSound (unsigned numChannels=1, unsigned sampleRate=8000, unsigned bitsPerSample=16, PINDEX bufferSize=0, const BYTE *data=NULL)

Static Public Member Functions

Miscellaneous functions
static void Beep ()
 Play the "standard" warning beep for the platform.
static BOOL PlayFile (const PFilePath &file, BOOL wait=TRUE)

Protected Attributes

DWORD dwLastError
 Last error code for Load()/Save() functions.
unsigned encoding
 Format code.
PBYTEArray formatInfo
 Full info on the format (platform dependent).
unsigned numChannels
 Number of channels eg mono/stereo.
unsigned sampleRate
 Samples per second.
unsigned sampleSize
 Number of bits per sample.

Private Member Functions

 PCLASSINFO (PSound, PBYTEArray)

The documentation for this class was generated from the following files:

Generated by  Doxygen 1.6.0   Back to index