Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

How can I play a .wav file in a JDK 1.1.x applet?

applet file JDK play
0
Posted

How can I play a .wav file in a JDK 1.1.x applet?

0

First of all, JDK 1.1 generally only provides μ-law, 8000Hz mono playback. It does not provide .wav file playback directly. And for playback of audio data of the application, there are only the “unofficial” sun.audio.* classes. So you’d need to write your own classes that read in the .wav files, convert the sound data to μ-law and then use the sun.audio.* classes to play them. For code that parses .wav files and does μ-law conversion look at Tritonus’ source code: WaveAudioFileReader and TConversionTool. Tritonus classes are under the LGPL licence. Regarding sun.audio.* classes: it is discouraged to use them. I heard that they don’t work anymore as expected in JDK 1.3. My applets using them work well from JDK 1.0 to JDK 1.1 and in all browsers that I could put my hand on.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123