improvised function for converting into wav buffer