{"id":34,"date":"2009-01-03T16:19:04","date_gmt":"2009-01-03T07:19:04","guid":{"rendered":"http:\/\/www.studioeth.net\/ethBlog\/?p=442"},"modified":"2009-01-03T16:19:04","modified_gmt":"2009-01-03T07:19:04","slug":"iphone-app-avaudioplayer-%e3%81%a7%e9%9f%b3%e6%ba%90%e5%a4%9a%e9%87%8d%e5%86%8d%e7%94%9f","status":"publish","type":"post","link":"https:\/\/inage.ksd6700.net\/?p=34","title":{"rendered":"[iPhone app] AVAudioPlayer \u3067\u97f3\u6e90\u591a\u91cd\u518d\u751f"},"content":{"rendered":"<p>\u3042\u3051\u307e\u3057\u3066\u304a\u3081\u3067\u3068\u3046\u3054\u3056\u3044\u307e\u3059\u3002\u4eca\u5e74\u3082\u3069\u3046\u305e\u3088\u308d\u3057\u304f\u304a\u9858\u3044\u3057\u307e\u3059\u3002<br \/>\n\u307f\u3093\u306a\u304c\u3001\u805e\u3051\u308b\u97f3\u697d\u3001\u4f7f\u3048\u308b\u30a2\u30d7\u30ea\u3001\u697d\u3057\u3081\u308b\u7a7a\u9593 \u3092\u5275\u308b\u4e00\u5e74\u306b\u3057\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<p>\u3067\u3001\u76f8\u5909\u308f\u3089\u305aiPhone\u30a2\u30d7\u30ea\u3092\u4f5c\u6210\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p><img decoding=\"async\" class=\"pict\" src=\"http:\/\/studioeth.net\/ethBlog\/_images\/2a34eee7.png\" border=\"0\" alt=\"avAudioPlayer\" hspace=\"5\" align=\"top\" \/><\/p>\n<p>iPhone OS 2.2\u304b\u3089AVFoundation.framework\u304c\u4f7f\u7528\u53ef\u80fd\u306b\u306a\u308a\u3001mp3\u306a\u3069\u306e\u97f3\u697d\u30b3\u30f3\u30c6\u30f3\u30c4\u306e\u518d\u751f\u304c\u7c21\u5358\u306b\u51fa\u6765\u308b\u3088\u3046\u306b\u306a\u3063\u305f\u307f\u305f\u3044\u3067\u3059\u3002<br \/>\n\u3067\u3001\u591a\u91cd\u97f3\u697d\u518d\u751f\u306e\u305f\u3081\u306b\u4f7f\u7528\u3057\u305f\u306e\u3067\u3059\u304c\u3001\u3044\u308d\u3044\u308d\u30c8\u30e9\u30d6\u3063\u305f\u306e\u3067\u30e1\u30e2\u3057\u3066\u304a\u304d\u307e\u3059\u3002<\/p>\n<p>\u6700\u521d\u3001\u30ea\u30d5\u30a1\u30ec\u30f3\u30b9\u3092\u898b\u306a\u304c\u3089\u3001<br \/>\n<span > #import&lt;AVFoundation\/AVFoundation.h&gt;<\/span><br \/>\n\u3057\u3066<\/p>\n<p><span ><span >NSString *path = [[NSBundle mainBundle] pathForResource:@&#8221;sound&#8221; ofType:@&#8221;mp3&#8243;];<br \/>\nNSURL *url = [NSURL fileURLWithPath:path]; <\/span><span > AVAudioPlayer *audio = [[AVAudioPlayer alloc] initWithContentsOfURL:url error:nil];<\/span><\/span><\/p>\n<p><span ><span >;<\/span><br \/>\n<\/span><br \/>\n\u3068\u3057\u305f\u304c\u30d3\u30eb\u30c9\u5931\u6557\u3002<br \/>\n<span ><br \/>\n&#8220;.objc_class_name_AVAudioPlayer&#8221;, referenced from: literal-pointer@__OBJC@__cls_refs@AVAudioPlayer in AVAudioTest2AppDelegate.o<br \/>\nld: symbol(s) not found collect2: ld returned 1 exit status<br \/>\n<\/span><br \/>\n\u3053\u306e\u30a8\u30e9\u30fc\u3092\u30b3\u30d4\u30da\u3057\u3066\u30b0\u30b0\u3063\u305f\u3089\u3001\u539f\u56e0\u304c\u308f\u304b\u3063\u305f\u3002<br \/>\n&#8211;<br \/>\nXcode\u306eFramework\u306bAVFoundation.framework\u3092\u8ffd\u52a0\u3057\u3066\u3044\u306a\u304b\u3063\u305f\u305f\u3081\u3002<br \/>\n\u3057\u304b\u3057\u3001\u8ffd\u52a0\u3057\u3088\u3046\u306b\u3082\u3001System\/Library\/Frameworks\u4e0b\u306b\u898b\u5f53\u305f\u3089\u306a\u3044\u3002SpotLight\u3067\u201dAVFoundation.framework\u201d\u3092\u63a2\u3057\u305f\u3089\u3001iPhone\u30b7\u30df\u30e5\u30ec\u30fc\u30bf\u306e\u30d5\u30a9\u30eb\u30c0\u306b\u3042\u3063\u305f\u305f\u3081\u3001\u305d\u308c\u3092\u30b3\u30d4\u30da\u3002<br \/>\n\u3057\u304b\u3057\u307e\u3060\u51fa\u6765\u306a\u3044\u3002\u4e0b\u306e\u30a8\u30e9\u30fc\u304c\u51fa\u308b\u3002<\/p>\n<p><span >Error loading<br \/>\n\/Library\/QuickTime\/LiveType.component\/Contents\/MacOS\/LiveType:<br \/>\ndlopen(\/Library\/QuickTime\/LiveType.component\/Contents\/MacOS\/LiveType,<br \/>\n262): Symbol not found:<\/span><\/p>\n<p>\u307e\u305f\u30b0\u30b0\u3063\u305f\u3089\u3001<br \/>\nNumata Designed Factory\u3055\u3093\u306e\u30da\u30fc\u30b8\u306b\u7b54\u3048\u304c\u3002<br \/>\n<a href=\"http:\/\/numata.designed.jp\/ja\/2008\/12\/iphone-1.html \" >http:\/\/numata.designed.jp\/ja\/2008\/12\/iphone-1.html<br \/>\n<\/a>\u3069\u3046\u3084\u3089\u958b\u767a\u74b0\u5883\u306e\u4e0d\u5177\u5408\uff08\u4ed5\u69d8\uff1f\uff09\u3063\u307d\u3044\u3002<br \/>\n\u3067\u3001\u8a18\u8f09\u3055\u308c\u3066\u3044\u308b\u901a\u308a\u3001\/Library\/QuickTime\u304b\u3089<\/p>\n<ul>\n<li>LiveType.component<\/li>\n<\/ul>\n<p>\u3092\u524a\u9664\u3057\u305f\u3089\u518d\u751f\u6210\u529f\u3002\u30a8\u30e9\u30fc\u51fa\u529b\u3067\u30b0\u30b0\u308b\u306e\u306f\u5f37\u529b\u3060\u3068\u3001\u5b9f\u611f\u3057\u305f\u3002<\/p>\n<p>\u3067\u591a\u91cd\u518d\u751f\u3057\u3088\u3046\u3068<br \/>\nAVAudioPlayer\u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3092\uff12\u3064\u3064\u304f\u3063\u3066\u4e21\u65b9\u518d\u751f\u3055\u305b\u3088\u3046\u3068\u3057\u305f\u304c\u3001\uff11\u66f2\u76ee\u518d\u751f\u4e2d\u306b\uff12\u66f2\u76ee\u3092\u518d\u751f\u3055\u305b\u308b\u3068\u3001\u305d\u3053\u3067\uff11\u66f2\u76ee\u306e\u518d\u751f\u304c\u30b9\u30c8\u30c3\u30d7\u3057\u3066\u3057\u307e\u3044\u3001\u4ea4\u4e92\u306b\u3057\u304b\u518d\u751f\u51fa\u6765\u306a\u3044\u3002\u3002\u30ea\u30d5\u30a1\u30ec\u30f3\u30b9\u306b\u306f\u3001<br \/>\n<span ><span >Using an audio player you can:<\/span><br  \/><span > * Play sounds of any duration<\/span><br  \/><span > * Play sounds from files or memory buffers<\/span><br  \/><span > * Loop sounds<\/span><br  \/><span > * Play multiple sounds simultaneously<\/span><br  \/><span > * Control relative playback level for each sound you are playing<\/span><br  \/><span > * Seek to a particular point in a sound file, which supports such application features as fast forward and rewind<\/span><br  \/><span > * Obtain data that you can use for playback level metering<\/span><\/span><\/p>\n<p>\u3063\u3066\u3061\u3083\u3093\u3068\u66f8\u3044\u3066\u3042\u308b\u306e\u306b\u3067\u304d\u306a\u3044\u3002<br \/>\n\u3067<a href=\"http:\/\/jamesbrooks.net\/\" >\u8abf\u3079\u305f\u3089<\/a>\u3001\u3069\u3046\u3084\u3089\u591a\u91cd\u518d\u751f\u3057\u305f\u3044\u5834\u5408\u3001\u30d5\u30a9\u30fc\u30de\u30c3\u30c8\u306f<span > .caf\u30d5\u30a1\u30a4\u30eb\u3092\u4f7f\u308f\u306a\u3051\u308c\u3070\u3044\u3051\u306a\u3044\u3089\u3057\u3044\u3002<\/span><\/p>\n<p>caf\u30d5\u30a1\u30a4\u30eb\u306fmp3\u30d5\u30a1\u30a4\u30eb\u304b\u3089\u3001\u30bf\u30fc\u30df\u30ca\u30eb\u4e0a\u3067\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u306b\u3088\u308a\u4f5c\u6210\u51fa\u6765\u308b\u3002<\/p>\n<pre class=\"textmate-source twilight\" ><span class=\"source source_shell\">\/usr\/bin\/afconvert -f caff -d ima4 sound.mp3 sound.caf<\/span><\/pre>\n<p>\u4f5c\u6210\u3057\u305fcaf\u30d5\u30a1\u30a4\u30eb\u3092\u4f7f\u7528\u3057\u305f\u3068\u3053\u308d\u3001\u3061\u3083\u3093\u3068\u591a\u91cd\u518d\u751f\u3067\u304d\u307e\u3057\u305f\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3042\u3051\u307e\u3057\u3066\u304a\u3081\u3067\u3068\u3046\u3054\u3056\u3044\u307e\u3059\u3002\u4eca\u5e74\u3082\u3069\u3046\u305e\u3088\u308d\u3057\u304f\u304a\u9858\u3044\u3057\u307e\u3059\u3002<br \/>\n\u307f\u3093\u306a\u304c\u3001\u805e\u3051\u308b\u97f3\u697d\u3001\u4f7f\u3048\u308b\u30a2\u30d7\u30ea\u3001\u697d\u3057\u3081\u308b\u7a7a\u9593 \u3092\u5275\u308b\u4e00\u5e74\u306b\u3057\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002<br \/>\n\u3067\u3001\u76f8\u5909\u308f\u3089\u305aiPhone\u30a2\u30d7\u30ea\u3092\u4f5c\u6210\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>iPhone O [&#8230;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[],"_links":{"self":[{"href":"https:\/\/inage.ksd6700.net\/index.php?rest_route=\/wp\/v2\/posts\/34"}],"collection":[{"href":"https:\/\/inage.ksd6700.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/inage.ksd6700.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/inage.ksd6700.net\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/inage.ksd6700.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=34"}],"version-history":[{"count":0,"href":"https:\/\/inage.ksd6700.net\/index.php?rest_route=\/wp\/v2\/posts\/34\/revisions"}],"wp:attachment":[{"href":"https:\/\/inage.ksd6700.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=34"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/inage.ksd6700.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=34"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/inage.ksd6700.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=34"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}