• WANTED: Happy members who like to discuss audio and other topics related to our interest. Desire to learn and share knowledge of science required. There are many reviews of audio hardware and expert members to help answer your questions. Click here to have your audio equipment measured for free!

My Beef with DeaDBeeF (Linux) - Batch Resampling is Incomplete

attoutekina

Member
Joined
Jul 8, 2022
Messages
8
Likes
4
On Linux DeaDBeeF there is the handy function of transcoding your files to a different format. It can dither 24bit flac files to 16bit, however, I cannot figure out how to change the sample rate. This means I start with a 24/96 file and end up with a 16/96 file. The file size is about half, which is appreciated, but I would like to be able to change the sample rate as well.

Is there any reason why DDBF wouldn't include a dithering function for sample rates as well?

Are there any downsides to doing the reduction using two separate programs (one for bit-rate one for sample-rate)?

Is there another program I can use to easily accomplish my goal?

Is there some issue with having a file in 16/96 format (besides size)? I have read things on here about how in certain cases higher than necessary sample rates can negatively affect sound quality.
 

Blumlein 88

Grand Contributor
Forum Donor
Joined
Feb 23, 2016
Messages
20,521
Likes
37,050
Use Sound Converter. Look into the preferences and you can choose format and sample rate. You get to choose bit depth for .wav and some other formats. Not FLAC however. Oh and don't confuse it with Sound Konverter. They aren't the same software.

You also can do any combo you want in Audacity. I don't think it does batch converting or at least not simply.
You want to go into Preferences and pick your dither (triangular should be fine).

So in Audacity you open your file, it will remember dither if you have it set. You change the project rate to what you want the new rate to be. When you export it choose the file format and then with most you get to pick bit depth and export it. It exports at the new sample rate and your chosen bit depth.
 
OP
A

attoutekina

Member
Joined
Jul 8, 2022
Messages
8
Likes
4
Use Sound Converter. Look into the preferences and you can choose format and sample rate. You get to choose bit depth for .wav and some other formats. Not FLAC however. Oh and don't confuse it with Sound Konverter. They aren't the same software.
Thank you so much! Sound Converter did the sample rate conversion in batch format - in FLAC :D.

My ffmpeg skills are not so good but that tutorial might be useful in the future, thanks.
 

monkeyboy

Active Member
Joined
Jan 8, 2019
Messages
239
Likes
214
do you need to change the file, can't you just re-sample in pulseaudio?
 
OP
A

attoutekina

Member
Joined
Jul 8, 2022
Messages
8
Likes
4
do you need to change the file, can't you just re-sample in pulseaudio?
I'm good now. I can use DDBF to downsize the bit depth and Sound Converter to do the sample rate. As with many things on Linux, "where there's a will there is a way" ;)
 

gavagai

Member
Joined
Jul 17, 2022
Messages
21
Likes
47
Location
France
Assuming that all tracks are in a folder and you are in a console in that folder :

for x in ./*.flac do ffmpeg -i ./"$x" -c:v copy -af aresample=resampler=soxr:precision=28:out_sample_fmt=s16:out_sample_rate=48000 ./convert/"$x" done

Converts all tracks in 16bits / 48Khz.
Covert arts are preserved.
The resampling quality if the highest possible.
ffmpeg dithers by default.
All the converted tracks will be in ./convert.
 

danadam

Addicted to Fun and Learning
Joined
Jan 20, 2017
Messages
956
Likes
1,496
ffmpeg -i ./"$x" -c:v copy -af aresample=resampler=soxr:precision=28:eek:ut_sample_fmt=s16:eek:ut_sample_rate=48000 ./convert/"$x"
I always preferred sox, much simpler:
Code:
sox "$x" -b16 "./convert/$x" rate 48k

ffmpeg dithers by default.
Um... mine doesn't (version 4.4.2-1+b3). Below -90 dBFS 1 kHz, in order:
  • original, generated at 24 bit, 96 kHz
  • sox
  • ffmpeg with dither (command like above with additional dither_method=triangular)
  • ffmpeg default (command like above)
sin1k.24_96.png

sin1k.16_48.sox.png

sin1k.16_48.dither.png

sin1k.16_48.png
 

gavagai

Member
Joined
Jul 17, 2022
Messages
21
Likes
47
Location
France
I always preferred sox, much simpler:
Code:
sox "$x" -b16 "./convert/$x" rate 48k


Um... mine doesn't (version 4.4.2-1+b3). Below -90 dBFS 1 kHz, in order:
  • original, generated at 24 bit, 96 kHz
  • sox
  • ffmpeg with dither (command like above with additional dither_method=triangular)
  • ffmpeg default (command like above)
View attachment 219409
View attachment 219408
View attachment 219406
View attachment 219407

Great post ! Thanks ! So ffmpeg sox dithers by default.
The command line is must simpler indeed. But sox doesn't preserve album art.
 

theREALdotnet

Major Contributor
Joined
Mar 11, 2022
Messages
1,181
Likes
2,036

BeerBear

Active Member
Joined
Mar 9, 2020
Messages
264
Likes
252
The resampling that Reaper does is not really good. I wouldn't say it will sound terrible, but it is at best mediocre versus Sox or similar.
Reaper has a few different resampling modes, including r8brain free now, which is very good. (It was added some months ago, so maybe you didn't see it.)
 

raif71

Major Contributor
Joined
Sep 7, 2019
Messages
2,333
Likes
2,535
This thread sounds like BADF00D :D. I remember working with cryptography simulating with verilog/vhdl...these are the kind of testvectors to give so that it is easier to read back to test whether encryption/decryption were done property... DEADBEEF, FEEDCAFE and the various permutation of the hex characters
 
Top Bottom