本文整理匯總了Java中javazoom.jl.decoder.JavaLayerException.printStackTrace方法的典型用法代碼示例。如果您正苦於以下問題:Java JavaLayerException.printStackTrace方法的具體用法?Java JavaLayerException.printStackTrace怎麽用?Java JavaLayerException.printStackTrace使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類javazoom.jl.decoder.JavaLayerException
的用法示例。
在下文中一共展示了JavaLayerException.printStackTrace方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: testPlay
import javazoom.jl.decoder.JavaLayerException; //導入方法依賴的package包/類
public void testPlay()
{
String[] args = new String[1];
args[0] = filename;
jlp player = jlp.createInstance(args);
try
{
player.play();
assertTrue("Play",true);
}
catch (JavaLayerException e)
{
e.printStackTrace();
assertTrue("JavaLayerException : "+e.getMessage(),false);
}
}
示例2: start
import javazoom.jl.decoder.JavaLayerException; //導入方法依賴的package包/類
/**
* Starts this applet. An input stream and audio device
* are created and passed to the play() method.
*/
public void start()
{
String name = getAudioFileName();
try
{
InputStream in = getAudioStream();
AudioDevice dev = getAudioDevice();
play(in, dev);
}
catch (JavaLayerException ex)
{
synchronized (System.err)
{
System.err.println("Unable to play "+name);
ex.printStackTrace(System.err);
}
}
}
示例3: play
import javazoom.jl.decoder.JavaLayerException; //導入方法依賴的package包/類
@Override
public void play(Song song, SongAudio songAudio) {
this.currentSong = song;
RenderedSong renderedSong = songPersistenceService.getRenderedSongById(song.getId()).orElse(new RenderedSong());
this.renderedChannelMap = new Gson().fromJson(renderedSong.getRenderData(), RenderedChannelMap.class);
try {
FactoryRegistry r = FactoryRegistry.systemRegistry();
audioDevice = r.createAudioDevice();
ByteArrayInputStream inputStream = new ByteArrayInputStream(songAudio.getAudioData());
AdvancedPlayer player = new AdvancedPlayer(inputStream, audioDevice);
player.setPlayBackListener(playbackListener);
player.play();
} catch (JavaLayerException e) {
e.printStackTrace();
}
}
示例4: convertMP3toWAV
import javazoom.jl.decoder.JavaLayerException; //導入方法依賴的package包/類
public static File convertMP3toWAV(File mp3){
File temp=null;
try {
temp = File.createTempFile(mp3.getName().split("\\.")[0],".wav");
temp.deleteOnExit();
} catch (IOException e1) {
e1.printStackTrace();
}
Converter converter = new Converter();
try {
converter.convert(mp3.getAbsolutePath(), temp.getAbsolutePath());
} catch (JavaLayerException e) {
e.printStackTrace();
}
return temp;
}
示例5: mp3ToWav
import javazoom.jl.decoder.JavaLayerException; //導入方法依賴的package包/類
private File mp3ToWav(File audioFile) {
// Check to make sure that if a generated wav file was created, it is
// deleted
if (generatedWav != null) {
String oldName = generatedWav.getName();
if (generatedWav.delete() == true) {
System.out.println("Deleted unused wav file: " + oldName);
} else {
System.out.println("There was an issue deleting the old wavfile");
}
generatedWav = null;
}
System.out.println("Converting mp3 to wav...");
Converter converter = new Converter();
String fileURI = audioFile.getAbsolutePath();
File tempWavFile = null;
try {
tempWavFile = File.createTempFile("soniccandle", ".wav");
tempWavFile.deleteOnExit();
} catch (IOException e1) {
e1.printStackTrace();
}
try {
converter.convert(fileURI, tempWavFile.getAbsolutePath());
} catch (JavaLayerException e) {
e.printStackTrace();
}
System.out.println("Conversion Complete");
return tempWavFile;
}
示例6: run
import javazoom.jl.decoder.JavaLayerException; //導入方法依賴的package包/類
@Override
public void run() {
try {
Thread.sleep(100);
for (String audioPath : audioPaths) {
player = new Player(getClass().getResourceAsStream(audioPath));
while (player.play(1))
if (paused.get())
LockSupport.park();
}
} catch (JavaLayerException e) {
e.printStackTrace();
} catch (InterruptedException ignored) {
}
}
示例7: run
import javazoom.jl.decoder.JavaLayerException; //導入方法依賴的package包/類
@Override
public void run() {
// TODO Auto-generated method stub
try {
mp3_player.play();
} catch (JavaLayerException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
示例8: loadSong
import javazoom.jl.decoder.JavaLayerException; //導入方法依賴的package包/類
/**
* Load a song to play.
*
* @param path The path of the song
*/
public static void loadSong(String path){
if(playerStatus == NOT_STARTED || playerStatus == FINISHED){
ClassLoader loader = Thread.currentThread().getContextClassLoader();
InputStream fis = loader.getResourceAsStream(path);
lastPlayedSong = path;
try {
thePlayer = new Player(fis);
playerStatus = LOADED;
}catch(JavaLayerException e){
e.printStackTrace();
}
}
}
示例9: playAudio
import javazoom.jl.decoder.JavaLayerException; //導入方法依賴的package包/類
/**
* Standartm�ssig ist der Pfad folgendermassen: Ordner Sounds / Audiofiles
*
* @param fileName
* --> Name des Files dass du abspielen willst
*/
public void playAudio () {
String fullPath = globals.Environment.getUserPath()
+ "\\git\\Lernkartei\\GameFiles\\Sounds\\Audiofiles\\"
+ fileName;
try {
FileInputStream in = new FileInputStream(fullPath);
pl = new javazoom.jl.player.Player(in);
pl.play();
pl.close();
}
catch (JavaLayerException jle) {
jle.printStackTrace();
}
catch (FileNotFoundException fnf) {
fnf.printStackTrace();
}
}