{"id":29062074,"url":"https://github.com/readium/speech","last_synced_at":"2025-10-29T09:52:30.785Z","repository":{"id":251067263,"uuid":"836299348","full_name":"readium/speech","owner":"readium","description":"💬 A TypeScript library for implementing read aloud on the Web","archived":false,"fork":false,"pushed_at":"2025-10-17T12:44:11.000Z","size":385,"stargazers_count":7,"open_issues_count":13,"forks_count":2,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-10-18T15:45:22.392Z","etag":null,"topics":["a11y","accessibility","read-aloud","readium","synthetic-speech","text-to-speech","tts","typescript","web-speech","web-speech-api"],"latest_commit_sha":null,"homepage":"http://readium.org/speech/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/readium.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-07-31T14:52:49.000Z","updated_at":"2025-10-17T12:33:06.000Z","dependencies_parsed_at":"2024-07-31T18:29:34.603Z","dependency_job_id":"57e76798-4be0-4df6-acb4-6267f2dbaf73","html_url":"https://github.com/readium/speech","commit_stats":null,"previous_names":["readium/speech"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/readium/speech","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/readium%2Fspeech","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/readium%2Fspeech/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/readium%2Fspeech/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/readium%2Fspeech/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/readium","download_url":"https://codeload.github.com/readium/speech/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/readium%2Fspeech/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":281600619,"owners_count":26528905,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-29T02:00:06.901Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["a11y","accessibility","read-aloud","readium","synthetic-speech","text-to-speech","tts","typescript","web-speech","web-speech-api"],"created_at":"2025-06-27T08:38:01.270Z","updated_at":"2025-10-29T09:52:30.779Z","avatar_url":"https://github.com/readium.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Readium Speech\n\nReadium Speech is a TypeScript library for implementing a read aloud feature with Web technologies. It follows [best practices](https://github.com/HadrienGardeur/read-aloud-best-practices) gathered through interviews with members of the digital publishing industry.\n\nWhile this project is still in a very early stage, it is meant to power the read aloud feature for two different Readium projects: [Readium Web](https://readium.org/guided-navigation) and [Thorium](https://thorium.edrlab.org/).\n\nReadium Speech was spun out as a separate project in order to facilitate its integration as a shared component, but also because of its potential outside of the realm of ebook reading apps.\n\n## Scope\n\n* Extracting [Guided Navigation objects](https://readium.org/guided-navigation) from a document (or a fragment of a document)\n* Generating utterances from these Guided Navigation objects\n* Processing utterances (prepending/appending text to utterances based on context, pronunciation through SSML/PLS…)\n* Voice selection\n* TTS playback\n* Highlighting\n\n## Current focus\n\nFor our initial work on this project, we're focusing on voice selection based on [recommended voices](https://github.com/HadrienGardeur/web-speech-recommended-voices).\n\nThe outline of this work has been explored in a [GitHub discussion](https://github.com/HadrienGardeur/web-speech-recommended-voices/discussions/9) and through a [best practices document](https://github.com/HadrienGardeur/read-aloud-best-practices/blob/main/voice-selection.md).\n\n## Demo\n\n[A live demo](https://readium.org/speech/demo/) of the voice selection API is available.\n\nIt demonstrates the following features:\n\n- fetching a list of all available languages, translating them to the user's locale and sorting them based on these translations\n- returning a list of voices for a given language, grouped by region and sorted based on quality\n- filtering languages and voices based on gender and offline availability\n- using embedded test utterances to demo voices\n\n## QuickStart\n\n`npm install https://github.com/readium/speech#build`\n\n```\nimport { voicesSelection} from \"readium-speech\";\nconsole.log(voicesSelection);\n\n// or with cjs only : \nconst { getVoices } = require(\"readium-speech/cjs/voices.js\");\nconsole.log(getVoices);\n\n// or with esm mjs :\nimport { getVoices } from \"readium-speech/mjs/voices.js\";\nconsole.log(getVoices);\n\nconst voices = await voicesSelection.getVoices();\nconsole.log(voices);\n\n```\n\n## API\n\n### Interface \n\n```\nexport interface IVoices {\n    label: string;\n    voiceURI: string;\n    name: string;\n    language: string;\n    gender?: TGender | undefined;\n    age?: string | undefined;\n    offlineAvailability: boolean;\n    quality?: TQuality | undefined;\n    pitchControl: boolean;\n    recommendedPitch?: number | undefined;\n    recommendedRate?: number | undefined;\n}\n\nexport interface ILanguages {\n    label: string;\n    code: string;\n    count: number;\n}\n```\n\n#### Parse and Extract IVoices from speechSynthesis WebAPI\n```\nfunction getVoices(preferredLanguage?: string[] | string, localization?: string): Promise\u003cIVoices[]\u003e\n```\n\n#### List languages from IVoices\n```\nfunction getLanguages(voices: IVoices[], preferredLanguage?: string[] | string, localization?: string | undefined): ILanguages[]\n```\n\n#### helpers\n\n```\nfunction listLanguages(voices: IVoices[], localization?: string): ILanguages[]\n\nfunction ListRegions(voices: IVoices[], localization?: string): ILanguages[]\n\nfunction parseSpeechSynthesisVoices(speechSynthesisVoices: SpeechSynthesisVoice[]): IVoices[]\n\nfunction getSpeechSynthesisVoices(): Promise\u003cSpeechSynthesisVoice[]\u003e\n```\n\n#### groupBy\n\n```\nfunction groupByKindOfVoices(allVoices: IVoices[]): TGroupVoices\n\nfunction groupByRegions(voices: IVoices[], language: string, preferredRegions?: string[] | string, localization?: string): TGroupVoices\n\nfunction groupByLanguage(voices: IVoices[], preferredLanguage?: string[] | string, localization?: string): TGroupVoices\n```\n\n#### sortBy\n\n```\nfunction sortByLanguage(voices: IVoices[], preferredLanguage?: string[] | string): IVoices[]\n\nfunction sortByRegion(voices: IVoices[], preferredRegions?: string[] | string, localization?: string | undefined): IVoices[]\n\nfunction sortByGender(voices: IVoices[], genderFirst: TGender): IVoices[]\n\nfunction sortByName(voices: IVoices[]): IVoices[]\n\nfunction sortByQuality(voices: IVoices[]): IVoices[]\n```\n\n#### filterOn\n\n```\nfunction filterOnRecommended(voices: IVoices[], _recommended?: IRecommended[]): TReturnFilterOnRecommended\n\nfunction filterOnVeryLowQuality(voices: IVoices[]): IVoices[]\n\nfunction filterOnNovelty(voices: IVoices[]): IVoices[]\n\nfunction filterOnQuality(voices: IVoices[], quality: TQuality | TQuality[]): IVoices[]\n\nfunction filterOnLanguage(voices: IVoices[], language: string | string[]): IVoices[]\n\nfunction filterOnGender(voices: IVoices[], gender: TGender): IVoices[]\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freadium%2Fspeech","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Freadium%2Fspeech","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freadium%2Fspeech/lists"}