Set a different transcription language for one episode
A whole show in another language needs no code: choose Same as the show (the show’s own Language from Show Settings → Details), Auto-detect or a specific language under Transcription language on the show’s Transcription settings tab. It defaults to the site-wide Language on Settings → Transcription. For one episode in another language, filter the hint per request with benecaster_transcription_language: $language arrives as the show’s hint.
Return '' for no hint (the provider detects the language), or a code the current provider lists, in that provider’s own spelling. Any other value is ignored, and the show’s hint is used.
- Rev.ai cannot detect a language. Returning
''under Rev.ai transcribes as English. - Your answer is sent as the hint, and asked for again when the job completes, when it becomes the episode’s recorded language. Answer the same both times.
Code
<?php
add_filter( 'benecaster_transcription_language', function ( string $language, int $show_id, int $episode_id ): string {
// One interview recorded in Spanish on an English show. 'es' is the same code on all
// four built-in providers; a regional code is not (AssemblyAI 'en_uk', Deepgram 'es-419', Rev.ai 'en-gb').
return 456 === $episode_id ? 'es' : $language;
}, 10, 3 );
Hooks Used
Need this built rather than just documented? See our services →