result = fmod_system->setOutput(FMOD_OUTPUTTYPE_WAVWRITER);
fmod_system->setSoftwareFormat(48000, FMOD_SPEAKERMODE_DEFAULT, 0);
fmod_system->setDSPBufferSize(1024, 4);
result = fmod_system->getSoftwareFormat(&frequency, 0, 0);
result = fmod_system->getDSPBufferSize(&blocksize, &numblocks);
ms = (float)blocksize * 1000.0f / (float)frequency;
printf("numblocks = %d\n",numblocks); // 4
printf("blocksize = %d\n",blocksize); // 1024
printf("frequency = %d\n",frequency); // 48000
printf("Mixer blocksize = %.02f ms\n", ms); // 21.33ms
printf("Mixer Total buffersize = %.02f ms\n", ms * numblocks);
printf("Mixer Average Latency = %.02f ms\n", ms * ((float)numblocks - 1.5f));
result = fmod_system->init(32, FMOD_INIT_STREAM_FROM_UPDATE, cDest);
result = fmod_system->getMasterChannelGroup(&mastergroup);
result = fmod_system->createSound([[NSString stringWithFormat:@"%@/%@", [[NSBundle mainBundle] resourcePath], fileName] UTF8String], FMOD_DEFAULT, 0, &sound);
fmod_system->playSound(sound, mastergroup, false, &channel);
result = fmod_system->createDSPByType(FMOD_DSP_TYPE_PITCHSHIFT, &dsppitchshift);
result = mastergroup->addDSP(0, dsppitchshift);
result = dsppitchshift->setBypass(false);
dsppitchshift->setParameterFloat(FMOD_DSP_PITCHSHIFT_PITCH, 1.5);
unsigned int sound_pcmbytes = 0;
sound->getLength(&sound_pcmbytes, FMOD_TIMEUNIT_PCMBYTES); // 1046400
unsigned int sound_length = 0;
sound->getLength(&sound_length, FMOD_TIMEUNIT_MS); // 10900
// what to do next
// while (???) { // the number is (10900 / 21.3) + 1 ?
// fmod_system->update();
// }
fmod_system->release();