3 #include <ptlib/socket.h>
4 #include <ptlib/plugin.h>
7 //#include <ptlib/contain.inl>
11 #include <sys/soundcard.h>
15 #if P_FREEBSD >= 500000
16 #include <sys/soundcard.h>
18 #include <machine/soundcard.h>
22 #if defined(P_OPENBSD) || defined(P_NETBSD)
23 #include <soundcard.h>
26 class PSoundChannelESD
: public PSoundChannel
31 PSoundChannelESD(const PString
&device
,
32 PSoundChannel::Directions dir
,
35 unsigned bitsPerSample
);
37 static PStringArray
GetDeviceNames(PSoundChannel::Directions
= Player
);
38 static PString
GetDefaultDevice(PSoundChannel::Directions
);
39 BOOL
Open(const PString
& _device
,
41 unsigned _numChannels
,
43 unsigned _bitsPerSample
);
47 BOOL
Write(const void * buf
, PINDEX len
);
48 BOOL
Read(void * buf
, PINDEX len
);
49 BOOL
SetFormat(unsigned numChannels
,
51 unsigned bitsPerSample
);
52 unsigned GetChannels() const;
53 unsigned GetSampleRate() const;
54 unsigned GetSampleSize() const;
55 BOOL
SetBuffers(PINDEX size
, PINDEX count
);
56 BOOL
GetBuffers(PINDEX
& size
, PINDEX
& count
);
57 BOOL
PlaySound(const PSound
& sound
, BOOL wait
);
58 BOOL
PlayFile(const PFilePath
& filename
, BOOL wait
);
59 BOOL
HasPlayCompleted();
60 BOOL
WaitForPlayCompletion();
61 BOOL
RecordSound(PSound
& sound
);
62 BOOL
RecordFile(const PFilePath
& filename
);
63 BOOL
StartRecording();
64 BOOL
IsRecordBufferFull();
65 BOOL
AreAllRecordBuffersFull();
66 BOOL
WaitForRecordBufferFull();
67 BOOL
WaitForAllRecordBuffersFull();
69 BOOL
SetVolume(unsigned newVal
);
70 BOOL
GetVolume(unsigned &devVol
);
73 unsigned mNumChannels
;
75 unsigned mBitsPerSample
;
76 unsigned actualSampleRate
;