Streaming audio from a servlet

Posted on 2004-11-29
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
    LVL 86

    Accepted Solution

    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
    LVL 2

    Assisted Solution

    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

    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

    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 (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


    Featured Post

    Find Ransomware Secrets With All-Source Analysis

    Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

    Join & Write a Comment

    Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
    Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
    Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
    Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…

    734 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

    Need Help in Real-Time?

    Connect with top rated Experts

    24 Experts available now in Live!

    Get 1:1 Help Now