SlideShare uma empresa Scribd logo
1 de 53
Get on the Audiobus
Chris Adamson • @invalidname
CocoaConf Atlanta • November, 2013

Slides & code will be posted to the CocoaConf Glassboard,
and announced on my Twitter & app.net (@invalidname)
Roadmap
• How audio works on iOS
• What Audiobus is and how it connects apps
• Adopting Audiobus in your audio app
Audio on iOS
• Each app is responsible for its own audio
• No access to audio to/from other apps
• Apps use the Audio Session API to interact
with the system

• See also AVAudioSession in AV
Foundation
Audio Session
• Allows inspection of hardware properties

(sampling rate, hardware latencies) and
negotiation of access to system audio resources

• Audio “category” declares what your app does
with audio

• This affects things like whether you mix with
other apps’ audio, honor ring/silent, can play
in background, etc.
Audio Categories
• Ambient
• Solo Ambient
• Playback
• Record
• Play and Record
• Audio Processing
• Multi-Route
Audio Engines
• How your app interacts with audio

hardware, i.e., captures or produces sound

• OpenAL (play-out only)
• Audio Queue
• Audio Units
AURemoteIO
Bus 1: audio in
AURemoteIO

Bus 0: audio out
Mixing between apps

AURemoteIO

AURemoteIO
Mixing between apps

AURemoteIO

!

AURemoteIO
Every App is an Island
• Only awareness of other apps’ audio is
value of

kAudioSessionProperty_OtherAudioIsPlaying

property

• No access to what other apps are playing
audio, how loud it is, etc.
Which means…
• You can’t record audio from one app in
another app

• Production apps can’t specialize; have to
provide everything (instruments, filters/
effects, recording) that you’d ever need
Enter Audiobus
Audiobus
• Standalone app that coordinates inter-app
audio

• Currently on 50% off sale ($4.99)

• Only works with apps that adopt the
Audiobus API

• 300 and counting!
Demo
What Audiobus Is
• Audiobus is an app for users to coordinate
audio across supported apps

• User decides which apps are the inputs,
effects, and outputs
What Audiobus Isn’t
• Audiobus is not a general-purpose systemlevel audio capture (like Audio Hijack on
Mac)

• Audiobus cannot get audio from or send
audio to an arbitrary app

• Apps must adopt the Audiobus SDK and
register with the Audiobus website
How the heck does it
even work?
Considering that inter-app communication
is nearly impossible on iOS…
Secret Sauce!
• Audiobus began with MIDI “System Exclusive” (SysEx)
messages, defined as being arbitrary blobs of data
unique to a given MIDI device

• Originally meant for synths to exchange waveforms,
patches or other software/firmware upgrades, etc.

• MIDI messages available to all interested apps via Core
MIDI

• Later switched to Mach Ports, which Core MIDI is
implemented atop
Audiobus Concepts
• Apps take on roles based on their
relationship to Audiobus

• Inputs produce audio
• Outputs receive audio
• Filters receive from inputs and send to
outputs

• Points of connection are called ports
http://developer.audiob.us/doc/index.html
Basic Audiobus
Integration
• Decide if you’re an input, output, or filter
• Decide if you can work with the Remote
IO unit or Audiobus’ port API

• Adopt the Audiobus SDK to connect to
Audiobus at runtime

• Register at audiob.us
An Audiobus
Integration Case Study
Audiobus Web Radio
• Web Radio app developed as in-class

exercise for Thursday's all-day Core Audio
class

• Uses Audio File Stream to receive packets
of MP3 and play them with Audio Queue

Packets
Packets
2
Packets

Packets
Packets
1

0
Packets
LPCM or GTFO
• Audiobus ports and AURemoteIO only

work with uncompressed LPCM audio

• Web radio app is dealing in MP3 or AAC
• Conversion to LPCM happens inside the
Audio Queue
Offline Queues

Packets
Packets
2
Packets

1
Packets

Packets
0
Packets

AURemoteIO

AudioQueueOfflineRender()
Libraries
• Download the Audiobus SDK from
developer.audiob.us

• Add libAudiobus.a and the Audiobus
headers to your project

• Add Accelerate, AudioToolbox,

QuartzCore, CoreGraphics, and Security
frameworks to your project
Enable background audio
• Add “audio” to the app’s “Required

Background Modes” if it’s not already
present

• All Audiobus-enabled apps must

participate in backgrounding, since they
must be able to keep running when
Audiobus is in foreground
Create a launch URL
scheme
• You must have a URL scheme for your app

that ends in “.audiobus” for Audiobus to be
able to launch you

• Add this to the target’s “URL Types”
Get Audiobus API key
• For apps registered with iTunes Connect,
submit your App Store URL or ID

• For unpublished apps or tinkering, register
for a temporary ID, good for 14 days

• This requires dropping the Info.plist from
your app bundle (not from project!)
Audiobus API Keys
• Audiobus app gets a master list of known
keys from a server every 30 minutes

• For temporary IDs, click the link from the

developer page on the device that you’re using
Audiobus on to register your App ID

• e.g., audiobus-registry://
developer.audiob.us/tempreg?t=0ff37
• The dev page can mail you the link
Set Audiobus-compatible
behaviors
• Audio Session category must be playback
or play-and-record

• Must also set the mix-with-others property
on the audio session

