68 unsigned bitsPerSample = 16,
69 PINDEX bufferSize = 0,
70 const BYTE * data = NULL
126 unsigned bitsPerSample
275 unsigned bitsPerSample = 16
306 ) {
return GetDriversDeviceNames(driverName, direction, pluginMgr); }
339 unsigned bitsPerSample = 16,
351 static PString GetDefaultDevice(
383 unsigned bitsPerSample = 16
404 virtual int GetHandle()
const;
407 virtual PString GetName()
const;
412 return activeDirection;
416 static const char * GetDirectionText(
Directions dir);
420 return GetDirectionText(activeDirection);
447 unsigned bitsPerSample = 16
515 virtual bool SetMute(
524 virtual bool GetMute(
553 virtual PBoolean Write(
const void * buf, PINDEX len);
585 virtual PINDEX GetLastWriteCount()
const;
634 virtual PBoolean HasPlayCompleted();
642 virtual PBoolean WaitForPlayCompletion();
682 PINDEX GetLastReadCount()
const;
736 virtual PBoolean IsRecordBufferFull();
746 virtual PBoolean AreAllRecordBuffersFull();
755 virtual PBoolean WaitForRecordBufferFull();
765 virtual PBoolean WaitForAllRecordBuffersFull();
791 #define PCREATE_SOUND_PLUGIN(name, className) \ 792 static PSoundChannelPluginServiceDescriptor<className> className##_descriptor; \ 793 PCREATE_PLUGIN(name, PSoundChannel, &className##_descriptor) 797 #elif defined(__BEOS__) 801 #if defined(P_DIRECTSOUND) 805 #if defined(P_WAVFILE) 810 #endif // PTLIB_SOUND_H DWORD GetErrorCode() const
Get the platform dependent error code from the last file load.
Definition: sound.h:144
Abstract class for a generalised sound channel, and an implementation of PSoundChannel for old code t...
Definition: sound.h:251
PSound(unsigned numChannels=1, unsigned sampleRate=8000, unsigned bitsPerSample=16, PINDEX bufferSize=0, const BYTE *data=NULL)
Create a new sound, using the parameters provided.
Directions
Definition: sound.h:258
static PBoolean PlayFile(const PFilePath &file, PBoolean wait=true)
Play a sound file to the default device.
unsigned GetSampleRate() const
Get the sample rate in samples per second.
Definition: sound.h:138
#define PCLASSINFO(cls, par)
Declare all the standard PTLib class information.
Definition: object.h:1049
Directions activeDirection
This is the direction that this sound channel is opened for use in.
Definition: sound.h:776
static void Beep()
Play the "standard" warning beep for the platform.
Definition: pluginmgr.h:57
PSound & operator=(const PBYTEArray &data)
Set new data bytes for the sound.
PSoundChannel * m_baseChannel
Definition: sound.h:769
This class describes a full description for a file on the particular platform.
Definition: filepath.h:65
unsigned GetSampleSize() const
Get the sample size in bits per sample.
Definition: sound.h:141
virtual PObject * CreateInstance(int) const
Definition: sound.h:787
This is an array collection class of PString objects.
Definition: pstring.h:2024
BOOL PBoolean
Definition: object.h:102
PBoolean Load(const PFilePath &filename)
Load a platform dependent sound file (eg .WAV file for Win32) into the object.
PINDEX GetFormatInfoSize() const
Get the size of the platform dependent format info.
Definition: sound.h:147
A class representing a sound.
Definition: sound.h:52
unsigned GetEncoding() const
Get the current encoding.
Definition: sound.h:132
Array of unsigned characters.
Definition: array.h:670
PBoolean Play()
Play the sound on the default sound device.
unsigned GetChannels() const
Get the number of channels (mono/stereo) in the sound.
Definition: sound.h:135
PPLUGIN_STATIC_LOAD(FakeVideo, PVideoInputDevice)
Abstract class defining I/O channel semantics.
Definition: channel.h:107
The character string class.
Definition: pstring.h:108
DWORD dwLastError
Last error code for Load()/Save() functions.
Definition: sound.h:182
void SetFormat(unsigned numChannels, unsigned sampleRate, unsigned bitsPerSample)
Set the internal sound format to linear PCM at the specification in the parameters.
PBoolean Save(const PFilePath &filename)
Save a platform dependent sound file (eg .WAV file for Win32) from the object.
unsigned sampleSize
Number of bits per sample.
Definition: sound.h:180
PReadWriteMutex m_baseMutex
Definition: sound.h:770
PBYTEArray formatInfo
Full info on the format (platform dependent)
Definition: sound.h:184
static PStringArray GetDeviceNames(const PString &driverName, Directions direction, PPluginManager *pluginMgr=NULL)
Definition: sound.h:302
unsigned sampleRate
Samples per second.
Definition: sound.h:178
virtual const char * GetDirectionText() const
Definition: sound.h:418
virtual PINDEX GetSize() const
Get the current size of the container.
This class defines a thread synchronisation object.
Definition: syncthrd.h:251
unsigned numChannels
Number of channels eg mono/stereo.
Definition: sound.h:176
virtual PStringArray GetDeviceNames(int userData) const
Definition: sound.h:788
Ultimate parent class for all objects in the class library.
Definition: object.h:1118
const void * GetFormatInfoData() const
Get pointer to the platform dependent format info.
Definition: sound.h:150
unsigned encoding
Format code.
Definition: sound.h:174
Directions GetDirection() const
Get the direction of the channel.
Definition: sound.h:410