     
     // get audio out interface
     let aoi = unsafeBitCast(inRefCon, AudioOutputInterface.self)
-    let buffer = UnsafeMutablePointer<Float>(data[0].mBuffers.mData)
+    let usableBufferList = UnsafeMutableAudioBufferListPointer(data)
+    let buffer = UnsafeMutablePointer<Float>(usableBufferList[0].mData)
     
     // high settings
     let highFor = aoi.outputHighFor

            guard noErr == status else { return nil }
            self.streamsInput = Int(size) / sizeof(AudioStreamID)
            
            propertyAddress.mSelector = kAudioDevicePropertyStreams
            propertyAddress.mScope = kAudioDevicePropertyScopeOutput
            status = AudioObjectGetPropertyDataSize(deviceID, &propertyAddress, 0, nil, &size)
            guard noErr == status else { return nil }
            self.streamsOutput = Int(size) / sizeof(AudioStreamID)
        }
    }
    
    var audioUnit: AudioComponentInstance = nil
    
    func devices() throws -> [AudioDevice?] {
        // property address
        var propertyAddress = AudioObjectPropertyAddress(mSelector: kAudioHardwarePropertyDevices, mScope: kAudioObjectPropertyScopeGlobal, mElement: kAudioObjectPropertyElementMaster)
        var size: UInt32 = 0

        // get device ids
        try checkError(AudioObjectGetPropertyData(AudioObjectID(kAudioObjectSystemObject), &propertyAddress, 0, nil, &size, &audioDevices[0]))
        
        return audioDevices.flatMap {
            return AudioDevice(deviceID: $0)
        }
    }
