feat: ability to select audio input device

This commit is contained in:
Philippe de Reynal 2024-11-30 11:24:34 +01:00
parent e4a1d6fe89
commit e11faadf39
6 changed files with 317 additions and 281 deletions

View file

@ -1085,7 +1085,7 @@ class Commands:
self.io.tool_error("To use /voice you must provide an OpenAI API key.")
return
try:
self.voice = voice.Voice(audio_format=self.args.voice_format)
self.voice = voice.Voice(audio_format=self.args.voice_format, device_name=self.args.voice_input_device)
except voice.SoundDeviceError:
self.io.tool_error(
"Unable to import `sounddevice` and/or `soundfile`, is portaudio installed?"