2 Replies Latest reply: Aug 9, 2010 1:09 PM by 843802 RSS

    Sound processing

    843802
      Say i have a computer where no sound card is installed and i have a Java application that processes audio files without ever actually playing them. I'm pretty new to Java Sound, and i'm wondering if there would be a way to do this other than by installing a virtual audio sound card.
      Basically, i want to be able to write sound data to a SourceDataLine, process it with some controls in the Mixer, and grab the output through a TargetDataLine. From what i understand, Java already provides a software mixer, but it doesn't supply TargetDataLine's and just redirects whatever data you feed it through SourceDataLine/Clip's to the sound card.
      So, is there any way to achieve this using only Java code/what's already implemented in Java Sound, or do i need to install a virtual sound card on the computer?

      Thanks!
        • 1. Re: Sound processing
          captfoss
          I'd recommend reading the following article...
          [http://www.vsj.co.uk/java/display.asp?id=370]

          It has some sample code that displays everything available for you to use on a system. I'd recommend running that and seeing what peices the JVM is actually giving you to work with, rather than reading about what someone thinks it should / might do... Always better to actually see what you have to work with.
          • 2. Re: Sound processing
            843802
            Hi, and thanks for your reply,

            Running the code on the page outputed a list of system-specific mixers (2 microphones, Realtek mixers, etc.), and "Java Sound Audio Engine," which only has SourceDataLine's and clips.
            What if i ran the code sample on a computer that had absolutely no sound-related hardware though? I assume the output would only contain "Java Sound Audio Engine." Should i conclude that there's nothing in the implementation of Java Sound that would let me read audio data from a file, play around with it (in the same way a Mixer can modify the audio data it receives for playback, for example), and place the result in a new file?

            I guess it all comes down to knowing if there's a way to modify audio data without sending it to a Mixer for playback and to somehow get the modified audio data back. I'm assuming it would be done in the same way you'd send data to a Mixer for playback, except that instead of rendering the data as sound through whatever hardware the Mixer represents, the Mixer would send it back to the application through TargetDataLine's, but I get the feeling i may be completely wrong and that it's possibly why i haven't found any information about it so far. Does anyone have any idea?

            Thanks for your time!