Is it possible to read a .wav file into an applet as a float array value from a HTML page? I have a .wav file saved on a server and I would like to be able to manipulate the values of the file from an applet.
Anyone got any ideas?
Thanks
Ulf Dittmer
Marshal
Joined: Mar 22, 2005
Posts: 32421
posted
0
What would that float array contain - the pitch over time?
Yes my float array would contain the amplitude over time ie an array with values between -1 and 1.
My question however is if it is possible to read a .wav file into the applet from a remote server. For example, if I have a HTML page that passes the .wav file as a parameter:
It is possible to get the value of the parameter "number" using the getParameter("number") method. Is it possible to read the contents of the .wav file into a float array from the HTML page?
Thanks.
Ulf Dittmer
Marshal
Joined: Mar 22, 2005
Posts: 32421
posted
0
No, it's more complicated than that. The "From URL" part of the code sample shows how to load a file from the server.
Jody Monahan
Greenhorn
Joined: Feb 10, 2010
Posts: 20
posted
0
Again, thanks for the reply Ulf. Is there any way, to your knowledge that you can get the AudioInputStream as a float array value?
Ulf Dittmer
Marshal
Joined: Mar 22, 2005
Posts: 32421
posted
0
From an AudioInputStream you can obtain an AudioFormat object, about which its javadocs state "By examing the information stored in the audio format, you can discover how to interpret the bits in the binary sound data." There's also more information on how to go about this.