samedi 24 janvier 2015

Write byte[] array to audio file in Java for playback

If I have an array of byte forming the samples to a sound, like a generated tone, how can I write these to an audio file from within Java, so that they can be almost immediately played back from that File using something like a MediaPlayer?


Which format do you think I should use, and how would I go about using that format? I've hear that .wav's have some sort of header that I'd have to account for, and if such a header exists in the format I'd want to use, the main issue is how I would properly write that header.


Thank you.


Aucun commentaire:

Enregistrer un commentaire