Home Java SoundSystem error
Reply: 0

Java SoundSystem error

Potato
1#
Potato Published in 2017-12-07 00:13:07Z

I am trying to make a program that plays sound back to you. How I got the sound was I went to this link and I had it speak some words for about 9 seconds. While he was speaking, I was recording him with Audacity. It recorded him at 16-bit PCM, 48 khz and a stereo channel.

The code I use to play the sound is,

 public void playSound(String Path) {
      try {
        Clip clip = AudioSystem.getClip();
        AudioInputStream inputStream = AudioSystem.getAudioInputStream(Variables.class.getResourceAsStream("/com/project/resources/" + Path));
        clip.open(inputStream);
        clip.start(); 
      } catch (Exception e) {
          e.printStackTrace();
        System.err.println(e.getMessage());
      }
    }

and the error that pops up is at this link.

I have stored the file in another package located at com.project.resources. If you have any questions about this situation, let me know.

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.298923 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO