{"id":24760929,"url":"https://github.com/ziozzang/mac-tts-apiserver","last_synced_at":"2026-04-18T02:03:28.042Z","repository":{"id":228915360,"uuid":"775260968","full_name":"ziozzang/Mac-TTS-APIServer","owner":"ziozzang","description":null,"archived":false,"fork":false,"pushed_at":"2024-03-21T06:13:04.000Z","size":13,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-28T18:20:05.670Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ziozzang.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}},"created_at":"2024-03-21T03:41:44.000Z","updated_at":"2024-03-21T03:45:15.000Z","dependencies_parsed_at":"2024-03-21T04:48:29.010Z","dependency_job_id":null,"html_url":"https://github.com/ziozzang/Mac-TTS-APIServer","commit_stats":null,"previous_names":["ziozzang/mac-tts-apiserver"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ziozzang%2FMac-TTS-APIServer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ziozzang%2FMac-TTS-APIServer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ziozzang%2FMac-TTS-APIServer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ziozzang%2FMac-TTS-APIServer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ziozzang","download_url":"https://codeload.github.com/ziozzang/Mac-TTS-APIServer/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245097830,"owners_count":20560319,"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","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":[],"created_at":"2025-01-28T18:20:07.383Z","updated_at":"2026-04-18T02:03:22.997Z","avatar_url":"https://github.com/ziozzang.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TTS (Text-to-Speech) Server (For MacOS) User Manual\n\n## Introduction\nThis is a Python-based Text-to-Speech (TTS) API server that converts text to audio using the built-in say command on macOS. The server supports various audio formats and voice options.\n\n\nThere's two version of server type.\n- api_server.py: initial version/simple.\n- api_server2.py: OpenAI speech API compatible.\n\n## Requirements\n- only works in MacOSX. this program use OSX's tts model to run.\n- need python and flask. (api_server2.py need ffmpeg to convert output file format)\n\n```\npip install flask\n\n# to use api_server2, ffmpeg is needed\nbrew install ffmpeg\n\n```\n\n- tested on Sonoma 14.2 \u0026 python 3.11\n\n## Author\n- Jioh L. Jung (with Claude3 opus assisted)\n- Test/Sample project to test AI performance.\n\n## LICENSE\nMIT License (any use permitted)\n\n# Usage (api_server2.py)\n- openAI's speech API compatible.\n\n## Get Available Voices\n- Comment: Getting Voices API is added to get installed voices.\n\n- Endpoint: /v1/voices\n- Method: GET\n- Description: Retrieves the list of available voices.\n- Response: JSON array of voice names.\n- Example using cURL:\n\n```\ncurl -X GET \"http://localhost:2088/v1/voices\"\n```\n\n## Convert Text to Speech\n- Endpoint: /v1/audio/speech\n- Method: POST\n- Description: Converts the provided text to speech using the specified voice and audio format.\n\n- Request Body:\n - input (string, required): The text to be converted to speech.\n - voice (string, required): The name of the voice to use for the speech.\n - response_format (string, optional): The desired audio format. Supported formats are: mp3, wav, aac, flac, opus, pcm. Default is mp3.\n - speed (number, optional): The speed of the speech. Value range is 0.25 to 4.0. Default is 1.0.\n- Response: The generated audio file in the specified format.\n\n```\ncurl -X POST \"http://localhost:2088/v1/audio/speech\" \\\n     -H \"Content-Type: application/json\" \\\n     -d '{\"input\": \"Hello, this is a test.\", \"voice\": \"Shelley\", \"response_format\": \"mp3\"}' \\\n     -o output.mp3\n```\n\n- Note: Replace \"Shelley\" with the desired voice name obtained from the /v1/voices endpoint.\n\n\n## Error Handling\nThe API returns appropriate error responses with corresponding HTTP status codes in case of invalid requests or server errors. The error responses are in JSON format.\n\n# Usage (api_server.py)\n\n## Get the list of voice models\n- Endpoint: /models\n- Method: GET\n- Response: List of voice models (JSON format)\n\n## Convert text to speech\n- Endpoint: /tts\n- Method: POST\n- Request parameters:\n  - text (required): The text to be converted\n  - voice (optional): The name of the voice model to use\n  - speed (optional): The speed of the speech (default: 1.0)\n  - sample_rate (optional): The audio sample rate (default: 44100)\n - Response: The generated audio file (audio/x-aiff format)\n\n## Examples\n### Get the list of voice models\n```\nGET /models\n```\n\n- Response example:\n\n```\n[\n  {\n    \"name\": \"Alex\",\n    \"lang_code\": \"en_US\"\n  },\n  {\n    \"name\": \"Yuna\",\n    \"lang_code\": \"ko_KR\"\n  }\n]\n```\n\n###  Convert text to speech\n\n```\nPOST /tts\nContent-Type: application/x-www-form-urlencoded\n\ntext=Hello\u0026voice=Alex\u0026speed=0.8\u0026sample_rate=22050\n```\n\n\n# Limitations\nThe server relies on the say command, which is available on macOS. It may not work on other operating systems without modifications.\nThe available voices and supported formats may vary depending on the system configuration.\n# Contributing\nContributions are welcome! If you find any issues or have suggestions for improvements, please open an issue or submit a pull request.\n\n\n\n- Response: The generated audio file (audio/x-aiff format)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fziozzang%2Fmac-tts-apiserver","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fziozzang%2Fmac-tts-apiserver","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fziozzang%2Fmac-tts-apiserver/lists"}