DSD (WavPack) to PCM flac

Tutorials, tips and tricks.

Moderator: moderators

DSD (WavPack) to PCM flac

Postby jeffgt14 » Tue Feb 05, 2019 7:13 pm

I think I finally got this working well. I wanted a way to keep DSD rips SACD’s for archival purposes but obviously it’s a bit more difficult with to stream to my phone via DSub on the go. I’m sure there’s some way to do this if you have .dsf or .dts files but I highly recommend using the new Wavpack to contain .dsf audio. Compresses great and is much more efficient on the CPU. Plus, the more people using it should force more apps to support it.

Enough of the plugging, you’ll need to download both SoX and WVUNPACK and create symlinks to those programs in your transcodes directory. I’m sure ffmpeg will work too but I prefer SoX.

Convert From: wv
Convert To: flac

Step 1: wvunpack -t --wav %s -o -
Step 2: sox -t wav -v 1.413 - -b 16 -r 44100 -t flac -

Step 1 Breakdown
“wvunpack --wav” – converts wv to 32bit 352800 Hz WAV by 8x decimation

“-t” – copies the input file's time stamp to output file. This is needed to show the percent complete when transcoding

“-o” – specifies the output filename which is stdout in this case

Step 2 Breakdown
“-t wav” – specifies the wav header for stdin

“-v 1.413” – increase volume by 1.413 amplitude = +3dB. I think this is a fairly number to avoid any potential clipping as most DSD to PCM conversion will need anywhere from a 3.5 to 6 decibel increase. Only a 1999 SACD of Thriller appears to actually need a negative decibel gain. For some reason I could never get the gain or vol option to work but using -v on the input works great

“-b 16 -r 44100 -t flac” – should be self explanatory but transcodes the 32bit 352.8 kHz WAV to 16/44.1 flac. You can adjust these numbers if you want 24/88.2 files as well but redbook is enough for my streaming purposes. SoX will automatically apply TPDF dither when changing bitrate so if you are against dithering or want to specify a different dither function, you’ll need to add the appropriate options there

For my purposes, I only use wavpack for files containing .dsf DSD audio so if you use wavpack for both PCM and DSD files it’s probably a bit more difficult to mess with. You’ll need to make sure you remove the “wv” from any other conversions you may have too.
Posts: 34
Joined: Tue Nov 18, 2014 9:35 pm

Re: DSD (WavPack) to PCM flac

Postby manwithaplan » Mon Mar 04, 2019 1:57 am

This is very intriguing - I've been off and on grappling with this, now that I have more and more DSD files (.dsf to be exact). I've been using AVSub on iPhone to play DSD natively with its advanced options, when connecting the iPhone to an Oppo HA-1 DSD DAC/headphone amp for instance. BUT! Many more times I find myself simply wanting to stream these files to FLAC and now that the Chrome browser includes native FLAC support, stream them to my Mac this way in FLAC format.

So....question for you - been a LONG while since I messed with the transcoding folder/packs. Are you saying that in addition to the FFMPEG stuff that gets installed automatically in a fresh install of SS, that you would also load the WVUNPACK and SoX into the same directory as FFMPEG. Can you elaborate a bit? What OS do you run SS on by the way? I'm guessing some *nix platform, yes? I'll have to adjust the 2 steps for the syntax used on Mac OSX. No problem.

Thanks again, just need a little extra help here - since having kids, my brain for these things doesn't engage as quickly :-)
Subsonic 5.2.1 on 2009 Apple XServe w/ Yosemite Server 10.10.5; 96GB RAM. Lots of Music - High Rez, native DSD streaming, and otherwise.
Posts: 152
Joined: Sun Nov 28, 2010 5:01 pm

Return to Tutorials

Who is online

Users browsing this forum: No registered users and 2 guests