Hi, I am trying to record a node output using AKNodeRecorder based on the Recording Notes example from Playground. Based on the console output, it did start recording (it shows record() AKNodeRecorder: recording). In the playground example, it logs the further info (record() AKNodeRecorder writing (file duration: 0.1 seconds)). But in my case it doesn't log any further info. When I stopped recording after at least 10 seconds, the console shows stopRecordingAndExport() Stopped. (0.000 seconds recorded). It looks to me like the recorder was not able to record the node. Am I doing something wrong here?
When initializing the recorder, the system said that Audio files cannot be non-interleaved. Ignoring setting AVLinearPCMIsNonInterleaved YES. I wonder if it's related to the issue I am having.
I am running the program on an iPad with iOS 10.3.1. I am using the latest AudioKit release.
Here is the code:
open class OscillatorInstrument: NSObject {
var fmBank = AKFMOscillatorBank()
var oscMixer : AKMixer!
var recorder : AKNodeRecorder!
public override init() {
super.init()
oscMixer = AKMixer(fmBank)
AudioKit.output = fmBank
AudioKit.start()
do {
recorder = try AKNodeRecorder(node: oscMixer)
AKLog((recorder.audioFile?.directoryPath.absoluteString)!)
AKLog((recorder.audioFile?.fileNamePlusExtension)!)
} catch {
AKLog("can't create recorder")
}
}
open func startRecording() {
do {
try recorder.record()
} catch {
AKLog("Couldn't record")
}
}
open func stopRecordingAndExport() {
let dur = String(format: "%0.3f seconds", recorder.recordedDuration)
AKLog("Stopped. (\(dur) recorded)")
recorder.stop()
}
}
Here is the log data from the console:
2017-04-26 09:54:04.045329+0200 VideoSynth[3149:726988] [DYMTLInitPlatform] platform initialization successful
2017-04-26 09:54:04.414046+0200 VideoSynth[3149:726925] Audio files cannot be non-interleaved. Ignoring setting AVLinearPCMIsNonInterleaved YES.
init() /private/var/mobile/Containers/Data/Application/91AD0864-0C60-4152-8922-2541AF89979D/tmp/
init() 27202A4E-9283-443A-B4BB-4264FB235EDA.caf
2017-04-26 09:54:04.591836+0200 VideoSynth[3149:726925] Creating OpenGL ES2 Renderer
2017-04-26 09:54:04.691268+0200 VideoSynth[3149:726925] [MC] System group container for systemgroup.com.apple.configurationprofiles path is /private/var/containers/Shared/SystemGroup/systemgroup.com.apple.configurationprofiles
2017-04-26 09:54:04.693088+0200 VideoSynth[3149:726925] [MC] Reading from public effective user settings.
record() AKNodeRecorder: recording
stopRecordingAndExport() Stopped. (0.000 seconds recorded)