java - Audio Player Worked, Now it Doesn't -
i modified audio player , posted new (and not duplicate) question here: bigclip won't play .wav file
i wrote audio player, , worked, doesn't. here's code:
package me.pogostick29.audiorpg.audio; import java.applet.applet; import java.applet.audioclip; import java.io.file; import java.net.malformedurlexception; public class audioplayer { private audioplayer() { } private static audioplayer instance = new audioplayer(); public static audioplayer getinstance() { return instance; } public void play(string name) { audioclip clip = null; try { clip = applet.newaudioclip(new file("audio/" + name + ".wav").touri().tourl()); } catch (malformedurlexception e) { e.printstacktrace(); } clip.play(); } public void playdialogue(string character, string name) { play("people/" + character + "/" + name); } }
however, when try play audio file located here (http://icap.me/i/rnixecfscy.png)
using
audioplayer.getinstance().playdialogue("blacksmith", "blacksmith1");
from class, nothing.
thanks in advance help!
Comments
Post a Comment