Python Forum

Full Version: Error: audioio has no attribute 'AudioOut'
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Having issues with audioio within CircuitPython giving the error 'audioio' has no attribute 'AudioOut'
AudioOut is used to set the audio interface for the files played on the Pi; in this case targeted to the standard headphone jack.

Details:
Pi3 B Using CircuitPython for Adafruit Trellis as sound board trigger
Validated and Reinstalled audioio using pip3
All packages were installed via pip3 as Python3 is intended environment
All packages are listed in pip and pip3
Tried running the script using sudo and non-sudo with python and python3

Example of a script that will throw the error:

import board
import time
import busio
import audioio
import audiocore
import adafruit_trellis

#Create I2C object
i2c_bus =  busio.I2C(SCL, SDA)

#Create Trellis Object
trellis = Trellis(i2c_bus)

#Set Audio to play from board
myaudio = audioio.AudioOut(board.A0)
I thought maybe being a novice is the issue but at this point I have exhausted what resources I can.
Any help would be appreciated. Not finding any reference to audioio having this issue.
Resolutions I've tried of similar "no attribute" issues do not resolve my issue.
looking at the documentation (for audioio), I don't see any AudioOut reference.
I think you found the problem Larz60+. There is a CircuitPython audioio

https://docs.circuitpython.org/en/8.2.x/...index.html

And a regular python audioio

If you are running CircuitPython you would not be using python3 or pip3.
(Oct-22-2023, 10:49 AM)deanhystad Wrote: [ -> ]I think you found the problem Larz60+. There is a CircuitPython audioio

https://docs.circuitpython.org/en/8.2.x/...index.html

And a regular python audioio

If you are running CircuitPython you would not be using python3 or pip3.

I didn't realize that CircuitPython wasn't just a Python library but fully independent, so I just jumped in assuming that it was compatible since Python3 is a req.
Looks like there are a specific list of file names to use with CircuitPython, kinda lame if I intend to make anything complex.
Thanks for the help, I was loosing my mind lol.