回答編集履歴
1
追加
answer
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
AudioQueueNewInputの関数型引数で、それが取りうる引数が一部オプショナル型になってました。
|
2
2
|
```swift
|
3
|
-
/*
|
3
|
+
/* for swift 2.x
|
4
4
|
private func AudioQueueInputCallback(
|
5
5
|
_ inUserData: UnsafeMutableRawPointer,
|
6
6
|
inAQ: AudioQueueRef,
|
@@ -12,7 +12,7 @@
|
|
12
12
|
// Do nothing, because not recoding.
|
13
13
|
}
|
14
14
|
*/
|
15
|
-
/*
|
15
|
+
/* for swift 3.0 */
|
16
16
|
private func AudioQueueInputCallback(
|
17
17
|
_ inUserData: UnsafeMutableRawPointer?,
|
18
18
|
inAQ: AudioQueueRef,
|
@@ -24,4 +24,16 @@
|
|
24
24
|
// Do nothing, because not recoding.
|
25
25
|
}
|
26
26
|
```
|
27
|
+
```swift
|
28
|
+
// 不要なキャストなので as! 以下を削除
|
29
|
+
error = AudioQueueNewInput(
|
30
|
+
&dataFormat,
|
31
|
+
AudioQueueInputCallback , //as! AudioQueueInputCallback,
|
32
|
+
UnsafeMutableRawPointer(Unmanaged.passUnretained(self).toOpaque()),
|
33
|
+
.none,
|
34
|
+
.none,
|
35
|
+
0,
|
36
|
+
&audioQueue)
|
37
|
+
|
38
|
+
```
|
27
39
|
swift3で稼働確認
|