Email or username:

Password:

Forgot your password?
nixCraft 🐧

01. #Linux users open your terminal (you must have ffmpeg package installed).

02. Type the following bash command

for i in {100..1000..100}; do ffplay -f lavfi -i "sine=frequency=${i}:duration=0.1" -autoexit -nodisp -loglevel quiet; done

03. Enjoy!

20 comments
nixCraft 🐧

@michael Life is either a daring adventure or nothing at all.

Michael

@nixCraft I guess it’s only my work laptop πŸ€”πŸ˜‚

Steven Fail

@nixCraft tried on Termux & that's music to my ears 🀩

Steven Fail

note:
running on Termux requires to install `x11-repo` and `ffplay`

6ix
I don't understand what this did lol
Mark

@nixCraft Tested it in my Debian 12 KDE VM, needed to install ffmpeg first.

Are you using this in a script somewhere, to maybe signal that it has completed?

6ix
i just tested it in debian 12 too and had to instwall ffmpeg lol.
The Planet Repairman

@nixCraft

It's a robot mating call. You raised an army of horny bots.

ryunosevi πŸ‡ͺπŸ‡Ί

@nixCraft For folks who use fish shell like me:

for i in (seq 100 100 1000); ffplay -f lavfi -i "sine=frequency=$i:duration=0.1" -autoexit -nodisp -loglevel quiet; end;

🎡🎢🎡🎢🎡🎢🎡🎢🎡🎢🎡🎢

Raul

@nixCraft Replicating my reply in X:
To check the low frequency extension of your speakers or headphones:
for i in {100..20..-10}; do echo "$i"; ffplay -f lavfi -i "sine=frequency=${i}:duration=2" -autoexit -nodisp -loglevel quiet; done

Clwhitt

@nixCraft for i in {100..3000..100}; do ffplay -f lavfi -i "sine=frequency=${i}:duration=0.1" -autoexit -nodisp -loglevel quiet; done

The "3000" will trigger my tinitus, whereas a "2000" doesn't quite get there. ;-)

An Inhabitant of Earth

@nixCraft That's the... first 10 harmonics of 100 Hz, I guess…

MeaTLoTioN

@nixCraft I see your tune and raise you a hearing test;

#!/bin/bash
m=10; M=12000; s=100
p() { ffplay -nodisp -autoexit -loglevel quiet -f lavfi -i "sine=frequency=$1:duration=1" > /dev/null 2>&1; }
a() { read -p "Can you hear $1 Hz? (y/n): " r; [[ $r == [Yy]* ]]; }

while p $M && ! a $M; do ((M-=s)); [[ $M -le $m ]] && break; done
while p $m && ! a $m; do ((m+=$((s/10)))); [[ $m -ge $M ]] && break; done

echo "Your hearing range is approximately between $m Hz and $M Hz."

@nixCraft I see your tune and raise you a hearing test;

#!/bin/bash
m=10; M=12000; s=100
p() { ffplay -nodisp -autoexit -loglevel quiet -f lavfi -i "sine=frequency=$1:duration=1" > /dev/null 2>&1; }
a() { read -p "Can you hear $1 Hz? (y/n): " r; [[ $r == [Yy]* ]]; }

while p $M && ! a $M; do ((M-=s)); [[ $M -le $m ]] && break; done
while p $m && ! a $m; do ((m+=$((s/10)))); [[ $m -ge $M ]] && break; done

MeaTLoTioN

@nixCraft (in case it doesn't lay out well here's what it should look like;

lemgandi

@nixCraft Dang it. A long time ago I gave a talk on the wonders of sox(1). I had a shell script that would use it to play happy birthday, but I can't find it now.

Go Up