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

editing bufferedwaveprovider prob: stack overflow ex

May 11, 2011 at 7:28 PM
Edited May 13, 2011 at 1:56 PM

I tried to edit the bufferedwaveprovider but it failed. There is always an stackoverflow exception but why?

Ok i solved problem now:

If someone else needs that just edit your provider you need to readout the volume( i'm using the Stereo16SampleProvider).

Create a new method like this:

public void LoadNextChunk(byte[] source, int samplePairsRequired)
        {
            int sourceBytesRequired = samplePairsRequired * 4;
            sourceBuffer = GetSourceBuffer(sourceBytesRequired);
            
            sourceSamples = sourceBytesRequired / 2;
            sourceBuffer = source;
            sourceWaveBuffer = new WaveBuffer(sourceBuffer);
            sourceSample = 0;
        }

 

so you can use the byte[] buffer you have in your Read Method in class bufferedwaveprovider to use this method and you won t get a stackoverlfow.