You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Ubuntu 16.04 X86_64下Google Assistant SDK Python示例无声音求助

Troubleshooting No Audio Output with Google Assistant SDK on Ubuntu 16.04

Hey there! Let's figure out why your Google Assistant isn't playing sound even though it's correctly recognizing your query ("TF1 21h") and processing responses. From your logs, the conversation flow is working perfectly—so the issue is definitely tied to audio output configuration. Here are step-by-step fixes to try:

1. First, Verify System Audio Works

Before blaming the SDK, make sure your Ubuntu system can play sound at all:

  • Test your speakers/headphones with a system sound:
    aplay /usr/share/sounds/alsa/Front_Center.wav
    
  • Check your default audio output device:
    pacmd list-sinks
    
    Look for the line marked * index:—that's your default device. If it's not the one you're using, set the correct one with:
    pacmd set-default-sink <sink-name>
    
    (Replace <sink-name> with the name: value from the output, like alsa_output.pci-0000_00_1b.0.analog-stereo)

2. Force the SDK to Use the Correct Audio Device

The Google Assistant SDK might be using the wrong output device. Try running the sample with explicit audio output settings:

  • If you're using the library demo, add the --output-device flag:
    python -m googlesamples.assistant.library.demo --output-device=<your-sink-name>
    
  • If you're using a custom script, ensure the AudioOut component is initialized with the correct device. Check the SDK's built-in audio helper notes for how to specify devices in code.

3. Fix Audio Permissions and Service Issues

Ubuntu 16.04 uses PulseAudio by default—let's make sure permissions and services are set right:

  • Ensure your user is in the audio group (required for accessing audio devices):
    groups
    
    If audio isn't listed, add yourself and log out/in:
    sudo usermod -aG audio $USER
    
  • Restart PulseAudio to clear any stuck processes:
    pulseaudio -k && pulseaudio --start
    
  • Reset your ALSA config if there's a misconfiguration (back up first):
    sudo mv /etc/asound.conf /etc/asound.conf.bak
    

4. Reinstall Audio Dependencies

Missing or outdated audio libraries can cause issues. Refresh your dependencies:

  • Install system-level audio dev packages:
    sudo apt-get install portaudio19-dev libasound2-dev
    
  • Upgrade Python audio packages:
    pip install --upgrade pyaudio sounddevice
    

5. Test with a Minimal Audio Sample

To isolate the issue, run the SDK's audio helper test to confirm output works:

python -m googlesamples.assistant.audio_helpers --output-device=<your-sink-name>

This should play a test tone—if it does, the SDK can access your audio device, and the problem might be in your main sample setup.

Since your logs confirm the Assistant is processing queries correctly, focusing on these audio output tweaks should get sound working in no time!

内容的提问来源于stack exchange,提问作者Thierry Donnadieu

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.21 08:22:27