Added a function to export into a wav file