Skip to main content


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!

This entry was edited (2 months ago)

Tech Cyborg reshared this.

Unknown parent

6ix
i just tested it in debian 12 too and had to instwall ffmpeg lol.
in reply to 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;

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

in reply to 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. ;-)

in reply to 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."

This entry was edited (2 months ago)
in reply to 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.
⇧