ai_audio_translate
AI Audio Translator integrates with the Drupal AI module to automatically transcribe and translate audio media files into any target language : then converts the translated text back into a new audio file using text-to-speech. All processing happens in the background so your editorial workflow is never blocked.
Site administrators can trigger translation directly from the Media library with a single click, select a target language from a configurable taxonomy vocabulary, and let the AI do the rest. The resulting translated audio file is automatically saved as a new media entity in your library, named [English] original-file.wav.
Features
- One-click translation from the Media library : a "Translate" operation link appears next to every audio media entity in the Content > Media admin listing.
- Language selection modal : clicking Translate opens a dialog where the editor selects a target language. Languages are sourced from any taxonomy vocabulary you choose.
- Full speech-to-text → translate → text-to-speech pipeline : audio is transcribed, the transcript is translated, and the translated text is synthesised back into a new audio file.
- Background queue processing : jobs are processed via Drupal's Queue API so the UI returns immediately with a "Translation queued" message. No page timeouts.
- Automatic output media entity : the translated audio is saved as a managed file and a new media entity named
[Language] original-name.ext, ready to use anywhere on the site. - Duplicate prevention : re-submitting a translation for the same media + language combination is blocked if a completed translation already exists.
- Configurable AI provider overrides : independently override the provider and model used for speech-to-text, translation, and text-to-speech, or leave them empty to use the AI module's global defaults.
- Configurable translation prompt : customise the system prompt sent to the translation model, with a
{language}placeholder for the target language name. - Queue status dashboard : the settings page shows how many jobs are pending and includes a "Run Now" button to process the queue immediately without waiting for cron.
- ai_translate compatibility : if the AI Translate submodule is enabled, the module delegates translation to it automatically; otherwise it falls back to prompt-based chat generation.
- File safety checks : validates MIME type, file size (25 MB limit), file accessibility, and provider capability before processing begins.
Post-Installation
- Enable the module:
drush en ai_audio_translator - Go to Administration → Configuration → AI → AI Audio Translator (
/admin/config/ai/audio-translator). - Select the Language Vocabulary : the taxonomy vocabulary whose terms will appear as target language options in the translation modal. Create a vocabulary (e.g. "Translation Languages") and add terms like "English", "French", "Spanish" first.
- Optionally customise the Translation Prompt used when calling the AI translation model.
- Optionally override the AI provider and model for each of the three operations (speech-to-text, translation, text-to-speech). Leave empty to use the AI module's configured defaults.
- Grant the "Translate audio media" permission to the roles that should see the Translate operation link.
- Navigate to Content → Media. Audio media entities will now show a Translate link in their Operations dropdown.
- Click Translate, choose a language, and click the Translate button. The job is queued immediately.
- The translated audio file appears in the Media library as
[Language] original-filename.wavonce the queue is processed (automatically every 60 seconds via the background daemon, or immediately via the "Run Now" button on the settings page).
Additional Requirements
- Drupal AI (drupal/ai) : required. Provides the AI provider plugin system and the
speech_to_text,chat, andtext_to_speechoperation types. - An AI provider module configured within the AI module : for example AI (Gemini, OpenAI, Anthropic, etc.). At least one provider must support
speech_to_textandtext_to_speech. - Drupal core Media module (
drupal:media) : required. Audio files must be managed as Media entities using theaudio_filesource plugin. - Drupal core Taxonomy module (
drupal:taxonomy) : required. Used to manage the list of available target languages. - Drupal 10.3 or 11 (PHP 8.2+).
Recommended modules/libraries
- AI Translate (ai_translate submodule) : when enabled, the module automatically delegates the translation step to AI Translate's native integration instead of using a raw prompt, potentially improving translation quality.
- Any AI provider module that supports all three operation types (speech-to-text, chat/translation, text-to-speech) in a single provider : this simplifies configuration. Gemini 2.5 Flash supports all three.
Similar projects
- AI Translate : translates text content and fields using the AI module, but does not handle audio files, speech-to-text transcription, or text-to-speech synthesis. AI Audio Translator complements it by adding the full audio pipeline.
- Human-powered translation workflows (e.g. TMGMT) : provide translation management with human translators or third-party translation APIs. AI Audio Translator is fully automated and AI-driven, making it faster for bulk audio content but without human review steps.
Supporting this Module
Found a bug or have a feature request? Please open an issue in the project issue queue. Pull requests and patches are welcome.
Community Documentation
Configuration walkthrough and usage examples coming soon. In the meantime, refer to the Post-Installation steps above and the Drupal AI module documentation for provider setup instructions.