swifttext-to-speechavspeechutterance

Swift Text-To-Speech - pronunciation


how I can set pronunciation for 1 word in AVSpeechUtterance? for example - read [ri:d], read [red], read [red] spelled the same but pronounced differently

AVSpeechUtterance(string: "read") // in second form, how?

Solution

  • You can use an attributed string with International Phonetic Alphabet pronunciation attached by way of the AVSpeechSynthesisIPANotationAttribute key.