Recognize spoken words in recorded or live audio using Speech.

Posts under Speech tag

200 Posts

Post

Replies

Boosts

Views

Activity

TTsError
[AXTTSCommon] _BeginSpeaking: speech cancelled error: Error Domain=TTSErrorDomain Code=-4001 "(null)" [AXTTSCommon] _BeginSpeaking: couldn't begin playback [plugin] invokeFlutter soundLevelChange [VOTSpeech] Failed to speak request with error: Error Domain=TTSErrorDomain Code=-4005 "(null)". Attempting to speak again with fallback identifier: com.apple.voice.compact.en-US.Samantha
1
3
925
Apr ’23
AVSpeechSynthesizer error unable to list voice folder
IOS 16.4 let synthesizer = AVSpeechSynthesizer() private func speakText(text: String) { let utterance = AVSpeechUtterance(string: text) utterance.voice = AVSpeechSynthesisVoice(language: "en-US") utterance.rate = 0.5 synthesizer.speak(utterance) print("speak code run") } The above code works fine on the emulator but not on iphone 13 or ipad pro m1. Each time these errors 2023-04-02 22:34:43.418311+0200 [45953:4354804] [catalog] Unable to list voice folder speak code run 2023-04-02 22:34:43.447608+0200 [45953:4354804] [catalog] Unable to list voice folder 2023-04-02 22:34:43.452857+0200 [45953:4354804] [catalog] Unable to list voice folder 2023-04-02 22:34:43.471776+0200 [45953:4354804] [catalog] Unable to list voice folder 2023-04-02 22:34:43.618664+0200 [45953:4354804] [catalog] Query for com.apple.MobileAsset.VoiceServices.VoiceResources failed: 2 2023-04-02 22:34:43.798930+0200 [45953:4354957] [AXTTSCommon] Failure starting audio queue \M-3<…> 2023-04-02 22:34:45.812019+0200 [45953:4354957] [AXTTSCommon] Run loop timed out waiting for free audio buffer
1
0
1.6k
Apr ’23
AVFoundation AVSpeechUtterance AVSpeechSynthesizer not working in iOS 16 Beta 4, Beta 5
Anyone experiencing issues with Speech to Text in Beta 4 ? It was working absolutely fine in earlier iOS versions.        let utterance = AVSpeechUtterance(string: "The quick brown fox jumped over the lazy dog.")       utterance.voice = AVSpeechSynthesisVoice(language: "en-US")       utterance.volume = 1       utterance.rate = 0.1       let synthesizer = AVSpeechSynthesizer()       synthesizer.speak(utterance)
15
3
6.2k
Mar ’23
com.apple.TextToSpeech.SpeechThread crash after iOS 16
Hi, I face an issue with AVSpeechSynthesizer after iOS 16. Crashed: com.apple.TextToSpeech.SpeechThread 0 libobjc.A.dylib 0x3518 objc_release + 16 1 libobjc.A.dylib 0x3518 objc_release_x0 + 16 2 libobjc.A.dylib 0x15d8 AutoreleasePoolPage::releaseUntil(objc_object**) + 196 3 libobjc.A.dylib 0x4f40 objc_autoreleasePoolPop + 256 4 libobjc.A.dylib 0x329dc objc_tls_direct_base<AutoreleasePoolPage*, (tls_key)3, AutoreleasePoolPage::HotPageDealloc>::dtor_(void*) + 168 5 libsystem_pthread.dylib 0x1bd8 _pthread_tsd_cleanup + 620 6 libsystem_pthread.dylib 0x4674 _pthread_exit + 84 7 libsystem_pthread.dylib 0x16d8 _pthread_start + 160 8 libsystem_pthread.dylib 0xba4 thread_start + 8 I got many crash reports from my clients, but unfortunately, I can't reproduce this on my test devices. Does anybody face this also?
21
4
7.1k
Mar ’23
SFSpeechRecognizer (Siri Transcription) Timeout Error on iOS App
In my iOS app, I am trying to transcribe prerecorded audio using iOS 10's latest feature, the Speech API.Multiple sources including the documentation have stated that the audio duration limit for the Speech API (more specifically SFSpeechRecognizer) is 1 minute.In my code, I have found that any audio files with a length of about 15 seconds or more, will get the following error:Error Domain=kAFAssistantErrorDomain Code=203 "SessionId=com.siri.cortex.ace.speech.session.event.SpeechSessionId@50a8e246, Message=Timeout waiting for command after 30000 ms" UserInfo={NSLocalizedDescription=SessionId=com.siri.cortex.ace.speech.session.event.SpeechSessionId@50a8e246, Message=Timeout waiting for command after 30000 ms, NSUnderlyingError=0x170248c40 {Error Domain=SiriSpeechErrorDomain Code=100 "(null)"}}I have searched all over the internet and have set to find a solution to this. There also have been people with the same problem. Some people suspect that it's a problem with Nuance.It is also worth noting that I do get partial results from the transcription process.Here's the code from my iOS app.` // Create a speech recognizer request object. let srRequest = SFSpeechURLRecognitionRequest(url: location) srRequest.shouldReportPartialResults = false sr?.recognitionTask(with: srRequest) { (result, error) in if let error = error { // Something wrong happened print(error.localizedDescription) } else { if let result = result { print(4) print(result.bestTranscription.formattedString) if result.isFinal { print(5) transcript = result.bestTranscription.formattedString print(result.bestTranscription.formattedString) // Store the transcript into the database. print("\nSiri-Transcript: " + transcript!) // Store the audio transcript into Firebase Realtime Database self.firebaseRef = FIRDatabase.database().reference() let ud = UserDefaults.standard if let uid = ud.string(forKey: "uid") { print("Storing the transcript into the database.") let path = "users" + "/" + uid + "/" + "siri_transcripts" + "/" + date_recorded + "/" + filename.components(separatedBy: ".")[0] print("transcript database path: \(path)") self.firebaseRef.child(path).setValue(transcript) } } } } }`Thank you for your help.
6
0
4.9k
Mar ’23
AVSpeechSynthesizer not working in iOS 16 Beta
I am using below piece of code for TTS in iOS: let utterance = AVSpeechUtterance(string: "Hello World") utterance.voice = AVSpeechSynthesisVoice(language: "en-US") let synthesizer = AVSpeechSynthesizer() synthesizer.speak(utterance) It is working fine for iOS 15.6.1 and all lower versions. But the same code is giving below exception in iOS 16 Beta (latest beta 6 as well): [catalog] Unable to list voice folder The required voices are present in the iPhone and working properly in Voice Over and Spoken content. Even the voice API AVSpeechSynthesisVoice.speechVoices() is fetching all the voices, but I am getting above exception at line synthesizer.speak(utterance).
5
4
8.2k
Mar ’23
WebView doesn't play youtube after speech recognization
I use WKWebView to play embed youtube video, and also use SFSpeechRecognizer to recognize speech. But after recognize speech, webview does not play video. Please tell me how to fix it. 2023-03-04 15:27:14.100700+0900 SpeechRecognition[66390:23051497] [assertion] Error acquiring assertion: <Error Domain=RBSServiceErrorDomain Code=1 "(originator doesn't have entitlement com.apple.runningboard.assertions.webkit AND originator doesn't have entitlement com.apple.multitasking.systemappassertions)" UserInfo={NSLocalizedFailureReason=(originator doesn't have entitlement com.apple.runningboard.assertions.webkit AND originator doesn't have entitlement com.apple.multitasking.systemappassertions)}> 2023-03-04 15:27:14.100756+0900 SpeechRecognition[66390:23051497] [ProcessSuspension] 0x113000400 - ProcessAssertion::acquireSync Failed to acquire RBS assertion 'WebKit Media Playback' for process with PID=66392, error: Error Domain=RBSServiceErrorDomain Code=1 "(originator doesn't have entitlement com.apple.runningboard.assertions.webkit AND originator doesn't have entitlement com.apple.multitasking.systemappassertions)" UserInfo={NSLocalizedFailureReason=(originator doesn't have entitlement com.apple.runningboard.assertions.webkit AND originator doesn't have entitlement com.apple.multitasking.systemappassertions)} import UIKit import AVFAudio import Speech import MediaPlayer import WebKit class ViewController: UIViewController { @IBOutlet weak var startButton: UIButton! @IBOutlet weak var cancelButton: UIButton! var recognitionTask: SFSpeechRecognitionTask? = nil var webView: WKWebView! override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view. print("viewDidLoad") startButton.addTarget(self, action: #selector(StartSpeechRecognition), for: .touchUpInside) cancelButton.addTarget(self, action: #selector(StopSpeechRecognition), for: .touchUpInside) //startButton.addTarget(self, action: #selector(ChangeVolume), for: .touchUpInside) let webConfiguration = WKWebViewConfiguration() webConfiguration.allowsInlineMediaPlayback = true webView = WKWebView(frame: CGRect(x: 0, y: 0, width: 200, height: 200), configuration: webConfiguration) self.view.addSubview(webView) let myURL = URL(string: "https://www.youtube.com/embed/B7BxrAAXl94?playsinline=1") let myRequest = URLRequest(url: myURL!) webView.load(myRequest) } @objc public func StartSpeechRecognition() { let audioEngine = AVAudioEngine() // Configure the audio session for the app. let audioSession = AVAudioSession.sharedInstance() try? audioSession.setCategory(.record, mode: .measurement, options: .duckOthers) try? audioSession.setActive(true, options: .notifyOthersOnDeactivation) let inputNode = audioEngine.inputNode // Create and configure the speech recognition request. let recognitionRequest = SFSpeechAudioBufferRecognitionRequest() recognitionRequest.shouldReportPartialResults = true // Configure the microphone input. let recordingFormat = inputNode.outputFormat(forBus: 0) inputNode.installTap(onBus: 0, bufferSize: 1024, format: recordingFormat) { (buffer: AVAudioPCMBuffer, when: AVAudioTime) in recognitionRequest.append(buffer) } audioEngine.prepare() try? audioEngine.start() // Create a recognition task for the speech recognition session. // Keep a reference to the task so that it can be canceled. guard let speechRecognizer = SFSpeechRecognizer(locale: Locale(identifier: "ja-JP")) else { return } print("Start Recognize") recognitionTask = speechRecognizer.recognitionTask(with: recognitionRequest) { result, error in var isFinal = false if let result = result { // Update the text view with the results. isFinal = result.isFinal print("Text \(result.bestTranscription.formattedString)") } if error != nil || isFinal { // Stop recognizing speech if there is a problem. audioEngine.stop() inputNode.removeTap(onBus: 0) print("Stop") print(self.recognitionTask?.isFinishing) self.recognitionTask = nil } } } @objc public func StopSpeechRecognition() { guard let recognitionTask = recognitionTask else { return } recognitionTask.finish() } }
0
0
1.1k
Mar ’23
How to get Transcription for less than 1 minute of Audio Data using SFSpeechRecognizer Api.
Why SfSpeechRecognizer is not returning Transcription properly for less than 1 minute of Audio if we are Sending Audio Data to Server. we know 1 minute of limitation is there for server . That's why i m adding some Silence to Audio File for making it exact 1 minute. it is returning Transcription (Some Segment) but not properly. it is skipping some Substring from the middle part. if i m Keeping Same Audio File(after Adding Silence) on OnDeviceSpeechRecognition ,it is working properly. so, what can i do in this situation if we want transcription from server. Does anybody knows here anything about this? Thanks.
0
0
673
Mar ’23
ContextualStrings
Hi, did anyone make contextualStrings work? I would love to use it in various languages but it does not work at all. What I want to do in my app is make it able to recognise e.g. „Quintsextakkord“ oder „F-Dur“ „B-flat Minor“ or „sixth-fifth chord“ etc. Any hints? Thanks
0
0
576
Feb ’23
Teach SFSpeechRecognizer custom words (medication names, chemistry terms, etc)
Hi, I have a question regarding the integration of the speech to text library called SFSpeechRecognizer. I need SFSpeechRecognizer to recognize terms that are not present in the iOS dictionary like medication names, chemistry terms, etc. I would have to add them, somehow, for SFSpeechRecognizer to be able to recognise them. Is this possible? Thanks
2
0
1.6k
Feb ’23
Contextual Strings not working for on-device speech recognition.
I've noticed that contextual strings do not work for on-device speech recognition. I've written a Feedback entry: FB7496068 To reproduce: Create a basic app that transcribes speech. Add “Flubbery Dubbery” or a made up couple of words to a strings array and set it equal to the contextualStrings property of SFSpeechAudioBufferRecognitionRequest For the recognition request being used, set the requiresOnDeviceRecognition Boolean property to true. Transcribe audio and say the made up couple of words. See that the device never correctly transcribes the made up couple of words. Now set the requiresOnDeviceRecognition Boolean to false. Transcribe audio and say the made up words. See that the device correctly transcribes the made up words. Has anyone else run into this problem? I would love a fix. PS, I noticed that if you add a custom word as a contact in the Contacts app, then on-device recognition picks it up. So it seems it's possible, just not implemented quite right.
2
0
1.5k
Feb ’23
XCode 14 & iOS 16 Beta: No AVSpeechSynthesisVoice.speechVoices available
I'm testing my App in the Xcode 14 beta (released with WWDC22) on iOS 16, and it seems that AVSpeechSynthesisVoice is not working correctly. The following code always returns an empty array: AVSpeechSynthesisVoice.speechVoices() Additionally, attempting to initialize AVSpeechSynthesisVoice returns nil for all of the following: AVSpeechSynthesisVoice(language: AVSpeechSynthesisVoice.currentLanguageCode()) AVSpeechSynthesisVoice(language: "en") AVSpeechSynthesisVoice(language: "en-US") AVSpeechSynthesisVoice(identifier: AVSpeechSynthesisVoiceIdentifierAlex) AVSpeechSynthesisVoice.speechVoices().first
15
3
5.1k
Feb ’23
Can't hear audio in VoIP call when i grant media permission to webView
VoIP call works perfectly fine at start until i grant access to WKWebView media(microphone access). I am using WKWebView to highlight the spoken word using web speech engine. If i use webView i can't hear VoIP call audio and if i stop webView VoIP call works perfectly fine. What i want to achieve is to stay in VoIP call as well as work with webView to highlight the spoken words and I want to know if there is any problem in giving microphone access to VoIP as well as WKWebView simultaneously. Please post your question if i am not clear about anything or you want to know more information.
0
0
631
Feb ’23
iOS 16 TTS is horrible, it doesn’t work!
iOS 15 Siri voices worked perfectly. However, iOS 16 has a lot of issues - such as skipping words and sentences, and stopping reading all together. Obviously, this is a problem with the TTS I myself use Siri to read books while driving, but I regret updating to iOS 16. I went as far as upgrading my iPhone SE to my iPhone 14 Pro thinking it was the memory issue, but it's the same issue on both phones even my Mac M1 Pro with 16Gigs has same issues. https://youtu.be/g58nbW4J0DY It would be nice to receive and update or even a roll back to iOS 15 state of TTS
3
1
2.6k
Jan ’23
Switch voice on AVSpeechSynthesizer is causing "[AXTTSCommon] Invalid rule"
Simplifying, if I implement a code like the following let utterance = AVSpeechUtterance(string: "Hello world.") utterance.voice = AVSpeechSynthesisVoice(language: "en-GB") self.synthesizer.speak(utterance) let utterance = AVSpeechUtterance(string: "Hola mundo.") utterance.voice = AVSpeechSynthesisVoice(language: "es-ES") self.synthesizer.speak(utterance) After the second speak, I get the following error messages from the console [AXTTSCommon] Invalid rule: /(?<!\d|\d\s)(1\/2\s?)(mm|cm|m|m²|m2|m³|m3|km|km²|km2|km³|km3|mg|g|kg|l|ml)\b/i --> "M_FRACTION_OF_$1 EXPANSION_SG_OF_$2" # 1/2 mm --> medio milímetro [AXTTSCommon] Invalid rule: /(?<!\d|\d\s)(\d\/\d\s?)(mm|cm|m|m²|m2|m³|m3|km|km²|km2|km³|km3|mg|g|kg|l|ml)\b/i --> "M_FRACTION_OF_$1 de EXPANSION_SG_OF_$2" # 1/4 km² --> un cuarto de kilómetro cuadrado" [AXTTSCommon] Invalid rule: /(?<=\d\s)(\d\/\d\s?)(mm|cm|m|m²|m2|m³|m3|km|km²|km2|km³|km3|mg|g|kg|l|ml)\b/i --> "$2 y M_FRACTION_OF_$1" # 1/6m --> un sexto de metro [AXTTSCommon] Invalid rule: /(1\/2\s)(milímetro|centímetro|metro|metro cuadrado|metro cúbico|kilómetro|kilómetro cuadrado|kilómetro cúbico|miligramo|gramo|kilo|kilogramo|mililitro|litro)\b/i --> "M_FRACTION_OF_$1 $2" # 1/2 milímetro --> medio milímetro [AXTTSCommon] Invalid rule: /(milímetros?|centímetros?|metros?|metros? cuadrados?|metros? cúbicos?|kilómetros?|kilómetros? cuadrados?|kilómetros? cúbicos?|miligramos?|gramos?|kilos?|kilogramos?|mililitros?|litros?)\sy?\s?(1\/2)\b/i --> "$1 y M_FRACTION_OF_$2" # 3 metros y 1/2 --> tres metros y medio [AXTTSCommon] Invalid rule: /M_FRACTION_OF_1\/2/ --> "medio" # 1/2 m --> medio metro [AXTTSCommon] Invalid rule: /(?<!\d|\d\s)(\d\/\d\s?)(milímetros?|centímetros?|metros?|metros? cuadrados?|metros? cúbicos?|kilómetros?|kilómetros? cuadrados?|kilómetros? cúbicos?|miligramoS?|gramos?|kilos?|kilogramos?|mililitros?|litros?)\b/i --> "M_FRACTION_OF_$1 de $2" # 1/4 kilómetro --> un cuarto de kilómetro [AXTTSCommon] Invalid rule: /(?<=\d\s)(\d\/\d\s?)(milímetros?|centímetros?|metros?|metros? cuadrados?|metro cúbicos?|kilómetros?|kilómetros? cuadrados?|kilómetros? cúbicos?|miligramos?|gramos?|kilos?|kilogramos?|mililitros?|litros?)\b/i --> "$2 y M_FRACTION_OF_$1" # 2 1/4 kilómetros --> dos kilómetros y un cuarto [AXTTSCommon] Invalid rule: /(milímetros?|centímetros?|metros?|metro cuadrados?|metro cúbicos?|kilómetros?|kilómetro cuadrados?|kilómetro cúbicos?|miligramos?|gramos?|kilos?|kilogramos?|mililitros?|litros?)\sy?\s?(\d\/\d\s?)/ --> "$1 y M_FRACTION_OF_$2" # 2 milímetros y 1/2 --> dos milímetros y medio [AXTTSCommon] Invalid rule: /M_FRACTION_OF_(\d\/\d)/ --> "\e\\tn=fraction\\$1\e\\tn=normal\\" # 1/4 --> un cuarto [AXTTSCommon] Invalid rule: /(?<!\d|\d\s)(\d\/\d\s)(?=de (pan|masa|taza|hora)\b)/i --> "\e\\tn=fraction\\$1\e\\tn=normal\\" # 1/4 de pan --> un cuarto de pan [AXTTSCommon] Invalid rule: /(?<!\d|\d\s)(\d\/\d\s)(?=de (milímetros?|centímetros?|metros?|metro cuadrados?|metro cúbicos?|kilómetros?|kilómetro cuadrados?|kilómetro cúbicos?|miligramos?|gramos?|kilos?|kilogramos?|mililitros?|litros?)\b)/i --> "\e\\tn=fraction\\$1\e\\tn=normal\\" # 1/4 de metro --> un cuarto de metro [AXTTSCommon] Invalid rule: /(?<!\d|\d\s)(\d\/\d\s)/ --> "\e\\tn=fraction\\$1\e\\tn=normal\\" # catch-all rule for fractions, to avoid "1/4" --> "uno cuatro" The final behavior is correct, the expression is reproduced despite de console messages. However, after approximately 400 iterations the application consumes all memory resources in processes related to AXTTSCommon and Regex.
4
0
2.1k
Jan ’23
iOS Speech module not detecting some simple english words
We are using the speech module to detect the voice. Whenever the user says END Task the speech module is detecting it as AND Task. This is happening with similar phrases like END Activity, END Shift etc.., Is there any workaround for this issue?
Replies
0
Boosts
1
Views
642
Activity
May ’23
TTsError
[AXTTSCommon] _BeginSpeaking: speech cancelled error: Error Domain=TTSErrorDomain Code=-4001 "(null)" [AXTTSCommon] _BeginSpeaking: couldn't begin playback [plugin] invokeFlutter soundLevelChange [VOTSpeech] Failed to speak request with error: Error Domain=TTSErrorDomain Code=-4005 "(null)". Attempting to speak again with fallback identifier: com.apple.voice.compact.en-US.Samantha
Replies
1
Boosts
3
Views
925
Activity
Apr ’23
SFSpeechRecognizer Addspunctuation is not working why?
SFSpeechRecognizer addspunctuation is not working for all languages, it is giving only for some languages like English,Spanish,French,German,Russian , other languages not at all giving punctuation, how can I get punctuation for all languages? if anyone knows help me.
Replies
0
Boosts
2
Views
564
Activity
Apr ’23
AVSpeechSynthesizer error unable to list voice folder
IOS 16.4 let synthesizer = AVSpeechSynthesizer() private func speakText(text: String) { let utterance = AVSpeechUtterance(string: text) utterance.voice = AVSpeechSynthesisVoice(language: "en-US") utterance.rate = 0.5 synthesizer.speak(utterance) print("speak code run") } The above code works fine on the emulator but not on iphone 13 or ipad pro m1. Each time these errors 2023-04-02 22:34:43.418311+0200 [45953:4354804] [catalog] Unable to list voice folder speak code run 2023-04-02 22:34:43.447608+0200 [45953:4354804] [catalog] Unable to list voice folder 2023-04-02 22:34:43.452857+0200 [45953:4354804] [catalog] Unable to list voice folder 2023-04-02 22:34:43.471776+0200 [45953:4354804] [catalog] Unable to list voice folder 2023-04-02 22:34:43.618664+0200 [45953:4354804] [catalog] Query for com.apple.MobileAsset.VoiceServices.VoiceResources failed: 2 2023-04-02 22:34:43.798930+0200 [45953:4354957] [AXTTSCommon] Failure starting audio queue \M-3<…> 2023-04-02 22:34:45.812019+0200 [45953:4354957] [AXTTSCommon] Run loop timed out waiting for free audio buffer
Replies
1
Boosts
0
Views
1.6k
Activity
Apr ’23
Local Speech Recognition on WatchOS
How can we implement audio speech recognition as of watchOs 9.1 ? i saw this question that as of watchOs 8.0 is not yet available https://developer.apple.com/forums/thread/682508#reply-to-this-question and looking at the apple store search engine its clearly that this is something that is working https://i.imgur.com/T4MN3LO.jpg
Replies
0
Boosts
0
Views
1.1k
Activity
Mar ’23
AVFoundation AVSpeechUtterance AVSpeechSynthesizer not working in iOS 16 Beta 4, Beta 5
Anyone experiencing issues with Speech to Text in Beta 4 ? It was working absolutely fine in earlier iOS versions.        let utterance = AVSpeechUtterance(string: "The quick brown fox jumped over the lazy dog.")       utterance.voice = AVSpeechSynthesisVoice(language: "en-US")       utterance.volume = 1       utterance.rate = 0.1       let synthesizer = AVSpeechSynthesizer()       synthesizer.speak(utterance)
Replies
15
Boosts
3
Views
6.2k
Activity
Mar ’23
com.apple.TextToSpeech.SpeechThread crash after iOS 16
Hi, I face an issue with AVSpeechSynthesizer after iOS 16. Crashed: com.apple.TextToSpeech.SpeechThread 0 libobjc.A.dylib 0x3518 objc_release + 16 1 libobjc.A.dylib 0x3518 objc_release_x0 + 16 2 libobjc.A.dylib 0x15d8 AutoreleasePoolPage::releaseUntil(objc_object**) + 196 3 libobjc.A.dylib 0x4f40 objc_autoreleasePoolPop + 256 4 libobjc.A.dylib 0x329dc objc_tls_direct_base<AutoreleasePoolPage*, (tls_key)3, AutoreleasePoolPage::HotPageDealloc>::dtor_(void*) + 168 5 libsystem_pthread.dylib 0x1bd8 _pthread_tsd_cleanup + 620 6 libsystem_pthread.dylib 0x4674 _pthread_exit + 84 7 libsystem_pthread.dylib 0x16d8 _pthread_start + 160 8 libsystem_pthread.dylib 0xba4 thread_start + 8 I got many crash reports from my clients, but unfortunately, I can't reproduce this on my test devices. Does anybody face this also?
Replies
21
Boosts
4
Views
7.1k
Activity
Mar ’23
SFSpeechRecognizer (Siri Transcription) Timeout Error on iOS App
In my iOS app, I am trying to transcribe prerecorded audio using iOS 10's latest feature, the Speech API.Multiple sources including the documentation have stated that the audio duration limit for the Speech API (more specifically SFSpeechRecognizer) is 1 minute.In my code, I have found that any audio files with a length of about 15 seconds or more, will get the following error:Error Domain=kAFAssistantErrorDomain Code=203 "SessionId=com.siri.cortex.ace.speech.session.event.SpeechSessionId@50a8e246, Message=Timeout waiting for command after 30000 ms" UserInfo={NSLocalizedDescription=SessionId=com.siri.cortex.ace.speech.session.event.SpeechSessionId@50a8e246, Message=Timeout waiting for command after 30000 ms, NSUnderlyingError=0x170248c40 {Error Domain=SiriSpeechErrorDomain Code=100 "(null)"}}I have searched all over the internet and have set to find a solution to this. There also have been people with the same problem. Some people suspect that it's a problem with Nuance.It is also worth noting that I do get partial results from the transcription process.Here's the code from my iOS app.` // Create a speech recognizer request object. let srRequest = SFSpeechURLRecognitionRequest(url: location) srRequest.shouldReportPartialResults = false sr?.recognitionTask(with: srRequest) { (result, error) in if let error = error { // Something wrong happened print(error.localizedDescription) } else { if let result = result { print(4) print(result.bestTranscription.formattedString) if result.isFinal { print(5) transcript = result.bestTranscription.formattedString print(result.bestTranscription.formattedString) // Store the transcript into the database. print("\nSiri-Transcript: " + transcript!) // Store the audio transcript into Firebase Realtime Database self.firebaseRef = FIRDatabase.database().reference() let ud = UserDefaults.standard if let uid = ud.string(forKey: "uid") { print("Storing the transcript into the database.") let path = "users" + "/" + uid + "/" + "siri_transcripts" + "/" + date_recorded + "/" + filename.components(separatedBy: ".")[0] print("transcript database path: \(path)") self.firebaseRef.child(path).setValue(transcript) } } } } }`Thank you for your help.
Replies
6
Boosts
0
Views
4.9k
Activity
Mar ’23
AVSpeechSynthesizer not working in iOS 16 Beta
I am using below piece of code for TTS in iOS: let utterance = AVSpeechUtterance(string: "Hello World") utterance.voice = AVSpeechSynthesisVoice(language: "en-US") let synthesizer = AVSpeechSynthesizer() synthesizer.speak(utterance) It is working fine for iOS 15.6.1 and all lower versions. But the same code is giving below exception in iOS 16 Beta (latest beta 6 as well): [catalog] Unable to list voice folder The required voices are present in the iPhone and working properly in Voice Over and Spoken content. Even the voice API AVSpeechSynthesisVoice.speechVoices() is fetching all the voices, but I am getting above exception at line synthesizer.speak(utterance).
Replies
5
Boosts
4
Views
8.2k
Activity
Mar ’23
WebView doesn't play youtube after speech recognization
I use WKWebView to play embed youtube video, and also use SFSpeechRecognizer to recognize speech. But after recognize speech, webview does not play video. Please tell me how to fix it. 2023-03-04 15:27:14.100700+0900 SpeechRecognition[66390:23051497] [assertion] Error acquiring assertion: <Error Domain=RBSServiceErrorDomain Code=1 "(originator doesn't have entitlement com.apple.runningboard.assertions.webkit AND originator doesn't have entitlement com.apple.multitasking.systemappassertions)" UserInfo={NSLocalizedFailureReason=(originator doesn't have entitlement com.apple.runningboard.assertions.webkit AND originator doesn't have entitlement com.apple.multitasking.systemappassertions)}> 2023-03-04 15:27:14.100756+0900 SpeechRecognition[66390:23051497] [ProcessSuspension] 0x113000400 - ProcessAssertion::acquireSync Failed to acquire RBS assertion 'WebKit Media Playback' for process with PID=66392, error: Error Domain=RBSServiceErrorDomain Code=1 "(originator doesn't have entitlement com.apple.runningboard.assertions.webkit AND originator doesn't have entitlement com.apple.multitasking.systemappassertions)" UserInfo={NSLocalizedFailureReason=(originator doesn't have entitlement com.apple.runningboard.assertions.webkit AND originator doesn't have entitlement com.apple.multitasking.systemappassertions)} import UIKit import AVFAudio import Speech import MediaPlayer import WebKit class ViewController: UIViewController { @IBOutlet weak var startButton: UIButton! @IBOutlet weak var cancelButton: UIButton! var recognitionTask: SFSpeechRecognitionTask? = nil var webView: WKWebView! override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view. print("viewDidLoad") startButton.addTarget(self, action: #selector(StartSpeechRecognition), for: .touchUpInside) cancelButton.addTarget(self, action: #selector(StopSpeechRecognition), for: .touchUpInside) //startButton.addTarget(self, action: #selector(ChangeVolume), for: .touchUpInside) let webConfiguration = WKWebViewConfiguration() webConfiguration.allowsInlineMediaPlayback = true webView = WKWebView(frame: CGRect(x: 0, y: 0, width: 200, height: 200), configuration: webConfiguration) self.view.addSubview(webView) let myURL = URL(string: "https://www.youtube.com/embed/B7BxrAAXl94?playsinline=1") let myRequest = URLRequest(url: myURL!) webView.load(myRequest) } @objc public func StartSpeechRecognition() { let audioEngine = AVAudioEngine() // Configure the audio session for the app. let audioSession = AVAudioSession.sharedInstance() try? audioSession.setCategory(.record, mode: .measurement, options: .duckOthers) try? audioSession.setActive(true, options: .notifyOthersOnDeactivation) let inputNode = audioEngine.inputNode // Create and configure the speech recognition request. let recognitionRequest = SFSpeechAudioBufferRecognitionRequest() recognitionRequest.shouldReportPartialResults = true // Configure the microphone input. let recordingFormat = inputNode.outputFormat(forBus: 0) inputNode.installTap(onBus: 0, bufferSize: 1024, format: recordingFormat) { (buffer: AVAudioPCMBuffer, when: AVAudioTime) in recognitionRequest.append(buffer) } audioEngine.prepare() try? audioEngine.start() // Create a recognition task for the speech recognition session. // Keep a reference to the task so that it can be canceled. guard let speechRecognizer = SFSpeechRecognizer(locale: Locale(identifier: "ja-JP")) else { return } print("Start Recognize") recognitionTask = speechRecognizer.recognitionTask(with: recognitionRequest) { result, error in var isFinal = false if let result = result { // Update the text view with the results. isFinal = result.isFinal print("Text \(result.bestTranscription.formattedString)") } if error != nil || isFinal { // Stop recognizing speech if there is a problem. audioEngine.stop() inputNode.removeTap(onBus: 0) print("Stop") print(self.recognitionTask?.isFinishing) self.recognitionTask = nil } } } @objc public func StopSpeechRecognition() { guard let recognitionTask = recognitionTask else { return } recognitionTask.finish() } }
Replies
0
Boosts
0
Views
1.1k
Activity
Mar ’23
How to get Transcription for less than 1 minute of Audio Data using SFSpeechRecognizer Api.
Why SfSpeechRecognizer is not returning Transcription properly for less than 1 minute of Audio if we are Sending Audio Data to Server. we know 1 minute of limitation is there for server . That's why i m adding some Silence to Audio File for making it exact 1 minute. it is returning Transcription (Some Segment) but not properly. it is skipping some Substring from the middle part. if i m Keeping Same Audio File(after Adding Silence) on OnDeviceSpeechRecognition ,it is working properly. so, what can i do in this situation if we want transcription from server. Does anybody knows here anything about this? Thanks.
Replies
0
Boosts
0
Views
673
Activity
Mar ’23
AVSpeechUtterance speed up or partial play
Hello, In car navigation application I experience TTS glitches. Most likely because audio is processed on GPU at the same time as it renders map. Is there a way to solve that? My first guess is to pre-create AVSpeechUtterance, and then send this object to speak when it's time to speak this phrase. Does it makes sense?
Replies
0
Boosts
0
Views
1k
Activity
Feb ’23
iPAD & iOS 15 - webkitSpeechRecognition not working
Apple added support for WebKit speech recognition in Safari 14.1. We're trying to use it in our WebApp and facing some issues. The issue is mic never stops after the user stops speaking and we never get the recognized text on iPhone and iPad. Here is a simple WebApp to test : https://oiyw7.csb.app/
Replies
1
Boosts
3
Views
3k
Activity
Feb ’23
ContextualStrings
Hi, did anyone make contextualStrings work? I would love to use it in various languages but it does not work at all. What I want to do in my app is make it able to recognise e.g. „Quintsextakkord“ oder „F-Dur“ „B-flat Minor“ or „sixth-fifth chord“ etc. Any hints? Thanks
Replies
0
Boosts
0
Views
576
Activity
Feb ’23
Teach SFSpeechRecognizer custom words (medication names, chemistry terms, etc)
Hi, I have a question regarding the integration of the speech to text library called SFSpeechRecognizer. I need SFSpeechRecognizer to recognize terms that are not present in the iOS dictionary like medication names, chemistry terms, etc. I would have to add them, somehow, for SFSpeechRecognizer to be able to recognise them. Is this possible? Thanks
Replies
2
Boosts
0
Views
1.6k
Activity
Feb ’23
Contextual Strings not working for on-device speech recognition.
I've noticed that contextual strings do not work for on-device speech recognition. I've written a Feedback entry: FB7496068 To reproduce: Create a basic app that transcribes speech. Add “Flubbery Dubbery” or a made up couple of words to a strings array and set it equal to the contextualStrings property of SFSpeechAudioBufferRecognitionRequest For the recognition request being used, set the requiresOnDeviceRecognition Boolean property to true. Transcribe audio and say the made up couple of words. See that the device never correctly transcribes the made up couple of words. Now set the requiresOnDeviceRecognition Boolean to false. Transcribe audio and say the made up words. See that the device correctly transcribes the made up words. Has anyone else run into this problem? I would love a fix. PS, I noticed that if you add a custom word as a contact in the Contacts app, then on-device recognition picks it up. So it seems it's possible, just not implemented quite right.
Replies
2
Boosts
0
Views
1.5k
Activity
Feb ’23
XCode 14 & iOS 16 Beta: No AVSpeechSynthesisVoice.speechVoices available
I'm testing my App in the Xcode 14 beta (released with WWDC22) on iOS 16, and it seems that AVSpeechSynthesisVoice is not working correctly. The following code always returns an empty array: AVSpeechSynthesisVoice.speechVoices() Additionally, attempting to initialize AVSpeechSynthesisVoice returns nil for all of the following: AVSpeechSynthesisVoice(language: AVSpeechSynthesisVoice.currentLanguageCode()) AVSpeechSynthesisVoice(language: "en") AVSpeechSynthesisVoice(language: "en-US") AVSpeechSynthesisVoice(identifier: AVSpeechSynthesisVoiceIdentifierAlex) AVSpeechSynthesisVoice.speechVoices().first
Replies
15
Boosts
3
Views
5.1k
Activity
Feb ’23
Can't hear audio in VoIP call when i grant media permission to webView
VoIP call works perfectly fine at start until i grant access to WKWebView media(microphone access). I am using WKWebView to highlight the spoken word using web speech engine. If i use webView i can't hear VoIP call audio and if i stop webView VoIP call works perfectly fine. What i want to achieve is to stay in VoIP call as well as work with webView to highlight the spoken words and I want to know if there is any problem in giving microphone access to VoIP as well as WKWebView simultaneously. Please post your question if i am not clear about anything or you want to know more information.
Replies
0
Boosts
0
Views
631
Activity
Feb ’23
iOS 16 TTS is horrible, it doesn’t work!
iOS 15 Siri voices worked perfectly. However, iOS 16 has a lot of issues - such as skipping words and sentences, and stopping reading all together. Obviously, this is a problem with the TTS I myself use Siri to read books while driving, but I regret updating to iOS 16. I went as far as upgrading my iPhone SE to my iPhone 14 Pro thinking it was the memory issue, but it's the same issue on both phones even my Mac M1 Pro with 16Gigs has same issues. https://youtu.be/g58nbW4J0DY It would be nice to receive and update or even a roll back to iOS 15 state of TTS
Replies
3
Boosts
1
Views
2.6k
Activity
Jan ’23
Switch voice on AVSpeechSynthesizer is causing "[AXTTSCommon] Invalid rule"
Simplifying, if I implement a code like the following let utterance = AVSpeechUtterance(string: "Hello world.") utterance.voice = AVSpeechSynthesisVoice(language: "en-GB") self.synthesizer.speak(utterance) let utterance = AVSpeechUtterance(string: "Hola mundo.") utterance.voice = AVSpeechSynthesisVoice(language: "es-ES") self.synthesizer.speak(utterance) After the second speak, I get the following error messages from the console [AXTTSCommon] Invalid rule: /(?<!\d|\d\s)(1\/2\s?)(mm|cm|m|m²|m2|m³|m3|km|km²|km2|km³|km3|mg|g|kg|l|ml)\b/i --> "M_FRACTION_OF_$1 EXPANSION_SG_OF_$2" # 1/2 mm --> medio milímetro [AXTTSCommon] Invalid rule: /(?<!\d|\d\s)(\d\/\d\s?)(mm|cm|m|m²|m2|m³|m3|km|km²|km2|km³|km3|mg|g|kg|l|ml)\b/i --> "M_FRACTION_OF_$1 de EXPANSION_SG_OF_$2" # 1/4 km² --> un cuarto de kilómetro cuadrado" [AXTTSCommon] Invalid rule: /(?<=\d\s)(\d\/\d\s?)(mm|cm|m|m²|m2|m³|m3|km|km²|km2|km³|km3|mg|g|kg|l|ml)\b/i --> "$2 y M_FRACTION_OF_$1" # 1/6m --> un sexto de metro [AXTTSCommon] Invalid rule: /(1\/2\s)(milímetro|centímetro|metro|metro cuadrado|metro cúbico|kilómetro|kilómetro cuadrado|kilómetro cúbico|miligramo|gramo|kilo|kilogramo|mililitro|litro)\b/i --> "M_FRACTION_OF_$1 $2" # 1/2 milímetro --> medio milímetro [AXTTSCommon] Invalid rule: /(milímetros?|centímetros?|metros?|metros? cuadrados?|metros? cúbicos?|kilómetros?|kilómetros? cuadrados?|kilómetros? cúbicos?|miligramos?|gramos?|kilos?|kilogramos?|mililitros?|litros?)\sy?\s?(1\/2)\b/i --> "$1 y M_FRACTION_OF_$2" # 3 metros y 1/2 --> tres metros y medio [AXTTSCommon] Invalid rule: /M_FRACTION_OF_1\/2/ --> "medio" # 1/2 m --> medio metro [AXTTSCommon] Invalid rule: /(?<!\d|\d\s)(\d\/\d\s?)(milímetros?|centímetros?|metros?|metros? cuadrados?|metros? cúbicos?|kilómetros?|kilómetros? cuadrados?|kilómetros? cúbicos?|miligramoS?|gramos?|kilos?|kilogramos?|mililitros?|litros?)\b/i --> "M_FRACTION_OF_$1 de $2" # 1/4 kilómetro --> un cuarto de kilómetro [AXTTSCommon] Invalid rule: /(?<=\d\s)(\d\/\d\s?)(milímetros?|centímetros?|metros?|metros? cuadrados?|metro cúbicos?|kilómetros?|kilómetros? cuadrados?|kilómetros? cúbicos?|miligramos?|gramos?|kilos?|kilogramos?|mililitros?|litros?)\b/i --> "$2 y M_FRACTION_OF_$1" # 2 1/4 kilómetros --> dos kilómetros y un cuarto [AXTTSCommon] Invalid rule: /(milímetros?|centímetros?|metros?|metro cuadrados?|metro cúbicos?|kilómetros?|kilómetro cuadrados?|kilómetro cúbicos?|miligramos?|gramos?|kilos?|kilogramos?|mililitros?|litros?)\sy?\s?(\d\/\d\s?)/ --> "$1 y M_FRACTION_OF_$2" # 2 milímetros y 1/2 --> dos milímetros y medio [AXTTSCommon] Invalid rule: /M_FRACTION_OF_(\d\/\d)/ --> "\e\\tn=fraction\\$1\e\\tn=normal\\" # 1/4 --> un cuarto [AXTTSCommon] Invalid rule: /(?<!\d|\d\s)(\d\/\d\s)(?=de (pan|masa|taza|hora)\b)/i --> "\e\\tn=fraction\\$1\e\\tn=normal\\" # 1/4 de pan --> un cuarto de pan [AXTTSCommon] Invalid rule: /(?<!\d|\d\s)(\d\/\d\s)(?=de (milímetros?|centímetros?|metros?|metro cuadrados?|metro cúbicos?|kilómetros?|kilómetro cuadrados?|kilómetro cúbicos?|miligramos?|gramos?|kilos?|kilogramos?|mililitros?|litros?)\b)/i --> "\e\\tn=fraction\\$1\e\\tn=normal\\" # 1/4 de metro --> un cuarto de metro [AXTTSCommon] Invalid rule: /(?<!\d|\d\s)(\d\/\d\s)/ --> "\e\\tn=fraction\\$1\e\\tn=normal\\" # catch-all rule for fractions, to avoid "1/4" --> "uno cuatro" The final behavior is correct, the expression is reproduced despite de console messages. However, after approximately 400 iterations the application consumes all memory resources in processes related to AXTTSCommon and Regex.
Replies
4
Boosts
0
Views
2.1k
Activity
Jan ’23