OutOfBoundsException in Processing (Sound library)

大城市里の小女人 提交于 2019-12-11 15:36:18

问题


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.

Console Output

import processing.sound.*;
SoundFile file;

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

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

void draw ()
{

}

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.


回答1:


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

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.

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.



来源:https://stackoverflow.com/questions/53950278/outofboundsexception-in-processing-sound-library

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!