https://github.com/ryanlintott/oevoice
Old English text-to-speech using AVSpeechSynthesis and IPA pronunciations.
https://github.com/ryanlintott/oevoice
avfoundation avspeechsynthesizer international-phonetic-alphabet ipa swift text-to-speech
Last synced: 10 months ago
JSON representation
Old English text-to-speech using AVSpeechSynthesis and IPA pronunciations.
- Host: GitHub
- URL: https://github.com/ryanlintott/oevoice
- Owner: ryanlintott
- License: mit
- Created: 2021-07-29T18:41:41.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2025-05-24T05:10:37.000Z (about 1 year ago)
- Last Synced: 2025-07-25T06:30:10.027Z (11 months ago)
- Topics: avfoundation, avspeechsynthesizer, international-phonetic-alphabet, ipa, swift, text-to-speech
- Language: Swift
- Homepage:
- Size: 299 KB
- Stars: 24
- Watchers: 3
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README

[](https://swiftpackageindex.com/ryanlintott/OEVoice)
[](https://swiftpackageindex.com/ryanlintott/OEVoice)



[](http://mastodon.social/@ryanlintott)
[](http://twitter.com/ryanlintott)
# Overview
AVSpeechSynthesis for Old English with IPA pronunciations.
# Demo App
The `Example` folder has an app that demonstrates the features of this package.
# Installation and Usage
This package is compatible with iOS 14+.
1. In Xcode go to `File -> Add Packages`
2. Paste in the repo's url: `https://github.com/ryanlintott/OEVoice` and select by version.
3. Import the package using `import OEVoice`
# Platforms
This package is compatible with iOS 14 or later.
# Is this Production-Ready?
Really it's up to you. I currently use this package in my own [Old English Wordhord app](https://oldenglishwordhord.com/app).
Additionally, if you find a bug or want a new feature add an issue and I will get back to you about it.
# Support
OEVoice is open source and free but if you like using it, please consider supporting my work.
[](https://ko-fi.com/X7X04PU6T)
- - -
# Details
Use
`AVSpeechSynthesizerIPA`
instead of
`AVSpeechSynthesizer`
to access
`speakIPA(_ ipaString: String, voice: AVSpeechSynthesisVoice, willSpeak: ((String) -> Void)? = nil)`
There are 3 options for initializing `AVSpeechSynthesizerIPA`
1. `AVSpeechSynthesizerIPA.oeSupported` - Use this to ensure an OEVoice supported language is set.
2. `AVSpeechSynthesizerIPA.init(language: String)` - Force a language of your choice.
3. `AVSpeechSynthesizerIPA.init?(languages: [String])` - Provide a list of language options.
## Why must a language be provided?
Somewhere in the internals of `AVspeechSynthesizer`'s `speak()` function, a language value is set the first time it's run. Instead of using the language supplied by `AVSpeechSynthesisVoice` used in `AVSpeechUtterance`, it accesses the user's preferred languages (probably via the UserDefaults key `AppleLanguages`. If the preferred language does not match the voice language, speech using IPA will not be at all accurate. Sounds will be mispronounced, some chatacters will be read as their character name instead of their sound, and some characters will be ignored.
I have reported this as a bug (FB9688443). Ideally `speak()` would only use the language of the supplied voice each time it's run and would not need to reference the user's preferred langauges.
The init for `AVspeechSynthesizerIPA` ensures the pronunciations are accurate even on devices with incompatible primary languages. If the user's first preferred language is incompatible, their preferred languages in UserDefaults will temporarily be changed to the desired language, `speak()` is run on an empty string, and the languages are changed back again.