logoalt Hacker News

crooked-vyesterday at 11:54 PM1 replyview on HN

For people looking for treatment for long-term tinnitus, notched sound therapy has been statistically shown to help by reducing brain activity in relation to the perceived tinnitus frequencies (https://pmc.ncbi.nlm.nih.gov/articles/PMC8832119/). In other words, it doesn't go away, but it becomes less "important" to the auditory centers.

There are various professionally provided therapies of this style, but there are also simple self-therapy apps that find the perceived frequencies and then play white noise or a music library with the sound adjusted to produce the notched effect in that small frequency window. For example: https://audionotch.com/ https://www.tinnitusnotch.com/ https://www.tinnaway.com/


Replies

Nursietoday at 2:55 AM

I haven't used this for years and I don't know if it helped me or not, but the below is a bash script which will duplicate a directory of mp3s and 'notch' everything using the linux command line tool 'sox'. You'll have to figure out the frequency band you want to remove, it's currently set to remove approximately a half-octave notch around my target frequency, 13.5kHz. Sox can do lots of file formats but you'll have to adapt the script if you want anything but mp3s altered. And no I'm not 100% sure why I felt the need to multi-process enable it...

  #!/bin/bash

  HIGHFREQ=16000
  LOWFREQ=-11500

  if [[ -z $1 || -z $2 ]] ; then
      echo "Usage: " $0 " <InputDir> <OutputDir>"
      exit
  fi

  OLDDIR=$1
  NEWDIR=$2

  echo pushd $OLDDIR
  pushd $OLDDIR

  TEMP=0
  BUFSIZE=1024000
  CONCURRENCY=1
  IFS=$(echo -en "\n\b")

  for file in `find |grep mp3`; do
      mkdir -p $NEWDIR/"`dirname \"$file\"`"
      TEMP=$(($TEMP + 1))
      TEMP=$(($TEMP % $CONCURRENCY))
      echo $TEMP $(basename $file)
      if [ "$TEMP" = "0" ]; then
          sox --multi-threaded --buffer $BUFSIZE --temp $NEWDIR/"`dirname \"$file\"`" -V2 "$file" -C -0.1 "$NEWDIR/$file" gain -hen sinc $HIGHFREQ$LOWFREQ
          wait
      else
          sox --multi-threaded --buffer $BUFSIZE --temp $NEWDIR/"`dirname \"$file\"`" -V2 "$file" -C -0.1 "$NEWDIR/$file" gain -hen sinc $HIGHFREQ$LOWFREQ &
      fi
  done
  wait
  popd

  cp -R --update=none $OLDDIR/* $NEWDIR