Eclipse,Java,Midi,Linux(Debian) - 音序器问题

时间:2015-07-07 18:21:02

标签: java eclipse debian midi jfugue

问题在于:

  

线程“main”中的异常org.jfugue.JFugueException:MIDI系统无法实例化音序器。虽然JFugue报告了这个错误,但问题不在于JFugue本身。查找在特定系统上使用MIDI的资源。来自MidiSystem.getSequencer()的异常消息是:null

以下是整个代码:

    import org.jfugue.*;
    import javax.sound.midi.*;

    public class HelloWorld {

        public static void main(String[] args){     

        MidiDevice.Info[] devices = MidiSystem.getMidiDeviceInfo();

        if (devices.length == 0) {
            System.out.println("No MIDI devices found");
        } else {
            for (MidiDevice.Info dev : devices) {
                System.out.println(dev.getName());
            }
        }

        Player player = new Player();
        player.play("A B C");

        System.exit(0);
    }
}

和输出:

Real Time Sequencer
Exception in thread "main" org.jfugue.JFugueException: The MIDI System cannot instantiate a sequencer.  Although this error is reported by JFugue, the problem is not with JFugue itself.  Find resources for using MIDI on your specific system.  The exception message from MidiSystem.getSequencer() is: null
    at org.jfugue.Player.<init>(Player.java:82)
    at org.jfugue.Player.<init>(Player.java:65)
    at HelloWorld.main(HelloWorld.java:20)

我正在使用apt-get的一个包运行Eclipse - 'sun-java6-jdk',它将自己解压缩到jvm目录。我使用JRE1.5进行编译,使用1.6进行运行。我使用1.5进行编译,因为这是与jfugue4.0兼容的版本。

这可能是个问题 - 我的ALSA'aplay'命令不会“播放”文件。我可以从命令行使用VLC媒体播放器或胆怯,我听到声音。此外,扬声器测试工作。为什么命令行'aplay'也不会起作用?这是java问题的症状吗?

编辑:aplay确实有用。抱歉,刚刚重新测试。

编辑:这是“cat / dev / sndstat /”

的结果
  

声音驱动程序:3.8.1a-980706(ALSA v1.0.24仿真代码)内核:Linux   sean-debian 3.2.0-4-amd64#1 SMP Debian 3.2.68-1 + deb7u2 x86_64配置   选项:0

     

已安装的驱动程序:类型10:ALSA仿真

     

卡配置:HDA ATI SB在0xd0400000 irq 16 HDA ATI HDMI at   0xd0310000 irq 19

     

音频设备:配置中未启用

     

Synth设备:配置中未启用

     

Midi设备:配置中未启用

     

计时器:31:系统计时器

     

调音台:配置中没有启用

谢谢大家 - 这一直困扰着我。

0 个答案:

没有答案