1
0
mirror of https://github.com/kmein/niveum synced 2026-03-16 10:11:08 +01:00
Files
niveum/packages/noise-waves.nix

23 lines
553 B
Nix
Raw Permalink Normal View History

2025-12-27 22:22:54 +01:00
{
sox,
mpv,
writers,
coreutils,
}:
2024-09-18 09:20:26 +02:00
# ref https://askubuntu.com/a/789472
writers.writeDashBin "noise-waves" ''
2024-09-19 09:54:12 +02:00
file="/tmp/noise-$(${coreutils}/bin/date +%s | ${coreutils}/bin/md5sum | ${coreutils}/bin/cut -d' ' -f1).wav"
2024-09-18 09:20:26 +02:00
trap clean EXIT
clean() {
rm "$file"
}
${coreutils}/bin/mkfifo "$file"
2024-09-19 09:54:12 +02:00
${sox}/bin/sox -c2 -r44.1k -b8 -n "$file" synth brownnoise synth pinknoise mix synth sine amod 0.3 10 &
2024-09-18 09:20:26 +02:00
${mpv}/bin/mpv "$file"
''
2024-09-19 09:54:12 +02:00
# play -c2 -r44.1k -b8 -n synth -1 brownnoise .1 40
# play -c2 -r44.1k -b8 -n synth -1 pinknoise .1 60