Logo Search packages:      
Sourcecode: pwlib version File versions  Download package

PSound::PSound ( unsigned  numChannels = 1,
unsigned  sampleRate = 8000,
unsigned  bitsPerSample = 16,
PINDEX  bufferSize = 0,
const BYTE *  data = NULL 
)

Create a new sound, using the parameters provided. It is expected that the "lowest common denominator" encoding, linear PCM, is used.

All other values for the encoding are platform dependent.

Parameters:
numChannels  Number of channels eg mono/stereo
sampleRate  Samples per second
bitsPerSample  Number of bits per sample
bufferSize  Size of data
data  Pointer to initial data

Definition at line 225 of file sound.cxx.

References encoding, numChannels, sampleRate, and sampleSize.

{
  encoding = 0;
  numChannels = channels;
  sampleRate = samplesPerSecond;
  sampleSize = bitsPerSample;
  SetSize(bufferSize);
  if (buffer != NULL)
    memcpy(GetPointer(), buffer, bufferSize);
}


Generated by  Doxygen 1.6.0   Back to index