Advertisement

Linux + Java Sound

Started by March 19, 2006 09:52 PM
-1 comments, last by AllTheLuck 18 years, 10 months ago
Well, I'm having problems with Java (jdk-1.5.06) sound in linux (debian and fedora core 4). My sound card is a Intel Corp. 82801CA/CAM AC'97 Audio Controller (rev 01) (as reported by lspci). I first wrote a test class to simply play back a wav file or an au file. When I ran the program, the sound code threw some exceptions (sorry, I don't remember which it was a while ago.). So I figured that my code was mest up. So I went online to find an example of a program that worked. I found: http://www.jsresources.org/examples/SimpleAudioPlayer.java.html When I run the program with a wav file as the argument: $ java SimpleAudioPlayer test.wav javax.sound.sampled.UnsupportedAudioFileException: could not get audio input stream from input file at javax.sound.sampled.AudioSystem.getAudioInputStream(AudioSystem.java:1170) at SimpleAudioPlayer.main(SimpleAudioPlayer.java:121) When I run the program with an au file as the argument: $ java SimpleAudioPlayer test.au java.lang.IllegalArgumentException: No line matching interface SourceDataLine supporting format ULAW 8000.0 Hz, 8 bit, mono, 1 bytes/frame, is supported. at javax.sound.sampled.AudioSystem.getLine(AudioSystem.java:459) at SimpleAudioPlayer.main(SimpleAudioPlayer.java:171) Now, I haven't done much testing or anything, but I would like to know if audio playback is really supported with Java and Linux. I also ran a mixer info program which returned the following information: Mixer information : Name = Modem [plughw:0,0] Vendor = ALSA (http://www.alsa-project.org) Version = 1.0.4 Description = Direct Audio Device: Intel 82801CA-ICH3 Modem, Intel ICH - Modem, Intel 82801CA-ICH3 Modem - Modem Mixer information : Name = Java Sound Audio Engine Vendor = Sun Microsystems Version = 1.0 Description = Software mixer and synthesizer Mixer information : Name = Port Modem [hw:0] Vendor = ALSA (http://www.alsa-project.org) Version = 1.0.4 Description = Intel 82801CA-ICH3 Modem, Silicon Laboratory Si3036/8 rev 7 I thought that the problem might also be with my sound hardware. I have no problems listening to music or audio files with applications not written in Java. Thank you for your input. -AllTheLuck

This topic is closed to new replies.

Advertisement