• Often do both these things in the
AppDelegate
UInt32 audioCategory = kAudioSessionCategory_MediaPlayback;
AudioSessionSetProperty(kAudioSessionProperty_AudioCategory,

 
 
 
 
 
 sizeof(audioCategory),



 
 
 
 
 
 &audioCategory);


UInt32 allowMixing = YES;
AudioSessionSetProperty(kAudioSessionProperty_OverrideCategory
MixWithOthers,

 
 
 
 
 
 
 
 sizeof (allowMixing),


 
 
 
 
 
 
 
 &allowMixing);


Note: Audio Session is deprecated in iOS 7
Modern apps can use the AV Foundation equivalents
Setup Your App’s Audio
System
• Your app’s audio infrastructure needs to be up
and running before you connect to Audiobus

• If you’re going to send audio via the

ABAudioBusAudioUnitWrapper, you’ll need
to initialize your AURemoteIO

• For the web radio app, I send an

NSNotification once the player class starts
playing
Instantiate
ABAudiobusController
• ABAudiobusController is your app’s

connection to Audiobus; probably gets held
as a strong property somewhere

• init method takes the launch URL and your
API key

• Obviously, these must match what you
registered on audiob.us
self.audiobusController = [[ABAudiobusController alloc]

 
 
 
 

initWithAppLaunchURL:
[NSURL URLWithString:@"audiobuswebradio.audiobus://"]

 
 
 
 

apiKey:AUDIOBUS_API_KEY];
Create ABOutputPort
(and Audio Unit wrapper)
• ABOutputPort sends audio to Audiobus

(via ABOutputPortSendAudio() function)

• If you use a RemoteIO unit for your output,
the ABAudiobusAudioUnitWrapper will
make these calls for you
CCFViewController *vc =
(CCFViewController*) self.window.rootViewController;

ABOutputPort *output = [self.audiobusController

 
 
 
 
 addOutputPortNamed:@"Audio Output"


 
 
 
 
 title:NSLocalizedString(@"Main App Output", @"")];


self.audiobusAudioUnitWrapper = [[ABAudiobusAudioUnitWrapper alloc]

 
 
 
 
 initWithAudiobusController:self.audiobusController


 
 
 
 
 
 

audioUnit:vc.player.remoteIOUnit

 
 
 
 
 
 

output:output

 
 
 
 
 
 

input:nil];
Demo
Demo
Ports
• Apps that don’t use the Audio Unit

Wrapper use ports directly instead

• ABOutputPortSendAudio() for senders
(inputs and filters)

• Block-based callback or poll with

ABInputPortReceive() for receivers (filters
and outputs)
Filters & Outputs
• If you produce audio output based on input,
you need to tell the ABInputPort, so that
the signal isn’t doubled in Audiobus.
As for iOS 7…
iOS 7 Inter-App Audio
Sherlocked?
Embrace & Extend!
From: michael@audiob.us
Date: June 19, 2013
Subject: Important Information Regarding Audiobus, iOS 7 and Inter-App
Audio 


iOS 7 introduces many new features, including Apple’s own Inter-App
Audio framework which we’re planning to incorporate into Audiobus so you
don’t have to. For details and further discussion, we highly recommend
checking out our thread on the Apple developer forums:

https://devforums.apple.com/thread/191197
Closing Thoughts
• Audiobus is approachable for developers
already working at the Audio Unit level

• Adding Audiobus will get it seen by users

who’ve proven willing to pay for good apps
(we love music app users!)

• Future-proofed for iOS 7
Q&A
Slides & code will be posted to the CocoaConf Glassboard,
and announced on my Twitter & app.net (@invalidname)

Mais conteúdo relacionado

Mais procurados

Capturing Stills, Sounds, and Scenes with AV Foundation
Capturing Stills, Sounds, and Scenes with AV FoundationCapturing Stills, Sounds, and Scenes with AV Foundation
Capturing Stills, Sounds, and Scenes with AV FoundationChris Adamson
 
Building Modern Audio Apps with AVAudioEngine
Building Modern Audio Apps with AVAudioEngineBuilding Modern Audio Apps with AVAudioEngine
Building Modern Audio Apps with AVAudioEngineBob McCune
 
Introduction to AV Foundation
Introduction to AV FoundationIntroduction to AV Foundation
Introduction to AV FoundationChris Adamson
 
Mastering Media with AV Foundation
Mastering Media with AV FoundationMastering Media with AV Foundation
Mastering Media with AV FoundationChris Adamson
 
Stupid Video Tricks, CocoaConf Las Vegas
Stupid Video Tricks, CocoaConf Las VegasStupid Video Tricks, CocoaConf Las Vegas
Stupid Video Tricks, CocoaConf Las VegasChris Adamson
 
Composing and Editing Media with AV Foundation
Composing and Editing Media with AV FoundationComposing and Editing Media with AV Foundation
Composing and Editing Media with AV FoundationBob McCune
 
Core Audio Cranks It Up
Core Audio Cranks It UpCore Audio Cranks It Up
Core Audio Cranks It UpChris Adamson
 
Stupid Video Tricks (CocoaConf DC, March 2014)
Stupid Video Tricks (CocoaConf DC, March 2014)Stupid Video Tricks (CocoaConf DC, March 2014)
Stupid Video Tricks (CocoaConf DC, March 2014)Chris Adamson
 
