处理中的OutOfBoundsException(声音库) [英] OutOfBoundsException in Processing (Sound library)

查看:102
本文介绍了处理中的OutOfBoundsException(声音库)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近开始玩Processing.我想创建一个简单的FFT可视化程序,该可视化程序将使用声音库导入音乐文件.这是我的代码和控制台输出.

I recently started playing with Processing. I want to create a simple FFT visualizer that will import music file using Sound library. Here's my code and the console output.

控制台输出

import processing.sound.*;
SoundFile file;

void setup()
{
    size();
    background(51);

    file = new SoundFile(this, "song.mp3");
    file.play();
}

void draw ()
{

}

有人可以解释为什么会这样吗?如何解决? 顺便说一句,声音文件(song.mp3)与.pde文件位于同一文件夹中.

Can someone explain why is this happening and how it can be fixed? By the way, sound file (song.mp3) is located in the same folder as the .pde file.

推荐答案

将mp3文件放在一个名为data的文件夹中,该文件夹应该位于您的.pde文件所在的位置.

Put the mp3 file in a folder called data which should be located where your .pde file is located.

这可能无法解决您的问题.如果问题仍然存在,则是SoundFile库的问题,您目前无法执行任何操作.

This might not fix your issue though. If the issue persists, then it's the fault of the SoundFile library and there is nothing you can currently do.

我听说有人推荐最小"库.尝试研究一下,因为继续使用SoundFile库只会导致问题.

I have heard people recommending the "minim" library. Try to look into that, as continuing to use the SoundFile library will only lead to problems.

这篇关于处理中的OutOfBoundsException(声音库)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