fix issue where some garbage was encoded

when number of samples passed to the encoder is not multiple of 1024,
the last batch of samples was including samples outside of the pcm
buffer causing audio artifacts.
Now set correctly the input buffer size