{"id":22332550,"url":"https://github.com/theoddysey/speech-sythesis-transformers-python","last_synced_at":"2026-04-29T10:33:35.055Z","repository":{"id":196934830,"uuid":"697437712","full_name":"TheODDYSEY/Speech-Sythesis-Transformers-Python","owner":"TheODDYSEY","description":"Speech Generation with SpeechT5 and HiFIGAN Vocoder","archived":false,"fork":false,"pushed_at":"2023-11-24T08:49:25.000Z","size":799,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-03T11:53:17.736Z","etag":null,"topics":["data-science","python","pytorch","transformers"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/TheODDYSEY.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2023-09-27T18:19:31.000Z","updated_at":"2023-11-07T21:37:48.000Z","dependencies_parsed_at":null,"dependency_job_id":"ebb8e917-7a17-415b-a2ce-f709f21679f1","html_url":"https://github.com/TheODDYSEY/Speech-Sythesis-Transformers-Python","commit_stats":null,"previous_names":["theoddysey/speech-sythesis-transformers-python"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/TheODDYSEY/Speech-Sythesis-Transformers-Python","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheODDYSEY%2FSpeech-Sythesis-Transformers-Python","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheODDYSEY%2FSpeech-Sythesis-Transformers-Python/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheODDYSEY%2FSpeech-Sythesis-Transformers-Python/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheODDYSEY%2FSpeech-Sythesis-Transformers-Python/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TheODDYSEY","download_url":"https://codeload.github.com/TheODDYSEY/Speech-Sythesis-Transformers-Python/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheODDYSEY%2FSpeech-Sythesis-Transformers-Python/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32421861,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-29T06:29:02.080Z","status":"ssl_error","status_checked_at":"2026-04-29T06:29:00.631Z","response_time":110,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["data-science","python","pytorch","transformers"],"created_at":"2024-12-04T04:18:40.393Z","updated_at":"2026-04-29T10:33:35.042Z","avatar_url":"https://github.com/TheODDYSEY.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Speech Generation with SpeechT5 and HiFIGAN Vocoder\n\nThis Python script demonstrates how to use the SpeechT5 model and HiFIGAN vocoder to generate speech from text input. It includes the option to specify a particular speaker or use a random voice for speech synthesis.\n\n## Prerequisites\n\n- Python 3.x\n- [Transformers](https://github.com/huggingface/transformers) library\n- [Datasets](https://github.com/huggingface/datasets) library\n- PyTorch\n- SoundFile (soundfile) library\n\nYou can install the required Python libraries using `pip`:\n\n```bash\npip install transformers datasets torch soundfile\n```\n\n## Usage\n\n1. Save the script as a Python (.py) file, e.g., `speech_generation.py`.\n\n2. Open a terminal or command prompt and navigate to the directory where the script is located.\n\n3. Run the script using Python:\n\n```bash\npython speech_generation.py\n```\n\nThe script will generate speech based on the text input and save the speech as an MP3 file.\n\n## Functionality\n\n- The script loads a pretrained SpeechT5 model and HiFIGAN vocoder using the Transformers library.\n\n- It loads a dataset of speaker embeddings to associate specific speakers with the generated speech.\n\n- You can specify a particular speaker for the generated speech by providing the speaker's name. The available speakers are defined in the `speakers` dictionary within the script.\n\n- If you do not specify a speaker, the script will generate speech using a random voice.\n\n- The generated speech is saved as an MP3 file with a filename that includes the speaker's name (if specified) or a random string, along with the first few words of the input text.\n\n- The script uses a 16KHz sampling rate for the saved speech.\n\n## Example Usage\n\n1. Generate speech with a specific speaker (e.g., US female):\n\n```python\nsave_text_to_speech(\"Python is my favorite programming language\", speaker=speakers[\"slt\"])\n```\n\n2. Generate speech with a random voice:\n\n```python\nsave_text_to_speech(\"Python is my favorite programming language\")\n```\n\n3. Generate speech with a challenging text for all available speakers:\n\n```python\ntext = \"\"\"In his miracle year, he published four groundbreaking papers. \nThese outlined the theory of the photoelectric effect, explained Brownian motion, \nintroduced special relativity, and demonstrated mass-energy equivalence.\"\"\"\nfor speaker_name, speaker in speakers.items():\n    output_filename = save_text_to_speech(text, speaker)\n    print(f\"Saved {output_filename}\")\n```\n\n4. Generate speech with a random voice for challenging text:\n\n```python\noutput_filename = save_text_to_speech(text)\nprint(f\"Saved {output_filename}\")\n```\n\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftheoddysey%2Fspeech-sythesis-transformers-python","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftheoddysey%2Fspeech-sythesis-transformers-python","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftheoddysey%2Fspeech-sythesis-transformers-python/lists"}