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.
@@ -106,19 +106,16 @@ public class VoiceRecorder: CAPPlugin {
106
106
  let audioSession = AVAudioSession.sharedInstance()
107
107
  var devices = [[String: Any]]()
108
108
 
109
- // 現在の設定を保持
110
- let originalCategory = audioSession.category
111
- let originalMode = audioSession.mode
112
- var didActivate = false
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 didActivate {
145
- try audioSession.setCategory(originalCategory, mode: originalMode)
146
- try audioSession.setActive(true)
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 {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "capacitor-voice-recorder-wav-stereo",
3
- "version": "7.0.6",
3
+ "version": "7.0.7",
4
4
  "description": "Capacitor plugin for voice recording in wav format",
5
5
  "main": "dist/plugin.cjs.js",
6
6
  "module": "dist/esm/index.js",