My iPhone app should play midi files, unfortunelly iPhone does not supported them. I ported timidity for my project. It successfully compiles and installs on device. But when i try to convert midi to wav - get the following message in debugging console:
/usr/local/share/timidity/timidity.cfg: No such开发者_运维百科 file or directory timidity: Can't read any configuration file. Please check /usr/local/share/timidity/timidity.cfg
Somebody! Please! Who have solutions or any ideas please help!)
Caveat: I've never used timidity.
It would appear that timidity needs a configuration file, and I expect that there is a hardcoded (or possibly autoconf manipulated) default location for the configuration file. Clearly, this won't work on the iPhone since your application bundle will be installed in it's own sandbox.
Looking here: http://ccrma.stanford.edu/planetccrma/man/man5/timidity.cfg.5.html
It would appear that using the timidity utility you can pass in a configuration file (-c) or a path to search (-L). You will need to call the equivalent functionality in your port and at runtime use something like:
NSString *bundlePath = [[NSBundle mainBundle] bundlePath];
To pull out the location of where you've put the config file and soundfont files.
Hope that helps.
精彩评论