Wondering if anyone has some handy ready made python ode to generate tones using the Rpi DAC Pro and plug in speakers. I’ve been trying lots of things but being a coding novice, nothing much is working. The DAC is configured correctly and the speakers play audio output from websites. I’ve tried using the pygame library but am obviously getting it very wrong as getting lots of different errors that I am unsure about solving. I realise this is something I should work out for myself-part of the RPi journey but am a bit time poor with project deadlines so would be extremely grateful for any help to point me in the right direction. Thanks in advance.
Hi @Cath250795 - I’ve only seen these devices used as an audio output for eg. video and music though it stands to reason if you can generate tones you should be able to play them.
There may be something you need to do with eg. your code or DAC installation/setup to begin routing the audio through the DAC
Can you share your code / any other pertinent setup information?
Some light research led me to this stack overflow post where a user had to specify which soundcard to use when playing a file from the os
module. It looks like they’re generating a simple tone, but stands to reason this might work for audio files as well.