Skip to content

Commit c224b5a

Browse files
authored
Merge pull request #106 from sloganking/codex/add-cli-flag-for-audio-ducking
Add CLI flag for SpeakStream audio ducking
2 parents 49b3200 + b6a1f62 commit c224b5a

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

assistant_v2/src/main.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@ struct Opt {
4242
#[arg(long, default_value_t = false)]
4343
tick: bool,
4444

45+
/// Enable audio ducking while the assistant is speaking.
46+
#[arg(long, default_value_t = false)]
47+
duck: bool,
48+
4549
/// Enable audio ducking while the push-to-talk key is held.
4650
#[arg(long, default_value_t = false)]
4751
duck_ptt: bool,
@@ -290,7 +294,7 @@ async fn main() -> Result<(), Box<dyn Error>> {
290294
Voice::Echo,
291295
opt.speech_speed,
292296
opt.tick,
293-
opt.duck_ptt,
297+
opt.duck,
294298
)));
295299

296300
let (audio_tx, audio_rx) = flume::unbounded();

src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -976,7 +976,7 @@ async fn main() -> Result<(), Box<dyn Error>> {
976976
Some(voice) => voice.into(),
977977
None => Voice::Echo,
978978
};
979-
let mut speak_stream = ss::SpeakStream::new(ai_voice, opt.speech_speed, opt.tick, true);
979+
let mut speak_stream = ss::SpeakStream::new(ai_voice, opt.speech_speed, opt.tick, opt.duck);
980980
if opt.mute {
981981
speak_stream.mute();
982982
}

src/options.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ pub struct Opt {
3232
#[arg(long)]
3333
pub tick: bool,
3434

35+
/// Duck other application audio while the assistant is speaking.
36+
#[arg(long)]
37+
pub duck: bool,
38+
3539
/// Duck other application audio while the push-to-talk key is held down.
3640
#[arg(long)]
3741
pub duck_ptt: bool,

0 commit comments

Comments
 (0)