Logo Search packages:      
Sourcecode: pwlib version File versions

BOOL PSoundChannel::Open ( const PString device,
Directions  dir,
unsigned  numChannels = 1,
unsigned  sampleRate = 8000,
unsigned  bitsPerSample = 16 
) [virtual]

Open the specified device for playing or recording. The device name is platform specific and is as returned in the GetDevices() function.

TRUE if the sound device is valid for playing/recording.
device  Name of sound driver/device
dir  Sound I/O direction
numChannels  Number of channels eg mono/stereo
sampleRate  Samples per second
bitsPerSample  Number of bits per sample

Definition at line 201 of file sound.cxx.

References CreateChannel(), GetDriverNames(), and Open().

Referenced by CreateOpenedChannel(), Open(), and PSoundChannel().

  if (baseChannel == NULL) {
    PStringArray names = GetDriverNames();
    if (names.GetSize() == 0)
      return FALSE;

    baseChannel = CreateChannel(names[0]);

  if (baseChannel == NULL)
    return FALSE;

  return baseChannel->Open(device, dir, numChannels, sampleRate, bitsPerSample);

Generated by  Doxygen 1.6.0   Back to index