[AudioI] Send multiple wav files to Octo using Python

Bradley Dawson bdawson at une.edu.au
Fri Jul 9 07:20:20 UTC 2021


Hello Serge,
Thanks for the response. I'm not sure if I can use vlc or mpv in this application. I need to be able to schedule various sound files to play on different channels at set times throughout the day. I don't think standard media players will give me this level of flexibility. That is why I am using Python and have based it on this project by Devon Bray https://www.raspberrypi.org/blog/multiple-sounds-simultaneously-raspberry-pi/ .
Sorry - I should have given more detail in the original post.
The system in Devon's project uses USB sound cards, but my problem with that is that you never know which card is going to be allocated to a particular device number after a reboot. I'm hoping that the Octo card doesn't behave like that.

Regards,
Brad
[https://www.raspberrypi.org/app/uploads/2019/02/MG_7230-1-500x333.jpg]<https://www.raspberrypi.org/blog/multiple-sounds-simultaneously-raspberry-pi/>
Play multiple sounds simultaneously with a Raspberry Pi<https://www.raspberrypi.org/blog/multiple-sounds-simultaneously-raspberry-pi/>
Turning to the sounddevice Python library for help, Devon got to work designing the hardware and code for the project.. The job was to create some kind of box that could play eight different audio files at the same time on eight different unpowered speakers.
www.raspberrypi.org

________________________________
From: People <people-bounces at lists.audioinjector.net> on behalf of Serge Ortega via People <people at lists.audioinjector.net>
Sent: Friday, July 9, 2021 4:23 PM
To: people at lists.audioinjector.net <people at lists.audioinjector.net>
Subject: Re: [AudioI] Send multiple wav files to Octo using Python

Hey Brad

I did the same application.
The best way is to use jack as a service
1. Install jackd : sudo apt install jackd2
2. Create a file /etc/systemctl/system/jackd.service
[Unit]
Description=JACK Audio Connection Kit
After=sound.target
After=ntp.service
After=time-sync.target
#Before=jackd.service
#Requires=jackd.service

[Install]
WantedBy=multi-user.target

[Service]
#EnvironmentFile=-/etc/my_jack_config
LimitRTPRIO=90
LimitMEMLOCK=128000000
User=aladin
Environment="DBUS_SESSION_BUS_ADDRESS=unix:path=/run/dbus/system_bus_socket"
Environment="JACK_NO_AUDIO_RESERVATION=1"
ExecStartPre=/home/aladin/scripts/setupOcto.sh
ExecStart=/usr/bin/jackd -R -P60 -S -d alsa -d hw:audioinjectoroc -r 48000 -p512 -n3 -o8
ExecStartPost=/usr/bin/jack_load netmanager -i "-a224.0.1.27 -p34210"
RestartSec=5
Restart=on-failure

3. start the service, and then use vlc or mpv to read your file
4. connect the output of vlc to the output you want using jack_connect



Le 09/07/2021 à 03:43, Bradley Dawson via People a écrit :
Hello,
I'm trying to work out how to send 3 different mono .wav files to 3 different channels on the Octo card using Python and the Sounddevice library. I can do this using USB sound cards, but since the Octo just shows up as a single device in the device list, I can't see how to stream each file to a different output of the Octo. Is this even possible?

Thanks,
Brad







--
[cid:part1.59CE8730.B2C59146 at regie-technologie.com]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.audioinjector.net/pipermail/people/attachments/20210709/0507b069/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: vcard r&t.jpg
Type: image/jpeg
Size: 25352 bytes
Desc: vcard r&t.jpg
URL: <https://lists.audioinjector.net/pipermail/people/attachments/20210709/0507b069/attachment-0001.jpg>


More information about the People mailing list