{"id":48830508,"url":"https://github.com/evolutionapi/evolution-audio-converter","last_synced_at":"2026-04-14T20:03:01.384Z","repository":{"id":259040394,"uuid":"876171146","full_name":"EvolutionAPI/evolution-audio-converter","owner":"EvolutionAPI","description":null,"archived":false,"fork":false,"pushed_at":"2025-05-19T13:12:03.000Z","size":26,"stargazers_count":20,"open_issues_count":1,"forks_count":20,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-01T22:24:22.984Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","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/EvolutionAPI.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}},"created_at":"2024-10-21T14:13:24.000Z","updated_at":"2025-10-06T09:30:53.000Z","dependencies_parsed_at":"2024-12-03T03:00:41.348Z","dependency_job_id":null,"html_url":"https://github.com/EvolutionAPI/evolution-audio-converter","commit_stats":null,"previous_names":["evolutionapi/evolution-audio-converter"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/EvolutionAPI/evolution-audio-converter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EvolutionAPI%2Fevolution-audio-converter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EvolutionAPI%2Fevolution-audio-converter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EvolutionAPI%2Fevolution-audio-converter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EvolutionAPI%2Fevolution-audio-converter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/EvolutionAPI","download_url":"https://codeload.github.com/EvolutionAPI/evolution-audio-converter/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EvolutionAPI%2Fevolution-audio-converter/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31812977,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-14T18:05:02.291Z","status":"ssl_error","status_checked_at":"2026-04-14T18:05:01.765Z","response_time":153,"last_error":"SSL_read: 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":[],"created_at":"2026-04-14T20:02:54.268Z","updated_at":"2026-04-14T20:03:01.360Z","avatar_url":"https://github.com/EvolutionAPI.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Evolution Audio Converter\n\nThis project is a microservice in Go that processes audio files, converts them to **opus** or **mp3** format, and returns both the duration of the audio and the converted file (as base64 or S3 URL). The service accepts audio files sent as **form-data**, **base64**, or **URL**.\n\n## Requirements\n\nBefore starting, you'll need to have the following installed:\n\n- [Go](https://golang.org/doc/install) (version 1.21 or higher)\n- [Docker](https://docs.docker.com/get-docker/) (to run the project in a container)\n- [FFmpeg](https://ffmpeg.org/download.html) (for audio processing)\n\n## Installation\n\n### Clone the Repository\n\nClone this repository to your local machine:\n\n```bash\ngit clone https://github.com/EvolutionAPI/evolution-audio-converter.git\ncd evolution-audio-converter\n```\n\n### Install Dependencies\n\nInstall the project dependencies:\n\n```bash\ngo mod tidy\n```\n\n### Install FFmpeg\n\nThe service depends on **FFmpeg** to convert the audio. Make sure FFmpeg is installed on your system.\n\n- On Ubuntu:\n\n  ```bash\n  sudo apt update\n  sudo apt install ffmpeg\n  ```\n\n- On macOS (via Homebrew):\n\n  ```bash\n  brew install ffmpeg\n  ```\n\n- On Windows, download FFmpeg [here](https://ffmpeg.org/download.html) and add it to your system `PATH`.\n\n### Configuration\n\nCreate a `.env` file in the project's root directory. Here are the available configuration options:\n\n#### Basic Configuration\n\n```env\nPORT=4040\nAPI_KEY=your_secret_api_key_here\n```\n\n#### Transcription Configuration\n\n```env\nENABLE_TRANSCRIPTION=true\nTRANSCRIPTION_PROVIDER=openai  # or groq\nOPENAI_API_KEY=your_openai_key_here\nGROQ_API_KEY=your_groq_key_here\nTRANSCRIPTION_LANGUAGE=en  # Default transcription language (optional)\n```\n\n#### Storage Configuration\n\n```env\nENABLE_S3_STORAGE=true\nS3_ENDPOINT=play.min.io\nS3_ACCESS_KEY=your_access_key_here\nS3_SECRET_KEY=your_secret_key_here\nS3_BUCKET_NAME=audio-files\nS3_REGION=us-east-1\nS3_USE_SSL=true\nS3_URL_EXPIRATION=24h\n```\n\n### Storage Options\n\nThe service supports two storage modes for the converted audio:\n\n1. **Base64 (default)**: Returns the audio file encoded in base64 format\n2. **S3 Compatible Storage**: Uploads to S3-compatible storage (AWS S3, MinIO, etc.) and returns a presigned URL\n\nWhen S3 storage is enabled, the response will include a `url` instead of the `audio` field:\n\n```json\n{\n  \"duration\": 120,\n  \"format\": \"ogg\",\n  \"url\": \"https://your-s3-endpoint/bucket/file.ogg?signature...\",\n  \"transcription\": \"Transcribed text here...\" // if transcription was requested\n}\n```\n\nIf S3 upload fails, the service automatically falls back to base64 encoding.\n\n## Running the Project\n\n### Locally\n\nTo run the service locally:\n\n```bash\ngo run main.go -dev\n```\n\nThe server will be available at `http://localhost:4040`.\n\n### Using Docker\n\n1. **Build the Docker image**:\n\n   ```bash\n   docker build -t audio-service .\n   ```\n\n2. **Run the container**:\n\n   ```bash\n   docker run -p 4040:4040 --env-file=.env audio-service\n   ```\n\n## API Usage\n\n### Authentication\n\nAll requests must include the `apikey` header with your API key.\n\n### Endpoints\n\n#### Process Audio\n\n`POST /process-audio`\n\nAccepts audio files in these formats:\n\n- Form-data\n- Base64\n- URL\n\nOptional parameters:\n\n- `format`: Output format (`mp3` or `ogg`, default: `ogg`)\n- `transcribe`: Enable transcription (`true` or `false`)\n- `language`: Transcription language code (e.g., \"en\", \"es\", \"pt\")\n\n#### Transcribe Only\n\n`POST /transcribe`\n\nTranscribes audio without format conversion.\n\nOptional parameters:\n\n- `language`: Transcription language code\n\n### Example Requests\n\n#### Form-data Upload\n\n```bash\ncurl -X POST -F \"file=@audio.mp3\" \\\n  -F \"format=ogg\" \\\n  -F \"transcribe=true\" \\\n  -F \"language=en\" \\\n  http://localhost:4040/process-audio \\\n  -H \"apikey: your_secret_api_key_here\"\n```\n\n#### Base64 Upload\n\n```bash\ncurl -X POST \\\n  -d \"base64=$(base64 audio.mp3)\" \\\n  -d \"format=ogg\" \\\n  http://localhost:4040/process-audio \\\n  -H \"apikey: your_secret_api_key_here\"\n```\n\n#### URL Upload\n\n```bash\ncurl -X POST \\\n  -d \"url=https://example.com/audio.mp3\" \\\n  -d \"format=ogg\" \\\n  http://localhost:4040/process-audio \\\n  -H \"apikey: your_secret_api_key_here\"\n```\n\n### Response Format\n\nWith S3 storage disabled (default):\n\n```json\n{\n  \"duration\": 120,\n  \"audio\": \"UklGR... (base64 of the file)\",\n  \"format\": \"ogg\",\n  \"transcription\": \"Transcribed text here...\" // if requested\n}\n```\n\nWith S3 storage enabled:\n\n```json\n{\n  \"duration\": 120,\n  \"url\": \"https://your-s3-endpoint/bucket/file.ogg?signature...\",\n  \"format\": \"ogg\",\n  \"transcription\": \"Transcribed text here...\" // if requested\n}\n```\n\n## License\n\nThis project is licensed under the [MIT](LICENSE) license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fevolutionapi%2Fevolution-audio-converter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fevolutionapi%2Fevolution-audio-converter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fevolutionapi%2Fevolution-audio-converter/lists"}