SFML community forums

General => Feature requests => Topic started by: amir ramezani on January 02, 2014, 03:06:30 pm

Title: allow to change speed without changing the pitch
Post by: amir ramezani on January 02, 2014, 03:06:30 pm
hi,
this is in my idea is very good thing, but maybe it's very very hard to do
in audacity, they used soundtouch library to do that
this is it's website:
http://www.surina.net/soundtouch/
Title: Re: allow to change speed without changing the pitch
Post by: eXpl0it3r on January 02, 2014, 03:24:38 pm
It would certainly be a nice feature, however this goes quite a bit into audio processing, thus I wonder if it should really be part of SFML itself. I'm not sure how well SFML lets the users process the audio themselves, but personally I'd say it would be better if we get easily access to the audio data via SFML and then anyone can choose what they want to do with that data.

As for SoundTouch, given that it's under LGPL it's not an option for SFML.

Btw. the links in your signature are broken! ;)
Title: Re: allow to change speed without changing the pitch
Post by: Lo-X on January 02, 2014, 03:59:55 pm
If openAL allows it, I don't see why SFML wouldn't.
And indeed, I needed that feature for the last LD48 but I had to use the pitch instead.
Title: Re: allow to change speed without changing the pitch
Post by: amir ramezani on January 02, 2014, 06:29:41 pm
It would certainly be a nice feature, however this goes quite a bit into audio processing, thus I wonder if it should really be part of SFML itself. I'm not sure how well SFML lets the users process the audio themselves, but personally I'd say it would be better if we get easily access to the audio data via SFML and then anyone can choose what they want to do with that data.

As for SoundTouch, given that it's under LGPL it's not an option for SFML.

Btw. the links in your signature are broken! ;)
firstly, boath of them are open source
so, it's not be a problem
secondly, I've update my links
thanks for your report
if they don't load, report here
Title: Re: allow to change speed without changing the pitch
Post by: Nexus on January 02, 2014, 06:38:05 pm
firstly, boath of them are open source
so, it's not be a problem
But you know what LGPL (https://en.wikipedia.org/wiki/LGPL) means? There exist many open-source licenses, a lot of which are incompatible to each other.
Title: Re: allow to change speed without changing the pitch
Post by: amir ramezani on January 02, 2014, 07:22:18 pm
But you know what LGPL (https://en.wikipedia.org/wiki/LGPL) means? There exist many open-source licenses, a lot of which are incompatible to each other.
an OS developer must know that
but, libsndfile and OpenAL are open source and boath of them are in LGPL license
Title: Re: allow to change speed without changing the pitch
Post by: Laurent on January 02, 2014, 09:04:05 pm
Quote
If openAL allows it, I don't see why SFML wouldn't.
It doesn't. That's why it requires another third-party library.
Title: Re: allow to change speed without changing the pitch
Post by: eXpl0it3r on January 03, 2014, 01:59:17 am
but, libsndfile and OpenAL are open source and boath of them are in LGPL license
True forgot that they are LGPL as well, but that's also a bit of a pain, because we'll always have to link them dynamically.

Btw. when talking about licenses or even in general, it's mostly of no use to say "it's open source", because that just means we can look at the source. But since we're mostly interested in how we can use the code, it's way better to name the license directly. ;)
Title: Re: allow to change speed without changing the pitch
Post by: Lo-X on January 03, 2014, 04:24:57 am
Quote
If openAL allows it, I don't see why SFML wouldn't.
It doesn't. That's why it requires another third-party library.

Bad :( Well, we'll wait for that for a future version, someday :)
Title: Re: allow to change speed without changing the pitch
Post by: amir ramezani on January 03, 2014, 05:01:54 am
I know that and of course saw that
you can compile it as a dynamic library and use it in your apps
it is not hard!
what do you think?
Title: Re: allow to change speed without changing the pitch
Post by: zsbzsb on January 03, 2014, 07:15:07 am
I know that and of course saw that
you can compile it as a dynamic library and use it in your apps
it is not hard!
what do you think?

If you want to use it then go for it, however this is out of the scope of SFML since it is high level audio processing. But feel free to integrate it yourself into your own application  ;)
Title: Re: allow to change speed without changing the pitch
Post by: amir ramezani on January 03, 2014, 09:29:36 am
what can I say?
i'll use it but I don't know about SFML
Title: Re: allow to change speed without changing the pitch
Post by: Foaly on January 13, 2014, 12:52:39 am
I don't really think that changing speed and pitch is highlevel audio processing, but it might still be a little out of SFMLs scope (although it would be really nice!) and there is the licensing issue.
Processing on sf::SoundBuffer is quiet easy, due to the getBuffer() method. I have done that before.
But I have not succeeded to manipulate sf::Music in real time. So like suggested it would be an awesome addition if there was a way to access the musics samples for processing. This would give everybody the freedom to do what they like (FFT analysis, pitch, distort...)
Title: Re: allow to change speed without changing the pitch
Post by: amir ramezani on January 13, 2014, 10:17:21 am
it help's many thing related to sound and sound processing
Title: Re: allow to change speed without changing the pitch
Post by: Cornstalks on February 28, 2014, 03:11:16 am
A former coworker of mine wrote the atempo filter in FFmpeg, which allows audio to be sped up/slowed down without changing the pitch. The source  can be found here (http://git.videolan.org/?p=ffmpeg.git;a=blob;f=libavfilter/af_atempo.c;h=c474d6a58cda83e70770366321d1219a7ddd0744;hb=HEAD) for FFmpeg's atempo. If you look at that file, you'll see that it's LGPL, but he links to another (original) implementation that's licensed under the MIT license: Apprentice Video Player (http://sourceforge.net/projects/apprenticevideo/) (specifically, the yaeAudioTempoFilter.h and yaeAudioFragment.h files).

You could strip out that code and turn it into a library, all based on the MIT license, if you felt so inclined.

But I'd have to agree this is beyond SFML's scope.