![]() ![]() Run the following command, and you should see it listed as the device with 'USB' in the name: $ cat /proc/asound/modules There are other ways to detect and/or choose a specific device in the Python code itself, but it's easiest if you can just set the default system-wide and let Python use that default.įirst, you need to make sure your sound device (in my case a little $9 Vantec NBA-120U adapter) is recognized. The first step is to detect the USB audio device, and to tell your system to use it as the default audio device. The problem is, in my case, running a USB sound device off a headless Raspberry Pi Zero, neither of those assumptions were true. You're running code interactively or in some way that it magically works without understanding how the underlying APIs work.Your Raspberry Pi has a default sound device (e.g.The problem is most guides, like this simple one from Raspberry Pi's project site, assume two things: Well, a couple hours later I decided to write this blog post to document the easiest way to do it, since I had to take quite a journey to get to the point where sound actually plays through the USB audio output. Today I needed to play back an MP3 or WAV file through a USB audio device on a Raspberry Pi, in a Python script. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |