this post was submitted on 03 Apr 2024
57 points (93.8% liked)
Linux
47237 readers
3343 users here now
From Wikipedia, the free encyclopedia
Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).
Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.
Rules
- Posts must be relevant to operating systems running the Linux kernel. GNU/Linux or otherwise.
- No misinformation
- No NSFW content
- No hate speech, bigotry, etc
Related Communities
Community icon by Alpár-Etele Méder, licensed under CC BY 3.0
founded 5 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
I think sox is what you want
I went ahead and asked a free AI how to use sox and played audio to trigger a script. Probably won't be 100% accurate but maybe send you down the right path. Good luck.
Install 'sox' if you haven't already. You can use the package manager of your Linux distribution to install it.
Open a terminal and use the 'rec' command from 'sox' to continuously listen to the audio input:
This command will listen for audio and create a .wav file when it detects sound.
Write a script that will be triggered when a sound is detected. For example, you can create a script called "myscript.sh" with the following content:
Make the script executable by running the following command in the terminal:
Use the 'rec' command along with the 'play' command from 'sox' to continuously listen for sound and execute your script when sound is detected:
This command will continuously listen for sound and execute your script each time sound is detected.
Remember to customize the script "myscript.sh" with your desired actions.
How would this not just trigger from any sound rather one specific?