有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!

java从站点抓取播放列表URL?

我现在的课程位于下面,我只是想知道是否有什么方法可以让我从一个有音乐播放列表的网站上抓取一个URL并使用它,而不必保留一个链接。我的项目文件夹中的wav文件。这是我目前针对这个音响系统的特定课程。 希望我能得到一些反馈,我正试图保持我的项目文件夹在最小的文件大小尽可能多!提前谢谢

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package GUI.Music;

import java.io.File;
import java.io.FileInputStream;
import java.io.InputStream;
import javax.swing.JOptionPane;
import sun.audio.AudioPlayer;
import sun.audio.AudioStream;

/**
 *
 * @author Mod Den
 */
public class MusicPlayer {
    public static void sound(){
    InputStream in;
    try{
    in = new FileInputStream(new File("C:\\Users\\Mod Den\\Documents\\NetBeansProjects\\JavaApplication18\\dist\\lib\\music.wav"));
    AudioStream audios = new AudioStream(in);
    AudioPlayer.player.start(audios);
    }
    catch(Exception e){
    JOptionPane.showMessageDialog(null,e);
    }
    }
}

共 (0) 个答案