當前位置: 首頁>>代碼示例>>Java>>正文


Java JavaLayerException.printStackTrace方法代碼示例

本文整理匯總了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);			
	}
}
 
開發者ID:EndlessBot,項目名稱:jLib,代碼行數:17,代碼來源:jlpTest.java

示例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);
		}
	}
}
 
開發者ID:EndlessBot,項目名稱:jLib,代碼行數:23,代碼來源:PlayerApplet.java

示例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();
    }
}
 
開發者ID:sparkled,項目名稱:sparkled,代碼行數:19,代碼來源:SongPlayerServiceImpl.java

示例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;
}
 
開發者ID:miracatici,項目名稱:MakamBox,代碼行數:17,代碼來源:AudioUtilities.java

示例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;

}
 
開發者ID:ryan-schroeder,項目名稱:sonic-candle,代碼行數:32,代碼來源:MainController.java

示例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) {
    }
}
 
開發者ID:MitchTalmadge,項目名稱:TheAmericanLife,代碼行數:16,代碼來源:AudioThread.java

示例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();
	}
	
}
 
開發者ID:MrBrax,項目名稱:unifrog,代碼行數:13,代碼來源:unisound.java

示例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();
		}
	}
}
 
開發者ID:dstumpff,項目名稱:VortexGameLibrary,代碼行數:19,代碼來源:BackgroundMusic.java

示例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();

	}

}
 
開發者ID:CoffeeCodeSwitzerland,項目名稱:Lernkartei_2017,代碼行數:34,代碼來源:Audio.java


注:本文中的javazoom.jl.decoder.JavaLayerException.printStackTrace方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。