Master Video with AV Foundation
Master Video with AV FoundationMaster Video with AV Foundation
Master Video with AV FoundationBob McCune
 
AVFoundation @ TACOW 2013 05 14
AVFoundation @ TACOW 2013 05 14AVFoundation @ TACOW 2013 05 14
AVFoundation @ TACOW 2013 05 14Ryder Mackay
 
Core audio
Core audioCore audio
Core audioscussen
 
Managing Eclipse Preferences for Teams (EclipseCon 2011)
Managing Eclipse Preferences for Teams (EclipseCon 2011)Managing Eclipse Preferences for Teams (EclipseCon 2011)
Managing Eclipse Preferences for Teams (EclipseCon 2011)Netcetera
 
Yapi.js, An Adaptive Streaming Web Player
Yapi.js, An Adaptive Streaming Web PlayerYapi.js, An Adaptive Streaming Web Player
Yapi.js, An Adaptive Streaming Web PlayerJesse (Chien Chen) Chen
 
Serverless Media Workflow
Serverless Media WorkflowServerless Media Workflow
Serverless Media WorkflowMooYeol Lee
 
The Next-Gen Dynamic Sound System of Killzone Shadow Fall
The Next-Gen Dynamic Sound System of Killzone Shadow FallThe Next-Gen Dynamic Sound System of Killzone Shadow Fall
The Next-Gen Dynamic Sound System of Killzone Shadow FallGuerrilla
 
Chaione Ember.js Training
Chaione Ember.js TrainingChaione Ember.js Training
Chaione Ember.js Trainingaortbals
 

Mais procurados (20)

Capturing Stills, Sounds, and Scenes with AV Foundation
Capturing Stills, Sounds, and Scenes with AV FoundationCapturing Stills, Sounds, and Scenes with AV Foundation
Capturing Stills, Sounds, and Scenes with AV Foundation
 
Building Modern Audio Apps with AVAudioEngine
Building Modern Audio Apps with AVAudioEngineBuilding Modern Audio Apps with AVAudioEngine
Building Modern Audio Apps with AVAudioEngine
 
Introduction to AV Foundation
Introduction to AV FoundationIntroduction to AV Foundation
Introduction to AV Foundation
 
Mastering Media with AV Foundation
Mastering Media with AV FoundationMastering Media with AV Foundation
Mastering Media with AV Foundation
 
Stupid Video Tricks, CocoaConf Las Vegas
Stupid Video Tricks, CocoaConf Las VegasStupid Video Tricks, CocoaConf Las Vegas
Stupid Video Tricks, CocoaConf Las Vegas
 
Composing and Editing Media with AV Foundation
Composing and Editing Media with AV FoundationComposing and Editing Media with AV Foundation
Composing and Editing Media with AV Foundation
 
Core Audio Cranks It Up
Core Audio Cranks It UpCore Audio Cranks It Up
Core Audio Cranks It Up
 
Stupid Video Tricks (CocoaConf DC, March 2014)
Stupid Video Tricks (CocoaConf DC, March 2014)Stupid Video Tricks (CocoaConf DC, March 2014)
Stupid Video Tricks (CocoaConf DC, March 2014)
 
Master Video with AV Foundation
Master Video with AV FoundationMaster Video with AV Foundation
Master Video with AV Foundation
 
HTML5 Audio & Video
HTML5 Audio & VideoHTML5 Audio & Video
HTML5 Audio & Video
 
Stupid Video Tricks
Stupid Video TricksStupid Video Tricks
Stupid Video Tricks
 
AVFoundation @ TACOW 2013 05 14
AVFoundation @ TACOW 2013 05 14AVFoundation @ TACOW 2013 05 14
AVFoundation @ TACOW 2013 05 14
 
Core audio
Core audioCore audio
Core audio
 
Managing Eclipse Preferences for Teams (EclipseCon 2011)
Managing Eclipse Preferences for Teams (EclipseCon 2011)Managing Eclipse Preferences for Teams (EclipseCon 2011)
Managing Eclipse Preferences for Teams (EclipseCon 2011)
 
Studio track1
Studio track1Studio track1
Studio track1
 
Yapi.js, An Adaptive Streaming Web Player
Yapi.js, An Adaptive Streaming Web PlayerYapi.js, An Adaptive Streaming Web Player
Yapi.js, An Adaptive Streaming Web Player
 
Understanding open max il
Understanding open max ilUnderstanding open max il
Understanding open max il
 
Serverless Media Workflow
Serverless Media WorkflowServerless Media Workflow
Serverless Media Workflow
 
The Next-Gen Dynamic Sound System of Killzone Shadow Fall
The Next-Gen Dynamic Sound System of Killzone Shadow FallThe Next-Gen Dynamic Sound System of Killzone Shadow Fall
The Next-Gen Dynamic Sound System of Killzone Shadow Fall
 
Chaione Ember.js Training
Chaione Ember.js TrainingChaione Ember.js Training
Chaione Ember.js Training
 

Destaque

