1
Audio / Does setPitch() modify SoundBuffer?
« on: December 24, 2015, 10:23:35 pm »
What my program in theory does is it loads a sound from a file, modifies the pitch by some values, and each time it modifies the pitch it saves the (now pitch-modified) sound into a new file(saves the SoundBuffer). However, when I load the sounds from the new files the sound is like the original (the pitch is not modified). So I was wondering: Does Sound.setPitch() in any way modify the SoundBuffer bound with that sound? and Is it possible to save the sound taking into account the change of the pitch via Sound.setPitch?
Here's the code that modifies the sound and then save it's SoundBuffer to file:
Thanks in advance!
Here's the code that modifies the sound and then save it's SoundBuffer to file:
for (int i = -7; i <= 7; i++)
{
if (i == 0)
{
sound.setPitch(1.f);
}
sound.setPitch(sound.getPitch() + (i/1000.f));
sound.getBuffer()->saveToFile("music_" + to_string(i) + ".wav");
}
{
if (i == 0)
{
sound.setPitch(1.f);
}
sound.setPitch(sound.getPitch() + (i/1000.f));
sound.getBuffer()->saveToFile("music_" + to_string(i) + ".wav");
}
Thanks in advance!