NAudio not playing, but WaveProvider32 Read is being called
===

I'm trying to combine NAudio with Reactive Extentions, and I'm having an issue getting NAudio to play the audio.

The following is my code so far:

 

    public class WaveOutPlayer : IDisposable
        {
            WaveOut wavOut = new WaveOut(WaveCallbackInfo.FunctionCallback());
    
            public WaveOutPlayer(int device, int sampleRate, int channels, IStereoSource source)
            {
                var provider = new WavProv();
                provider.SetWaveFormat(sampleRate,channels);
    
                source.ChannelLeft

                     //one sample from each channel
                    .Zip(source.ChannelRight, 
                         (ls, rs) => new double[] { ls, rs })
  
                     //convert to samples array l,r,l,r,l                      
                     .SelectMany(samps => samps)

                     //buffer samplerate*channels*2 seconds
                    .Buffer(sampleRate*channels* 2)  
                                   
                     // to observable of chunks                    
                    .Select(x=>x.ToArray())     
                                        
                    //.SubscribeOn(NewThreadScheduler.Default)
                    //.ObserveOn(DefaultScheduler.Instance)
                    .Subscribe(provider);
    
                wavOut.Init(provider);
    
            }
    
            private class WavProv : WaveProvider32,IObserver<double[]>
            {
                AutoResetEvent are = new AutoResetEvent(false);
                public WavProv()
                {
                }
    
                Queue<float> queue = new Queue<float>();
                public override int Read(float[] buffer, int offset, int sampleCount) 
                {
                    int itemsRead;
    
                    if (!queue.Any())               //No data in the queue
                        are.WaitOne();              //Wait for some data
    
                    //number of items to read is lower of  samplecount or items in queue
                    int itemsToRead = (queue.Count() > sampleCount) ? sampleCount : queue.Count();  
    
                    for (itemsRead = 0; itemsRead < itemsToRead; itemsRead++)       
                    {
                        //add items from queue to buffer
                        buffer[itemsRead + offset] = queue.Dequeue();       
                    }
                    Console.WriteLine("Requested:{0}, Read: {1}",sampleCount, itemsRead);
                    return itemsRead;
                }
    
                #region IObserver<double[]> Members
    
                public void OnNext(double[] value)
                {
                    //Add each item in the array to the queue
                    value.ToList().ForEach((x)=>queue.Enqueue((float)x));
    
                    //signal to read that it can continue
                    are.Set();
                }
    
                public void OnCompleted()
                {
                    throw new NotImplementedException();
                }
                public void OnError(Exception error)
                {
                    throw new NotImplementedException();
                }
                #endregion
            }
    
            public void Play()
            {
                wavOut.Play();
            }
    
            public void Dispose()
            {
                wavOut.Dispose();
            }
        }

The Read method is being called, and the Console.WriteLine is showing I'm always providing enough data. Incidently, If I slow down the production of signal, such that I need to occasionally provide an all zeros buffer, (code not present currently) then I get a 'clicking' sound. 

Is there any other issues/gotchas that I've missed?

e.g. Is the amplitude range between 0-1 only, or does it support the full range of float?

Thanks
