LoginSignup
0
0

More than 5 years have passed since last update.

openFrameworks for vs で audioInputExampleが正常に動かない時の対処

Posted at

殊にsmoothedVolでのビジュアライザが動かない時のメモ書き

アプリケーション起動時(つまりサウンドを取得する前)にinputの値がfloat型の値でないことが原因のようだったので,
条件文を足してやる。

こいつを

ofApp.cpp
left[i] = input[i * 2] * 0.5;
right[i] = input[i * 2 + 1] * 0.5;

こう

ofApp.cpp
left[i] = input[i * 2] * 0.5 > 0 ? input[i * 2] * 0.5 : 0;
right[i] = input[i * 2 + 1] * 0.5 > 0 ? input[i * 2 + 1] * 0.5 : 0;

これでひとまず回避できる。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0