Quantcast
Channel: Programming Forums
Viewing all articles
Browse latest Browse all 51036

Java playing .wav file problem

$
0
0
Its weird, when I am playing my sound, it plays right the first time, but it sound electronic the following times. But it only does it with that sound, my other sound works fine every time. Here is my playing method.

package Sound;

import java.io.InputStream;
import sun.audio.AudioPlayer;

/**
 * @class Player
 * @date Mar 3, 2013 4:22:13 PM
 * @author
 */
public class Player {
    
    static InputStream in;

    public static void run(String sound) {

            in = new Player().getClass().getClassLoader().getResourceAsStream(sound);
            AudioPlayer.player.start(in);
    }
}


Does that make sense?

Viewing all articles
Browse latest Browse all 51036

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>