This is the first time I use this mod, so please be good xd
I’m using FMOD for a live pitch detection program. I need to detect the notes played by a guitar in about 3 or 5 minutes. Here’s my code:
CREATION OF THE SOUND:
memset(&exinfo, 0, sizeof(FMOD_CREATESOUNDEXINFO));
// Informacion del sonido exinfo.cbsize = sizeof(FMOD_CREATESOUNDEXINFO); exinfo.numchannels = 1; exinfo.format = format; exinfo.defaultfrequency = outputRate; exinfo.length = exinfo.defaultfrequency * sizeof(short) * exinfo.numchannels * 5;
result = system->createSound(0, FMOD_2D | FMOD_SOFTWARE | FMOD_LOOP_NORMAL | FMOD_OPENUSER , &exinfo, &sound);
RECORDING AND PLAYACK:
result = system->recordStart(sound,true);
result = system->playSound(channelid, sound, false, &channel);
result = channel->setVolume(0);
And then it enters the main loop where executes the pitch detection algorithm…
It works fine at the beginin of the recording (first 20 seconds), then it starst to delay more and more. I know that there’s some delay in the realtime playbacks, it doesn’t matter to me, but I want to maintain the delay time.
I tried to load the entire non-looping sound into memory:
exinfo.length = exinfo.defaultfrequency * sizeof(short) * exinfo.numchannels * 180; // 180 seconds
… but it only records the first 30 seconds.
Is there any way to solve this problem?
How could I use a sound buffer of more than 30 seconds and play it without problems?
Thanks and sorry for my bad english! I’m from Spain xd
Note: The pitch algorithm is very slow.
- Xavi-Wan asked 10 years ago
- You must login to post comments