Firebase: Totally Not Parse All Over Again (Unless It Is) (CocoaConf San Jose...
Firebase: Totally Not Parse All Over Again (Unless It Is) (CocoaConf San Jose...Firebase: Totally Not Parse All Over Again (Unless It Is) (CocoaConf San Jose...
Firebase: Totally Not Parse All Over Again (Unless It Is) (CocoaConf San Jose...Chris Adamson
 
Firebase: Totally Not Parse All Over Again (Unless It Is)
Firebase: Totally Not Parse All Over Again (Unless It Is)Firebase: Totally Not Parse All Over Again (Unless It Is)
Firebase: Totally Not Parse All Over Again (Unless It Is)Chris Adamson
 
Core Image: The Most Fun API You're Not Using (CocoaConf Columbus 2014)
Core Image: The Most Fun API You're Not Using (CocoaConf Columbus 2014)Core Image: The Most Fun API You're Not Using (CocoaConf Columbus 2014)
Core Image: The Most Fun API You're Not Using (CocoaConf Columbus 2014)Chris Adamson
 
Revenge of the 80s: Cut/Copy/Paste, Undo/Redo, and More Big Hits (CocoaConf C...
Revenge of the 80s: Cut/Copy/Paste, Undo/Redo, and More Big Hits (CocoaConf C...Revenge of the 80s: Cut/Copy/Paste, Undo/Redo, and More Big Hits (CocoaConf C...
Revenge of the 80s: Cut/Copy/Paste, Undo/Redo, and More Big Hits (CocoaConf C...Chris Adamson
 
Core Image: The Most Fun API You're Not Using, CocoaConf Atlanta, December 2014
Core Image: The Most Fun API You're Not Using, CocoaConf Atlanta, December 2014Core Image: The Most Fun API You're Not Using, CocoaConf Atlanta, December 2014
Core Image: The Most Fun API You're Not Using, CocoaConf Atlanta, December 2014Chris Adamson
 
Forward Swift 2017: Media Frameworks and Swift: This Is Fine
Forward Swift 2017: Media Frameworks and Swift: This Is FineForward Swift 2017: Media Frameworks and Swift: This Is Fine
Forward Swift 2017: Media Frameworks and Swift: This Is FineChris Adamson
 

Destaque (6)

Firebase: Totally Not Parse All Over Again (Unless It Is) (CocoaConf San Jose...
Firebase: Totally Not Parse All Over Again (Unless It Is) (CocoaConf San Jose...Firebase: Totally Not Parse All Over Again (Unless It Is) (CocoaConf San Jose...
Firebase: Totally Not Parse All Over Again (Unless It Is) (CocoaConf San Jose...
 
Firebase: Totally Not Parse All Over Again (Unless It Is)
Firebase: Totally Not Parse All Over Again (Unless It Is)Firebase: Totally Not Parse All Over Again (Unless It Is)
Firebase: Totally Not Parse All Over Again (Unless It Is)
 
Core Image: The Most Fun API You're Not Using (CocoaConf Columbus 2014)
Core Image: The Most Fun API You're Not Using (CocoaConf Columbus 2014)Core Image: The Most Fun API You're Not Using (CocoaConf Columbus 2014)
Core Image: The Most Fun API You're Not Using (CocoaConf Columbus 2014)
 
Revenge of the 80s: Cut/Copy/Paste, Undo/Redo, and More Big Hits (CocoaConf C...
Revenge of the 80s: Cut/Copy/Paste, Undo/Redo, and More Big Hits (CocoaConf C...Revenge of the 80s: Cut/Copy/Paste, Undo/Redo, and More Big Hits (CocoaConf C...
Revenge of the 80s: Cut/Copy/Paste, Undo/Redo, and More Big Hits (CocoaConf C...
 
Core Image: The Most Fun API You're Not Using, CocoaConf Atlanta, December 2014
Core Image: The Most Fun API You're Not Using, CocoaConf Atlanta, December 2014Core Image: The Most Fun API You're Not Using, CocoaConf Atlanta, December 2014
Core Image: The Most Fun API You're Not Using, CocoaConf Atlanta, December 2014
 
Forward Swift 2017: Media Frameworks and Swift: This Is Fine
Forward Swift 2017: Media Frameworks and Swift: This Is FineForward Swift 2017: Media Frameworks and Swift: This Is Fine
Forward Swift 2017: Media Frameworks and Swift: This Is Fine
 

Semelhante a Get On The Audiobus (CocoaConf Atlanta, November 2013)

Core Audio in iOS 6 (CocoaConf Portland, Oct. '12)
Core Audio in iOS 6 (CocoaConf Portland, Oct. '12)Core Audio in iOS 6 (CocoaConf Portland, Oct. '12)
Core Audio in iOS 6 (CocoaConf Portland, Oct. '12)Chris Adamson
 
Appium overview (Selenium Israel #2, Feb. 2014)
Appium overview (Selenium Israel #2, Feb. 2014)Appium overview (Selenium Israel #2, Feb. 2014)
Appium overview (Selenium Israel #2, Feb. 2014)danielputerman
 
Habitat Workshop at Velocity London 2017
Habitat Workshop at Velocity London 2017Habitat Workshop at Velocity London 2017
Habitat Workshop at Velocity London 2017Mandi Walls
 
Core Audio in iOS 6 (CocoaConf Chicago, March 2013)
Core Audio in iOS 6 (CocoaConf Chicago, March 2013)Core Audio in iOS 6 (CocoaConf Chicago, March 2013)
Core Audio in iOS 6 (CocoaConf Chicago, March 2013)Chris Adamson
 
Android Multimedia Player Project Presentation
Android Multimedia Player Project PresentationAndroid Multimedia Player Project Presentation
Android Multimedia Player Project PresentationRashmi Gupta
 
[2015/2016] Apache Cordova
[2015/2016] Apache Cordova[2015/2016] Apache Cordova
[2015/2016] Apache CordovaIvano Malavolta
 
Appium Overview - by Daniel Puterman
Appium Overview - by Daniel PutermanAppium Overview - by Daniel Puterman
Appium Overview - by Daniel PutermanApplitools
 
WebRTC, RED and Janus @ ClueCon21
WebRTC, RED and Janus @ ClueCon21WebRTC, RED and Janus @ ClueCon21
WebRTC, RED and Janus @ ClueCon21Lorenzo Miniero
 
Android Audio & OpenSL
Android Audio & OpenSLAndroid Audio & OpenSL
Android Audio & OpenSLYoss Cohen
 
Android media framework overview
Android media framework overviewAndroid media framework overview
Android media framework overviewJerrin George
 
A Framework Driven Development
A Framework Driven DevelopmentA Framework Driven Development
A Framework Driven Development정민 안
 
Cordova: APIs and instruments
Cordova: APIs and instrumentsCordova: APIs and instruments
Cordova: APIs and instrumentsIvano Malavolta
 
Php Dependency Management with Composer ZendCon 2016
Php Dependency Management with Composer ZendCon 2016Php Dependency Management with Composer ZendCon 2016
Php Dependency Management with Composer ZendCon 2016Clark Everetts
 
habitat at docker bud
habitat at docker budhabitat at docker bud
habitat at docker budMandi Walls
 
TAA eLearn Course - Presentation Week 3
TAA eLearn Course - Presentation Week 3TAA eLearn Course - Presentation Week 3
TAA eLearn Course - Presentation Week 3Yum Studio
 
Apache Cordova phonegap plugins for mobile app development
Apache Cordova phonegap plugins for mobile app developmentApache Cordova phonegap plugins for mobile app development
Apache Cordova phonegap plugins for mobile app developmentwebprogr.com
 
Introduction to android sessions new
Introduction to android   sessions newIntroduction to android   sessions new
Introduction to android sessions newJoe Jacob
 

Semelhante a Get On The Audiobus (CocoaConf Atlanta, November 2013) (20)

Core Audio in iOS 6 (CocoaConf Portland, Oct. '12)
Core Audio in iOS 6 (CocoaConf Portland, Oct. '12)Core Audio in iOS 6 (CocoaConf Portland, Oct. '12)
Core Audio in iOS 6 (CocoaConf Portland, Oct. '12)
 
Inter-process audio options on iOS
Inter-process audio options on iOSInter-process audio options on iOS
Inter-process audio options on iOS
 
Appium overview (Selenium Israel #2, Feb. 2014)
Appium overview (Selenium Israel #2, Feb. 2014)Appium overview (Selenium Israel #2, Feb. 2014)
Appium overview (Selenium Israel #2, Feb. 2014)
 
Habitat Workshop at Velocity London 2017
Habitat Workshop at Velocity London 2017Habitat Workshop at Velocity London 2017
Habitat Workshop at Velocity London 2017
 
Core Audio in iOS 6 (CocoaConf Chicago, March 2013)
Core Audio in iOS 6 (CocoaConf Chicago, March 2013)Core Audio in iOS 6 (CocoaConf Chicago, March 2013)
Core Audio in iOS 6 (CocoaConf Chicago, March 2013)
 
Android Multimedia Player Project Presentation
Android Multimedia Player Project PresentationAndroid Multimedia Player Project Presentation
Android Multimedia Player Project Presentation
 
Podcasting
PodcastingPodcasting
Podcasting
 
[2015/2016] Apache Cordova
[2015/2016] Apache Cordova[2015/2016] Apache Cordova
[2015/2016] Apache Cordova
 
Appium Overview - by Daniel Puterman
Appium Overview - by Daniel PutermanAppium Overview - by Daniel Puterman
Appium Overview - by Daniel Puterman
 
WebRTC, RED and Janus @ ClueCon21
WebRTC, RED and Janus @ ClueCon21WebRTC, RED and Janus @ ClueCon21
WebRTC, RED and Janus @ ClueCon21
 
Android Audio & OpenSL
Android Audio & OpenSLAndroid Audio & OpenSL
Android Audio & OpenSL
 
Android media framework overview
Android media framework overviewAndroid media framework overview
Android media framework overview
 
A Framework Driven Development
A Framework Driven DevelopmentA Framework Driven Development
A Framework Driven Development
 
Cordova: APIs and instruments
Cordova: APIs and instrumentsCordova: APIs and instruments
Cordova: APIs and instruments
 
Apache Cordova
Apache CordovaApache Cordova
Apache Cordova
 
Php Dependency Management with Composer ZendCon 2016
Php Dependency Management with Composer ZendCon 2016Php Dependency Management with Composer ZendCon 2016
Php Dependency Management with Composer ZendCon 2016
 
habitat at docker bud
habitat at docker budhabitat at docker bud
habitat at docker bud
 
TAA eLearn Course - Presentation Week 3
TAA eLearn Course - Presentation Week 3TAA eLearn Course - Presentation Week 3
TAA eLearn Course - Presentation Week 3
 
Apache Cordova phonegap plugins for mobile app development
Apache Cordova phonegap plugins for mobile app developmentApache Cordova phonegap plugins for mobile app development
Apache Cordova phonegap plugins for mobile app development
 
Introduction to android sessions new
Introduction to android   sessions newIntroduction to android   sessions new
Introduction to android sessions new
 

Mais de Chris Adamson

Whatever Happened to Visual Novel Anime? (AWA/Youmacon 2018)
Whatever Happened to Visual Novel Anime? (AWA/Youmacon 2018)Whatever Happened to Visual Novel Anime? (AWA/Youmacon 2018)
Whatever Happened to Visual Novel Anime? (AWA/Youmacon 2018)Chris Adamson
 
Whatever Happened to Visual Novel Anime? (JAFAX 2018)
Whatever Happened to Visual Novel Anime? (JAFAX 2018)Whatever Happened to Visual Novel Anime? (JAFAX 2018)
Whatever Happened to Visual Novel Anime? (JAFAX 2018)Chris Adamson
 
Media Frameworks Versus Swift (Swift by Northwest, October 2017)
Media Frameworks Versus Swift (Swift by Northwest, October 2017)Media Frameworks Versus Swift (Swift by Northwest, October 2017)
Media Frameworks Versus Swift (Swift by Northwest, October 2017)Chris Adamson
 
Fall Premieres: Media Frameworks in iOS 11, macOS 10.13, and tvOS 11 (CocoaCo...
Fall Premieres: Media Frameworks in iOS 11, macOS 10.13, and tvOS 11 (CocoaCo...Fall Premieres: Media Frameworks in iOS 11, macOS 10.13, and tvOS 11 (CocoaCo...
Fall Premieres: Media Frameworks in iOS 11, macOS 10.13, and tvOS 11 (CocoaCo...Chris Adamson
 
CocoaConf Chicago 2017: Media Frameworks and Swift: This Is Fine
CocoaConf Chicago 2017: Media Frameworks and Swift: This Is FineCocoaConf Chicago 2017: Media Frameworks and Swift: This Is Fine
CocoaConf Chicago 2017: Media Frameworks and Swift: This Is FineChris Adamson
 
Glitch-Free A/V Encoding (CocoaConf Boston, October 2013)
Glitch-Free A/V Encoding (CocoaConf Boston, October 2013)Glitch-Free A/V Encoding (CocoaConf Boston, October 2013)
Glitch-Free A/V Encoding (CocoaConf Boston, October 2013)Chris Adamson
 
Core Audio in iOS 6 (CocoaConf San Jose, April 2013)
Core Audio in iOS 6 (CocoaConf San Jose, April 2013) Core Audio in iOS 6 (CocoaConf San Jose, April 2013)
Core Audio in iOS 6 (CocoaConf San Jose, April 2013) Chris Adamson
 
Core Audio in iOS 6 (CocoaConf DC, March 2013)
Core Audio in iOS 6 (CocoaConf DC, March 2013)Core Audio in iOS 6 (CocoaConf DC, March 2013)
Core Audio in iOS 6 (CocoaConf DC, March 2013)Chris Adamson
 
Mobile Movies with HTTP Live Streaming (CocoaConf DC, March 2013)
Mobile Movies with HTTP Live Streaming (CocoaConf DC, March 2013)Mobile Movies with HTTP Live Streaming (CocoaConf DC, March 2013)
Mobile Movies with HTTP Live Streaming (CocoaConf DC, March 2013)Chris Adamson
 
Core Audio Intro (Detroit Mobile City 2013)
Core Audio Intro (Detroit Mobile City 2013)Core Audio Intro (Detroit Mobile City 2013)
Core Audio Intro (Detroit Mobile City 2013)Chris Adamson
 
Objective-C Is Not Java
Objective-C Is Not JavaObjective-C Is Not Java
Objective-C Is Not JavaChris Adamson
 
Core Audio in iOS 6 (CocoaConf Raleigh, Dec. '12)
Core Audio in iOS 6 (CocoaConf Raleigh, Dec. '12)Core Audio in iOS 6 (CocoaConf Raleigh, Dec. '12)
Core Audio in iOS 6 (CocoaConf Raleigh, Dec. '12)Chris Adamson
 

Mais de Chris Adamson (12)

Whatever Happened to Visual Novel Anime? (AWA/Youmacon 2018)
Whatever Happened to Visual Novel Anime? (AWA/Youmacon 2018)Whatever Happened to Visual Novel Anime? (AWA/Youmacon 2018)
Whatever Happened to Visual Novel Anime? (AWA/Youmacon 2018)
 
Whatever Happened to Visual Novel Anime? (JAFAX 2018)
Whatever Happened to Visual Novel Anime? (JAFAX 2018)Whatever Happened to Visual Novel Anime? (JAFAX 2018)
Whatever Happened to Visual Novel Anime? (JAFAX 2018)
 
Media Frameworks Versus Swift (Swift by Northwest, October 2017)
Media Frameworks Versus Swift (Swift by Northwest, October 2017)Media Frameworks Versus Swift (Swift by Northwest, October 2017)
Media Frameworks Versus Swift (Swift by Northwest, October 2017)
 
Fall Premieres: Media Frameworks in iOS 11, macOS 10.13, and tvOS 11 (CocoaCo...
Fall Premieres: Media Frameworks in iOS 11, macOS 10.13, and tvOS 11 (CocoaCo...Fall Premieres: Media Frameworks in iOS 11, macOS 10.13, and tvOS 11 (CocoaCo...
Fall Premieres: Media Frameworks in iOS 11, macOS 10.13, and tvOS 11 (CocoaCo...
 
CocoaConf Chicago 2017: Media Frameworks and Swift: This Is Fine
CocoaConf Chicago 2017: Media Frameworks and Swift: This Is FineCocoaConf Chicago 2017: Media Frameworks and Swift: This Is Fine
CocoaConf Chicago 2017: Media Frameworks and Swift: This Is Fine
 
Glitch-Free A/V Encoding (CocoaConf Boston, October 2013)
Glitch-Free A/V Encoding (CocoaConf Boston, October 2013)Glitch-Free A/V Encoding (CocoaConf Boston, October 2013)
Glitch-Free A/V Encoding (CocoaConf Boston, October 2013)
 
Core Audio in iOS 6 (CocoaConf San Jose, April 2013)
Core Audio in iOS 6 (CocoaConf San Jose, April 2013) Core Audio in iOS 6 (CocoaConf San Jose, April 2013)
Core Audio in iOS 6 (CocoaConf San Jose, April 2013)
 
Core Audio in iOS 6 (CocoaConf DC, March 2013)
Core Audio in iOS 6 (CocoaConf DC, March 2013)Core Audio in iOS 6 (CocoaConf DC, March 2013)
Core Audio in iOS 6 (CocoaConf DC, March 2013)
 
Mobile Movies with HTTP Live Streaming (CocoaConf DC, March 2013)
Mobile Movies with HTTP Live Streaming (CocoaConf DC, March 2013)Mobile Movies with HTTP Live Streaming (CocoaConf DC, March 2013)
Mobile Movies with HTTP Live Streaming (CocoaConf DC, March 2013)
 
Core Audio Intro (Detroit Mobile City 2013)
Core Audio Intro (Detroit Mobile City 2013)Core Audio Intro (Detroit Mobile City 2013)
Core Audio Intro (Detroit Mobile City 2013)
 
Objective-C Is Not Java
Objective-C Is Not JavaObjective-C Is Not Java
Objective-C Is Not Java
 
Core Audio in iOS 6 (CocoaConf Raleigh, Dec. '12)
Core Audio in iOS 6 (CocoaConf Raleigh, Dec. '12)Core Audio in iOS 6 (CocoaConf Raleigh, Dec. '12)
Core Audio in iOS 6 (CocoaConf Raleigh, Dec. '12)
 

Último

Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 

Último (20)

Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 

Get On The Audiobus (CocoaConf Atlanta, November 2013)

  • 1. Get on the Audiobus Chris Adamson • @invalidname CocoaConf Atlanta • November, 2013 Slides & code will be posted to the CocoaConf Glassboard, and announced on my Twitter & app.net (@invalidname)
  • 2.
  • 3. Roadmap • How audio works on iOS • What Audiobus is and how it connects apps • Adopting Audiobus in your audio app
  • 4. Audio on iOS • Each app is responsible for its own audio • No access to audio to/from other apps • Apps use the Audio Session API to interact with the system • See also AVAudioSession in AV Foundation
  • 5. Audio Session • Allows inspection of hardware properties (sampling rate, hardware latencies) and negotiation of access to system audio resources • Audio “category” declares what your app does with audio • This affects things like whether you mix with other apps’ audio, honor ring/silent, can play in background, etc.
  • 6. Audio Categories • Ambient • Solo Ambient • Playback • Record • Play and Record • Audio Processing • Multi-Route
  • 7. Audio Engines • How your app interacts with audio hardware, i.e., captures or produces sound • OpenAL (play-out only) • Audio Queue • Audio Units
  • 8. AURemoteIO Bus 1: audio in AURemoteIO Bus 0: audio out
  • 11. Every App is an Island • Only awareness of other apps’ audio is value of kAudioSessionProperty_OtherAudioIsPlaying property • No access to what other apps are playing audio, how loud it is, etc.
  • 12. Which means… • You can’t record audio from one app in another app • Production apps can’t specialize; have to provide everything (instruments, filters/ effects, recording) that you’d ever need
  • 14. Audiobus • Standalone app that coordinates inter-app audio • Currently on 50% off sale ($4.99) • Only works with apps that adopt the Audiobus API • 300 and counting!
  • 15. Demo
  • 16. What Audiobus Is • Audiobus is an app for users to coordinate audio across supported apps • User decides which apps are the inputs, effects, and outputs
  • 17. What Audiobus Isn’t • Audiobus is not a general-purpose systemlevel audio capture (like Audio Hijack on Mac) • Audiobus cannot get audio from or send audio to an arbitrary app • Apps must adopt the Audiobus SDK and register with the Audiobus website
  • 18. How the heck does it even work? Considering that inter-app communication is nearly impossible on iOS…
  • 19. Secret Sauce! • Audiobus began with MIDI “System Exclusive” (SysEx) messages, defined as being arbitrary blobs of data unique to a given MIDI device • Originally meant for synths to exchange waveforms, patches or other software/firmware upgrades, etc. • MIDI messages available to all interested apps via Core MIDI • Later switched to Mach Ports, which Core MIDI is implemented atop
  • 20. Audiobus Concepts • Apps take on roles based on their relationship to Audiobus • Inputs produce audio • Outputs receive audio • Filters receive from inputs and send to outputs • Points of connection are called ports
  • 22. Basic Audiobus Integration • Decide if you’re an input, output, or filter • Decide if you can work with the Remote IO unit or Audiobus’ port API • Adopt the Audiobus SDK to connect to Audiobus at runtime • Register at audiob.us
  • 24. Audiobus Web Radio • Web Radio app developed as in-class exercise for Thursday's all-day Core Audio class • Uses Audio File Stream to receive packets of MP3 and play them with Audio Queue Packets Packets 2 Packets Packets Packets 1 0 Packets
  • 25. LPCM or GTFO • Audiobus ports and AURemoteIO only work with uncompressed LPCM audio • Web radio app is dealing in MP3 or AAC • Conversion to LPCM happens inside the Audio Queue
  • 27. Libraries • Download the Audiobus SDK from developer.audiob.us • Add libAudiobus.a and the Audiobus headers to your project • Add Accelerate, AudioToolbox, QuartzCore, CoreGraphics, and Security frameworks to your project
  • 28.
  • 29. Enable background audio • Add “audio” to the app’s “Required Background Modes” if it’s not already present • All Audiobus-enabled apps must participate in backgrounding, since they must be able to keep running when Audiobus is in foreground
  • 30.
  • 31. Create a launch URL scheme • You must have a URL scheme for your app that ends in “.audiobus” for Audiobus to be able to launch you • Add this to the target’s “URL Types”
  • 32.
  • 33. Get Audiobus API key • For apps registered with iTunes Connect, submit your App Store URL or ID • For unpublished apps or tinkering, register for a temporary ID, good for 14 days • This requires dropping the Info.plist from your app bundle (not from project!)
  • 34.
  • 35. Audiobus API Keys • Audiobus app gets a master list of known keys from a server every 30 minutes • For temporary IDs, click the link from the developer page on the device that you’re using Audiobus on to register your App ID • e.g., audiobus-registry:// developer.audiob.us/tempreg?t=0ff37 • The dev page can mail you the link
  • 36.
  • 37. Set Audiobus-compatible behaviors • Audio Session category must be playback or play-and-record • Must also set the mix-with-others property on the audio session • Often do both these things in the AppDelegate
  • 38. UInt32 audioCategory = kAudioSessionCategory_MediaPlayback; AudioSessionSetProperty(kAudioSessionProperty_AudioCategory, sizeof(audioCategory), &audioCategory); UInt32 allowMixing = YES; AudioSessionSetProperty(kAudioSessionProperty_OverrideCategory MixWithOthers, sizeof (allowMixing), &allowMixing); Note: Audio Session is deprecated in iOS 7 Modern apps can use the AV Foundation equivalents
  • 39. Setup Your App’s Audio System • Your app’s audio infrastructure needs to be up and running before you connect to Audiobus • If you’re going to send audio via the ABAudioBusAudioUnitWrapper, you’ll need to initialize your AURemoteIO • For the web radio app, I send an NSNotification once the player class starts playing
  • 40. Instantiate ABAudiobusController • ABAudiobusController is your app’s connection to Audiobus; probably gets held as a strong property somewhere • init method takes the launch URL and your API key • Obviously, these must match what you registered on audiob.us
  • 41. self.audiobusController = [[ABAudiobusController alloc] initWithAppLaunchURL: [NSURL URLWithString:@"audiobuswebradio.audiobus://"] apiKey:AUDIOBUS_API_KEY];
  • 42. Create ABOutputPort (and Audio Unit wrapper) • ABOutputPort sends audio to Audiobus (via ABOutputPortSendAudio() function) • If you use a RemoteIO unit for your output, the ABAudiobusAudioUnitWrapper will make these calls for you
  • 43. CCFViewController *vc = (CCFViewController*) self.window.rootViewController; ABOutputPort *output = [self.audiobusController addOutputPortNamed:@"Audio Output" title:NSLocalizedString(@"Main App Output", @"")]; self.audiobusAudioUnitWrapper = [[ABAudiobusAudioUnitWrapper alloc] initWithAudiobusController:self.audiobusController audioUnit:vc.player.remoteIOUnit output:output input:nil];
  • 44. Demo
  • 45. Demo
  • 46. Ports • Apps that don’t use the Audio Unit Wrapper use ports directly instead • ABOutputPortSendAudio() for senders (inputs and filters) • Block-based callback or poll with ABInputPortReceive() for receivers (filters and outputs)
  • 47. Filters & Outputs • If you produce audio output based on input, you need to tell the ABInputPort, so that the signal isn’t doubled in Audiobus.
  • 48. As for iOS 7…
  • 49.
  • 51. Sherlocked? Embrace & Extend! From: michael@audiob.us Date: June 19, 2013 Subject: Important Information Regarding Audiobus, iOS 7 and Inter-App Audio iOS 7 introduces many new features, including Apple’s own Inter-App Audio framework which we’re planning to incorporate into Audiobus so you don’t have to. For details and further discussion, we highly recommend checking out our thread on the Apple developer forums: https://devforums.apple.com/thread/191197
  • 52. Closing Thoughts • Audiobus is approachable for developers already working at the Audio Unit level • Adding Audiobus will get it seen by users who’ve proven willing to pay for good apps (we love music app users!) • Future-proofed for iOS 7
  • 53. Q&A Slides & code will be posted to the CocoaConf Glassboard, and announced on my Twitter & app.net (@invalidname)