3

I am using FMOD to play some sounds and I would like to save the resulting mix to the disk.

I have been trying the system->recordStart(0, sound, true) path, but that saves the microphone input of the device.

In some way, I would like to redirect the speakers output to the disk

Thank you

Marc

Marc
  • 1,029
  • 1
  • 10
  • 27

1 Answers1

2

To redirect everything that would go to the speakers to disk simply use the function System::setOutput and pass in a value of FMOD_OUTPUTTYPE_WAVWRITER. Make sure you call this function before you call System::init, when you are done call System::release and a wav file will appear next to your executable.

You can also specify the name and location of the output wav file by passing a full path via the System::init extradriverdata parameter.

Mathew Block
  • 1,613
  • 1
  • 10
  • 9
  • Works great. This code will set the filename to 'recordName.wav' `char cDest[200] = {0}; [[NSString stringWithFormat:@"%@/recordName.wav", [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0]] getCString:cDest maxLength:200 encoding:NSASCIIStringEncoding]; result = system->setOutput(FMOD_OUTPUTTYPE_WAVWRITER); ERRCHECK(result);` – Marc May 30 '11 at 10:31