Posts

Es werden Posts vom Juli, 2015 angezeigt.

Swift 2, AudioConverter, Callback and Core Audio

Currently I am working on bcAnalyze 3 - our sound analysis tool. I decided to write it in Swift to learn the new language. While most of my doings went well resulting in a first bcAnalyze 3 light version... i hit a wall when starting on AudioConverters and a callback function completely written in Swift. While with some help I managed to define a callback , the AudioConverter didn't run but threw an error when calling it via AudioConverterFillComplexBuffer. After some digging I realized that the AudioBufferList supplied to the callback function was loosing its filled in values. After some days struggling I managed to get it running - I need only samplerate conversions, so, running to do that at least. How to get it running? I supplied a struct as user info in the callback. The struct holds a pointer to the sound data as well as the AudiobufferList... but I'll best show the code: struct audioIO {     var pos: UInt32 = 0     var srcBuffer: Array < Float >