capacitor-voice-recorder-wav-stereo 7.0.6 → 7.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ios/Plugin/VoiceRecorder.swift +12 -16
- package/package.json +1 -1
|
@@ -106,19 +106,16 @@ public class VoiceRecorder: CAPPlugin {
|
|
|
106
106
|
let audioSession = AVAudioSession.sharedInstance()
|
|
107
107
|
var devices = [[String: Any]]()
|
|
108
108
|
|
|
109
|
-
//
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
109
|
+
// 現在の設定をログ出力
|
|
110
|
+
print("Current Category: \(audioSession.category.rawValue)")
|
|
111
|
+
print("Current Mode: \(audioSession.mode.rawValue)")
|
|
112
|
+
print("Current Route: \(audioSession.currentRoute)")
|
|
113
|
+
|
|
114
|
+
// 変更前のルートを保持
|
|
115
|
+
let originalRoute = audioSession.currentRoute
|
|
113
116
|
|
|
114
117
|
do {
|
|
115
|
-
//
|
|
116
|
-
if !audioSession.isOtherAudioPlaying {
|
|
117
|
-
try audioSession.setActive(false)
|
|
118
|
-
didActivate = true
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
// 入力デバイス(マイクなど)
|
|
118
|
+
// セッションを変更せずにデバイス情報を取得
|
|
122
119
|
let availableInputs = audioSession.availableInputs ?? []
|
|
123
120
|
for port in availableInputs {
|
|
124
121
|
devices.append([
|
|
@@ -129,7 +126,6 @@ public class VoiceRecorder: CAPPlugin {
|
|
|
129
126
|
])
|
|
130
127
|
}
|
|
131
128
|
|
|
132
|
-
// 出力デバイス(現在のルートから取得)
|
|
133
129
|
let currentOutputs = audioSession.currentRoute.outputs
|
|
134
130
|
for port in currentOutputs {
|
|
135
131
|
devices.append([
|
|
@@ -140,10 +136,10 @@ public class VoiceRecorder: CAPPlugin {
|
|
|
140
136
|
])
|
|
141
137
|
}
|
|
142
138
|
|
|
143
|
-
//
|
|
144
|
-
if
|
|
145
|
-
|
|
146
|
-
|
|
139
|
+
// ルートが変更されたか確認
|
|
140
|
+
if audioSession.currentRoute != originalRoute {
|
|
141
|
+
print("Route changed during operation!")
|
|
142
|
+
print("New Route: \(audioSession.currentRoute)")
|
|
147
143
|
}
|
|
148
144
|
|
|
149
145
|
} catch {
|