奇妙なことです。私は処理を続けるか、javaが処理用Webサイトのサンプルコードに基づいてこのコードでクラッシュする。処理中fftクラッシュ
libc++abi.dylib: terminating with uncaught exception of type std::runtime_error: RtApiCore::probeDeviceOpen: the device (2) does not support the requested channel count. Could not run the sketch (Target VM failed to initialize).
PC上では、1 MACそれはマックそれだけで地殻それは押しつぶすまで5秒間、別の上で動作し、私はこれを与え上、全く動作しません。
ライブラリやコードに問題があると思いますか? ライブラリに問題がある場合は、このようなことを行うには最高のサウンドライブラリをお勧めしますか?
ありがとうございました:)
import processing.sound.*;
FFT fft;
AudioIn in;
int bands = 512;
float[] spectrum = new float[bands];
void setup() {
size(900, 600);
background(255);
// Create an Input stream which is routed into the Amplitude analyzer
fft = new FFT(this, bands);
in = new AudioIn(this, 0);
// start the Audio Input
in.start();
// patch the AudioIn
fft.input(in);
}
void draw() {
background(255);
int midPointW = width/2;
int midPointH = height/2;
float angle = 1;
fft.analyze(spectrum);
//float radius = 200;
for(int i = 0; i < bands; i++){
// create the actions for placing points on a circle
float radius = spectrum[i]*height*10;
//float radius = 10;
float endX = midPointW+sin(angle) * radius*10;
float endY = midPointH+cos(angle) * radius*10;
float startX = midPointW+sin(angle) * radius*5;
float startY = midPointH+cos(angle) * radius*5;
// The result of the FFT is normalized
// draw the line for frequency band i scaling it up by 5 to get more amplitude.
line(startX, startY, endX, endY);
angle = angle + angle;
println(endX, "" ,endY);
// if(angle > 360){
// angle = 0;
// }
}
}
あなたが何を求めているのか、これがどの言語なのかは少し不明です。これはC、C++、Javaの要素を持っています。あなたのコードが何をすべきかについてもっと具体的に教えてください。それはファイルベースの分析ですか? 'draw()'はどのように呼び出されますか?どのAPIを解析に使用していますか?いくつかの関連情報が欠落しています。 – user3078414