Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

audio stream via network  RSS feed

 
nimo frey
Ranch Hand
Posts: 580
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I wrote a Applet embedded in a web page.
This Applet have a "play" button to play audio files (wav).
The audio files are stored in directory of the servers Host.

I use the Java-Sound-API with its SourceDataLine-Interface to buffer the sound and transmit it via URL through the client which invokes the play button of the applet.

All works, but the streaming is not so good (The sound stutters and hangs very often).

I used this method to buffer the audio data to the stream:



I have also tried it with the code of http://www.java2s.com/Code/Java/Development-Class/PlayssoundsstreamingfromaURL.htm.
But it has the same effect.

Look at this applet:

http://www.javazoom.net/applets/jlguiapplet/jlguiapplet.html

The player works very well - it streams the audio data correctly. However, it streams mp3-files. I want to stream wav-files.

Maybe I can use the new features of NIO-API to stream faster or something else. But I have no clue.

How can I solve that?
 
nimo frey
Ranch Hand
Posts: 580
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Okay, I know, where the mistake is: I have to enlarge the clients buffer size.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!