wav
wav copied to clipboard
Support converting in memory bytes?
I tried the converting from pcm to wav file and succeeded.
However in my go server I want to reduce disk IO becasue all my data are []bytes in memory(my server can generate pcm bytes by some TTS server and will serve as wav bytes for user to download).
NewEncoder function can only accept io.WriteSeeker, and I found a walkaround in stackoverflow to use a in memory one. However I think this walkaround is not elegant nor stable.
So could you consider add such in memory only convertion?
I'm honestly not too sure how to offer a transparent way to do that since the seeking is needed to finish writing the header of the file. However, as a potential alternative, consider using this package I wrote for this exact use case (short audio files that could stay in memory) https://github.com/mattetti/filebuffer
thanks! I'll use it. seems it has more stars than https://github.com/orcaman/writerseeker(from above SO comment)