Skip to content

Commit

Permalink
feat: experimental fix for #109
Browse files Browse the repository at this point in the history
  • Loading branch information
sowens-csd committed Jul 26, 2020
1 parent 4eb4f15 commit 09ae26f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions ios/Classes/SwiftSpeechToTextPlugin.swift
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,11 @@ public class SwiftSpeechToTextPlugin: NSObject, FlutterPlugin {
}
}
rememberedAudioCategory = self.audioSession.category
// Attempt to fix sample rate problem see https://developer.apple.com/forums/thread/65656
if let audioUnit = audioEngine.inputNode.audioUnit {
AudioOutputUnitStop(audioUnit)
AudioUnitUninitialize(audioUnit)
}
try self.audioSession.setCategory(AVAudioSession.Category.playAndRecord, options: .defaultToSpeaker)
// try self.audioSession.setMode(AVAudioSession.Mode.measurement)
try self.audioSession.setMode(AVAudioSession.Mode.default)
Expand Down

0 comments on commit 09ae26f

Please sign in to comment.