This project has moved. For the latest updates, please go here.

mixing audio received through serial port with a local audio file

Jan 25, 2014 at 7:19 PM
Edited Jan 25, 2014 at 7:20 PM
Dear Sir,

I am getting audio file stream (as variable sized chunks per time eg 2000 bytes). I am saving this file to filewriter class

Private Mywriter As WaveFileWriter

and into the dataReceived event , I pass the audio chunk to wavefileriter class by Mywriter.Write

Question , :
  • I have a local mp3 file in the same format at the received bytes (PCM,16 bit , 8000 HZ,mono).
  • I will get the size of the received data , eg 2000 bytes, and will get the first 2000 bytes from the local file(same format)
  • I need to get 2000 bytes that is mix between first 2000 bytes & second 2000 bytes.
  • I will pass this 2000 bytes to the wavefilewriter.
How.

Thanks,
Coordinator
Jan 26, 2014 at 7:51 PM
you need to get to floating point first, then use a MixingSampleProvider to do the mixing. I'd use a BufferdWaveProvider and use ToSampleProvider() to get the recorded audio as floating point.