Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Zelda

macrumors member
Original poster
Aug 10, 2014
39
2
I have an app that creates midi files and would like to convert the midi file to a ringtone or mp3 or acc file.
I can't find any info to help with my dilemma.
Is it possible to record a midi file that is being played, using swift code?
thanks heaps.
Z
 

firewood

macrumors G3
Jul 29, 2003
8,107
1,345
Silicon Valley
Not in Swift (yet). You can currently only record what you play on iOS if you use Audio Units to play synthesized midi, and Audio Unit callbacks have to be coded in C (at least partially).

Look into the documentation on the AUSampler Audio Unit. You may also need to use the AVAssetReader and AVAssetWriter APIs to convert PCM audio samples into an .m4a or .m4r format. It's not simple code. Tons of documentation on Apple's web site, but very little sample code appropriate to what you need.
 

Zelda

macrumors member
Original poster
Aug 10, 2014
39
2
Ok, i will look at your suggestions.
Very much appreciated.
Thanks
Z
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.