Good evening.
I was trying to make a little playlist manager for one of my games using the m3u format. The m3u-thing is working good but I decided to use dynamic allocation because sf::Music wasn't copyable.
Before that, I was playing music well before but since dynamic allocation the music is marked as playing but nothing goes out of my headphones.
Here is the part were I allocate the sf::Music instance :
m_currentMusics.clear();
for(auto &musicName : it->second)
{
sf::Music* music = new sf::Music;
if (!music->openFromFile(musicName))
{
delete music;
continue;
}
music->setVolume(m_volume);
m_currentMusics.push_back(music);
}
m_currentMusicIndex = 0;
if (m_currentMusics.size() > 0)
{
m_currentMusics[m_currentMusicIndex]->play();
}
std::cout << (m_currentMusics[m_currentMusicIndex]->getStatus() == sf::Music::Status::Playing) << std::endl;
I do got a 1 answer on stdout meaning that the song's status is set to playing. Moreover, I toke a screenshot from VS debugger in order to show you that the song is loaded in the MusicManager after a call to the concerned method :
Any ideas ?
EDIT : Sorry for this useless topic, I set the m_volume to 0.6f instead of 60.f. Time to go bed I think.