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: Change sample rate of an audio with best quality? (Read 17606 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Re: Change sample rate of an audio with best quality?

Reply #25
the new post is a logical continuation of the discussion.
Perhaps, but made less relevant by time, and (as you say) off topic.  The author of Post 17 joined the forum on the same day as that post – his/her only post – and in that context, Post 17 starts to sound like product placement rather than a useful contribution.

My comment was aimed at educating metal-HTPC to pay attention to whether a discussion is current, particularly if it has strayed from the topic title.
It's your privilege to disagree, but that doesn't make you right and me wrong.

Re: Change sample rate of an audio with best quality?

Reply #26
Thanks for the replies so far.
My post wasn't intended to make any product placements. I thought it was ok to continue the discussion in this old thread, sorry if I made a mistake here. Of course the main toppic was about sample rate conversions but pitch shifting somehow belongs to that too and was brought up here as well.  I have to educate myself what double blind listening tests (ABX or ABC/HR) are to be able to post comparisons so please bear with me there. But I am willing to post those once a solution for the audacity pitch correction replacement is found, so no worries.
My intentions for the conversions are more movie audio track than music related.
23,976fps speed with correct pitch, conversion to 25fps with higher pitch due to PAL speedup, 25fps with the same pitch as 23,976 which would sound too low when slowed down to 23,976 again and as to be pitch corrected and vice versa and so on and so forth for cases in 24fps as well.
I usually used EAC3to to for speeding or slowing down the audio which somewhat is a natural conversion that the pitch is a bit lower when slowed down or a bit higher when sped up meaning that a 23,976fps sped up to 25 would sound correct when slowed down to 23,976 again without any audible loss of quality. For cases where somebody screwed with the pitch aside from the regular conversion I used audacity to do the pitch correction and applied that on the sped up/slowed down audio. So it is all a 2step scenario not an all on one conversion.

For the regular speed up/slow down only process I replaced EAC3to with ffmpeg and went for the following:
23,976fps sped up to 25fps
Code: [Select]
-drc_scale 0 -i %INPUTFILE% -af aresample=resampler=soxr:precision=20:osf=s16:dither_method=triangular,asetrate=50050 -ar 48000 -acodec pcm_s16le -f WAV %1%-25.wav
25fps slowed down to 23,976fps
Code: [Select]
-drc_scale 0 -i %INPUTFILE% -af aresample=resampler=soxr:precision=20:osf=s16:dither_method=triangular,asetrate=46033.966 -ar 48000 -acodec pcm_s16le -f WAV %1%-23976.wav
so the next step would be to find out how to apply a "stretch-free" pitch only correction to those while keeping the exact same length of the file such as audacity is able to do. That ascale solution with the ffmpeg fork sounds interesting.  The pitch shifts I'm looking for are +/- 0,10, 0,71, 0,72, 0,68, 0,69 cents.

PS.: of course I am willing to post this in a new thread is you want it that way, let me know

Re: Change sample rate of an audio with best quality?

Reply #27
You've got to admit that commenting out of the blue in a thread that's been dead four years looks a bit weird.  I'm sure there are more recent threads about tempo/pitch shifting.  IMO it would be appropriate for the moderators to split Reply 17 onwards into a new thread, although some patching up may be required throughout the new to make it read properly.

Of course the main toppic was about sample rate conversions but pitch shifting somehow belongs to that too and was brought up here as well.
No, pitch shifting has very little (if anything) to do with sample rate conversion, the subject only came up as a side issue.  Sample rate conversion does not change the pitch/tempo at all, the question of "best quality" is about the interpolation algorithm required to re-sample the audio waveform in between the existing samples, and the problem of (potentially) exceeding the digital full scale in extreme cases.  Pitch shifting algorithms have to analyse the content of a short stretch of audio and transform the harmonic content, and then the difficult bit is joining all those short stretches together in a way that sounds OK.

For info: I'm mainly interested in tempo shifting, but that's the opposite side of the same coin (tempo shift = speed shift + pitch correction).
It's your privilege to disagree, but that doesn't make you right and me wrong.

Re: Change sample rate of an audio with best quality?

Reply #28
I found a few old threads but they focused on changing tempos + pitch all in one and I'm only after changing pitch without changing tempo and change the length as less as possible. For ~70min audacity would change it 1ms which is acceptable. FFMPEG varies between 8-11 ms which is not acceptable for my taste. I thought that pitch shifting involves resampling too if it doesn't thats fine.
Shure we could start a new thread about it, no problem and sorry for my awkwardness ;-).