kaleetre
Posts: 2
Joined: Wed Jun 07, 2017 4:47 pm

exception line Unavailable with javax sound sampled

Fri Jun 09, 2017 9:21 pm

i code a music launch by java but i have this error
javax.sound.sampled.LineUnavailableException
at org.classpath.icedtea.pulseaudio.PulseAudioMixer.openImpl(PulseAudioMixer.java:714)
at org.classpath.icedtea.pulseaudio.PulseAudioMixer.openLocal(PulseAudioMixer.java:588)
And I spare you the rest so my code is :

Code: Select all

try {
                    AudioInputStream audioIn = AudioSystem.getAudioInputStream(new File("home/pi/music/"+music_finale));
                    Clip clip = AudioSystem.getClip();
                    clip.open(audioIn);
                    clip.start();
                    do{
                    	wait(50);
                    }while(clip.isRunning() );
                    clip.stop();
                } catch (UnsupportedAudioFileException e) {
                    e.printStackTrace();
                } catch (IOException e) {
                    e.printStackTrace();
                } catch (LineUnavailableException e) {
                    e.printStackTrace();
                } catch (InterruptedException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
if you can help it's will be very nice thanks

knute
Posts: 252
Joined: Thu Oct 23, 2014 12:14 am

Re: exception line Unavailable with javax sound sampled

Tue Jun 13, 2017 3:27 pm

kaleetre wrote:i code a music launch by java but i have this error
javax.sound.sampled.LineUnavailableException
at org.classpath.icedtea.pulseaudio.PulseAudioMixer.openImpl(PulseAudioMixer.java:714)
at org.classpath.icedtea.pulseaudio.PulseAudioMixer.openLocal(PulseAudioMixer.java:588)
And I spare you the rest so my code is :

The spared part is where the line number of the exception is created.

Code: Select all

try {
                    AudioInputStream audioIn = AudioSystem.getAudioInputStream(new File("home/pi/music/"+music_finale));
                    Clip clip = AudioSystem.getClip();
                    clip.open(audioIn);
                    clip.start();
                    do{
                    	wait(50);
                    }while(clip.isRunning() );
                    clip.stop();
                } catch (UnsupportedAudioFileException e) {
                    e.printStackTrace();
                } catch (IOException e) {
                    e.printStackTrace();
                } catch (LineUnavailableException e) {
                    e.printStackTrace();
                } catch (InterruptedException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
if you can help it's will be very nice thanks

Code: Select all

clip.start();
Thread.sleep(1);
clip.drain();
clip.stop();
clip.close();

Return to “Java”

Who is online

Users browsing this forum: No registered users and 9 guests