[{"data":1,"prerenderedAt":2802},["ShallowReactive",2],{"article_list_shuey_":3},[4,199,2212,2270,2324,2410,2552,2646],{"_path":5,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":9,"description":10,"publishDate":11,"tags":12,"image":16,"excerpt":10,"body":17,"_type":190,"_id":191,"_source":192,"_file":193,"_stem":194,"_extension":195,"author":196},"/shuey/2012-07/reset-button","2012-07",false,"","The Reset Button","Horace Dediu of Asymco has been publishing some fantastic insights and analysis of the mobile market in the past few weeks. I linked to some of Dediu's analysis of the Economics of Android in an earlier post, and since then he's updated his work with the latest data and is studying RIM and Microsoft's efforts in the space as well.","2012-07-19",[13,14,15],"android","apple","ios","/shuey/2012-07/img/kevin.jpg",{"type":18,"children":19,"toc":187},"root",[20,48,62,67,90,140,152,166,171],{"type":21,"tag":22,"props":23,"children":24},"element","p",{},[25,28,37,39,46],{"type":26,"value":27},"text","Horace Dediu of ",{"type":21,"tag":29,"props":30,"children":34},"a",{"href":31,"rel":32},"http://asymco.com",[33],"nofollow",[35],{"type":26,"value":36},"Asymco",{"type":26,"value":38}," has been publishing some fantastic insights and analysis of the mobile market in the past few weeks. I linked to some of Dediu's analysis of the ",{"type":21,"tag":29,"props":40,"children":43},{"href":41,"rel":42},"http://blog.artlogic.com/2012/05/17/the-economics-of-android/",[33],[44],{"type":26,"value":45},"Economics of Android",{"type":26,"value":47}," in an earlier post, and since then he's updated his work with the latest data and is studying RIM and Microsoft's efforts in the space as well.",{"type":21,"tag":22,"props":49,"children":50},{},[51,53,60],{"type":26,"value":52},"The recent episode of ",{"type":21,"tag":29,"props":54,"children":57},{"href":55,"rel":56},"http://5by5.tv/criticalpath/45",[33],[58],{"type":26,"value":59},"The Critical Path \"Management vs. Leadership\"",{"type":26,"value":61}," is simply fantastic. In the episode he posits that management is the process of running the day to day operations, of keeping a well organized system moving. Leadership on the other hand, is about disruption, about what's next, about bold moves. He captures this with the phrase, \"pressing the reset button\". With these definitions in mind, a successful leader is one who disrupts their business at its peak, and unsuccessful ones wait too long to make any bold moves. Dediu cites the famous example of Steve Jobs killing off the popular iPod Mini line and wonders if Apple is now \"pressing the reset button\" on the iPad as it dominates the tablet market.",{"type":21,"tag":22,"props":63,"children":64},{},[65],{"type":26,"value":66},"With that in mind, what have some of Apple's competitors been up to?",{"type":21,"tag":22,"props":68,"children":69},{},[70,72,79,81,88],{"type":26,"value":71},"RIM is making desperate, not bold moves, and possibly far too late. It's considering selling its handset business, BlackBerry OS 10 is delayed, and it's ",{"type":21,"tag":29,"props":73,"children":76},{"href":74,"rel":75},"http://www.businessweek.com/videos/2012-07-10/rim-to-sell-corporate-jet",[33],[77],{"type":26,"value":78},"selling a corporate jet to save some cash",{"type":26,"value":80},". It's stock price has fallen to record lows and the company just ",{"type":21,"tag":29,"props":82,"children":85},{"href":83,"rel":84},"http://www.morningstar.com/advisor/t/59341272/rim-found-guilty-of-infringing-mformation-patent.htm",[33],[86],{"type":26,"value":87},"lost a patent lawsuit to the tune of $142.7M",{"type":26,"value":89},".",{"type":21,"tag":22,"props":91,"children":92},{},[93,95,102,104,111,113,120,122,129,131,138],{"type":26,"value":94},"Microsoft is ",{"type":21,"tag":29,"props":96,"children":99},{"href":97,"rel":98},"http://www.bloomberg.com/news/2011-03-07/microsoft-is-said-to-pay-nokia-more-than-1-billion-under-software-accord.html",[33],[100],{"type":26,"value":101},"tied closely to Nokia",{"type":26,"value":103}," who bet heavily on the Lumia series of smartphones. Estimates show that ",{"type":21,"tag":29,"props":105,"children":108},{"href":106,"rel":107},"http://www.asymco.com/2012/07/19/how-many-lumia-phones-were-shipped-in-the-us/",[33],[109],{"type":26,"value":110},"400k to 1M Lumias were sold in the US",{"type":26,"value":112}," (updated 7/19/12 at 3:02pm) ",{"type":21,"tag":29,"props":114,"children":117},{"href":115,"rel":116},"http://www.asymco.com/2012/07/13/how-many-lumia/",[33],[118],{"type":26,"value":119},"that only 330k Lumias were sold in the US",{"type":26,"value":121}," and their launch partner AT&T is now ",{"type":21,"tag":29,"props":123,"children":126},{"href":124,"rel":125},"http://news.cnet.com/8301-1035_3-57472577-94/at-t-slashes-nokia-lumia-900-price-by-half/?tag=mncol;txt",[33],[127],{"type":26,"value":128},"selling them for half price.",{"type":26,"value":130}," Making matters worse, the Lumias aren't able to be upgraded to the newly demoed Windows Mobile 8 that was introduced alongside the new Surface tablet. In addition to competing with Apple's iPad, the Surface is set to compete against Microsoft's OEM partners, which ",{"type":21,"tag":29,"props":132,"children":135},{"href":133,"rel":134},"http://news.cnet.com/8301-10805_3-57469903-75/microsofts-surface-is-a-design-point-says-ceo/",[33],[136],{"type":26,"value":137},"they've tried to downplay",{"type":26,"value":139},". Following the failed Zune and Kin brands, the struggling Lumia line which they backed heavily, the Surface brand has its work cut out for itself. Pricing and a release date haven't been announced yet, but it will be interesting to see when it ships and what it will retail for.",{"type":21,"tag":22,"props":141,"children":142},{},[143,150],{"type":21,"tag":29,"props":144,"children":147},{"href":145,"rel":146},"http://www.asymco.com/2012/07/16/from-bad-to-worse-and-from-good-to-great/",[33],[148],{"type":26,"value":149},"Samsung is making most of the money",{"type":26,"value":151}," in the Android ecosystem and companies like HTC are suffering significant losses. In Dediu's analysis of HTC's woes it looks as if they've struggled to match Samsung in volume in their transition from a relatively low volume Windows Mobile smartphone business to Android. An area that Apple has excelled at, thanks largely to Tim Cook, is in volume, and they've been able to quickly ramp up production, purchase components in unheard of quantities, and are investing billions in their production facilities. This is an area that Microsoft may struggle in as well. Their Xbox business doesn't come close in size to the iPad or iPhone in units produced.",{"type":21,"tag":22,"props":153,"children":154},{},[155,157,164],{"type":26,"value":156},"Google's new Android tablet, the ",{"type":21,"tag":29,"props":158,"children":161},{"href":159,"rel":160},"http://www.google.com/nexus/#/7",[33],[162],{"type":26,"value":163},"Google Nexus 7",{"type":26,"value":165}," is getting good reviews, but looks to compete more with Amazon's Kindle Fire than the iPad. However, both devices are US only for the most part due to the lack of content distribution deals internationally which Apple has worked hard to establish. The US market is becoming an increasingly smaller piece of the worldwide mobile market so it will be interesting to see how Amazon and Google respond.",{"type":21,"tag":22,"props":167,"children":168},{},[169],{"type":26,"value":170},"Apple is set to release their third quarter earnings next Tuesday and rumors are swirling that a 7.85\" iPad and iPhone 5 will be announced and ship in September or October.  Will these products be an evolution of the current lineup or will there be some indications that the reset button has been pressed in Cupertino?",{"type":21,"tag":22,"props":172,"children":173},{},[174],{"type":21,"tag":175,"props":176,"children":177},"em",{},[178,180],{"type":26,"value":179},"Image credit: ",{"type":21,"tag":29,"props":181,"children":184},{"href":182,"rel":183},"http://www.flickr.com/photos/fortunelivemedia/",[33],[185],{"type":26,"value":186},"Fortune Live Media",{"title":8,"searchDepth":188,"depth":188,"links":189},3,[],"markdown","content:shuey:2012-07:reset-button.md","content","shuey/2012-07/reset-button.md","shuey/2012-07/reset-button","md",{"user":197,"name":198},"shuey","Steven Huey",{"_path":200,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":201,"description":202,"publishDate":203,"tags":204,"image":206,"excerpt":202,"body":207,"_type":190,"_id":2208,"_source":192,"_file":2209,"_stem":2210,"_extension":195,"author":2211},"/shuey/2012-07/mixer","A Simple Mixer Using AVFoundation","In iOS 4.0 Apple introduced the AV Foundation APIs that made working with audio and video media much easier than it had been in previous versions of iOS. Apple then brought these APIs to Mac OS X in OS X 10.7 \"Lion\". In this post I'll show how to use some of the APIs to create a simple four track mixer.","2012-07-02",[14,205,15],"cocoa","/shuey/2012-07/img/mixer-screenshot.jpg",{"type":18,"children":208,"toc":2206},[209,223,255,264,287,310,1254,1277,1285,1473,1478,1486,1659,1664,1672,1775,1780,1788,2159,2182,2190,2195,2200],{"type":21,"tag":22,"props":210,"children":211},{},[212,214,221],{"type":26,"value":213},"In iOS 4.0 Apple introduced the ",{"type":21,"tag":29,"props":215,"children":218},{"href":216,"rel":217},"https://developer.apple.com/library/mac/#documentation/AudioVideo/Conceptual/AVFoundationPG/Articles/00_Introduction.html#//apple_ref/doc/uid/TP40010188",[33],[219],{"type":26,"value":220},"AV Foundation APIs",{"type":26,"value":222}," that made working with audio and video media much easier than it had been in previous versions of iOS. Apple then brought these APIs to Mac OS X in OS X 10.7 \"Lion\". In this post I'll show how to use some of the APIs to create a simple four track mixer.",{"type":21,"tag":22,"props":224,"children":225},{},[226,228,235,237,244,246,253],{"type":26,"value":227},"The code for the project is ",{"type":21,"tag":29,"props":229,"children":232},{"href":230,"rel":231},"https://github.com/stevenhuey/ALMixer",[33],[233],{"type":26,"value":234},"available on GitHub",{"type":26,"value":236},". You'll need to provide your own audio files. The project is setup to use four WAV files named track1.wav - track4.wav but the ",{"type":21,"tag":29,"props":238,"children":241},{"href":239,"rel":240},"https://github.com/stevenhuey/ALMixer/blob/master/README.md",[33],[242],{"type":26,"value":243},"ReadMe.md",{"type":26,"value":245}," lists the two lines of code you need to change to use another audio format or naming scheme. Obviously you need to use an audio format supported by iOS. The project is configured to use ",{"type":21,"tag":29,"props":247,"children":250},{"href":248,"rel":249},"https://developer.apple.com/library/ios/#releasenotes/ObjectiveC/RN-TransitioningToARC/Introduction/Introduction.html#//apple_ref/doc/uid/TP40011226",[33],[251],{"type":26,"value":252},"ARC",{"type":26,"value":254}," (Automatic Reference Counting).",{"type":21,"tag":22,"props":256,"children":257},{},[258],{"type":21,"tag":259,"props":260,"children":261},"strong",{},[262],{"type":26,"value":263},"Setup",{"type":21,"tag":22,"props":265,"children":266},{},[267,269,276,278,285],{"type":26,"value":268},"To start we'll create an ",{"type":21,"tag":29,"props":270,"children":273},{"href":271,"rel":272},"https://developer.apple.com/library/ios/#documentation/AVFoundation/Reference/AVMutableComposition_Class/Reference/Reference.html#//apple_ref/doc/uid/TP40009526",[33],[274],{"type":26,"value":275},"AVMutableComposition",{"type":26,"value":277}," instance and two ",{"type":21,"tag":29,"props":279,"children":282},{"href":280,"rel":281},"https://developer.apple.com/library/ios/#documentation/Cocoa/Reference/Foundation/Classes/NSMutableDictionary_Class/Reference/Reference.html",[33],[283],{"type":26,"value":284},"NSMutableDictionaries",{"type":26,"value":286},". We'll use the dictionaries for keeping track of the IDs assigned to the audio tracks by the AVFoundation framework and for storing the volume level of each track.",{"type":21,"tag":22,"props":288,"children":289},{},[290,292,299,301,308],{"type":26,"value":291},"Our audio tracks are loaded from the Resources directory within the app bundle using the ",{"type":21,"tag":29,"props":293,"children":296},{"href":294,"rel":295},"https://developer.apple.com/library/ios/#documentation/AVFoundation/Reference/AVURLAsset_Class/Reference/Reference.html",[33],[297],{"type":26,"value":298},"AVURLAsset",{"type":26,"value":300}," class and then used to create an ",{"type":21,"tag":29,"props":302,"children":305},{"href":303,"rel":304},"https://developer.apple.com/library/ios/#documentation/AVFoundation/Reference/AVMutableCompositionTrack_Class/Reference/Reference.html",[33],[306],{"type":26,"value":307},"AVMutableCompositionTrack",{"type":26,"value":309}," that we insert into our AVMutableComposition. We record the ID of the track and set the track volume to 1.0, the maximum. The volume for each track can be set from 0.0 - 1.0.",{"type":21,"tag":311,"props":312,"children":316},"pre",{"className":313,"code":314,"language":315,"meta":8,"style":8},"language-swift shiki shiki-themes github-light github-dark","// Setup\n   _composition = [AVMutableComposition composition];\n\n   _audioMixValues = [[NSMutableDictionary alloc] initWithCapacity:0];\n   _audioMixTrackIDs = [[NSMutableDictionary alloc] initWithCapacity:0];\n\n   // Insert the audio tracks into our composition\n   NSArray* tracks = [NSArray arrayWithObjects:@\"track1\", @\"track2\", @\"track3\", @\"track4\", nil];\n   NSString* audioFileType = @\"wav\";\n\n   for (NSString* trackName in tracks)\n   {\n      AVURLAsset* audioAsset = [[AVURLAsset alloc]initWithURL:[NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:trackName ofType:audioFileType]]\n                                                      options:nil];\n\n      AVMutableCompositionTrack* audioTrack = [_composition addMutableTrackWithMediaType:AVMediaTypeAudio\n                                                                        preferredTrackID:kCMPersistentTrackID_Invalid];\n\n      NSError* error;\n      [audioTrack insertTimeRange:CMTimeRangeMake(kCMTimeZero, audioAsset.duration)\n                          ofTrack:[[audioAsset tracksWithMediaType:AVMediaTypeAudio]objectAtIndex:0]\n                           atTime:kCMTimeZero\n                            error:&error];\n\n      if (error)\n      {\n         NSLog(@\"%@\", [error localizedDescription]);\n      }\n\n      // Store the track IDs as track name -> track ID\n      [_audioMixTrackIDs setValue:[NSNumber numberWithInteger:audioTrack.trackID]\n                           forKey:trackName];\n\n      // Set the volume to 1.0 (max) for the track\n      [self setVolume:1.0f forTrack:trackName];\n   }\n\n   // Create a player for our composition of audio tracks. We observe the status so\n   // we know when the player is ready to play\n   AVPlayerItem* playerItem = [[AVPlayerItem alloc] initWithAsset:[_composition copy]];\n   [playerItem addObserver:self\n                forKeyPath:@\"status\"\n                   options:0\n                   context:NULL];\n\n   _player = [[AVPlayer alloc] initWithPlayerItem:playerItem];\n","swift",[317],{"type":21,"tag":318,"props":319,"children":320},"code",{"__ignoreMap":8},[321,333,354,363,397,426,434,443,528,565,573,606,615,678,699,707,743,761,769,787,810,850,868,887,895,909,918,942,951,959,968,995,1013,1021,1030,1072,1081,1089,1098,1107,1143,1161,1183,1201,1219,1227],{"type":21,"tag":322,"props":323,"children":326},"span",{"class":324,"line":325},"line",1,[327],{"type":21,"tag":322,"props":328,"children":330},{"style":329},"--shiki-default:#6A737D;--shiki-dark:#6A737D",[331],{"type":26,"value":332},"// Setup\n",{"type":21,"tag":322,"props":334,"children":336},{"class":324,"line":335},2,[337,343,349],{"type":21,"tag":322,"props":338,"children":340},{"style":339},"--shiki-default:#24292E;--shiki-dark:#E1E4E8",[341],{"type":26,"value":342},"   _composition ",{"type":21,"tag":322,"props":344,"children":346},{"style":345},"--shiki-default:#D73A49;--shiki-dark:#F97583",[347],{"type":26,"value":348},"=",{"type":21,"tag":322,"props":350,"children":351},{"style":339},[352],{"type":26,"value":353}," [AVMutableComposition composition];\n",{"type":21,"tag":322,"props":355,"children":356},{"class":324,"line":188},[357],{"type":21,"tag":322,"props":358,"children":360},{"emptyLinePlaceholder":359},true,[361],{"type":26,"value":362},"\n",{"type":21,"tag":322,"props":364,"children":366},{"class":324,"line":365},4,[367,372,376,381,386,392],{"type":21,"tag":322,"props":368,"children":369},{"style":339},[370],{"type":26,"value":371},"   _audioMixValues ",{"type":21,"tag":322,"props":373,"children":374},{"style":345},[375],{"type":26,"value":348},{"type":21,"tag":322,"props":377,"children":378},{"style":339},[379],{"type":26,"value":380}," [[NSMutableDictionary alloc] initWithCapacity",{"type":21,"tag":322,"props":382,"children":383},{"style":345},[384],{"type":26,"value":385},":",{"type":21,"tag":322,"props":387,"children":389},{"style":388},"--shiki-default:#005CC5;--shiki-dark:#79B8FF",[390],{"type":26,"value":391},"0",{"type":21,"tag":322,"props":393,"children":394},{"style":339},[395],{"type":26,"value":396},"];\n",{"type":21,"tag":322,"props":398,"children":400},{"class":324,"line":399},5,[401,406,410,414,418,422],{"type":21,"tag":322,"props":402,"children":403},{"style":339},[404],{"type":26,"value":405},"   _audioMixTrackIDs ",{"type":21,"tag":322,"props":407,"children":408},{"style":345},[409],{"type":26,"value":348},{"type":21,"tag":322,"props":411,"children":412},{"style":339},[413],{"type":26,"value":380},{"type":21,"tag":322,"props":415,"children":416},{"style":345},[417],{"type":26,"value":385},{"type":21,"tag":322,"props":419,"children":420},{"style":388},[421],{"type":26,"value":391},{"type":21,"tag":322,"props":423,"children":424},{"style":339},[425],{"type":26,"value":396},{"type":21,"tag":322,"props":427,"children":429},{"class":324,"line":428},6,[430],{"type":21,"tag":322,"props":431,"children":432},{"emptyLinePlaceholder":359},[433],{"type":26,"value":362},{"type":21,"tag":322,"props":435,"children":437},{"class":324,"line":436},7,[438],{"type":21,"tag":322,"props":439,"children":440},{"style":329},[441],{"type":26,"value":442},"   // Insert the audio tracks into our composition\n",{"type":21,"tag":322,"props":444,"children":446},{"class":324,"line":445},8,[447,452,457,462,466,471,475,480,486,491,496,500,505,509,514,519,524],{"type":21,"tag":322,"props":448,"children":449},{"style":339},[450],{"type":26,"value":451},"   NSArray",{"type":21,"tag":322,"props":453,"children":454},{"style":345},[455],{"type":26,"value":456},"*",{"type":21,"tag":322,"props":458,"children":459},{"style":339},[460],{"type":26,"value":461}," tracks ",{"type":21,"tag":322,"props":463,"children":464},{"style":345},[465],{"type":26,"value":348},{"type":21,"tag":322,"props":467,"children":468},{"style":339},[469],{"type":26,"value":470}," [NSArray arrayWithObjects",{"type":21,"tag":322,"props":472,"children":473},{"style":345},[474],{"type":26,"value":385},{"type":21,"tag":322,"props":476,"children":477},{"style":339},[478],{"type":26,"value":479},"@",{"type":21,"tag":322,"props":481,"children":483},{"style":482},"--shiki-default:#032F62;--shiki-dark:#9ECBFF",[484],{"type":26,"value":485},"\"track1\"",{"type":21,"tag":322,"props":487,"children":488},{"style":339},[489],{"type":26,"value":490},", @",{"type":21,"tag":322,"props":492,"children":493},{"style":482},[494],{"type":26,"value":495},"\"track2\"",{"type":21,"tag":322,"props":497,"children":498},{"style":339},[499],{"type":26,"value":490},{"type":21,"tag":322,"props":501,"children":502},{"style":482},[503],{"type":26,"value":504},"\"track3\"",{"type":21,"tag":322,"props":506,"children":507},{"style":339},[508],{"type":26,"value":490},{"type":21,"tag":322,"props":510,"children":511},{"style":482},[512],{"type":26,"value":513},"\"track4\"",{"type":21,"tag":322,"props":515,"children":516},{"style":339},[517],{"type":26,"value":518},", ",{"type":21,"tag":322,"props":520,"children":521},{"style":388},[522],{"type":26,"value":523},"nil",{"type":21,"tag":322,"props":525,"children":526},{"style":339},[527],{"type":26,"value":396},{"type":21,"tag":322,"props":529,"children":531},{"class":324,"line":530},9,[532,537,541,546,550,555,560],{"type":21,"tag":322,"props":533,"children":534},{"style":339},[535],{"type":26,"value":536},"   NSString",{"type":21,"tag":322,"props":538,"children":539},{"style":345},[540],{"type":26,"value":456},{"type":21,"tag":322,"props":542,"children":543},{"style":339},[544],{"type":26,"value":545}," audioFileType ",{"type":21,"tag":322,"props":547,"children":548},{"style":345},[549],{"type":26,"value":348},{"type":21,"tag":322,"props":551,"children":552},{"style":339},[553],{"type":26,"value":554}," @",{"type":21,"tag":322,"props":556,"children":557},{"style":482},[558],{"type":26,"value":559},"\"wav\"",{"type":21,"tag":322,"props":561,"children":562},{"style":339},[563],{"type":26,"value":564},";\n",{"type":21,"tag":322,"props":566,"children":568},{"class":324,"line":567},10,[569],{"type":21,"tag":322,"props":570,"children":571},{"emptyLinePlaceholder":359},[572],{"type":26,"value":362},{"type":21,"tag":322,"props":574,"children":576},{"class":324,"line":575},11,[577,582,587,591,596,601],{"type":21,"tag":322,"props":578,"children":579},{"style":345},[580],{"type":26,"value":581},"   for",{"type":21,"tag":322,"props":583,"children":584},{"style":339},[585],{"type":26,"value":586}," (NSString",{"type":21,"tag":322,"props":588,"children":589},{"style":345},[590],{"type":26,"value":456},{"type":21,"tag":322,"props":592,"children":593},{"style":339},[594],{"type":26,"value":595}," trackName ",{"type":21,"tag":322,"props":597,"children":598},{"style":345},[599],{"type":26,"value":600},"in",{"type":21,"tag":322,"props":602,"children":603},{"style":339},[604],{"type":26,"value":605}," tracks)\n",{"type":21,"tag":322,"props":607,"children":609},{"class":324,"line":608},12,[610],{"type":21,"tag":322,"props":611,"children":612},{"style":339},[613],{"type":26,"value":614},"   {\n",{"type":21,"tag":322,"props":616,"children":618},{"class":324,"line":617},13,[619,624,628,633,637,642,646,651,655,660,664,669,673],{"type":21,"tag":322,"props":620,"children":621},{"style":339},[622],{"type":26,"value":623},"      AVURLAsset",{"type":21,"tag":322,"props":625,"children":626},{"style":345},[627],{"type":26,"value":456},{"type":21,"tag":322,"props":629,"children":630},{"style":339},[631],{"type":26,"value":632}," audioAsset ",{"type":21,"tag":322,"props":634,"children":635},{"style":345},[636],{"type":26,"value":348},{"type":21,"tag":322,"props":638,"children":639},{"style":339},[640],{"type":26,"value":641}," [[AVURLAsset alloc]initWithURL",{"type":21,"tag":322,"props":643,"children":644},{"style":345},[645],{"type":26,"value":385},{"type":21,"tag":322,"props":647,"children":648},{"style":339},[649],{"type":26,"value":650},"[NSURL fileURLWithPath",{"type":21,"tag":322,"props":652,"children":653},{"style":345},[654],{"type":26,"value":385},{"type":21,"tag":322,"props":656,"children":657},{"style":339},[658],{"type":26,"value":659},"[[NSBundle mainBundle] pathForResource",{"type":21,"tag":322,"props":661,"children":662},{"style":345},[663],{"type":26,"value":385},{"type":21,"tag":322,"props":665,"children":666},{"style":339},[667],{"type":26,"value":668},"trackName ofType",{"type":21,"tag":322,"props":670,"children":671},{"style":345},[672],{"type":26,"value":385},{"type":21,"tag":322,"props":674,"children":675},{"style":339},[676],{"type":26,"value":677},"audioFileType]]\n",{"type":21,"tag":322,"props":679,"children":681},{"class":324,"line":680},14,[682,687,691,695],{"type":21,"tag":322,"props":683,"children":684},{"style":339},[685],{"type":26,"value":686},"                                                      options",{"type":21,"tag":322,"props":688,"children":689},{"style":345},[690],{"type":26,"value":385},{"type":21,"tag":322,"props":692,"children":693},{"style":388},[694],{"type":26,"value":523},{"type":21,"tag":322,"props":696,"children":697},{"style":339},[698],{"type":26,"value":396},{"type":21,"tag":322,"props":700,"children":702},{"class":324,"line":701},15,[703],{"type":21,"tag":322,"props":704,"children":705},{"emptyLinePlaceholder":359},[706],{"type":26,"value":362},{"type":21,"tag":322,"props":708,"children":710},{"class":324,"line":709},16,[711,716,720,725,729,734,738],{"type":21,"tag":322,"props":712,"children":713},{"style":339},[714],{"type":26,"value":715},"      AVMutableCompositionTrack",{"type":21,"tag":322,"props":717,"children":718},{"style":345},[719],{"type":26,"value":456},{"type":21,"tag":322,"props":721,"children":722},{"style":339},[723],{"type":26,"value":724}," audioTrack ",{"type":21,"tag":322,"props":726,"children":727},{"style":345},[728],{"type":26,"value":348},{"type":21,"tag":322,"props":730,"children":731},{"style":339},[732],{"type":26,"value":733}," [_composition addMutableTrackWithMediaType",{"type":21,"tag":322,"props":735,"children":736},{"style":345},[737],{"type":26,"value":385},{"type":21,"tag":322,"props":739,"children":740},{"style":339},[741],{"type":26,"value":742},"AVMediaTypeAudio\n",{"type":21,"tag":322,"props":744,"children":746},{"class":324,"line":745},17,[747,752,756],{"type":21,"tag":322,"props":748,"children":749},{"style":339},[750],{"type":26,"value":751},"                                                                        preferredTrackID",{"type":21,"tag":322,"props":753,"children":754},{"style":345},[755],{"type":26,"value":385},{"type":21,"tag":322,"props":757,"children":758},{"style":339},[759],{"type":26,"value":760},"kCMPersistentTrackID_Invalid];\n",{"type":21,"tag":322,"props":762,"children":764},{"class":324,"line":763},18,[765],{"type":21,"tag":322,"props":766,"children":767},{"emptyLinePlaceholder":359},[768],{"type":26,"value":362},{"type":21,"tag":322,"props":770,"children":772},{"class":324,"line":771},19,[773,778,782],{"type":21,"tag":322,"props":774,"children":775},{"style":339},[776],{"type":26,"value":777},"      NSError",{"type":21,"tag":322,"props":779,"children":780},{"style":345},[781],{"type":26,"value":456},{"type":21,"tag":322,"props":783,"children":784},{"style":339},[785],{"type":26,"value":786}," error;\n",{"type":21,"tag":322,"props":788,"children":790},{"class":324,"line":789},20,[791,796,800,805],{"type":21,"tag":322,"props":792,"children":793},{"style":339},[794],{"type":26,"value":795},"      [audioTrack insertTimeRange",{"type":21,"tag":322,"props":797,"children":798},{"style":345},[799],{"type":26,"value":385},{"type":21,"tag":322,"props":801,"children":802},{"style":388},[803],{"type":26,"value":804},"CMTimeRangeMake",{"type":21,"tag":322,"props":806,"children":807},{"style":339},[808],{"type":26,"value":809},"(kCMTimeZero, audioAsset.duration)\n",{"type":21,"tag":322,"props":811,"children":813},{"class":324,"line":812},21,[814,819,823,828,832,837,841,845],{"type":21,"tag":322,"props":815,"children":816},{"style":339},[817],{"type":26,"value":818},"                          ofTrack",{"type":21,"tag":322,"props":820,"children":821},{"style":345},[822],{"type":26,"value":385},{"type":21,"tag":322,"props":824,"children":825},{"style":339},[826],{"type":26,"value":827},"[[audioAsset tracksWithMediaType",{"type":21,"tag":322,"props":829,"children":830},{"style":345},[831],{"type":26,"value":385},{"type":21,"tag":322,"props":833,"children":834},{"style":339},[835],{"type":26,"value":836},"AVMediaTypeAudio]objectAtIndex",{"type":21,"tag":322,"props":838,"children":839},{"style":345},[840],{"type":26,"value":385},{"type":21,"tag":322,"props":842,"children":843},{"style":388},[844],{"type":26,"value":391},{"type":21,"tag":322,"props":846,"children":847},{"style":339},[848],{"type":26,"value":849},"]\n",{"type":21,"tag":322,"props":851,"children":853},{"class":324,"line":852},22,[854,859,863],{"type":21,"tag":322,"props":855,"children":856},{"style":339},[857],{"type":26,"value":858},"                           atTime",{"type":21,"tag":322,"props":860,"children":861},{"style":345},[862],{"type":26,"value":385},{"type":21,"tag":322,"props":864,"children":865},{"style":339},[866],{"type":26,"value":867},"kCMTimeZero\n",{"type":21,"tag":322,"props":869,"children":871},{"class":324,"line":870},23,[872,877,882],{"type":21,"tag":322,"props":873,"children":874},{"style":339},[875],{"type":26,"value":876},"                            error",{"type":21,"tag":322,"props":878,"children":879},{"style":345},[880],{"type":26,"value":881},":&",{"type":21,"tag":322,"props":883,"children":884},{"style":339},[885],{"type":26,"value":886},"error];\n",{"type":21,"tag":322,"props":888,"children":890},{"class":324,"line":889},24,[891],{"type":21,"tag":322,"props":892,"children":893},{"emptyLinePlaceholder":359},[894],{"type":26,"value":362},{"type":21,"tag":322,"props":896,"children":898},{"class":324,"line":897},25,[899,904],{"type":21,"tag":322,"props":900,"children":901},{"style":345},[902],{"type":26,"value":903},"      if",{"type":21,"tag":322,"props":905,"children":906},{"style":339},[907],{"type":26,"value":908}," (error)\n",{"type":21,"tag":322,"props":910,"children":912},{"class":324,"line":911},26,[913],{"type":21,"tag":322,"props":914,"children":915},{"style":339},[916],{"type":26,"value":917},"      {\n",{"type":21,"tag":322,"props":919,"children":921},{"class":324,"line":920},27,[922,927,932,937],{"type":21,"tag":322,"props":923,"children":924},{"style":388},[925],{"type":26,"value":926},"         NSLog",{"type":21,"tag":322,"props":928,"children":929},{"style":339},[930],{"type":26,"value":931},"(@",{"type":21,"tag":322,"props":933,"children":934},{"style":482},[935],{"type":26,"value":936},"\"%@\"",{"type":21,"tag":322,"props":938,"children":939},{"style":339},[940],{"type":26,"value":941},", [error localizedDescription]);\n",{"type":21,"tag":322,"props":943,"children":945},{"class":324,"line":944},28,[946],{"type":21,"tag":322,"props":947,"children":948},{"style":339},[949],{"type":26,"value":950},"      }\n",{"type":21,"tag":322,"props":952,"children":954},{"class":324,"line":953},29,[955],{"type":21,"tag":322,"props":956,"children":957},{"emptyLinePlaceholder":359},[958],{"type":26,"value":362},{"type":21,"tag":322,"props":960,"children":962},{"class":324,"line":961},30,[963],{"type":21,"tag":322,"props":964,"children":965},{"style":329},[966],{"type":26,"value":967},"      // Store the track IDs as track name -> track ID\n",{"type":21,"tag":322,"props":969,"children":971},{"class":324,"line":970},31,[972,977,981,986,990],{"type":21,"tag":322,"props":973,"children":974},{"style":339},[975],{"type":26,"value":976},"      [_audioMixTrackIDs setValue",{"type":21,"tag":322,"props":978,"children":979},{"style":345},[980],{"type":26,"value":385},{"type":21,"tag":322,"props":982,"children":983},{"style":339},[984],{"type":26,"value":985},"[NSNumber numberWithInteger",{"type":21,"tag":322,"props":987,"children":988},{"style":345},[989],{"type":26,"value":385},{"type":21,"tag":322,"props":991,"children":992},{"style":339},[993],{"type":26,"value":994},"audioTrack.trackID]\n",{"type":21,"tag":322,"props":996,"children":998},{"class":324,"line":997},32,[999,1004,1008],{"type":21,"tag":322,"props":1000,"children":1001},{"style":339},[1002],{"type":26,"value":1003},"                           forKey",{"type":21,"tag":322,"props":1005,"children":1006},{"style":345},[1007],{"type":26,"value":385},{"type":21,"tag":322,"props":1009,"children":1010},{"style":339},[1011],{"type":26,"value":1012},"trackName];\n",{"type":21,"tag":322,"props":1014,"children":1016},{"class":324,"line":1015},33,[1017],{"type":21,"tag":322,"props":1018,"children":1019},{"emptyLinePlaceholder":359},[1020],{"type":26,"value":362},{"type":21,"tag":322,"props":1022,"children":1024},{"class":324,"line":1023},34,[1025],{"type":21,"tag":322,"props":1026,"children":1027},{"style":329},[1028],{"type":26,"value":1029},"      // Set the volume to 1.0 (max) for the track\n",{"type":21,"tag":322,"props":1031,"children":1033},{"class":324,"line":1032},35,[1034,1039,1044,1049,1053,1059,1064,1068],{"type":21,"tag":322,"props":1035,"children":1036},{"style":339},[1037],{"type":26,"value":1038},"      [",{"type":21,"tag":322,"props":1040,"children":1041},{"style":388},[1042],{"type":26,"value":1043},"self",{"type":21,"tag":322,"props":1045,"children":1046},{"style":339},[1047],{"type":26,"value":1048}," setVolume",{"type":21,"tag":322,"props":1050,"children":1051},{"style":345},[1052],{"type":26,"value":385},{"type":21,"tag":322,"props":1054,"children":1056},{"style":1055},"--shiki-default:#B31D28;--shiki-default-font-style:italic;--shiki-dark:#FDAEB7;--shiki-dark-font-style:italic",[1057],{"type":26,"value":1058},"1.0f",{"type":21,"tag":322,"props":1060,"children":1061},{"style":339},[1062],{"type":26,"value":1063}," forTrack",{"type":21,"tag":322,"props":1065,"children":1066},{"style":345},[1067],{"type":26,"value":385},{"type":21,"tag":322,"props":1069,"children":1070},{"style":339},[1071],{"type":26,"value":1012},{"type":21,"tag":322,"props":1073,"children":1075},{"class":324,"line":1074},36,[1076],{"type":21,"tag":322,"props":1077,"children":1078},{"style":339},[1079],{"type":26,"value":1080},"   }\n",{"type":21,"tag":322,"props":1082,"children":1084},{"class":324,"line":1083},37,[1085],{"type":21,"tag":322,"props":1086,"children":1087},{"emptyLinePlaceholder":359},[1088],{"type":26,"value":362},{"type":21,"tag":322,"props":1090,"children":1092},{"class":324,"line":1091},38,[1093],{"type":21,"tag":322,"props":1094,"children":1095},{"style":329},[1096],{"type":26,"value":1097},"   // Create a player for our composition of audio tracks. We observe the status so\n",{"type":21,"tag":322,"props":1099,"children":1101},{"class":324,"line":1100},39,[1102],{"type":21,"tag":322,"props":1103,"children":1104},{"style":329},[1105],{"type":26,"value":1106},"   // we know when the player is ready to play\n",{"type":21,"tag":322,"props":1108,"children":1110},{"class":324,"line":1109},40,[1111,1116,1120,1125,1129,1134,1138],{"type":21,"tag":322,"props":1112,"children":1113},{"style":339},[1114],{"type":26,"value":1115},"   AVPlayerItem",{"type":21,"tag":322,"props":1117,"children":1118},{"style":345},[1119],{"type":26,"value":456},{"type":21,"tag":322,"props":1121,"children":1122},{"style":339},[1123],{"type":26,"value":1124}," playerItem ",{"type":21,"tag":322,"props":1126,"children":1127},{"style":345},[1128],{"type":26,"value":348},{"type":21,"tag":322,"props":1130,"children":1131},{"style":339},[1132],{"type":26,"value":1133}," [[AVPlayerItem alloc] initWithAsset",{"type":21,"tag":322,"props":1135,"children":1136},{"style":345},[1137],{"type":26,"value":385},{"type":21,"tag":322,"props":1139,"children":1140},{"style":339},[1141],{"type":26,"value":1142},"[_composition copy]];\n",{"type":21,"tag":322,"props":1144,"children":1146},{"class":324,"line":1145},41,[1147,1152,1156],{"type":21,"tag":322,"props":1148,"children":1149},{"style":339},[1150],{"type":26,"value":1151},"   [playerItem addObserver",{"type":21,"tag":322,"props":1153,"children":1154},{"style":345},[1155],{"type":26,"value":385},{"type":21,"tag":322,"props":1157,"children":1158},{"style":388},[1159],{"type":26,"value":1160},"self\n",{"type":21,"tag":322,"props":1162,"children":1164},{"class":324,"line":1163},42,[1165,1170,1174,1178],{"type":21,"tag":322,"props":1166,"children":1167},{"style":339},[1168],{"type":26,"value":1169},"                forKeyPath",{"type":21,"tag":322,"props":1171,"children":1172},{"style":345},[1173],{"type":26,"value":385},{"type":21,"tag":322,"props":1175,"children":1176},{"style":339},[1177],{"type":26,"value":479},{"type":21,"tag":322,"props":1179,"children":1180},{"style":482},[1181],{"type":26,"value":1182},"\"status\"\n",{"type":21,"tag":322,"props":1184,"children":1186},{"class":324,"line":1185},43,[1187,1192,1196],{"type":21,"tag":322,"props":1188,"children":1189},{"style":339},[1190],{"type":26,"value":1191},"                   options",{"type":21,"tag":322,"props":1193,"children":1194},{"style":345},[1195],{"type":26,"value":385},{"type":21,"tag":322,"props":1197,"children":1198},{"style":388},[1199],{"type":26,"value":1200},"0\n",{"type":21,"tag":322,"props":1202,"children":1204},{"class":324,"line":1203},44,[1205,1210,1214],{"type":21,"tag":322,"props":1206,"children":1207},{"style":339},[1208],{"type":26,"value":1209},"                   context",{"type":21,"tag":322,"props":1211,"children":1212},{"style":345},[1213],{"type":26,"value":385},{"type":21,"tag":322,"props":1215,"children":1216},{"style":339},[1217],{"type":26,"value":1218},"NULL];\n",{"type":21,"tag":322,"props":1220,"children":1222},{"class":324,"line":1221},45,[1223],{"type":21,"tag":322,"props":1224,"children":1225},{"emptyLinePlaceholder":359},[1226],{"type":26,"value":362},{"type":21,"tag":322,"props":1228,"children":1230},{"class":324,"line":1229},46,[1231,1236,1240,1245,1249],{"type":21,"tag":322,"props":1232,"children":1233},{"style":339},[1234],{"type":26,"value":1235},"   _player ",{"type":21,"tag":322,"props":1237,"children":1238},{"style":345},[1239],{"type":26,"value":348},{"type":21,"tag":322,"props":1241,"children":1242},{"style":339},[1243],{"type":26,"value":1244}," [[AVPlayer alloc] initWithPlayerItem",{"type":21,"tag":322,"props":1246,"children":1247},{"style":345},[1248],{"type":26,"value":385},{"type":21,"tag":322,"props":1250,"children":1251},{"style":339},[1252],{"type":26,"value":1253},"playerItem];\n",{"type":21,"tag":22,"props":1255,"children":1256},{},[1257,1259,1266,1268,1275],{"type":26,"value":1258},"Finally, we create an ",{"type":21,"tag":29,"props":1260,"children":1263},{"href":1261,"rel":1262},"https://developer.apple.com/library/ios/#documentation/AVFoundation/Reference/AVPlayerItem_Class/Reference/Reference.html",[33],[1264],{"type":26,"value":1265},"AVPlayerItem",{"type":26,"value":1267}," using our AVMutableComposition, and use that to create a ",{"type":21,"tag":29,"props":1269,"children":1272},{"href":1270,"rel":1271},"https://developer.apple.com/library/ios/#documentation/AVFoundation/Reference/AVPlayer_Class/Reference/Reference.html",[33],[1273],{"type":26,"value":1274},"AVPlayer",{"type":26,"value":1276}," that we'll use to control playback of the composition. We also want to observe the \"status\" key of our player item to be notified of changes in the state of our AVPlayerItem.",{"type":21,"tag":22,"props":1278,"children":1279},{},[1280],{"type":21,"tag":259,"props":1281,"children":1282},{},[1283],{"type":26,"value":1284},"Key Value Observing (KVO)",{"type":21,"tag":311,"props":1286,"children":1288},{"className":313,"code":1287,"language":315,"meta":8,"style":8},"- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context\n{\n   if ([keyPath isEqualToString:@\"status\"])\n   {\n      if (AVPlayerItemStatusReadyToPlay == _player.currentItem.status)\n      {\n         [_player play];\n      }\n   }\n}\n",[1289],{"type":21,"tag":318,"props":1290,"children":1291},{"__ignoreMap":8},[1292,1368,1376,1407,1414,1436,1443,1451,1458,1465],{"type":21,"tag":322,"props":1293,"children":1294},{"class":324,"line":325},[1295,1300,1305,1309,1314,1318,1323,1327,1332,1336,1341,1345,1350,1354,1359,1363],{"type":21,"tag":322,"props":1296,"children":1297},{"style":345},[1298],{"type":26,"value":1299},"-",{"type":21,"tag":322,"props":1301,"children":1302},{"style":339},[1303],{"type":26,"value":1304}," (void)observeValueForKeyPath",{"type":21,"tag":322,"props":1306,"children":1307},{"style":345},[1308],{"type":26,"value":385},{"type":21,"tag":322,"props":1310,"children":1311},{"style":339},[1312],{"type":26,"value":1313},"(NSString ",{"type":21,"tag":322,"props":1315,"children":1316},{"style":345},[1317],{"type":26,"value":456},{"type":21,"tag":322,"props":1319,"children":1320},{"style":339},[1321],{"type":26,"value":1322},")keyPath ofObject",{"type":21,"tag":322,"props":1324,"children":1325},{"style":345},[1326],{"type":26,"value":385},{"type":21,"tag":322,"props":1328,"children":1329},{"style":339},[1330],{"type":26,"value":1331},"(id)object change",{"type":21,"tag":322,"props":1333,"children":1334},{"style":345},[1335],{"type":26,"value":385},{"type":21,"tag":322,"props":1337,"children":1338},{"style":339},[1339],{"type":26,"value":1340},"(NSDictionary ",{"type":21,"tag":322,"props":1342,"children":1343},{"style":345},[1344],{"type":26,"value":456},{"type":21,"tag":322,"props":1346,"children":1347},{"style":339},[1348],{"type":26,"value":1349},")change context",{"type":21,"tag":322,"props":1351,"children":1352},{"style":345},[1353],{"type":26,"value":385},{"type":21,"tag":322,"props":1355,"children":1356},{"style":339},[1357],{"type":26,"value":1358},"(void ",{"type":21,"tag":322,"props":1360,"children":1361},{"style":345},[1362],{"type":26,"value":456},{"type":21,"tag":322,"props":1364,"children":1365},{"style":339},[1366],{"type":26,"value":1367},")context\n",{"type":21,"tag":322,"props":1369,"children":1370},{"class":324,"line":335},[1371],{"type":21,"tag":322,"props":1372,"children":1373},{"style":339},[1374],{"type":26,"value":1375},"{\n",{"type":21,"tag":322,"props":1377,"children":1378},{"class":324,"line":188},[1379,1384,1389,1393,1397,1402],{"type":21,"tag":322,"props":1380,"children":1381},{"style":345},[1382],{"type":26,"value":1383},"   if",{"type":21,"tag":322,"props":1385,"children":1386},{"style":339},[1387],{"type":26,"value":1388}," ([keyPath isEqualToString",{"type":21,"tag":322,"props":1390,"children":1391},{"style":345},[1392],{"type":26,"value":385},{"type":21,"tag":322,"props":1394,"children":1395},{"style":339},[1396],{"type":26,"value":479},{"type":21,"tag":322,"props":1398,"children":1399},{"style":482},[1400],{"type":26,"value":1401},"\"status\"",{"type":21,"tag":322,"props":1403,"children":1404},{"style":339},[1405],{"type":26,"value":1406},"])\n",{"type":21,"tag":322,"props":1408,"children":1409},{"class":324,"line":365},[1410],{"type":21,"tag":322,"props":1411,"children":1412},{"style":339},[1413],{"type":26,"value":614},{"type":21,"tag":322,"props":1415,"children":1416},{"class":324,"line":399},[1417,1421,1426,1431],{"type":21,"tag":322,"props":1418,"children":1419},{"style":345},[1420],{"type":26,"value":903},{"type":21,"tag":322,"props":1422,"children":1423},{"style":339},[1424],{"type":26,"value":1425}," (AVPlayerItemStatusReadyToPlay ",{"type":21,"tag":322,"props":1427,"children":1428},{"style":345},[1429],{"type":26,"value":1430},"==",{"type":21,"tag":322,"props":1432,"children":1433},{"style":339},[1434],{"type":26,"value":1435}," _player.currentItem.status)\n",{"type":21,"tag":322,"props":1437,"children":1438},{"class":324,"line":428},[1439],{"type":21,"tag":322,"props":1440,"children":1441},{"style":339},[1442],{"type":26,"value":917},{"type":21,"tag":322,"props":1444,"children":1445},{"class":324,"line":436},[1446],{"type":21,"tag":322,"props":1447,"children":1448},{"style":339},[1449],{"type":26,"value":1450},"         [_player play];\n",{"type":21,"tag":322,"props":1452,"children":1453},{"class":324,"line":445},[1454],{"type":21,"tag":322,"props":1455,"children":1456},{"style":339},[1457],{"type":26,"value":950},{"type":21,"tag":322,"props":1459,"children":1460},{"class":324,"line":530},[1461],{"type":21,"tag":322,"props":1462,"children":1463},{"style":339},[1464],{"type":26,"value":1080},{"type":21,"tag":322,"props":1466,"children":1467},{"class":324,"line":567},[1468],{"type":21,"tag":322,"props":1469,"children":1470},{"style":339},[1471],{"type":26,"value":1472},"}\n",{"type":21,"tag":22,"props":1474,"children":1475},{},[1476],{"type":26,"value":1477},"This code is pretty straightforward. If our AVPlayerItem is ready to play, then go ahead and start playing the audio composition that we created above.",{"type":21,"tag":22,"props":1479,"children":1480},{},[1481],{"type":21,"tag":259,"props":1482,"children":1483},{},[1484],{"type":26,"value":1485},"Slider Action",{"type":21,"tag":311,"props":1487,"children":1489},{"className":313,"code":1488,"language":315,"meta":8,"style":8},"// Action for our 4 sliders\n- (IBAction)mix:(id)sender\n{\n   UISlider* slider = (UISlider*)sender;\n\n   [self setVolume:slider.value\n          forTrack:[NSString stringWithFormat:@\"track%d\", slider.tag]];\n   [self applyAudioMix];\n}\n",[1490],{"type":21,"tag":318,"props":1491,"children":1492},{"__ignoreMap":8},[1493,1501,1522,1529,1564,1571,1601,1636,1652],{"type":21,"tag":322,"props":1494,"children":1495},{"class":324,"line":325},[1496],{"type":21,"tag":322,"props":1497,"children":1498},{"style":329},[1499],{"type":26,"value":1500},"// Action for our 4 sliders\n",{"type":21,"tag":322,"props":1502,"children":1503},{"class":324,"line":335},[1504,1508,1513,1517],{"type":21,"tag":322,"props":1505,"children":1506},{"style":345},[1507],{"type":26,"value":1299},{"type":21,"tag":322,"props":1509,"children":1510},{"style":339},[1511],{"type":26,"value":1512}," (IBAction)mix",{"type":21,"tag":322,"props":1514,"children":1515},{"style":345},[1516],{"type":26,"value":385},{"type":21,"tag":322,"props":1518,"children":1519},{"style":339},[1520],{"type":26,"value":1521},"(id)sender\n",{"type":21,"tag":322,"props":1523,"children":1524},{"class":324,"line":188},[1525],{"type":21,"tag":322,"props":1526,"children":1527},{"style":339},[1528],{"type":26,"value":1375},{"type":21,"tag":322,"props":1530,"children":1531},{"class":324,"line":365},[1532,1537,1541,1546,1550,1555,1559],{"type":21,"tag":322,"props":1533,"children":1534},{"style":339},[1535],{"type":26,"value":1536},"   UISlider",{"type":21,"tag":322,"props":1538,"children":1539},{"style":345},[1540],{"type":26,"value":456},{"type":21,"tag":322,"props":1542,"children":1543},{"style":339},[1544],{"type":26,"value":1545}," slider ",{"type":21,"tag":322,"props":1547,"children":1548},{"style":345},[1549],{"type":26,"value":348},{"type":21,"tag":322,"props":1551,"children":1552},{"style":339},[1553],{"type":26,"value":1554}," (UISlider",{"type":21,"tag":322,"props":1556,"children":1557},{"style":345},[1558],{"type":26,"value":456},{"type":21,"tag":322,"props":1560,"children":1561},{"style":339},[1562],{"type":26,"value":1563},")sender;\n",{"type":21,"tag":322,"props":1565,"children":1566},{"class":324,"line":399},[1567],{"type":21,"tag":322,"props":1568,"children":1569},{"emptyLinePlaceholder":359},[1570],{"type":26,"value":362},{"type":21,"tag":322,"props":1572,"children":1573},{"class":324,"line":428},[1574,1579,1583,1587,1591,1596],{"type":21,"tag":322,"props":1575,"children":1576},{"style":339},[1577],{"type":26,"value":1578},"   [",{"type":21,"tag":322,"props":1580,"children":1581},{"style":388},[1582],{"type":26,"value":1043},{"type":21,"tag":322,"props":1584,"children":1585},{"style":339},[1586],{"type":26,"value":1048},{"type":21,"tag":322,"props":1588,"children":1589},{"style":345},[1590],{"type":26,"value":385},{"type":21,"tag":322,"props":1592,"children":1593},{"style":339},[1594],{"type":26,"value":1595},"slider.",{"type":21,"tag":322,"props":1597,"children":1598},{"style":388},[1599],{"type":26,"value":1600},"value\n",{"type":21,"tag":322,"props":1602,"children":1603},{"class":324,"line":436},[1604,1609,1613,1618,1622,1626,1631],{"type":21,"tag":322,"props":1605,"children":1606},{"style":339},[1607],{"type":26,"value":1608},"          forTrack",{"type":21,"tag":322,"props":1610,"children":1611},{"style":345},[1612],{"type":26,"value":385},{"type":21,"tag":322,"props":1614,"children":1615},{"style":339},[1616],{"type":26,"value":1617},"[NSString stringWithFormat",{"type":21,"tag":322,"props":1619,"children":1620},{"style":345},[1621],{"type":26,"value":385},{"type":21,"tag":322,"props":1623,"children":1624},{"style":339},[1625],{"type":26,"value":479},{"type":21,"tag":322,"props":1627,"children":1628},{"style":482},[1629],{"type":26,"value":1630},"\"track%d\"",{"type":21,"tag":322,"props":1632,"children":1633},{"style":339},[1634],{"type":26,"value":1635},", slider.tag]];\n",{"type":21,"tag":322,"props":1637,"children":1638},{"class":324,"line":445},[1639,1643,1647],{"type":21,"tag":322,"props":1640,"children":1641},{"style":339},[1642],{"type":26,"value":1578},{"type":21,"tag":322,"props":1644,"children":1645},{"style":388},[1646],{"type":26,"value":1043},{"type":21,"tag":322,"props":1648,"children":1649},{"style":339},[1650],{"type":26,"value":1651}," applyAudioMix];\n",{"type":21,"tag":322,"props":1653,"children":1654},{"class":324,"line":530},[1655],{"type":21,"tag":322,"props":1656,"children":1657},{"style":339},[1658],{"type":26,"value":1472},{"type":21,"tag":22,"props":1660,"children":1661},{},[1662],{"type":26,"value":1663},"Our UI has four UISliders, each of which call this action method. The sliders are tagged from 1 to 4 and we use the tag to map to the corresponding audio track. The value of the slider is configured to be between 0.0 and 1.0 so we use it to set the track volume and then apply the updated audio mix to the composition.",{"type":21,"tag":22,"props":1665,"children":1666},{},[1667],{"type":21,"tag":259,"props":1668,"children":1669},{},[1670],{"type":26,"value":1671},"Setting the Volume",{"type":21,"tag":311,"props":1673,"children":1675},{"className":313,"code":1674,"language":315,"meta":8,"style":8},"// Set the volumne (0.0 - 1.0) for the given track\n- (void)setVolume:(float)volume forTrack:(NSString*)audioTrackName\n{\n   [_audioMixValues setValue:[NSNumber numberWithFloat:volume] forKey:audioTrackName];\n}\n",[1676],{"type":21,"tag":318,"props":1677,"children":1678},{"__ignoreMap":8},[1679,1687,1726,1733,1768],{"type":21,"tag":322,"props":1680,"children":1681},{"class":324,"line":325},[1682],{"type":21,"tag":322,"props":1683,"children":1684},{"style":329},[1685],{"type":26,"value":1686},"// Set the volumne (0.0 - 1.0) for the given track\n",{"type":21,"tag":322,"props":1688,"children":1689},{"class":324,"line":335},[1690,1694,1699,1703,1708,1712,1717,1721],{"type":21,"tag":322,"props":1691,"children":1692},{"style":345},[1693],{"type":26,"value":1299},{"type":21,"tag":322,"props":1695,"children":1696},{"style":339},[1697],{"type":26,"value":1698}," (void)setVolume",{"type":21,"tag":322,"props":1700,"children":1701},{"style":345},[1702],{"type":26,"value":385},{"type":21,"tag":322,"props":1704,"children":1705},{"style":339},[1706],{"type":26,"value":1707},"(float)volume forTrack",{"type":21,"tag":322,"props":1709,"children":1710},{"style":345},[1711],{"type":26,"value":385},{"type":21,"tag":322,"props":1713,"children":1714},{"style":339},[1715],{"type":26,"value":1716},"(NSString",{"type":21,"tag":322,"props":1718,"children":1719},{"style":345},[1720],{"type":26,"value":456},{"type":21,"tag":322,"props":1722,"children":1723},{"style":339},[1724],{"type":26,"value":1725},")audioTrackName\n",{"type":21,"tag":322,"props":1727,"children":1728},{"class":324,"line":188},[1729],{"type":21,"tag":322,"props":1730,"children":1731},{"style":339},[1732],{"type":26,"value":1375},{"type":21,"tag":322,"props":1734,"children":1735},{"class":324,"line":365},[1736,1741,1745,1750,1754,1759,1763],{"type":21,"tag":322,"props":1737,"children":1738},{"style":339},[1739],{"type":26,"value":1740},"   [_audioMixValues setValue",{"type":21,"tag":322,"props":1742,"children":1743},{"style":345},[1744],{"type":26,"value":385},{"type":21,"tag":322,"props":1746,"children":1747},{"style":339},[1748],{"type":26,"value":1749},"[NSNumber numberWithFloat",{"type":21,"tag":322,"props":1751,"children":1752},{"style":345},[1753],{"type":26,"value":385},{"type":21,"tag":322,"props":1755,"children":1756},{"style":339},[1757],{"type":26,"value":1758},"volume] forKey",{"type":21,"tag":322,"props":1760,"children":1761},{"style":345},[1762],{"type":26,"value":385},{"type":21,"tag":322,"props":1764,"children":1765},{"style":339},[1766],{"type":26,"value":1767},"audioTrackName];\n",{"type":21,"tag":322,"props":1769,"children":1770},{"class":324,"line":399},[1771],{"type":21,"tag":322,"props":1772,"children":1773},{"style":339},[1774],{"type":26,"value":1472},{"type":21,"tag":22,"props":1776,"children":1777},{},[1778],{"type":26,"value":1779},"When we set the volume we simply update the value in our NSMutableDictionary that stores the volume level for each track.",{"type":21,"tag":22,"props":1781,"children":1782},{},[1783],{"type":21,"tag":259,"props":1784,"children":1785},{},[1786],{"type":26,"value":1787},"Applying the Mix",{"type":21,"tag":311,"props":1789,"children":1791},{"className":313,"code":1790,"language":315,"meta":8,"style":8},"// Build and apply an audio mix using our volume values\n- (void)applyAudioMix\n{\n   AVMutableAudioMix* mix = [AVMutableAudioMix audioMix];\n\n   NSMutableArray* inputParameters = [[NSMutableArray alloc] initWithCapacity:0];\n\n   [_audioMixTrackIDs enumerateKeysAndObjectsUsingBlock:^(id key, id obj, BOOL*stop) {\n      AVAssetTrack* track = [self trackWithId:(CMPersistentTrackID)[(NSNumber*)obj integerValue]];\n\n      AVMutableAudioMixInputParameters* params = [AVMutableAudioMixInputParameters audioMixInputParametersWithTrack:track];\n\n      [params setVolume:[[_audioMixValues valueForKey:key] floatValue]\n                 atTime:kCMTimeZero];\n\n      [inputParameters addObject:params];\n   }];\n\n   mix.inputParameters = inputParameters;\n\n   _player.currentItem.audioMix = mix;\n}\n",[1792],{"type":21,"tag":318,"props":1793,"children":1794},{"__ignoreMap":8},[1795,1803,1815,1822,1848,1855,1893,1900,1927,1980,1987,2022,2029,2055,2072,2079,2096,2104,2111,2128,2135,2152],{"type":21,"tag":322,"props":1796,"children":1797},{"class":324,"line":325},[1798],{"type":21,"tag":322,"props":1799,"children":1800},{"style":329},[1801],{"type":26,"value":1802},"// Build and apply an audio mix using our volume values\n",{"type":21,"tag":322,"props":1804,"children":1805},{"class":324,"line":335},[1806,1810],{"type":21,"tag":322,"props":1807,"children":1808},{"style":345},[1809],{"type":26,"value":1299},{"type":21,"tag":322,"props":1811,"children":1812},{"style":339},[1813],{"type":26,"value":1814}," (void)applyAudioMix\n",{"type":21,"tag":322,"props":1816,"children":1817},{"class":324,"line":188},[1818],{"type":21,"tag":322,"props":1819,"children":1820},{"style":339},[1821],{"type":26,"value":1375},{"type":21,"tag":322,"props":1823,"children":1824},{"class":324,"line":365},[1825,1830,1834,1839,1843],{"type":21,"tag":322,"props":1826,"children":1827},{"style":339},[1828],{"type":26,"value":1829},"   AVMutableAudioMix",{"type":21,"tag":322,"props":1831,"children":1832},{"style":345},[1833],{"type":26,"value":456},{"type":21,"tag":322,"props":1835,"children":1836},{"style":339},[1837],{"type":26,"value":1838}," mix ",{"type":21,"tag":322,"props":1840,"children":1841},{"style":345},[1842],{"type":26,"value":348},{"type":21,"tag":322,"props":1844,"children":1845},{"style":339},[1846],{"type":26,"value":1847}," [AVMutableAudioMix audioMix];\n",{"type":21,"tag":322,"props":1849,"children":1850},{"class":324,"line":399},[1851],{"type":21,"tag":322,"props":1852,"children":1853},{"emptyLinePlaceholder":359},[1854],{"type":26,"value":362},{"type":21,"tag":322,"props":1856,"children":1857},{"class":324,"line":428},[1858,1863,1867,1872,1876,1881,1885,1889],{"type":21,"tag":322,"props":1859,"children":1860},{"style":339},[1861],{"type":26,"value":1862},"   NSMutableArray",{"type":21,"tag":322,"props":1864,"children":1865},{"style":345},[1866],{"type":26,"value":456},{"type":21,"tag":322,"props":1868,"children":1869},{"style":339},[1870],{"type":26,"value":1871}," inputParameters ",{"type":21,"tag":322,"props":1873,"children":1874},{"style":345},[1875],{"type":26,"value":348},{"type":21,"tag":322,"props":1877,"children":1878},{"style":339},[1879],{"type":26,"value":1880}," [[NSMutableArray alloc] initWithCapacity",{"type":21,"tag":322,"props":1882,"children":1883},{"style":345},[1884],{"type":26,"value":385},{"type":21,"tag":322,"props":1886,"children":1887},{"style":388},[1888],{"type":26,"value":391},{"type":21,"tag":322,"props":1890,"children":1891},{"style":339},[1892],{"type":26,"value":396},{"type":21,"tag":322,"props":1894,"children":1895},{"class":324,"line":436},[1896],{"type":21,"tag":322,"props":1897,"children":1898},{"emptyLinePlaceholder":359},[1899],{"type":26,"value":362},{"type":21,"tag":322,"props":1901,"children":1902},{"class":324,"line":445},[1903,1908,1913,1918,1922],{"type":21,"tag":322,"props":1904,"children":1905},{"style":339},[1906],{"type":26,"value":1907},"   [_audioMixTrackIDs enumerateKeysAndObjectsUsingBlock",{"type":21,"tag":322,"props":1909,"children":1910},{"style":345},[1911],{"type":26,"value":1912},":^",{"type":21,"tag":322,"props":1914,"children":1915},{"style":339},[1916],{"type":26,"value":1917},"(id key, id obj, BOOL",{"type":21,"tag":322,"props":1919,"children":1920},{"style":345},[1921],{"type":26,"value":456},{"type":21,"tag":322,"props":1923,"children":1924},{"style":339},[1925],{"type":26,"value":1926},"stop) {\n",{"type":21,"tag":322,"props":1928,"children":1929},{"class":324,"line":530},[1930,1935,1939,1944,1948,1953,1957,1962,1966,1971,1975],{"type":21,"tag":322,"props":1931,"children":1932},{"style":339},[1933],{"type":26,"value":1934},"      AVAssetTrack",{"type":21,"tag":322,"props":1936,"children":1937},{"style":345},[1938],{"type":26,"value":456},{"type":21,"tag":322,"props":1940,"children":1941},{"style":339},[1942],{"type":26,"value":1943}," track ",{"type":21,"tag":322,"props":1945,"children":1946},{"style":345},[1947],{"type":26,"value":348},{"type":21,"tag":322,"props":1949,"children":1950},{"style":339},[1951],{"type":26,"value":1952}," [",{"type":21,"tag":322,"props":1954,"children":1955},{"style":388},[1956],{"type":26,"value":1043},{"type":21,"tag":322,"props":1958,"children":1959},{"style":339},[1960],{"type":26,"value":1961}," trackWithId",{"type":21,"tag":322,"props":1963,"children":1964},{"style":345},[1965],{"type":26,"value":385},{"type":21,"tag":322,"props":1967,"children":1968},{"style":339},[1969],{"type":26,"value":1970},"(CMPersistentTrackID)[(NSNumber",{"type":21,"tag":322,"props":1972,"children":1973},{"style":345},[1974],{"type":26,"value":456},{"type":21,"tag":322,"props":1976,"children":1977},{"style":339},[1978],{"type":26,"value":1979},")obj integerValue]];\n",{"type":21,"tag":322,"props":1981,"children":1982},{"class":324,"line":567},[1983],{"type":21,"tag":322,"props":1984,"children":1985},{"emptyLinePlaceholder":359},[1986],{"type":26,"value":362},{"type":21,"tag":322,"props":1988,"children":1989},{"class":324,"line":575},[1990,1995,1999,2004,2008,2013,2017],{"type":21,"tag":322,"props":1991,"children":1992},{"style":339},[1993],{"type":26,"value":1994},"      AVMutableAudioMixInputParameters",{"type":21,"tag":322,"props":1996,"children":1997},{"style":345},[1998],{"type":26,"value":456},{"type":21,"tag":322,"props":2000,"children":2001},{"style":339},[2002],{"type":26,"value":2003}," params ",{"type":21,"tag":322,"props":2005,"children":2006},{"style":345},[2007],{"type":26,"value":348},{"type":21,"tag":322,"props":2009,"children":2010},{"style":339},[2011],{"type":26,"value":2012}," [AVMutableAudioMixInputParameters audioMixInputParametersWithTrack",{"type":21,"tag":322,"props":2014,"children":2015},{"style":345},[2016],{"type":26,"value":385},{"type":21,"tag":322,"props":2018,"children":2019},{"style":339},[2020],{"type":26,"value":2021},"track];\n",{"type":21,"tag":322,"props":2023,"children":2024},{"class":324,"line":608},[2025],{"type":21,"tag":322,"props":2026,"children":2027},{"emptyLinePlaceholder":359},[2028],{"type":26,"value":362},{"type":21,"tag":322,"props":2030,"children":2031},{"class":324,"line":617},[2032,2037,2041,2046,2050],{"type":21,"tag":322,"props":2033,"children":2034},{"style":339},[2035],{"type":26,"value":2036},"      [params setVolume",{"type":21,"tag":322,"props":2038,"children":2039},{"style":345},[2040],{"type":26,"value":385},{"type":21,"tag":322,"props":2042,"children":2043},{"style":339},[2044],{"type":26,"value":2045},"[[_audioMixValues valueForKey",{"type":21,"tag":322,"props":2047,"children":2048},{"style":345},[2049],{"type":26,"value":385},{"type":21,"tag":322,"props":2051,"children":2052},{"style":339},[2053],{"type":26,"value":2054},"key] floatValue]\n",{"type":21,"tag":322,"props":2056,"children":2057},{"class":324,"line":680},[2058,2063,2067],{"type":21,"tag":322,"props":2059,"children":2060},{"style":339},[2061],{"type":26,"value":2062},"                 atTime",{"type":21,"tag":322,"props":2064,"children":2065},{"style":345},[2066],{"type":26,"value":385},{"type":21,"tag":322,"props":2068,"children":2069},{"style":339},[2070],{"type":26,"value":2071},"kCMTimeZero];\n",{"type":21,"tag":322,"props":2073,"children":2074},{"class":324,"line":701},[2075],{"type":21,"tag":322,"props":2076,"children":2077},{"emptyLinePlaceholder":359},[2078],{"type":26,"value":362},{"type":21,"tag":322,"props":2080,"children":2081},{"class":324,"line":709},[2082,2087,2091],{"type":21,"tag":322,"props":2083,"children":2084},{"style":339},[2085],{"type":26,"value":2086},"      [inputParameters addObject",{"type":21,"tag":322,"props":2088,"children":2089},{"style":345},[2090],{"type":26,"value":385},{"type":21,"tag":322,"props":2092,"children":2093},{"style":339},[2094],{"type":26,"value":2095},"params];\n",{"type":21,"tag":322,"props":2097,"children":2098},{"class":324,"line":745},[2099],{"type":21,"tag":322,"props":2100,"children":2101},{"style":339},[2102],{"type":26,"value":2103},"   }];\n",{"type":21,"tag":322,"props":2105,"children":2106},{"class":324,"line":763},[2107],{"type":21,"tag":322,"props":2108,"children":2109},{"emptyLinePlaceholder":359},[2110],{"type":26,"value":362},{"type":21,"tag":322,"props":2112,"children":2113},{"class":324,"line":771},[2114,2119,2123],{"type":21,"tag":322,"props":2115,"children":2116},{"style":339},[2117],{"type":26,"value":2118},"   mix.inputParameters ",{"type":21,"tag":322,"props":2120,"children":2121},{"style":345},[2122],{"type":26,"value":348},{"type":21,"tag":322,"props":2124,"children":2125},{"style":339},[2126],{"type":26,"value":2127}," inputParameters;\n",{"type":21,"tag":322,"props":2129,"children":2130},{"class":324,"line":789},[2131],{"type":21,"tag":322,"props":2132,"children":2133},{"emptyLinePlaceholder":359},[2134],{"type":26,"value":362},{"type":21,"tag":322,"props":2136,"children":2137},{"class":324,"line":812},[2138,2143,2147],{"type":21,"tag":322,"props":2139,"children":2140},{"style":339},[2141],{"type":26,"value":2142},"   _player.currentItem.audioMix ",{"type":21,"tag":322,"props":2144,"children":2145},{"style":345},[2146],{"type":26,"value":348},{"type":21,"tag":322,"props":2148,"children":2149},{"style":339},[2150],{"type":26,"value":2151}," mix;\n",{"type":21,"tag":322,"props":2153,"children":2154},{"class":324,"line":852},[2155],{"type":21,"tag":322,"props":2156,"children":2157},{"style":339},[2158],{"type":26,"value":1472},{"type":21,"tag":22,"props":2160,"children":2161},{},[2162,2164,2171,2173,2180],{"type":26,"value":2163},"Here's where we update and apply the audio mix to our composition. First we create an instance of the ",{"type":21,"tag":29,"props":2165,"children":2168},{"href":2166,"rel":2167},"https://developer.apple.com/library/ios/#documentation/AVFoundation/Reference/AVMutableAudioMix_Class/Reference/Reference.html",[33],[2169],{"type":26,"value":2170},"AVMutableAudioMix",{"type":26,"value":2172}," class and then for each track create an ",{"type":21,"tag":29,"props":2174,"children":2177},{"href":2175,"rel":2176},"https://developer.apple.com/library/ios/#documentation/AVFoundation/Reference/AVMutableAudioMixInputParameters_Class/Reference/Reference.html",[33],[2178],{"type":26,"value":2179},"AVMutableAudioMixInputParameters",{"type":26,"value":2181}," instance for the track with the track volume as determined by the current slider value that we've stored. We add the AVMutableAudioMixInputParameters to an array and then set the parameters for our AVMutableAudioMix instance. Finally, we set the mix for the current item of our AVPlayer to our newly created mix.",{"type":21,"tag":22,"props":2183,"children":2184},{},[2185],{"type":21,"tag":259,"props":2186,"children":2187},{},[2188],{"type":26,"value":2189},"Closing Thoughts",{"type":21,"tag":22,"props":2191,"children":2192},{},[2193],{"type":26,"value":2194},"In just a few methods we have a simple four track mixer. This would have been much harder to accomplish without AVFoundation since we'd likely need to use the low-level Core Audio APIs.",{"type":21,"tag":22,"props":2196,"children":2197},{},[2198],{"type":26,"value":2199},"It will be interesting to see what updates Apple has planned for AVFoundation in iOS 6.0 and OS X 10.8 and if the related QuickTime APIs in OS X will be deprecated in favor of AVFoundation.",{"type":21,"tag":2201,"props":2202,"children":2203},"style",{},[2204],{"type":26,"value":2205},"html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":8,"searchDepth":188,"depth":188,"links":2207},[],"content:shuey:2012-07:mixer.md","shuey/2012-07/mixer.md","shuey/2012-07/mixer",{"user":197,"name":198},{"_path":2213,"_dir":2214,"_draft":7,"_partial":7,"_locale":8,"title":2215,"description":2216,"publishDate":2217,"tags":2218,"image":2219,"excerpt":2216,"body":2220,"_type":190,"_id":2266,"_source":192,"_file":2267,"_stem":2268,"_extension":195,"author":2269},"/shuey/2012-06/thoughts-ios6","2012-06","A few thoughts on iOS 6","Apple made their session videos from WWDC 2012 available earlier this week in record time. It's nice to see since tickets for this years event sold out in under two hours. Apple has an iOS 6 Preview page touting some of the new features such as Siri's new abilities, tighter integration with Facebook, Photo Stream sharing, and things like iCloud tabs for Safari all of which look great.","2012-06-21",[14,15],"/shuey/2012-06/img/ios6.jpg",{"type":18,"children":2221,"toc":2264},[2222,2245,2250],{"type":21,"tag":22,"props":2223,"children":2224},{},[2225,2227,2234,2236,2243],{"type":26,"value":2226},"Apple made their ",{"type":21,"tag":29,"props":2228,"children":2231},{"href":2229,"rel":2230},"https://developer.apple.com/videos/wwdc/2012/",[33],[2232],{"type":26,"value":2233},"session videos from WWDC 2012 available",{"type":26,"value":2235}," earlier this week in record time. It's nice to see since tickets for this years event sold out in under two hours. Apple has an ",{"type":21,"tag":29,"props":2237,"children":2240},{"href":2238,"rel":2239},"http://www.apple.com/ios/ios6/",[33],[2241],{"type":26,"value":2242},"iOS 6 Preview",{"type":26,"value":2244}," page touting some of the new features such as Siri's new abilities, tighter integration with Facebook, Photo Stream sharing, and things like iCloud tabs for Safari all of which look great.",{"type":21,"tag":22,"props":2246,"children":2247},{},[2248],{"type":26,"value":2249},"What stands out most about iOS 6 to me are the changes Apple has made to the OS to compete in the mobile arena. The all new Maps app that uses their own data instead of Google's, the Safari search field now reads \"Search\" instead of \"Google\", the OS level integration with Facebook (to go along with Twitter), features catering to the expanding Chinese market, and increased use of iCloud.",{"type":21,"tag":22,"props":2251,"children":2252},{},[2253,2255,2262],{"type":26,"value":2254},"Apple took some shots at Android and Samsung during the keynote but looks to take an even larger one when iOS 6 is released this fall, likely alongside the release of the next iPhone. If the adoption rates for iOS 6 are similar to iOS 5 (which are huge compared to ",{"type":21,"tag":29,"props":2256,"children":2259},{"href":2257,"rel":2258},"http://www.android.com",[33],[2260],{"type":26,"value":2261},"Android's 4.0 Ice Cream Sandwich",{"type":26,"value":2263}," release) and if the next iPhone sells anything close to how the 4S is, it will be interesting to see how market shares and revenues turn out late this year for the two companies.",{"title":8,"searchDepth":188,"depth":188,"links":2265},[],"content:shuey:2012-06:thoughts-ios6.md","shuey/2012-06/thoughts-ios6.md","shuey/2012-06/thoughts-ios6",{"user":197,"name":198},{"_path":2271,"_dir":2272,"_draft":7,"_partial":7,"_locale":8,"title":2273,"description":2274,"publishDate":2275,"tags":2276,"image":2278,"excerpt":2274,"body":2279,"_type":190,"_id":2320,"_source":192,"_file":2321,"_stem":2322,"_extension":195,"author":2323},"/shuey/2012-05/cloud","2012-05","Under the Sheets with iCloud and Core Data","Drew McCormack is writing a great series (Part 1, Part 2, Part 3) of posts about using iCloud for syncing Core Data managed data. It's harder than Apple lets on and Drew has done a great job of uncovering how this actually works.","2012-05-28",[14,2277],"icloud","/shuey/2012-05/img/icloud.jpg",{"type":18,"children":2280,"toc":2318},[2281],{"type":21,"tag":22,"props":2282,"children":2283},{},[2284,2291,2293,2300,2301,2308,2309,2316],{"type":21,"tag":29,"props":2285,"children":2289},{"href":2286,"rel":2287,"title":2288},"https://twitter.com/#!/drewmccormack",[33],"Drew McCormack",[2290],{"type":26,"value":2288},{"type":26,"value":2292}," is writing a great series (",{"type":21,"tag":29,"props":2294,"children":2297},{"href":2295,"rel":2296},"http://mentalfaculty.tumblr.com/post/23163747823/under-the-sheets-with-icloud-and-core-data-the-basics",[33],[2298],{"type":26,"value":2299},"Part 1",{"type":26,"value":518},{"type":21,"tag":29,"props":2302,"children":2305},{"href":2303,"rel":2304},"http://mentalfaculty.tumblr.com/post/23231176783/under-the-sheets-with-icloud-and-core-data-how-it",[33],[2306],{"type":26,"value":2307},"Part 2",{"type":26,"value":518},{"type":21,"tag":29,"props":2310,"children":2313},{"href":2311,"rel":2312},"http://mentalfaculty.tumblr.com/post/23788055417/under-the-sheets-with-icloud-and-core-data-seeding",[33],[2314],{"type":26,"value":2315},"Part 3",{"type":26,"value":2317},") of posts about using iCloud for syncing Core Data managed data. It's harder than Apple lets on and Drew has done a great job of uncovering how this actually works.",{"title":8,"searchDepth":188,"depth":188,"links":2319},[],"content:shuey:2012-05:cloud.md","shuey/2012-05/cloud.md","shuey/2012-05/cloud",{"user":197,"name":198},{"_path":2325,"_dir":2272,"_draft":7,"_partial":7,"_locale":8,"title":2326,"description":2327,"publishDate":2328,"tags":2329,"excerpt":2327,"body":2330,"_type":190,"_id":2406,"_source":192,"_file":2407,"_stem":2408,"_extension":195,"author":2409},"/shuey/2012-05/economics-android","The Economics of Android","If you haven't already do yourself a favor and head over to asymco.com to catch Horace Deidu's multi-post series on \"The Economics of Android\". Horace and Dan Benjamin discuss the series during this week's Critical Path podcast as well. Horace is a former analyst for Nokia and has been writing Asymco for a few years now. His analysis of the mobile industry and Apple's place within it in particular has been featured in publications such as Bloomberg and Forbes.","2012-05-17",[13],{"type":18,"children":2331,"toc":2404},[2332,2381],{"type":21,"tag":22,"props":2333,"children":2334},{},[2335,2337,2344,2346,2353,2355,2362,2364,2371,2373,2380],{"type":26,"value":2336},"If you haven't already do yourself a favor and head over to ",{"type":21,"tag":29,"props":2338,"children":2341},{"href":2339,"rel":2340},"http://www.asymco.com/",[33],[2342],{"type":26,"value":2343},"asymco.com",{"type":26,"value":2345}," to catch ",{"type":21,"tag":29,"props":2347,"children":2350},{"href":2348,"rel":2349},"https://twitter.com/#!/asymco",[33],[2351],{"type":26,"value":2352},"Horace Deidu's",{"type":26,"value":2354}," multi-post series on \"The Economics of Android\". Horace and Dan Benjamin discuss the series during ",{"type":21,"tag":29,"props":2356,"children":2359},{"href":2357,"rel":2358},"http://5by5.tv/criticalpath/38",[33],[2360],{"type":26,"value":2361},"this week's Critical Path podcast",{"type":26,"value":2363}," as well. Horace is a former analyst for Nokia and has been writing Asymco for a few years now. His analysis of the mobile industry and Apple's place within it in particular has been featured in publications such as ",{"type":21,"tag":29,"props":2365,"children":2368},{"href":2366,"rel":2367},"http://www.bloomberg.com/",[33],[2369],{"type":26,"value":2370},"Bloomberg",{"type":26,"value":2372}," and ",{"type":21,"tag":29,"props":2374,"children":2377},{"href":2375,"rel":2376},"http://www.forbes.com/",[33],[2378],{"type":26,"value":2379},"Forbes",{"type":26,"value":89},{"type":21,"tag":22,"props":2382,"children":2383},{},[2384,2386,2393,2395,2402],{"type":26,"value":2385},"I look forward to seeing how these numbers change as Apple is rumored to be ",{"type":21,"tag":29,"props":2387,"children":2390},{"href":2388,"rel":2389},"http://9to5mac.com/2012/05/11/ios-6-apple-drops-google-maps-debuts-in-house-maps-with-incredible-3d-mode/",[33],[2391],{"type":26,"value":2392},"dropping some Google services from iOS 6",{"type":26,"value":2394}," and as Google's competitors in search ",{"type":21,"tag":29,"props":2396,"children":2399},{"href":2397,"rel":2398},"http://www.theverge.com/2012/5/15/3022995/baidu-cloud-phone-launch-changhong-h5018",[33],[2400],{"type":26,"value":2401},"take advantage of the open-source Android OS",{"type":26,"value":2403}," for their own benefit.",{"title":8,"searchDepth":188,"depth":188,"links":2405},[],"content:shuey:2012-05:economics-android.md","shuey/2012-05/economics-android.md","shuey/2012-05/economics-android",{"user":197,"name":198},{"_path":2411,"_dir":2272,"_draft":7,"_partial":7,"_locale":8,"title":2412,"description":2413,"publishDate":2414,"tags":2415,"image":2417,"excerpt":2413,"body":2418,"_type":190,"_id":2548,"_source":192,"_file":2549,"_stem":2550,"_extension":195,"author":2551},"/shuey/2012-05/rubymotion","RubyMotion Brings Ruby to iOS","RubyMotion is a new development toolchain that allows you to build iOS apps using Ruby created by Laurent Sansonetti, a former Apple engineer and contributor to the MacRuby project. It has garnered a lot of attention the past few weeks and some detailed reviews have already been written:","2012-05-14",[15,2416],"ruby","/shuey/2012-05/img/logotype-icon.png",{"type":18,"children":2419,"toc":2546},[2420,2460,2510,2523],{"type":21,"tag":22,"props":2421,"children":2422},{},[2423,2431,2433,2440,2442,2449,2451,2458],{"type":21,"tag":29,"props":2424,"children":2428},{"href":2425,"rel":2426,"title":2427},"http://www.rubymotion.com/",[33],"RubyMotion - Ruby for iOS",[2429],{"type":26,"value":2430},"RubyMotion",{"type":26,"value":2432}," is a new development toolchain that allows you to build iOS apps using ",{"type":21,"tag":29,"props":2434,"children":2437},{"href":2435,"rel":2436},"http://www.ruby-lang.org/en/",[33],[2438],{"type":26,"value":2439},"Ruby",{"type":26,"value":2441}," created by ",{"type":21,"tag":29,"props":2443,"children":2446},{"href":2444,"rel":2445},"https://twitter.com/#!/lrz",[33],[2447],{"type":26,"value":2448},"Laurent Sansonetti",{"type":26,"value":2450},", a former Apple engineer and contributor to the ",{"type":21,"tag":29,"props":2452,"children":2455},{"href":2453,"rel":2454},"http://www.macruby.org/",[33],[2456],{"type":26,"value":2457},"MacRuby",{"type":26,"value":2459}," project. It has garnered a lot of attention the past few weeks and some detailed reviews have already been written:",{"type":21,"tag":2461,"props":2462,"children":2463},"ul",{},[2464,2477,2498],{"type":21,"tag":2465,"props":2466,"children":2467},"li",{},[2468,2475],{"type":21,"tag":29,"props":2469,"children":2472},{"href":2470,"rel":2471},"http://arstechnica.com/business/2012/05/exclusive-building-ruby-ios-applications-with-rubymotion/",[33],[2473],{"type":26,"value":2474},"Exclusive: building native iOS apps with RubyMotion",{"type":26,"value":2476}," (ArsTechnica)",{"type":21,"tag":2465,"props":2478,"children":2479},{},[2480,2487,2489,2496],{"type":21,"tag":29,"props":2481,"children":2484},{"href":2482,"rel":2483},"http://merbist.com/2012/05/04/macruby-on-ios-rubymotion-review/",[33],[2485],{"type":26,"value":2486},"RubyMotion - Ruby for iOS review",{"type":26,"value":2488}," (Matt Aimonetti, author of ",{"type":21,"tag":29,"props":2490,"children":2493},{"href":2491,"rel":2492},"http://shop.oreilly.com/product/0636920000723.do",[33],[2494],{"type":26,"value":2495},"MacRuby - The Definitive Guide",{"type":26,"value":2497},")",{"type":21,"tag":2465,"props":2499,"children":2500},{},[2501,2508],{"type":21,"tag":29,"props":2502,"children":2505},{"href":2503,"rel":2504},"http://pragmaticstudio.com/screencasts/rubymotion",[33],[2506],{"type":26,"value":2507},"RubyMotion screencast",{"type":26,"value":2509}," (The Pragmatic Studio)",{"type":21,"tag":22,"props":2511,"children":2512},{},[2513,2515,2521],{"type":26,"value":2514},"The MacRuby project (which is an open-source project supported by Apple) allows developers to create Mac OS X apps using ruby, however it doesn't work with iOS. MacRuby relies on the Garbage Collected (GC) Objective-C runtime that isn't available on iOS. With the introduction of ",{"type":21,"tag":29,"props":2516,"children":2519},{"href":2517,"rel":2518},"http://clang.llvm.org/docs/AutomaticReferenceCounting.html",[33],[2520],{"type":26,"value":252},{"type":26,"value":2522}," for iOS and Mac OS X Apple will likely drop support for the garbage collected (GC) runtime in a future version of Mac OS X and won't bother to bring it to iOS. This move by Apple called into question the future of MacRuby for OS X and made the prospect of developing iOS apps using ruby look even more remote.",{"type":21,"tag":22,"props":2524,"children":2525},{},[2526,2528,2535,2537,2544],{"type":26,"value":2527},"Enter RubyMotion. It ",{"type":21,"tag":29,"props":2529,"children":2532},{"href":2530,"rel":2531},"http://www.rubymotion.com/features/",[33],[2533],{"type":26,"value":2534},"takes a different approach",{"type":26,"value":2536}," than MacRuby and based on early results looks to be a good solution for rubyists looking to build iOS apps. However, the lack of support for creating UI elements in Interface Builder, dependence on Apple's developer tools and SDKs, and other risks are being ",{"type":21,"tag":29,"props":2538,"children":2541},{"href":2539,"rel":2540},"http://www.upbeat.it/2012/05/08/on-why-i-am-not-buying-rubymotion/",[33],[2542],{"type":26,"value":2543},"called into question already as well",{"type":26,"value":2545},". It will be interesting to see Apple's reaction to RubyMotion, especially considering that Sansonetti is a former employee and MacRuby contributor. I've bought my copy and am hoping the project succeeds and finds its way back to OS X too.",{"title":8,"searchDepth":188,"depth":188,"links":2547},[],"content:shuey:2012-05:rubymotion.md","shuey/2012-05/rubymotion.md","shuey/2012-05/rubymotion",{"user":197,"name":198},{"_path":2553,"_dir":2272,"_draft":7,"_partial":7,"_locale":8,"title":2554,"description":2555,"publishDate":2556,"image":2557,"tags":2558,"excerpt":2555,"body":2560,"_type":190,"_id":2642,"_source":192,"_file":2643,"_stem":2644,"_extension":195,"author":2645},"/shuey/2012-05/baas","BaaS Offerings Continue to Grow","The makers of Simplenote recently introduced their Backend as a Service (BaaS) offering called Simperium that looks to compete in an increasingly crowded space with services like CloudMine, Kinvey, and Parse and to some extent with iCloud for iOS and OS X only apps. So just how crowded is this space? Back in February, Kinvey published their own map of the BaaS ecosystem that highlights different tiers of the ecosystem and various relationships between them.","2012-05-10","/shuey/2012-05/img/header.png",[2559],"baas",{"type":18,"children":2561,"toc":2640},[2562,2630,2635],{"type":21,"tag":22,"props":2563,"children":2564},{},[2565,2567,2574,2576,2583,2585,2592,2594,2601,2603,2610,2612,2619,2621,2628],{"type":26,"value":2566},"The makers of ",{"type":21,"tag":29,"props":2568,"children":2571},{"href":2569,"rel":2570},"http://www.simplenoteapp.com/",[33],[2572],{"type":26,"value":2573},"Simplenote",{"type":26,"value":2575}," recently introduced their Backend as a Service (BaaS) offering called ",{"type":21,"tag":29,"props":2577,"children":2581},{"href":2578,"rel":2579,"title":2580},"https://simperium.com/",[33],"Simperium",[2582],{"type":26,"value":2580},{"type":26,"value":2584}," that looks to compete in an increasingly crowded space with services like ",{"type":21,"tag":29,"props":2586,"children":2590},{"href":2587,"rel":2588,"title":2589},"https://cloudmine.me/",[33],"CloudMine",[2591],{"type":26,"value":2589},{"type":26,"value":2593},", ",{"type":21,"tag":29,"props":2595,"children":2599},{"href":2596,"rel":2597,"title":2598},"http://www.kinvey.com/",[33],"Kinvey",[2600],{"type":26,"value":2598},{"type":26,"value":2602},", and ",{"type":21,"tag":29,"props":2604,"children":2608},{"href":2605,"rel":2606,"title":2607},"https://www.parse.com/",[33],"Parse",[2609],{"type":26,"value":2607},{"type":26,"value":2611}," and to some extent with ",{"type":21,"tag":29,"props":2613,"children":2617},{"href":2614,"rel":2615,"title":2616},"https://www.icloud.com/",[33],"iCloud",[2618],{"type":26,"value":2616},{"type":26,"value":2620}," for iOS and OS X only apps. So just how crowded is this space? Back in February, Kinvey published their own ",{"type":21,"tag":29,"props":2622,"children":2625},{"href":2623,"rel":2624},"https://artandlogic.com/wp-content/uploads/2012/05/kinvey_backend-as-a-service_mobileecosystem_feb-9-2012.png",[33],[2626],{"type":26,"value":2627},"map of the BaaS ecosystem",{"type":26,"value":2629}," that highlights different tiers of the ecosystem and various relationships between them.",{"type":21,"tag":22,"props":2631,"children":2632},{},[2633],{"type":26,"value":2634},"It will be interesting to see how this ecosystem develops through additional partnerships, acquisitions, rounds of funding, and killer apps that take advantage of a specific service. Another aspect to watch will be the pricing models. Simperium and Kinvey are free either at the moment or while in beta with CloudMine and Parse both taking a 3 tiered usage based pricing model.",{"type":21,"tag":22,"props":2636,"children":2637},{},[2638],{"type":26,"value":2639},"BaaS offerings look to lower the barrier of entry for start ups and indie developers looking to build a multi-platform app or app with server side needs. With consumers using more mobile apps and devices these services should deliver an even better and more consistent experience and less frustration keeping their data synced between desktop, web, and mobile apps.",{"title":8,"searchDepth":188,"depth":188,"links":2641},[],"content:shuey:2012-05:baas.md","shuey/2012-05/baas.md","shuey/2012-05/baas",{"user":197,"name":198},{"_path":2647,"_dir":2272,"_draft":7,"_partial":7,"_locale":8,"title":2648,"description":2649,"publishDate":2650,"tags":2651,"excerpt":2649,"body":2654,"_type":190,"_id":2798,"_source":192,"_file":2799,"_stem":2800,"_extension":195,"author":2801},"/shuey/2012-05/iot","The Internet of Things and Big Data","I've been following the developments in the \"Internet of Things\" and Big Data / Open Data markets as new apps and tools are released and they look to be two exciting technologies on a collision course. With the advent of internet connected home appliances like Wattvision and Nest that provide real utility to the average home owner at reasonable prices along with crowd funded projects like Air Quality Egg or Twine we should see an explosion in the kinds and amount of useful and real-time or near real-time data that is available to anyone with a smartphone. Health metric or \"quantitative self\" tracking devices such as Fitbit, Jawbone Up, and the Pebble watch will fuel this data explosion as well.","2012-05-07",[2652,2653],"big-data","iot",{"type":18,"children":2655,"toc":2796},[2656,2752,2782],{"type":21,"tag":22,"props":2657,"children":2658},{},[2659,2661,2669,2671,2678,2680,2687,2689,2696,2697,2705,2707,2714,2716,2723,2725,2732,2733,2740,2742,2750],{"type":26,"value":2660},"I've been following the developments in the ",{"type":21,"tag":29,"props":2662,"children":2666},{"href":2663,"rel":2664,"title":2665},"http://en.wikipedia.org/wiki/Internet_of_things",[33],"Internet of Things",[2667],{"type":26,"value":2668},"\"Internet of Things\"",{"type":26,"value":2670}," and ",{"type":21,"tag":29,"props":2672,"children":2676},{"href":2673,"rel":2674,"title":2675},"http://en.wikipedia.org/wiki/Big_data",[33],"Big Data",[2677],{"type":26,"value":2675},{"type":26,"value":2679}," / ",{"type":21,"tag":29,"props":2681,"children":2685},{"href":2682,"rel":2683,"title":2684},"http://en.wikipedia.org/wiki/Open_data",[33],"Open Data",[2686],{"type":26,"value":2684},{"type":26,"value":2688}," markets as new apps and tools are released and they look to be two exciting technologies on a collision course. With the advent of internet connected home appliances like ",{"type":21,"tag":29,"props":2690,"children":2694},{"href":2691,"rel":2692,"title":2693},"http://www.wattvision.com/",[33],"Wattvision",[2695],{"type":26,"value":2693},{"type":26,"value":2372},{"type":21,"tag":29,"props":2698,"children":2702},{"href":2699,"rel":2700,"title":2701},"http://www.nest.com/",[33],"Nest.com",[2703],{"type":26,"value":2704},"Nest",{"type":26,"value":2706}," that provide real utility to the average home owner at reasonable prices along with crowd funded projects like ",{"type":21,"tag":29,"props":2708,"children":2712},{"href":2709,"rel":2710,"title":2711},"http://www.kickstarter.com/projects/edborden/air-quality-egg",[33],"Air Quality Egg",[2713],{"type":26,"value":2711},{"type":26,"value":2715}," or ",{"type":21,"tag":29,"props":2717,"children":2721},{"href":2718,"rel":2719,"title":2720},"http://supermechanical.com/twine/",[33],"Twine",[2722],{"type":26,"value":2720},{"type":26,"value":2724}," we should see an explosion in the kinds and amount of useful and real-time or near real-time data that is available to anyone with a smartphone. Health metric or \"quantitative self\" tracking devices such as ",{"type":21,"tag":29,"props":2726,"children":2730},{"href":2727,"rel":2728,"title":2729},"http://www.fitbit.com/",[33],"Fitbit",[2731],{"type":26,"value":2729},{"type":26,"value":518},{"type":21,"tag":29,"props":2734,"children":2738},{"href":2735,"rel":2736,"title":2737},"http://jawbone.com/up",[33],"Jawbone Up",[2739],{"type":26,"value":2737},{"type":26,"value":2741},", and the ",{"type":21,"tag":29,"props":2743,"children":2747},{"href":2744,"rel":2745,"title":2746},"http://www.kickstarter.com/projects/597507018/pebble-e-paper-watch-for-iphone-and-android",[33],"Pebble Watch",[2748],{"type":26,"value":2749},"Pebble watch",{"type":26,"value":2751}," will fuel this data explosion as well.",{"type":21,"tag":22,"props":2753,"children":2754},{},[2755,2757,2764,2765,2772,2773,2780],{"type":26,"value":2756},"Racing to manage and make sense of this new information are some exciting startups and tools like ",{"type":21,"tag":29,"props":2758,"children":2762},{"href":2759,"rel":2760,"title":2761},"http://buzzdata.com/content/",[33],"BuzzData",[2763],{"type":26,"value":2761},{"type":26,"value":2593},{"type":21,"tag":29,"props":2766,"children":2770},{"href":2767,"rel":2768,"title":2769},"http://www.silkapp.com/",[33],"Silk",[2771],{"type":26,"value":2769},{"type":26,"value":2602},{"type":21,"tag":29,"props":2774,"children":2778},{"href":2775,"rel":2776,"title":2777},"http://www.wolframalpha.com/pro/",[33],"Wolfram Alpha Pro",[2779],{"type":26,"value":2777},{"type":26,"value":2781},". I'd expect to see an increasing number of smartphone and tablet apps developed to help mobile users make sense of and to also generate more data.",{"type":21,"tag":22,"props":2783,"children":2784},{},[2785,2787,2794],{"type":26,"value":2786},"Will these internet connected devices rapidly supplant  our current range of \"dumb\" belongings just as ",{"type":21,"tag":29,"props":2788,"children":2791},{"href":2789,"rel":2790},"http://www.asymco.com/2012/05/03/the-phone-market-in-2012-a-tale-of-two-disruptions/",[33],[2792],{"type":26,"value":2793},"smartphones quickly are dumb feature phones",{"type":26,"value":2795},"? Will the tools to manage it all be able to keep up? Interesting times ahead for sure.",{"title":8,"searchDepth":188,"depth":188,"links":2797},[],"content:shuey:2012-05:iot.md","shuey/2012-05/iot.md","shuey/2012-05/iot",{"user":197,"name":198},1780330272972]