AudioKit V3 in Objective C Project

464 views
Skip to first unread message

John Sanderson

unread,
Jan 27, 2016, 1:54:51 PM1/27/16
to AudioKit Users Group
Hi all,

I am writing a project in Objective C and was wondering if anyone had successfully integrated AudioKit V3 into an ObjC project yet?

I am torn between using AudioKit V2 in the current project or learning Swift (have only written in ObjC at present) and using V3 in a new project. Ideally I would like to continue using ObjC... 

Any tips/advice would be great. 

John 

Aurelius Prochazka Ph.D.

unread,
Jan 27, 2016, 4:48:16 PM1/27/16
to AudioKit Users Group
Hi John,

I've actually been trying to get HelloWorld to work in Objective-C and I'm having trouble.  According to Apple's docs, an external framework, regardless of what language it is written in, should be able to be imported with:


   
@import Audiokit;


so long as the framework Defines Module build setting is set to “Yes", which it is for AudioKit.  But, for me I get "cannot build module 'AudioKit'" which I try to import it from Objective-C.  I'll push on this until I figure it out, and perhaps Stephane will have some insight as well.  We'll get this fixed for you and the other Objective-C people.  

Aure

Aurelius Prochazka Ph.D.

unread,
Jan 27, 2016, 9:13:59 PM1/27/16
to AudioKit Users Group
Hi, I updated AudioKit and created an Objective-C Demo project for you, but Github is down right now so look for it after they are done with their maintenance.

Aure

Aurelius Prochazka Ph.D.

unread,
Jan 27, 2016, 11:25:05 PM1/27/16
to AudioKit Users Group
The develop branch of AudioKit now supports Objective-C and there is an example in the iOS folder called "HelloObjectiveC" that does the same thing as the HelloWorld examples do in Swift.

Aure

John Sanderson

unread,
Jan 28, 2016, 4:44:47 AM1/28/16
to AudioKit Users Group
Aure, thank you very much for your help! I will check out the demo now. 

John 

Hernan Arber

unread,
Dec 20, 2016, 9:33:58 PM12/20/16
to AudioKit Users Group
Hi guys:

I'm having the same "cannot build module 'AudioKit'" Message when trying to Build even though I Followed all the Steps in the Tutorial.

The Issue here is it Does Build in the Simulator, but While I'm developing I Got NO Recognition of AudioKit's Methods or Components, which makes it almost impossible to develop.

Can anyone Help me out?

Thanks

Hernan

Aurelius Prochazka Ph.D.

unread,
Dec 20, 2016, 9:52:31 PM12/20/16
to AudioKit Users Group
For developing I really like use the Audio for XXX.xcodeproj project files included as a subproject.  That way you can also make changes to AudioKit if need be.  It also seems to make Xcode much better at code completion.

Aure

Hernan Arber

unread,
Dec 21, 2016, 12:08:58 PM12/21/16
to AudioKit Users Group
Hi, Thanks for the Answer....

I Did Add AudioKit as a Sub-Project to the Project.

Gerhard Mayer

unread,
Dec 21, 2016, 4:23:00 PM12/21/16
to AudioKit Users Group

Nice to see that I am not alone with Obj-C - AK !
could anyone give me a little support with the follwoing ?
Please someone of you "knowing Swift+ObjC guys" be so kind and give me a hint on how to convert that swift example-code to Obj-C:

let effect = AKOperationEffect(player, numberOfChannels: 2) { _, parameters in
let leftDelay = AKOperation.leftInput.variableDelay(time: parameters[0], feedback: parameters[1])
let rightDelay = AKOperation.rightInput.variableDelay(time: parameters[2], feedback: parameters[3])
return [leftDelay, rightDelay]

}
effect.parameters = [0.2, 0.5, 0.01, 0.9]

AudioKit.output = effect

?

Thank you very much!!!
Gerhard

kuldeep tanwar

unread,
Mar 2, 2017, 12:26:34 AM3/2/17
to AudioKit Users Group, gerhard...@gmail.com
Hey, 

How do you manage the size of your app working with objective-C using cocoapods will ridiculously increased the size of my app how did you manage that. and of course to work with objective c you have to set ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES  to YES how did you deal with that? thanks in advance

Stephane Peter

unread,
Mar 2, 2017, 1:26:07 AM3/2/17
to AudioKit Users Group, gerhard...@gmail.com
You really don't have a choice in the matter, if you use Swift in any way (even if just through a dependence on AudioKit, which is a Swift library), then you have to bundle the Swift libraries and that's unfortunately going to inflate the size of your app bundle. Nothing can be done about this until Apple ships a standard Swift library that doesn't need to be bundled with apps.

kuldeep tanwar

unread,
Mar 2, 2017, 2:26:04 AM3/2/17
to AudioKit Users Group, gerhard...@gmail.com
and what about the size of the audiokit, if i include audiokit explicitly in a new project and make a build the size of the framework in .app will be 64mb and after enabling the  ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES the size of the framework increased to 86mb any help with that.

Stephane Peter

unread,
Mar 2, 2017, 3:48:08 AM3/2/17
to AudioKit Users Group, gerhard...@gmail.com
A big part of the reason for the size of the framework is the use of Bitcode. If you use that in you app (and you should), then you'll notice that the actual download size will be significantly stripped down for your users by Apple, as they made variants stripping out all the unused bits for each type of device. So a better measure would be to look at the actual download sizes on the App Store (you can check it in iTunes Connect) after uploading a build.
Reply all
Reply to author
Forward
0 new messages