I am using naudio to generate pulse width modulated audio signals for controlling a pair of servo's. Currently I am using the WaveProvider32 class that Mark Heath wrote (http://mark-dot-net.blogspot.com/2009/10/playback-of-sine-wave-in-naudio.html) which implements the IWaveProvider interface. The sample rate is 44100
The audio signal is basically a block N wide where the first part of the signal all the values are high, and for the remainder of the block the values are low. Since the Read operation asks for more samples than the width of the block I just repeat the signal until I fill up the buffer. The problem I have is that the length of the buffer is not a multiple of the width of my signal block, so part of the last block is cut off which screws with the servo and makes it twitch. I realize I could do some code fanciness to keep track of it and offset the beginning of the next read, but I would be easier if I could set the number of values that WaveProvider had to provide at once so that I could make it a multiple (or maybe the exact width) of the signal block size.
Is that possible?