Encoding/Decoding float samples with NSpeex

Dec 1, 2014 at 4:36 AM
Currently I have an array of samples containing 8KHz PCM data as normalized float values (-1 to 1). I'm wondering what the proper way to send them to the Encode function is. My guess is to multiply each sample by 32,767 and store them in an array of signed shorts that is the same length, and to pass this array into the Encode function and expect the passed byte array to end up filled with the encoded data.

Which brings me to another question, how am I supposed to know just how much of the encoded data array has been filled? Is it always constant?

And the other thing that I can't figure out is exactly how much data the Encode function is expecting. My array of float samples contains exactly one half second of data (4000 samples). Since Encoder.FrameSize is 160, do I need to call the Encode function 25 separate times?