Beispiel #1
0
 /// <summary>
 ///  This is where the actual decoding takes place.
 /// </summary>
 /// <param name="lost">
 ///  true if the Speex packet has been lost.
 /// </param>
 private void processData(bool lost)
 {
     /* decode the bitstream */
     if (lost)
     {
         decoder.Decode(null, decodedData);
     }
     else
     {
         decoder.Decode(bits, decodedData);
     }
     if (channels == 2)
     {
         decoder.DecodeStereo(decodedData, frameSize);
     }
     for (int i = 0; i < frameSize * channels; i++)
     {
         if (decodedData[i] > 32767.0f)
         {
             decodedData[i] = 32767.0f;
         }
         else if (decodedData[i] < -32768.0f)
         {
             decodedData[i] = -32768.0f;
         }
     }
     outputSize = frameSize * channels;
 }