Fix code examples in voice pipeline quickstart docs (#277)
This commit is contained in:
commit
8d906f88f0
1 changed files with 3 additions and 0 deletions
|
|
@ -100,10 +100,13 @@ pipeline = VoicePipeline(workflow=SingleAgentVoiceWorkflow(agent))
|
||||||
```python
|
```python
|
||||||
import numpy as np
|
import numpy as np
|
||||||
import sounddevice as sd
|
import sounddevice as sd
|
||||||
|
from agents.voice import AudioInput
|
||||||
|
|
||||||
# For simplicity, we'll just create 3 seconds of silence
|
# For simplicity, we'll just create 3 seconds of silence
|
||||||
# In reality, you'd get microphone data
|
# In reality, you'd get microphone data
|
||||||
audio = np.zeros(24000 * 3, dtype=np.int16)
|
audio = np.zeros(24000 * 3, dtype=np.int16)
|
||||||
|
audio_input = AudioInput(buffer=buffer)
|
||||||
|
|
||||||
result = await pipeline.run(audio_input)
|
result = await pipeline.run(audio_input)
|
||||||
|
|
||||||
# Create an audio player using `sounddevice`
|
# Create an audio player using `sounddevice`
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue