Hello.
I would like to add waveform plot features to my sound recorder/player, using Objective-C (I started using it on a NeXT in late 1990… so my brain is quite designed for it and not for swift, I'm afraid). I discovered the AudioKit 4 which seems a great framework, and I imported the AudioKit & AudioKitUI frameworks from audiokit.io website. I am using Xcode 9 with iOS10.0 target. Unfortunately I cannot initialize some classes from the AudioKit in my objective-C code... For example, to create an AKAudioPlayer instance, I use:
AKAudioFile *audioFile = [[AKAudioFile alloc] initForReading: myURL error:&error];
AKAudioPlayer* playerAK = [[AKAudioPlayer alloc] initWithFile:audioFile looping:NO deferBuffering:false completionHandler:nil];
From what I understand from Apple documentation on using swift framework in Objective-C, I thought that the initWithFile: looping: deferBuffering: completionHandler: was the good translation in objective-C from the swift init call defined in AKAudioPlayer.swift in AudioKit framework:
public init(file: AKAudioFile,
looping: Bool = false,
deferBuffering: Bool = false,
completionHandler: AKCallback? = nil) throws...
The AKAudioFile object instantiation causes neither warning nor error. But on instantiation of AKAudioPlayer, the compiler returns an error, saying no interface declares the selector initWithFile: looping: deferBuffering: completionHandler:
What am I doing wrong? Thanks for help