34 #ifndef PTLIB_PWAVFILEDEV_H
35 #define PTLIB_PWAVFILEDEV_H
47 #if defined(P_WAVFILE)
59 PSoundChannel_WAVFile();
60 PSoundChannel_WAVFile(
const PString &device,
64 unsigned bitsPerSample);
65 ~PSoundChannel_WAVFile();
72 unsigned bitsPerSample
81 unsigned bitsPerSample);
96 bool ReadSamples(
void * data, PINDEX size);
97 bool ReadSample(
short & data);
102 unsigned m_sampleRate;
105 PINDEX m_samplePosition;
109 #endif // defined(P_WAVFILE)
111 #endif // PTLIB_PWAVFILEDEV_H
virtual PBoolean Close()
Close the channel, shutting down the link to the data source.
Abstract class for a generalised sound channel, and an implementation of PSoundChannel for old code t...
Definition: sound.h:251
Directions
Definition: sound.h:258
virtual PString GetName() const
Get the name of the open channel.
virtual PBoolean WaitForPlayCompletion()
Block calling thread until the sound play begun with PlaySound() or PlayFile() has completed...
#define PCLASSINFO(cls, par)
Declare all the standard PTLib class information.
Definition: object.h:1049
A class representing a WAV audio file.
Definition: pwavfile.h:172
virtual unsigned GetSampleSize() const
Get the sample size in bits per sample.
virtual PBoolean HasPlayCompleted()
Indicate if the sound play begun with PlayBuffer() or PlayFile() has completed.
virtual PBoolean Read(void *buf, PINDEX len)
Low level read from the channel.
virtual PBoolean SetFormat(unsigned numChannels=1, unsigned sampleRate=8000, unsigned bitsPerSample=16)
Set the format for play/record.
This is an array collection class of PString objects.
Definition: pstring.h:2024
virtual PBoolean StartRecording()
Start filling record buffers.
virtual PBoolean AreAllRecordBuffersFull()
Determine if all of the record buffer allocated has been filled.
BOOL PBoolean
Definition: object.h:102
virtual PBoolean IsRecordBufferFull()
Determine if a record buffer has been filled, so that the next Read() call will not block...
virtual PBoolean WaitForRecordBufferFull()
Block the thread until a record buffer has been filled, so that the next Read() call will not block...
virtual PBoolean WaitForAllRecordBuffersFull()
Block the thread until all of the record buffer allocated has been filled.
virtual PBoolean Write(const void *buf, PINDEX len)
Low level write (or play) to the channel.
virtual unsigned GetSampleRate() const
Get the sample rate in samples per second.
The character string class.
Definition: pstring.h:108
virtual PBoolean GetBuffers(PINDEX &size, PINDEX &count)
Get the internal buffers for the sound channel I/O.
Class for implementing an "adaptive" delay.
Definition: delaychan.h:52
Array of short integers.
Definition: array.h:589
virtual unsigned GetChannels() const
Get the number of channels (mono/stereo) in the sound.
static PStringArray GetDeviceNames(const PString &driverName, Directions direction, PPluginManager *pluginMgr=NULL)
Definition: sound.h:302
virtual PBoolean Open(const PString &device, Directions dir, unsigned numChannels=1, unsigned sampleRate=8000, unsigned bitsPerSample=16)
Open the specified device for playing or recording.
virtual PBoolean IsOpen() const
Test if this instance of PSoundChannel is open.
virtual PBoolean SetBuffers(PINDEX size, PINDEX count=2)
Set the internal buffers for the sound channel I/O.