[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now


Streaming audio from a servlet

Posted on 2004-11-29
Medium Priority
Last Modified: 2013-11-24
Hi there...  

Say I have 10 audio files (the numbers 1 to 10 read out and saved as wav files);

What I want to do, is have a servlet that generates an audio stream of these files, dynamically added to the stream one after another indefinately (so the stream would appear to loop to the end user)

What are my best steps?  Does anyone have any sample code for these 2 distinct problems?

1)  Joining samples together on the fly
2)  Streaming this to multiple listeners from a servlet

I'm not sure if javasound will do, or if I will need JMF...and all of the JMF examples I have seen are on about "capturing streamed data" or streaming to another JMF application, not streaming to whatever tool the end client is using to listen to the stream (media player, winamp, xine, whatever)

So I was hoping someone out there would have some code/links/advice to give ;-)


Question by:TimYates
  • 2
  • 2
LVL 86

Accepted Solution

CEHJ earned 375 total points
ID: 12695105
Only a vague suggestion really - try using an audio format that is not proprietary, but open, and one that is supported by Windows. That way you've got a good chance of getting a library that will support concatenation

Assisted Solution

jprgn earned 375 total points
ID: 12703287
After capturing save it in appropriate format
e.g .avi or .wav , so any application that understands that format will automatically execute it.
LVL 35

Author Comment

ID: 12972898
Unfortunately, saving the entire sample to disk isn't possible...

What I want is sort of like a "PI reader", so the sequence is incredibly long, I just want the server to stream out the next number in the sequence, increment the sequence pointer, then send the next one...

Sorry it has taken me so long to get back to this question...I didn't get an email about it... :-(

LVL 35

Author Comment

ID: 13201067
After a bit of scraping around (I just got the time to do it), I found this:


Which *seems* to be an audio streamer in java...  (haven't had time to look at it yet)

It's used in the Streamsicle project http://streamsicle.com/ (which again, I haven't tried yet)

I just thought I'd post this for completeness, so anyone following or finding this question can see some sort of answer ;-)

Hehehe, I'll shut up and close this now :-)

LVL 86

Expert Comment

ID: 13202024

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
The viewer will learn how to implement Singleton Design Pattern in Java.
Suggested Courses
Course of the Month18 days, 19 hours left to enroll

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question