This project has moved and is read-only. For the latest updates, please go here.

Using the PCM 16-bit Audio through PanningSampleProvider

Feb 18, 2013 at 9:14 PM
Is it possible? The number of channels that is returned is "1", but it is still PCM audio and it appears that when I plug in the PanningSampleProvider, the output is complete garbage. I do not get any audio.


Feb 18, 2013 at 9:32 PM
panning sample provider takes a sample provider as an input. Sample providers are 32 bit float. Use Pcm16ToSampleProvider to get there
Feb 18, 2013 at 11:29 PM
I already have a Pcm16ToSampleProvider within the same provider within the provider chain, however, I will likely move it a little earlier and prior to passing the audio through the BassTreble provider I generated. I am not sure if order of provider's have an affect on audio, but I figure I will give that a try.

Originally, I had had the following chain:

--> BufferedWaveReader
--> Pcm16ToSampleProvider
--> BassTrebleProvider
--> SampleToWaveProvider16 (I think that is the name, I don't have the code in front of me).

This set up works perfectly....and I placed the PanningSampleProvider inbetween the BaseTrebleProvider and the last one. I will test to see how the works moving it one step earlier.

Feb 19, 2013 at 2:11 PM
for performance, I'd go with panning after basstreble, as panning will turn a mono input into a stereo output
Feb 19, 2013 at 5:36 PM
Edited Feb 19, 2013 at 5:46 PM
I think I have a feeling that once I send the audio through the PanningSampleProvider which then creates a stereo signal from a mono signal, I must use something other than SampleToWaveProvider16 which I assume only works with Mono inputs?

What is the correct provider to convert it back into an appropriate WaveProvider?

Feb 19, 2013 at 5:53 PM
SampleToWaveProvider16 should work just fine with stereo
Feb 19, 2013 at 5:57 PM
The output after passing the audio stream through the PanningSampleProvider (eliminating my BassTrebleProvider from the equation), is not yielding me any valuable results. I get silence and when I try to pan, it seems like the tempo was reduced significantly....

Not sure why this would not work and I tried different panning strategies and no improvements. :-(

Feb 19, 2013 at 8:49 PM
Found out more info....can't seem to use the MonoToStereoProvider either. Seems like the conversion process from the mono to stereo is not working as expected. Not sure if the audio format is off.

When I open up the audio file in Audacity, I see Mono, 8000Hz, 32-bit float. Not sure if I am missing something because even when I use 32-bit version of the PCM to Sample Provider, I do not get clean audio....

Feb 20, 2013 at 3:54 PM
figured out my problem....had to do with using the incorrect waveformat object for my provider. Since I was encapsulating all these listed providers (from my earlier) post in a master IWaveProvider object, I was using the waveformat object of the bufferedWaveReader instead of the final provider, so the difference was that my player was looking at the provider assuming it was 1 channel vs the 2 channels that was generated from the PanningSampleProvider.