diff --git a/CHANGELOG.md b/CHANGELOG.md index 51e42135..f7cd2dac 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -65,3 +65,12 @@ - Removed deprecated `PluginRegistry.Registrar` usage in Android plugin to resolve build errors on recent Flutter versions + +## 1.1.12 + +- Deactivated iOS audio session on stop to restore output audio + +## 1.1.13 + +- Reset iOS audio session to `.ambient` after stopping to fully release the + microphone and allow playback diff --git a/ios/Classes/AudioCapture.swift b/ios/Classes/AudioCapture.swift index 7eeee39e..3f2035b2 100644 --- a/ios/Classes/AudioCapture.swift +++ b/ios/Classes/AudioCapture.swift @@ -90,5 +90,14 @@ public class AudioCapture { public func stopSession() { audioEngine.inputNode.removeTap(onBus: 0) audioEngine.stop() + let audioSession = AVAudioSession.sharedInstance() + do { + try audioSession.setActive(false, options: .notifyOthersOnDeactivation) + try audioSession.setCategory(.ambient, options: [.mixWithOthers]) + try audioSession.setActive(true, options: .notifyOthersOnDeactivation) + print("✅ AudioSession desactivada y liberada correctamente") + } catch { + print("❌ Error al liberar AudioSession: \(error.localizedDescription)") + } } -} \ No newline at end of file +} diff --git a/pubspec.yaml b/pubspec.yaml index 36e93163..96f4263b 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: flutter_audio_capture description: Capture the audio buffer stream through microphone for iOS/Android. -version: 1.1.11 +version: 1.1.13 homepage: https://github.com/ysak-y/flutter_audio_capture environment: