---
type: email
from: Thomas Mansencal <notifications@github.com>
subject: Re: [openai/openai-agents-python] feat: #1614 gpt-realtime migration

 (Realtime API GA) (PR #1646)
received: 2026-03-06 07:42:58
date_header: Wed, 24 Sep 2025 05:17:42 -0700
priority: normal
status: awaiting_approval
uid: 31223
---

## Email Content

**From:** Thomas Mansencal <notifications@github.com>
**Subject:** Re: [openai/openai-agents-python] feat: #1614 gpt-realtime migration

 (Realtime API GA) (PR #1646)
**Date:** Wed, 24 Sep 2025 05:17:42 -0700

### Body (preview)

@KelSolaar commented on this pull request.







> +        // Smoothly ramp down before stopping to avoid clicks

+        if (this.currentAudioSource && this.playbackAudioContext) {

             try {

-                this.currentAudioSource.stop();

-                this.currentAudioSource = null;

+                const now = this.playbackAudioContext.currentTime;

+                const fade = Math.max(0.01, this.playbackFadeSec);

+                if (this.currentAudioGain) {

+                    try {

+                        this.currentAudioGain.gain.cancelScheduledValues(now);

+                        // Capture current value to ramp from it

+                        const current = this.currentAudioGain.gain.value ?? 1.0;

+                        this.currentAudioGain.gain.setValueAtTime(current, now);

+                        this.currentAudioGain.gain.linearRampToValueAtTime(0.0001, now + fade);

+                    } catch {}

+                }

+                // Stop after the fade completes

+                setTimeout(() => {

+                    try { this.currentAudioSource && this.currentAudioSource.stop(); } catch {}

+                    this.currentAudioSource = null;

+                    this.currentAudioGain = null;

+                }, Math.ceil(fade * 1000));



@seratch : Why are we getting those clicks in the first place, is this a scheduling issue?



-- 

Reply to this email directly or view it on GitHub:

https://github.com/openai/openai-agents-python/pull/1646#pullrequestreview-3262613000

You are receiving this because you are subscribed to this thread.



Message ID: <openai/openai-agents-python/pull/1646/review/3262613000@github.com>

---

## Suggested Actions
- [ ] Reply
- [ ] Archive
- [ ] Escalate
