Hello guys...
Laurent told me to create a new topic about my sugestion on the audio API.
My point here is that users cannot play chained parts of songs in a decent way with the current API. I've made some changes on my local version of SFML trying to accomplish something like that. Here is a version I changed a little from the one I'm currently using to show you:
EDIT: Code updated and upgraded.
I've renamed the class to Playlist, and changed some of the C fashion design of mine (the best I could with my limited C++ knowledge)
Now it is possible to return to a previous item during execution, and you can limit how many times it returns.
It is still not equal to my local version, but it can accomplish pretty much the same.Inside src/SFML/Audio:•
Playlist.cpp ▼ Download• You also have to alter CMakeLists.txt and add this lines among the similar others:
${SRCROOT}/Playlist.cpp
${INCROOT}/Playlist.hpp
Inside include/SFML/Audio:•
Playlist.hpp ▼ DownloadInside include/SFML you have to alter Audio.hpp and add this line among the similar others:
#include <SFML/Audio/Playlist.hpp>
I think these are the only changes, but I may be wrong. I've made a minimal example showing how to create a list and add sounds to it specifying (or not) the start and end positions in milliseconds:
•
Main.cpp ▼ DownloadBy the way... How hard would it be to incorporate a library like FAAD2 on SFML to make it possible to use AAC sounds? I think this format is the one with the best compression at the moment.
PS: Sorry about any english errors... English is not my main language.