Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change pitch filter #5

Open
ohcdh opened this issue May 6, 2020 · 1 comment
Open

Change pitch filter #5

ohcdh opened this issue May 6, 2020 · 1 comment

Comments

@ohcdh
Copy link

ohcdh commented May 6, 2020

Would it be possible to add a change pitch filter, allow the user to specify the percentage change or from x hz to y hz?

@Bleuzen
Copy link
Owner

Bleuzen commented May 13, 2020

Hi, well, ffmpeg has no really good option built in for this. But you could try something like this:

Option 1

grafik

aresample=48000
asetrate=48000*2
aresample=48000
atempo=0.5

This will double the tone frequency by keeping the original length of the track.

Off course you can change these numbers around. Another example would be to cut the frequency in half:

aresample=48000
asetrate=48000*0.5
aresample=48000
atempo=2.0

The lines explained:

aresample=48000

Resample the audio to a fixed rate (because we do not know the sample rate of the input files and want to process all files the same).

asetrate=48000*0.5

Tune the audio down to 50 %. Change this (0.5) as you want, but keep in mind to change the value in line 4 indirectly proportional to this.

aresample=48000

Resample back up to the original samplerate.

atempo=2.0

Double the tempo to keep the original duration of the track and not make it slower. You have to change this too if you changed the value in line 2.

Option 2

Use rubberband (if you have it installed on your system).
See: https://ffmpeg.org/ffmpeg-filters.html#rubberband

Btw. you can use any audio filter that ffmpeg supports. Have a look at the list here:
https://ffmpeg.org/ffmpeg-filters.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants