Configure and Test the Audio

  • The Google Assistant Library for Python is deprecated as of June 28th, 2019; use the Google Assistant Service instead.

  • This content is hardware-dependent, requiring selection from Raspberry Pi 3, Ubuntu Desktop, or Other Linux-based platforms.

  • Before running the sample, you must configure the audio system on the Raspberry Pi by finding recording and playback devices and creating an .asoundrc file.

  • You can verify that recording and playback work by adjusting playback volume, playing a test sound, recording a short audio clip, and replaying it.

  • If recording and playback are not working, check connections or try different hardware, and note that on Raspberry Pi, you can choose audio output device using raspi-config.

The content on this page is hardware-dependent. Please select from the following:

Before running the sample, you must configure the audio system on Ubuntu Desktop. Note that the commands listed on this page should work on any Linux distribution that includes ALSA tools.

Verify that recording and playback work. You can do this in the system sound settings or from the command line:

  1. Play a test sound (this will be a person speaking). Press Ctrl+C when done. If you don't hear anything when you run this, check your speaker connection.

    speaker-test -t wav

  2. Record a short audio clip.

    arecord --format=S16_LE --duration=5 --rate=16000 --file-type=raw out.raw

  3. Check the recording by replaying it.

    aplay --format=S16_LE --rate=16000 out.raw

  4. Adjust the playback and recording volume.

    alsamixer

See also

Next step

Configure a Developer Project and Account Settings