3 #include <ptlib/sound.h>
4 #include <ptlib/socket.h>
7 //#include <ptlib/contain.inl>
11 #include <sys/soundcard.h>
15 #include <sys/soundcard.h>
19 #if P_FREEBSD >= 500000
20 #include <sys/soundcard.h>
22 #include <machine/soundcard.h>
26 #if defined(P_OPENBSD) || defined(P_NETBSD)
27 #include <soundcard.h>
30 class SoundHandleEntry
: public PObject
{
32 PCLASSINFO(SoundHandleEntry
, PObject
)
42 unsigned bitsPerSample
;
43 unsigned fragmentValue
;
45 unsigned resampleRate
;
48 class PSoundChannelOSS
: public PSoundChannel
53 PSoundChannelOSS(const PString
&device
,
54 PSoundChannel::Directions dir
,
57 unsigned bitsPerSample
);
59 static PStringArray
GetDeviceNames(PSoundChannel::Directions
= Player
);
60 static PString
GetDefaultDevice(PSoundChannel::Directions
);
61 BOOL
Open(const PString
& _device
,
63 unsigned _numChannels
,
65 unsigned _bitsPerSample
);
69 BOOL
Write(const void * buf
, PINDEX len
);
70 BOOL
Read(void * buf
, PINDEX len
);
71 BOOL
SetFormat(unsigned numChannels
,
73 unsigned bitsPerSample
);
74 unsigned GetChannels() const;
75 unsigned GetSampleRate() const;
76 unsigned GetSampleSize() const;
77 BOOL
SetBuffers(PINDEX size
, PINDEX count
);
78 BOOL
GetBuffers(PINDEX
& size
, PINDEX
& count
);
79 BOOL
PlaySound(const PSound
& sound
, BOOL wait
);
80 BOOL
PlayFile(const PFilePath
& filename
, BOOL wait
);
81 BOOL
HasPlayCompleted();
82 BOOL
WaitForPlayCompletion();
83 BOOL
RecordSound(PSound
& sound
);
84 BOOL
RecordFile(const PFilePath
& filename
);
85 BOOL
StartRecording();
86 BOOL
IsRecordBufferFull();
87 BOOL
AreAllRecordBuffersFull();
88 BOOL
WaitForRecordBufferFull();
89 BOOL
WaitForAllRecordBuffersFull();
91 BOOL
SetVolume(unsigned newVal
);
92 BOOL
GetVolume(unsigned &devVol
);
95 unsigned mNumChannels
;
97 unsigned mBitsPerSample
;
98 unsigned actualSampleRate
;
102 unsigned resampleRate
;