avspeechsynthesizer

AVSpeechSynthesizer - If AVSpeechSynthesizer is Speaking & if has stopped speaking

百般思念 提交于 2019-12-12 02:01:32
问题 I want to display a view on my app whilst AVSpeechSynthesizer is speaking, and for the view to disappear when it has stopped speaking. -(void)speakText { AVSpeechSynthesizer *synthesizer = [[AVSpeechSynthesizer alloc] init]; float speechSpeed = 0.12; AVSpeechUtterance *synUtt = [[AVSpeechUtterance alloc] initWithString:textString]; [synUtt setRate:speechSpeed]; [synUtt setVoice:[AVSpeechSynthesisVoice voiceWithLanguage:selectedVoice]]; [synthesizer speakUtterance:synUtt]; //BELOW TO APPEAR

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 =

Can we give a custom voice to AVSpeechSynthesizer

一世执手 提交于 2019-12-10 17:48:41
问题 Hi I am developing an IOS application and I want to convert text to speech. For this I am using IOS AVSpeechSynthesizer SDK. My question is that can we give it our custom voice other than the defaults voices of IOS. For example can I give the voice of a child speaking a string? Or there is another SDK for that? And AVSpeechSynthesizer is only for IOS7 or can it work on IOS 6 as well? 回答1: You'd need to license a third-party speech synthesizer for that - it's not possible with anything Apple

How to play AVSpeechSynthesizer through call receiver speaker?

▼魔方 西西 提交于 2019-12-10 13:25:42
问题 I like to play audio through the call receiver speaker ,currently i am using this for play some text as a audio . AVSpeechUtterance *utterance = [AVSpeechUtterance speechUtteranceWithString:_strTextCheck]; AVSpeechSynthesizer *syn = [[AVSpeechSynthesizer alloc] init]; [syn speakUtterance:utterance]; I got but this is not for AVSpeechSynthesizer: [AVAudioSession overrideOutputAudioPort:AVAudioSessionPortOverrideSpeaker error:&error]; Correctly its working on a normal speaker but i want to make

AVSpeechSynthesizer errors in iOS 10

不打扰是莪最后的温柔 提交于 2019-12-09 19:17:23
问题 I'm currently creating a text-to-speech app using AVSpeechSynthesizer() . It's working fine in iOS 9 but has the following error in iOS 10: Could not get attribute 'LocalURL': Error Domain=MobileAssetError Code=1 "Unable to copy asset attributes" UserInfo={NSDescription=Unable to copy asset attributes} Does anyone know what's going on here? static let speechSynthesizer = AVSpeechSynthesizer() static func speak(text: String) { if speechSynthesizer.isSpeaking { speechSynthesizer

How to know when an AVSpeechUtterance has finished, so as to continue app activity?

拟墨画扇 提交于 2019-12-08 10:38:12
问题 When an AVSpeechUtterance is speaking, I want to wait until it's finished before doing something else. There is a property of AVSpeechSynthesizer that's seemingly indicative of when speech is occuring: isSpeaking As stupid and simple as this question might sound, I'm wondering how do I use/check this property to wait until speech has concluded before going on? ALTERNATIVELY: There's a delegate, that I'm also clueless as to how to use, which has an ability to do something when an utterance has

Using AVSpeechSynthesizer/AVSpeechUtterance for Text-To-Speech will not work if SpeakSelection is not enabled in device's Accessiblity settings

三世轮回 提交于 2019-12-08 05:48:56
问题 I use AVSpeechSynthesizer and AVSpeechUtterance for text-to-speech. It works fine, but the User must enable SpeakSelection feature in his/her device's accessibility settings. Is there a way to do it for them, or at least check the settings and warn them? 回答1: Maybe you can try to say something, attach delegate and measure duration of speaking. If duration of speaking out yours text is near zero, user should check settings/download voice or so! 来源: https://stackoverflow.com/questions/26181764

Using AVSpeechSynthesizer/AVSpeechUtterance for Text-To-Speech will not work if SpeakSelection is not enabled in device's Accessiblity settings

落花浮王杯 提交于 2019-12-08 05:16:19
I use AVSpeechSynthesizer and AVSpeechUtterance for text-to-speech. It works fine, but the User must enable SpeakSelection feature in his/her device's accessibility settings. Is there a way to do it for them, or at least check the settings and warn them? Maybe you can try to say something, attach delegate and measure duration of speaking. If duration of speaking out yours text is near zero, user should check settings/download voice or so! 来源: https://stackoverflow.com/questions/26181764/using-avspeechsynthesizer-avspeechutterance-for-text-to-speech-will-not-work-if

AVSpeechSynthesizer iOS 8 Issues

≯℡__Kan透↙ 提交于 2019-12-08 02:34:34
问题 Since upgrading to xCode 6 and iOS 8 I've noticed serious issues with AVSpeechSynthesizer. Prior to the upgrade, it worked perfectly, but now, several issues have risen. Speech Utterances are playing at a much faster rate then how they were prior to upgrade. When I queue up 2 speech utterances, it simply skips over the first utterance and plays the second one first. (This only occurs on the first run of the speech synthesizer. The second run and on works properly.) Please, any help would be

AVAudioSession mixing with AVSpeechUtterance

青春壹個敷衍的年華 提交于 2019-12-06 12:41:33
问题 I have an issue where I would like to have the iPod playing music in the background and in my application I would like to have AVSpeechUtterance lower the volume of the iPod, play a string of text and then I would like to have the iPod resume playing. I have tried several things but never had AVAudioSession and AVSpeechUtterance work well together. I can get the iPod to stop, pause for a bit and then start playing again. I can see my string being passed to AVSpeechUtterance , but it does not