Compressing Teamspeak 3 Recordings Using sox

tl;dr: Loop through the files in bash, sox them to FLAC


I’ve been combining fileserver contents recently, and I came across a little archive of Teamspeak 3 recordings:

$ du -sh .
483G /home/robert/storage/media/ts_recordings/


I wrote a quick-and-dirty script to convert the files:


total=$(ls *.wav|wc)
ls *.wav | while read file; do
        sox -q ${file} ${file%.*}.flac
        if [ -e ${file%.*}.flac ]; then
                if ! [ -s {file%.*}.flac ]; then
                        rm ${file}
                        echo "${file%.*}.flac is zero-length!"
                echo "Failed on ${file}"

        if  ! ((n % 10 )); then
                echo "${n} of ${total}"

The script checks that the FLACs replacing the WAVs exist and are not zero-length before removing the original.

This was fine, but after finishing, I was still left with a bunch of uncompressed files in RF64 format, which unfortunately errored.

It turns out sox 14.4.2 added RF64 read support, so I grabbed that on my Arch machine, and converted the few remaining files (substituting wav ? rf64 twice in the script above.

The final result?

$ du -sh .
64G /home/robert/storage/raid6/media/ts_recordings/

400 gigs less space and still lossless? Ahh, much better.

Plex Media Server Warning ‘Not Found’ Errors (Fixed)

The media browser on my LG TV has been acting up recently. Instead of listing the categories set up in Plex it pops up a dialog saying “Warning: Not Found”. It does this despite being able to see the Plex Media Server (going to ‘bowse sources’ or similar brings up the server’s name but selecting it gives the same error).

Fortunately Dunhillsmoker on the Plex forums had a solution:

  1. Stop plex service – sudo service plexmediaserver stop
  2. In Plex Plugins directory remove System and Framework bundle directories:
    • mv /var/lib/plexmediaserver/Library/Application\ Support/Plex\ Media\ Server/Plug-ins/System.bundle/ ~/plex
    • mv /var/lib/plexmediaserver/Library/Application\ Support/Plex\ Media\ Server/Plug-ins/Framework.bundle/ ~/plex
    • (note, depending on permissions you may need ot be root to do this)

    • Start plex service again: sudo service plexmediaserver start
    • This sorted the problem for me.