{"id":13584955,"url":"https://github.com/askrella/speech-rest-api","last_synced_at":"2025-09-04T20:32:10.176Z","repository":{"id":151050321,"uuid":"604292463","full_name":"askrella/speech-rest-api","owner":"askrella","description":"Transcription and TTS Rest API (OpenAI Whisper, Speechbrain)","archived":false,"fork":false,"pushed_at":"2024-02-01T20:27:36.000Z","size":32,"stargazers_count":76,"open_issues_count":16,"forks_count":22,"subscribers_count":7,"default_branch":"master","last_synced_at":"2024-02-08T02:59:53.491Z","etag":null,"topics":["artificial-intelligence","openai","python3","speech-recognition","speech-to-text","text-to-speech","whisper","whisper-ai"],"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/askrella.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}},"created_at":"2023-02-20T18:42:34.000Z","updated_at":"2024-04-15T01:23:02.204Z","dependencies_parsed_at":"2023-12-21T20:09:58.311Z","dependency_job_id":"bf8b9b93-81d3-4673-afad-406995585439","html_url":"https://github.com/askrella/speech-rest-api","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/askrella%2Fspeech-rest-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/askrella%2Fspeech-rest-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/askrella%2Fspeech-rest-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/askrella%2Fspeech-rest-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/askrella","download_url":"https://codeload.github.com/askrella/speech-rest-api/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":231991360,"owners_count":18457030,"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":["artificial-intelligence","openai","python3","speech-recognition","speech-to-text","text-to-speech","whisper","whisper-ai"],"created_at":"2024-08-01T15:04:37.575Z","updated_at":"2024-12-31T13:32:06.328Z","avatar_url":"https://github.com/askrella.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"# Speech REST API\n\nThis project provides a simple Flask API to transcribe speech from an audio file using the Whisper speech recognition library.\nThe API loads a pre-trained deep learning model to detect the spoken language and transcribe the speech to text.\n\nIt also provides an endpoint to generate speech from text using the Tacotron2 and HiFiGAN models.\n\n## Requirements\n\n- Python 3.9 or later\n\n## Installation\n\n```bash\n# Clone the repository\ngit clone https://github.com/askrella/speech-rest-api.git\n\n# Navigate to the project directory\ncd speech-rest-api\n\n# Install ffmpeg (Ubuntu \u0026 Debian)\nsudo apt update \u0026\u0026 sudo apt install ffmpeg -y\n\n# Install the dependencies\npip install -r requirements.txt\n\n# (Optional) Set PORT environment variable\nexport PORT=3000\n\n# Run the REST API\npython app.py\n```\n\n## Documentation\n\nThis endpoint generates speech from a text using the Tacotron2 and HiFiGAN models.\n\n```bash\nPOST http://localhost:80/tts\n```\n\nThe request body must be a JSON object with the following field:\n\n- text (required): The text you want to hear spoken in the audio file.\n\nExample:\n\n```json\n{\n    \"text\": \"Hello, I can do some text to speech. Thats awesome!\"\n}\n```\n\n\nThe response is an audio file in WAV format containing the generated speech.\n\n\nHere's an example curl command that generates speech from a list of input sentences:\n\n```sh\ncurl -X POST \\\n  -H \"Content-Type: application/json\" \\\n  --data '{\"text\": \"Hello, how are you? My name is Shubh. It is a pleasure to meet you.\"}' \\\n  http://localhost:80/tts \\\n  --output output.wav\n```\n\nThis curl command sends a JSON payload with a list of three input sentences to the /tts endpoint, and saves the resulting audio file to output.wav.\n\n\nThis endpoint transcribes audio files using the Whisper model.\n\n\n```bash\nPOST http://localhost:80/transcribe\n```\n\n\nThe request body must be a form data object containing an audio file.\n\nExample:\n\n```form\naudio=@path/to/your/audio/file.wav\n```\n\n\nThe response is a JSON object containing the detected language and the transcribed text.\n\nExample:\n\n```json\n{\n    \"language\": \"en-US\",\n    \"text\": \"Hello, how are you?\"\n}\n```\n\n\nHere's an example curl command that transcribes an audio file:\n\n```css \ncurl -X POST \\\n  -F \"audio=@path/to/your/audio/file.wav\" \\\n  http://localhost:80/transcribe\n```\n\nThis curl command sends an HTTP POST request to the /transcribe endpoint with a form data containing the audio file. The detected language and transcribed text are returned as a JSON object.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faskrella%2Fspeech-rest-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faskrella%2Fspeech-rest-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faskrella%2Fspeech-rest-api/lists"}