Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/98.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/iphone/39.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios SimplePCMRecorder中的AudioQueueBufferRef在swift 3中显示错误_Ios_Iphone_Swift_Alexa_Alexa Voice Service - Fatal编程技术网

Ios SimplePCMRecorder中的AudioQueueBufferRef在swift 3中显示错误

Ios SimplePCMRecorder中的AudioQueueBufferRef在swift 3中显示错误,ios,iphone,swift,alexa,alexa-voice-service,Ios,Iphone,Swift,Alexa,Alexa Voice Service,我想从iPhone连接Alexa,因为我使用的是一个用swift 2.2编写的示例 所以我需要把它转换成Swift 3.0 完成了从Swift 2.2到Swift 3.0的xcode迁移,解决了几乎所有的错误,现在剩下的唯一错误与AudioQueueBufferRef有关 Swift 2.2: self.recorderState = RecorderState( setupComplete: false, dataFormat: AudioStr

我想从iPhone连接Alexa,因为我使用的是一个用swift 2.2编写的示例

所以我需要把它转换成Swift 3.0

完成了从Swift 2.2到Swift 3.0的xcode迁移,解决了几乎所有的错误,现在剩下的唯一错误与AudioQueueBufferRef有关

Swift 2.2:

self.recorderState = RecorderState(
            setupComplete: false,
            dataFormat: AudioStreamBasicDescription(),
            queue: UnsafeMutablePointer<AudioQueueRef>.alloc(1),
            buffers: Array<AudioQueueBufferRef>(count: numberBuffers, repeatedValue: nil),
            recordFile: AudioFileID(),
            bufferByteSize: 0,
            currentPacket: 0,
            isRunning: false,
            recordPacket: 0,
            errorHandler: nil)
在swift 2.2中工作正常,但在swift 3.0中显示错误

/用户/macbookpro/下载/iOS Alexa主副本/iOS Alexa/AVS/simplepcmcrecorder.swift:28:32:表达式类型 “数组”(又名 “Array>”)在没有 更多上下文

我在google和stackoverflow上搜索过,但没有找到解决方案。我试着重写和谷歌的东西,但没有解决


有人能告诉我如何解决这个问题吗?

在Swift 3中,使用
AudioQueueBufferRef?
而不是
AudioQueueBufferRef

let buffers=Array(重复:nil,计数:numberBuffers)
//并分配每个缓冲区
对于0中的i..
这里也有同样的问题。你找到解决办法了吗?运气好吗?还没有,还没有找到任何解决方案:(哦,老兄,我被困在这里了。但是如果我找到了任何解决方案,我会告诉你的。@MuhammadRaza如果你在swift 3.0中获得了工作代码,请告诉我:(有什么更新吗?
let audioBufferQueue = Array<AudioQueueBufferRef>(repeating: nil, count: numberBuffers)