Add translation backend

Translate from any language to any language with alirezamsh/small100
running in a thread and reading from a queue shared with transcription thread.

Signed-off-by: makaveli10 <vineet.suryan@collabora.com>
This commit is contained in:
makaveli10
2025-07-22 08:54:10 +00:00
parent 1ec437e71f
commit 2b8b245fa8
9 changed files with 743 additions and 30 deletions
+5 -1
View File
@@ -111,6 +111,8 @@ If you don't want this, set `--no_single_model`.
- `save_output_recording`: Set to True to save the microphone input as a `.wav` file during live transcription. This option is helpful for recording sessions for later playback or analysis. Defaults to `False`.
- `output_recording_filename`: Specifies the `.wav` file path where the microphone input will be saved if `save_output_recording` is set to `True`.
- `mute_audio_playback`: Whether to mute audio playback when transcribing an audio file. Defaults to False.
- `enable_translation`: Start translation thread on the server (from any to any).
- `target_language`: Server translation thread's target translation language.
```python
from whisper_live.client import TranscriptionClient
@@ -124,6 +126,8 @@ client = TranscriptionClient(
save_output_recording=True, # Only used for microphone input, False by Default
output_recording_filename="./output_recording.wav", # Only used for microphone input
mute_audio_playback=False, # Only used for file input, False by Default
enable_translation=True,
target_language="hi",
)
```
It connects to the server running on localhost at port 9090. Using a multilingual model, language for the transcription will be automatically detected. You can also use the language option to specify the target language for the transcription, in this case, English ("en"). The translate option should be set to `True` if we want to translate from the source language to English and `False` if we want to transcribe in the source language.
@@ -195,7 +199,7 @@ Refer to [`ios-client`](https://github.com/collabora/WhisperLive/tree/main/Audio
```
## Future Work
- [ ] Add translation to other languages on top of transcription.
- [x] Add translation to other languages on top of transcription.
## Blog Posts
- [Transforming speech technology with WhisperLive](https://www.collabora.com/news-and-blog/blog/2024/05/28/transforming-speech-technology-with-whisperlive/)