Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 18 additions & 13 deletions run_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,24 @@

args = parser.parse_args()

client = TranscriptionClient(
args.server,
args.port,
lang=args.lang,
translate=args.translate,
model=args.model, # also support hf_model => `Systran/faster-whisper-small`
use_vad=True,
save_output_recording=args.save_output_recording, # Only used for microphone input, False by Default
output_recording_filename=args.output_file, # Only used for microphone input
mute_audio_playback=args.mute_audio_playback, # Only used for file input, False by Default
enable_translation=args.enable_translation, # Enable translation of the transcription output
target_language=args.target_language, # Target language for translation, e.g., "fr
)

if args.files is None:
client()
sys.exit(0)

# Validate audio files
valid_files = []
for file_path in args.files:
Expand All @@ -68,17 +86,4 @@
print(f" - {file_path}")

for f in valid_files:
client = TranscriptionClient(
args.server,
args.port,
lang=args.lang,
translate=args.translate,
model=args.model, # also support hf_model => `Systran/faster-whisper-small`
use_vad=True,
save_output_recording=args.save_output_recording, # Only used for microphone input, False by Default
output_recording_filename=args.output_file, # Only used for microphone input
mute_audio_playback=args.mute_audio_playback, # Only used for file input, False by Default
enable_translation=args.enable_translation, # Enable translation of the transcription output
target_language=args.target_language, # Target language for translation, e.g., "fr
)
client(f)