Added code to support wave file format encoding