sfspeechrecognizer

Get voice amplitude from SFSpeechRecognizer

こ雲淡風輕ζ 提交于 2019-12-23 17:14:53
问题 Im using this library https://github.com/appcoda/SpeechToTextDemo to transcript voice to text I want to have the real voice amplitude to show graph of voice with this library https://github.com/alankarmisra/SwiftSiriWaveformView i dont know how to get this value from the first library 回答1: I am not sure if you can get that from Speech kit but I made something similar where I combined speech recogniser and AVAudioRecorder and got the self.audioRecorder?.averagePower which I used to update

Swift: iPhone's volume is low when trying to change speech to iPhone's voice in swift

谁说我不能喝 提交于 2019-12-21 04:25:28
问题 I am trying Speech recognition sample. If I started to recognise my speech via microphone, then I tried to get iPhone's voice of that recognised text. It is working. But, voice is too low. Can u guide me on this? Rather than, if I am trying in simple button action, with AVSpeechUtterance code, volume is normal. After that, If I go for startRecognise() method, volume is too low. My Code func startRecognise() { let audioSession = AVAudioSession.sharedInstance() //2 do { try audioSession

AVAudioEngine inputNode installTap crash when restarting recording

空扰寡人 提交于 2019-12-18 04:40:07
问题 I am implementing Speech Recognition in my app. When I first present the view controller with the speech recognition logic, everything works fine. However, when I try present the view controller again, I get the following crash: ERROR: [0x190bf000] >avae> AVAudioNode.mm:568: CreateRecordingTap: required condition is false: IsFormatSampleRateAndChannelCountValid(format) *** Terminating app due to uncaught exception 'com.apple.coreaudio.avfaudio', reason: 'required condition is false:

AVSpeechRecognizer: required condition is false: _recordingTap == nil error in Swift3

吃可爱长大的小学妹 提交于 2019-12-12 17:50:56
问题 I have no idea why I have this error. The error I got is Terminating app due to uncaught exception 'com.apple.coreaudio.avfaudio', reason: 'required condition is false: _recordingTap == nil' UPDATE Actually, this works, but after several times, suddenly the button is disabled and the mic no longer is in action. Then it causes the error and get crashed. Could you please help me with this? class ViewController: UIViewController, SFSpeechRecognizerDelegate, UITextViewDelegate,

Implementing “user stopped speaking” notification for `SFSpeechRecognizer`

妖精的绣舞 提交于 2019-12-11 05:51:26
问题 I'm attempting to solve this problem: SFSpeechRecognizer - detect end of utterance The problem is that SFSpeechRecognizer callback fires every time the detected speech string changes, but it only fires after 60 seconds of silence (whereupon it sets the isFinal flag). The suggested technique is to start a 2 second timer each time to callback fires, first invalidating the timer if it is already set. I have implemented this technique. However at my timer callback is never getting hit. Can anyone

Volume has dropped significantly in text to speech since adding speech to text (speech recognition)

半腔热情 提交于 2019-12-11 04:52:41
问题 The volume in the view controller with the label has become extremely quiet even when just transferring text from the UITextView to the UILabel. Almost evrything is working perfectly apart from the volume issue. Speech Class File: import UIKit import AVFoundation class TextToSpeech { private let synthesizer = AVSpeechSynthesizer() var Rate: Float = AVSpeechUtteranceDefaultSpeechRate var Voice = AVSpeechSynthesisVoice(language: "en-US") func Say(_ phrase: String) { let Utterance =

SFSpeechRecognizer kAFAssistantErrorDomain Code=203 “Retry”

左心房为你撑大大i 提交于 2019-12-07 11:14:21
问题 I use SFSpeechRecognizer, basically to work. 1.But sometimes the following error occurs. And mostly before I did not execute avStop() . [Utility] +[AFAggregator logDictationFailedWithError:] Error Domain=kAFAssistantErrorDomain Code=203 "Retry" UserInfo={NSLocalizedDescription=Retry, NSUnderlyingError=0x1c464b880 {Error Domain=SiriSpeechErrorDomain Code=1 "(null)"}} 2.And completely unable to work in the background, will produce the following error. [Utility] +[AFAggregator

iOS 10.0 Speech Recognition Error kAFAssistantErrorDomain

十年热恋 提交于 2019-12-07 01:29:10
问题 I try using speech recognition as below let urlpath = Bundle.main().pathForResource("myvoice2", ofType: "m4a") let url:URL = URL.init(fileURLWithPath: urlpath!) let recognizer = SFSpeechRecognizer() let request = SFSpeechURLRecognitionRequest(url: url) recognizer?.recognitionTask(with: request, resultHandler: { (result, error) in print (result?.bestTranscription.formattedString) }) The result is nil, I debug and see the error as below Error Domain=kAFAssistantErrorDomain Code=1101 "(null)" Do

iOS 10.0 Speech Recognition Error kAFAssistantErrorDomain

♀尐吖头ヾ 提交于 2019-12-05 05:59:53
I try using speech recognition as below let urlpath = Bundle.main().pathForResource("myvoice2", ofType: "m4a") let url:URL = URL.init(fileURLWithPath: urlpath!) let recognizer = SFSpeechRecognizer() let request = SFSpeechURLRecognitionRequest(url: url) recognizer?.recognitionTask(with: request, resultHandler: { (result, error) in print (result?.bestTranscription.formattedString) }) The result is nil, I debug and see the error as below Error Domain=kAFAssistantErrorDomain Code=1101 "(null)" Do you have any idea? I have the same error, but identical code worked fine on device. So, install iOS 10

Swift Numbers Name Text to Int

走远了吗. 提交于 2019-12-02 11:47:35
问题 I just implemented SFSpeechRecognizer, because I want it to dictate some numbers, but the issue that I'm encountering is that if I say "one" the result.bestTranscription.formattedString is "one", but if I say "ten" the result throws "10", how can I manage to get single digit numbers to be represented by the actual number not the symphonic "one". 回答1: You can use NumberFormatter setting numberStyle to .spellOut and use its number(from: String) to convert your string to number. If you need a