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 SoundHandleEntry
: public PObject
{
28 PCLASSINFO(SoundHandleEntry
, PObject
)
38 unsigned bitsPerSample
;
39 unsigned fragmentValue
;
43 class PSoundChannelOSS
: public PSoundChannel
48 PSoundChannelOSS(const PString
&device
,
49 PSoundChannel::Directions dir
,
52 unsigned bitsPerSample
);
54 static PStringArray
GetDeviceNames(PSoundChannel::Directions
= Player
);
55 static PString
GetDefaultDevice(PSoundChannel::Directions
);
56 BOOL
Open(const PString
& _device
,
58 unsigned _numChannels
,
60 unsigned _bitsPerSample
);
64 BOOL
Write(const void * buf
, PINDEX len
);
65 BOOL
Read(void * buf
, PINDEX len
);
66 BOOL
SetFormat(unsigned numChannels
,
68 unsigned bitsPerSample
);
69 unsigned GetChannels() const;
70 unsigned GetSampleRate() const;
71 unsigned GetSampleSize() const;
72 BOOL
SetBuffers(PINDEX size
, PINDEX count
);
73 BOOL
GetBuffers(PINDEX
& size
, PINDEX
& count
);
74 BOOL
PlaySound(const PSound
& sound
, BOOL wait
);
75 BOOL
PlayFile(const PFilePath
& filename
, BOOL wait
);
76 BOOL
HasPlayCompleted();
77 BOOL
WaitForPlayCompletion();
78 BOOL
RecordSound(PSound
& sound
);
79 BOOL
RecordFile(const PFilePath
& filename
);
80 BOOL
StartRecording();
81 BOOL
IsRecordBufferFull();
82 BOOL
AreAllRecordBuffersFull();
83 BOOL
WaitForRecordBufferFull();
84 BOOL
WaitForAllRecordBuffersFull();
86 BOOL
SetVolume(unsigned newVal
);
87 BOOL
GetVolume(unsigned &devVol
);
90 unsigned mNumChannels
;
92 unsigned mBitsPerSample
;
93 unsigned actualSampleRate
;