This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Java in General and the fly likes Saving sound as byte array Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Java in General
Reply locked New topic
Author

Saving sound as byte array

colin shuker
Ranch Hand

Joined: Apr 11, 2005
Posts: 744
Hi I posted this question in the I/O streams section, but there was little response, and I have a little more info now:

I've ommitted try/catch blocks for clarity,
I am able to play a sound using...


Now, I can turn the file into bytes using..


So what I would like to do is play a sound given a byte[]
I attempted this..., but it threw an Exception

But AudioStram as=new AudioStream(is); throws an exception with message
-> "could not create audio stream from input stream"

Is there any way to solve this?
Thanks for any help
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Saving sound as byte array
 
Similar Threads
Problem playing sound from application
Saving a sound as byte array
How do I loop the sound file in this program>
Playing wav - java.io.FileNotFoundException when file is def there
Audio format conversion problems