Skip to main content

benecaster_transcription_language

Filter Premium transcription

Overrides, per show or per episode, the language hint the Transcription Service add-on sends to the provider, and the language it records when the job completes. It runs both times, so answer the same both times. $language is the Language setting on Settings → Transcription, '' for Auto-detect.

Return '' for no hint, or a code the current provider lists, in that provider’s own spelling. Most codes are ISO 639-1, but AssemblyAI writes en_uk, Deepgram es-419 and en-GB, and Rev.ai cmn for Mandarin. Any other value is ignored and the setting is used, because the provider’s API would refuse the job.

Parameters

Name Type Default Description
$language string — The Language setting, or '' for Auto-detect
$show_id int — ID of the episode's show
$episode_id int — ID of the episode being transcribed

Returns: string

Example

add_filter( 'benecaster_transcription_language', function ( string $language, int $show_id, int $episode_id ): string {
    return 123 === $show_id ? 'es' : $language; // An all-Spanish show.
}, 10, 3 );

Notes

Rev.ai cannot detect a language: returning '' under Rev.ai transcribes as English. The episode's recorded language is your answer when the job completes, else the language the provider detected, as a lower-case tag (en_uk becomes en-gb). Walkthrough: Set a different transcription language for one show or episode.

Need this built rather than just documented? See our services →