Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Resampler plugin (Read 496071 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Re: Resampler plugin

Reply #600
Speed comparison. The source file is a CD image, stereo, 16 bps, 44100 Hz. Duration reported by foobar2000: 55:41.150 (147 344 700 samples).
Conversion run untimed first so the source file gets cached in memory. C: is a fast NVMe SSD too, so not a bottleneck.

Code: [Select]
$ del C:\temp\out.wav & timer64 ffmpeg -i c:\temp\image.wav -af "ardftsrc=48000,atrim=start=0" -acodec pcm_f32le c:\temp\out.wav
- timed conversion ran three times, fastest run took 2.027 seconds. Average 2.065 s
- the conversion speed for the fastest run is 1648x realtime

$ del C:\temp\out.wav & timer64 ffmpeg7 -i c:\temp\image.wav -af "aresample=48000:resampler=soxr" -acodec pcm_f32le c:\temp\out.wav
- timed conversion ran three times, fastest run took 1.711 seconds. Average 1.711 s
- the conversion speed for the fastest run is 1953x realtime

The ardftsrc produced output length is still incorrect: 55:41.153 (160 375 360 samples)
Sox length is correct: 55:41.150 (160 375 184 samples)
147 344 700 / 44100 * 48000 = 160 375 183,67..., which rounds up to 160 375 184

Quality comparison:
Code: [Select]
$ ffmpeg -i swept_float.wv -af "ardftsrc=48000,atrim=start=0" -acodec pcm_f32le ardftsrc.wav
$ ffmpeg7 -i swept_float.wv -af "aresample=48000:resampler=soxr" -acodec pcm_f32le soxr.wav

$ ffmpeg7 -i ardftsrc.wav -lavfi showspectrumpic=s=1280x800 ardftsrc.png
$ ffmpeg7 -i soxr.wav -lavfi showspectrumpic=s=1280x800 soxr.png
$ ffmpeg7 -i swept_float.wv -lavfi showspectrumpic=s=1280x800 swept_float.png

ardftsrc.png:
X

soxr.png:
X

swept_float.png:
X

Edit: Added labels for images.