Skip to content

Conversation

@barsv
Copy link

@barsv barsv commented Jul 12, 2025

Adds support for recording speech in two languages using separate hotkeys.

Configuration

UTTERTYPE_LANGUAGE="en"                              # Primary language
UTTERTYPE_SECOND_LANGUAGE="ru"                       # Secondary language
UTTERTYPE_RECORD_HOTKEYS="<ctrl>+<alt>+v"           # Primary hotkey
UTTERTYPE_RECORD_HOTKEYS_SECOND_LANGUAGE="<ctrl>+<alt>+r"  # Secondary hotkey



## Usage
To start transcription, press and hold the registered hotkey to start recording. To stop the recording, lift your registered hotkey. On macOS, the registered hotkey is the globe icon by default. For other operating systems, this will have to by manually configured in `main.py` as described earlier.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add back the usage section.

transcriber = WhisperAPITranscriber.create()
# Set initial language from environment variable if provided
initial_language = os.getenv('UTTERTYPE_LANGUAGE', 'en')
transcriber.set_language(initial_language)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would prefer if this is done in the APITranscriber class itself to keep main.py simple. One of the goals of the repo is also to keep things extremely readable, especially main.py.

print(f"UtterType started with dual language support")
print(f"Primary language ({primary_lang.upper()}): {primary_key}")
print(f"Secondary language ({secondary_lang.upper()}): {secondary_key}")
print("Hold the respective hotkey to record in the corresponding language")
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you also move these print statements and env fetches somewhere else? Perhaps in the default transcriber class?

@dhruvyad
Copy link
Owner

Thanks for contributing to uttertype! Left some comments regarding style and some doc updates.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants