Text to Speech for Native iOS Apps with SwiftUI

Text to Speech for Native iOS Apps with SwiftUI

MissCoding

2 года назад

8,265 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

@eshalkhan3439
@eshalkhan3439 - 28.12.2023 20:19

I cant hear any greeting in my code... anyone knows how to fix that?

Ответить
@bbalthaz
@bbalthaz - 22.07.2023 00:30

I receive numerous errors when running in Xcode Version 15.0 beta 4 (15A5195m)

Speech Error: Error Domain=NSCocoaErrorDomain Code=260 "The folder “TTSPlugins” doesn’t exist." UserInfo={NSUserStringVariant=(
Folder
), NSFilePath=/Library/Developer/CoreSimulator/Volumes/iOS_21A5277g/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 17.0.simruntime/Contents/Resources/RuntimeRoot/System/Library/TTSPlugins, NSUnderlyingError=0x600000cb2820 {Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory"}}
AddInstanceForFactory: No factory registered for id <CFUUID 0x6000002bba20> F8BB1C28-BAE8-11D6-9C31-00039315CD46
Failed to get sandbox extensions

Ответить
@macrobionic
@macrobionic - 29.01.2023 06:39

Thanks for your sample code. I needed to move the "synthesizer" declaration to just after the "import AVFoundation to get it to work in iOS 16.3 beta. I assume they will fix it soon.

import AVFoundation
let synthesizer = AVSpeechSynthesizer()

Ответить
@Enzo-sp3bf
@Enzo-sp3bf - 18.12.2022 12:59

Thanks for the video : ) It helps a lot.

I am working on this feature right now, just some update:

After ios15 or 16 (stackoverflow said 16, but I faced the same issue on 15), the "let synthesizer = AVSpeechSynthesizer()" should be outside the func to make it work.

For example, if it is declared on the View, then put it outside the "var body : some view".
And if it is declared in a class, it should be in the class but outside the func

Ответить
@natgenesis5038
@natgenesis5038 - 02.09.2022 06:03

Great video wow, what about the opposite ? Speech to Text ???

Ответить
@lindahassard9162
@lindahassard9162 - 06.07.2022 12:39

A great introduction to text to speech and well explained

Ответить