Exiting arecord in shell script?
See original GitHub issueSo I’m utilizing dancyPi in sync with Raspotify / Librespot. Librespot has hooks so I’m using the follow script:
#!/bin/bash
if [ "$PLAYER_EVENT" = "start" ]; then
sudo python3 home/pi/dancyPi-audio-reactive-led/python/visualization.py scroll
elif [ "$PLAYER_EVENT" = "stop" ]; then
sudo python3 home/pi/dancyPi-audio-reactive-led/python/off.py
else
:
fi
However, I did not realize that the “off.py” script did not kill the mic recording. What would be the best way of freeing up the mic after Spotify stops?
Issue Analytics
- State:
- Created 3 years ago
- Comments:72 (6 by maintainers)
Top Results From Across the Web
stopping arecord recording without stopping rest of script
Show activity on this post. This command will record until the user exits with ctrl-c and the wav recorded format should be piped...
Read more >arecord command in Linux with examples - GeeksforGeeks
arecord is a command-line sound recorder for ALSA(Advanced Linux Sound ... -h, –help : It is used to show the help messages and...
Read more >How to Abort or Come out of ksh script?
I want to abort script if input variable matched first field in any line of a file. #!/bin/sh read INPUTVAR1 awk "{if(\$INPUTVAR1 ==...
Read more >How to Record and Replay Linux Terminal Sessions using ...
To stop script, type exit and press [Enter]. If the script can not write to the named log file then it shows an...
Read more >Using the script command on Linux to record command line ...
The easiest way to use the script command is simply to type "script" in the terminal window and press ^d when you want...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@naztronaut They introduced pulseaudio as default on the desktop version of Raspberry Pi OS so that’s going to throw a wrench in anything you do audio wise from now on. Pulseaudio is great 99.9% of the time for normal use cases but for stuff like this it complicates things.
I’m not bad at python. One of these days money permitting I’d like to get some of the LED’s and other necessary hardware and combine them with a couple 3 or 4 inch full range drivers a Raspberry Pi 4 and a HIFIBERRY AMP2 hat and maybe a small screen and build a small-ish semi-smart boombox for my son. He’s 12 and is starting to show an interest in actually listening to real music. If/when that happens I’m sure we can iron out a few kinks and probably create a few,lol!!!
@JasonLG1979 - awesome! Thanks for the modifications to
asound.conf
- definitely will try it out and probably merge it into a branch for others to use.Loving the collaboration in this thread! I learned a lot just reading through the conversation.