Hi there,
I would like to have a sound class that allows me to specify a certain number of soundBuffers and a specific duration on that sound buffer.
ex:
class Audio2 {
// ((start time / stop time) / buffer)
std::vector<std::pair<std::pair<sf::Time, sf::time>, const sf::soundBuffer*>> buffers;
}
where the length of the audio would be the sum of the vector's time members (difference between start and stop) and where soundbuffers could be repeated.
This would allow me to load 1/n sound buffers of dialogs and construct sentences using parts of those buffers.
So, If I had a buffer that played the sound of "hello" and another that played a sentence with the word "and" in the middle and a third that played "welcome", I could reproduce the sentence "Hello, and welcome" by adding 3 elements to the buffers with the soundBuffers of the tracks and a start and stop position in each buffer to play the part of the sound that corresponds to each word.
What would be the best approach I should take to implement this?
From what I saw, my best bet would probably be to implement this in SFML, to take advantage of private data that could facilitate this.