Fix code examples in voice pipeline quickstart docs (#277)

This commit is contained in:
Rohan Mehta 2025-03-21 21:44:14 -04:00 committed by GitHub
commit 8d906f88f0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -100,10 +100,13 @@ pipeline = VoicePipeline(workflow=SingleAgentVoiceWorkflow(agent))
```python
import numpy as np
import sounddevice as sd
from agents.voice import AudioInput
# For simplicity, we'll just create 3 seconds of silence
# In reality, you'd get microphone data
audio = np.zeros(24000 * 3, dtype=np.int16)
audio_input = AudioInput(buffer=buffer)
result = await pipeline.run(audio_input)
# Create an audio player using `sounddevice`