<?xml version="1.0" encoding="UTF-8"?> <rss
version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:wfw="http://wellformedweb.org/CommentAPI/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
> <channel><title>以太之内 生存之上 &#187; sound</title> <atom:link href="http://ixhan.com/tag/sound/feed/" rel="self" type="application/rss+xml" /><link>http://ixhan.com</link> <description>Live in your world, get owned in mine</description> <lastBuildDate>Tue, 15 May 2012 04:08:15 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.3.2</generator> <item><title>[iPhone]播放midi文件</title><link>http://ixhan.com/2009/10/how-to-let-iphone-play-midi-file/</link> <comments>http://ixhan.com/2009/10/how-to-let-iphone-play-midi-file/#comments</comments> <pubDate>Mon, 05 Oct 2009 15:41:57 +0000</pubDate> <dc:creator>xhan</dc:creator> <category><![CDATA[Coding]]></category> <category><![CDATA[c]]></category> <category><![CDATA[iOS]]></category> <category><![CDATA[midi]]></category> <category><![CDATA[opensource]]></category> <category><![CDATA[sound]]></category> <guid
isPermaLink="false">http://ixhan.com/?p=62</guid> <description><![CDATA[<a
href="http://ixhan.com/2009/10/how-to-let-iphone-play-midi-file/" title="[iPhone]播放midi文件"></a>iPhone 默认不带播放MIDI的框架，所以播放MIDI还得寻求第3方的库帮忙。 这里使用的库就是大名鼎鼎的 FMOD ,许多火爆游戏使用的都是这个库。开发者可以免费下载使用。 首先下载安装 FMOD API FOR IPHONE： http://www.fmod.org/index.php/release/version/fmodapi42607iphone-installer.dmg 安装后可以在目录中看到不少示范代码，可惜没有MIDI。 自己写一个：） 感谢强大的api，写起来异常轻松。 新建一个基于view项目 修改项目属性，添加 Other Linker Flags 为 -lfmodexL_$PLATFORM_NAME 添加 Header Search Paths ：/Developer/FMOD\ Programmers\ API\ iPhone/api/inc  （默认是这个位置，修改成自己FMOD安装的目录） 添加 Library Search Paths ：/Developer/FMOD\ Programmers\ API\ iPhone/api/lib （同上） 把 &#8230;<p
class="read-more"><a
href="http://ixhan.com/2009/10/how-to-let-iphone-play-midi-file/">Read more &#187;</a></p>]]></description> <content:encoded><![CDATA[<a
href="http://ixhan.com/2009/10/how-to-let-iphone-play-midi-file/" title="[iPhone]播放midi文件"></a><p>iPhone 默认不带播放MIDI的框架，所以播放MIDI还得寻求第3方的库帮忙。</p><p>这里使用的库就是大名鼎鼎的 <a
target="_blank" href="http://www.fmod.org/">FMOD</a> ,许多火爆游戏使用的都是这个库。开发者可以免费下载使用。</p><p>首先下载安装 FMOD API FOR IPHONE：<br
/> <a
target="_blank" href="http://www.fmod.org/index.php/release/version/fmodapi42607iphone-installer.dmg" target="_blank">http://www.fmod.org/index.php/release/version/fmodapi42607iphone-installer.dmg</a></p><p>安装后可以在目录中看到不少示范代码，可惜没有MIDI。</p><p>自己写一个：）<br
/> 感谢强大的api，写起来异常轻松。</p><ul><li>新建一个基于view项目</li><li>修改项目属性，添加 Other Linker Flags 为 -lfmodexL_$PLATFORM_NAME</li><li>添加 Header Search Paths ：/Developer/FMOD\ Programmers\ API\ iPhone/api/inc  （默认是这个位置，修改成自己FMOD安装的目录）</li><li>添加 Library Search Paths ：/Developer/FMOD\ Programmers\ API\ iPhone/api/lib （同上）</li><li>把 appDelegate 修改成 .mm 的后缀</li><li>MIDI 播放需要一个 DLS 文件， 在osx 下没找到，这里使用了xp 自带的 gm.dls 文件（3M 有点大～）,拷贝到项目中。</li><li>修改ViewController 代码如下 ，随便在xib文件中链接两个按钮action上即可</li><li>运行（真机有效）</li></ul><p>主要源码：<span
id="more-62"></span></p><p><script src="http://gist.github.com/202178.js"></script></p><p>项目打包下载（懒人专用包）<a
href="http://ixhan.com/wp-content/uploads/2009/10/PlayMidiDemo.zip">PlayMidiDemo</a></p><h3  class="related_post_title">Related Posts</h3><ul
class="related_post"><li><a
href="http://ixhan.com/2009/12/minesweeperever/" title="永远的扫雷英雄(开源) 登场">永远的扫雷英雄(开源) 登场</a></li><li><a
href="http://ixhan.com/2010/05/now-or-never/" title="now or never">now or never</a></li><li><a
href="http://ixhan.com/2010/04/a-new-approach-to-my-career/" title="A new approach to my career">A new approach to my career</a></li><li><a
href="http://ixhan.com/2010/03/tutorial-of-kissxml-iphone/" title="Tutorial of  kissXML(iPhone)">Tutorial of  kissXML(iPhone)</a></li></ul>]]></content:encoded> <wfw:commentRss>http://ixhan.com/2009/10/how-to-let-iphone-play-midi-file/feed/</wfw:commentRss> <slash:comments>2</slash:comments> </item> </channel> </rss>
