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

Protected Attributes | Private Member Functions

PSound Class Reference

#include <sound.h>

List of all members.

Public Member Functions

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

Static Public Member Functions

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

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)

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.


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

Generated by  Doxygen 1.6.0   Back to index