A device voice now has a tier, or a reason it is never used, decided from what the browser exposes (its name, identifier and language) and the platform, never from `default` or `localService` alone (WebKit sets both on every voice): - Rejected: a voice that sends the words away (not on the device, "Online", "-network"), eSpeak, Linux speech-dispatcher, Apple's Eloquence voices (Eddy, Flo, Grandma...), novelty voices (Readium's list, and Fred, Junior, Kathy and Ralph) and Apple's super-compact voices. - Premium: Apple Premium (identifier, or its marker in the interface language), a local "(Natural)" voice, or one Readium rates high (Google's natural voices on ChromeOS among them). - Enhanced: Apple Enhanced, or an Android speech engine's voice (Android Chrome lists them under localized names, so the platform comes in). - Basic: Apple compact, Microsoft's desktop voices (David, Zira, Mark...), other "Chrome OS" voices, anything unknown. rank_voices orders a language's usable voices by tier, then the region asked for, the language's usual region, Readium's order. choose_voice gives the person's chosen voice while the device has it, else the best that may speak unasked (premium or enhanced), else none. SystemVoice gains the identifier (voiceURI); Platform reads the user agent (iPadOS Safari says it is a Mac: touch points tell them apart). earlier_choice keeps the old ranking, to keep the voice of someone who was speaking with it; the app still uses it until the next commit. The facts come from Readium Speech v0.13.0 (npm latest; its json/ is byte-identical to v0.11.0's), voice data CC0 and code BSD-3-Clause. third_party/readium-speech/generate.py reads the pinned commit's files, checks their digest, and writes them as Rust tables (access-core/src/voice/readium.rs): nothing is fetched at run time. Tests use voice lists as iPad and Mac Safari, Mac Chrome, Windows Chrome and Edge, ChromeOS, Android Chrome and Linux give them. Co-Authored-By: Claude Opus 5.5 <[email protected]>
28 lines
1.5 KiB
Text
28 lines
1.5 KiB
Text
BSD 3-Clause License
|
|
|
|
Copyright (c) 2024, Readium Foundation
|
|
|
|
Redistribution and use in source and binary forms, with or without
|
|
modification, are permitted provided that the following conditions are met:
|
|
|
|
1. Redistributions of source code must retain the above copyright notice, this
|
|
list of conditions and the following disclaimer.
|
|
|
|
2. Redistributions in binary form must reproduce the above copyright notice,
|
|
this list of conditions and the following disclaimer in the documentation
|
|
and/or other materials provided with the distribution.
|
|
|
|
3. Neither the name of the copyright holder nor the names of its
|
|
contributors may be used to endorse or promote products derived from
|
|
this software without specific prior written permission.
|
|
|
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|