I have a web service that returns an array of bytes and my intention is to convert said array to a .wav in the client (a handheld such as Blackberry). However I really have no idea of how to do that, I tried just making an FileOutputStream but of course that wouldn't play. So I am once again without knowing what to do. Any ideas?
+2
A:
So, there are LOTS of .WAV formats, here's some documentation:
- http://en.wikipedia.org/wiki/WAV
- http://ccrma.stanford.edu/courses/422/projects/WaveFormat/ (note endian changes)
- http://www.lightlink.com/tjweber/StripWav/WAVE.html
It's not just a stream of data bytes, but it's close... Just a bit of header and you should be good.
I suppose you could also use something like http://java.sun.com/j2se/1.5.0/docs/api/javax/sound/sampled/spi/AudioFileWriter.html
Bill James
2009-04-08 18:05:11