_song.reset(DNEW Gosu::Song(filename.string()));
_song->play();
_song->stop();
if(boost::filesystem::exists(absolutePath() + L"data/bgm/m.wav"))
{
cout << "a";
Gosu::Song s(absolutePath() + L"data/bgm/m.wav");
cout << "b";
s.play();
cout << "c";
}
cout << "-done" << endl;
Gosu::sleep(100)
after the s.play() call?
scoped_ptr
(or the new unique_ptr
or anything else) to load and play it. Gosu::Window internally continues feeding the Song with new data.
Gosu::Song *song;
song = new Gosu::Song(absolutePath() + L"data/bgm/m.wav"); // this is ok
if(input().down(Gosu::kbA) && !song->playing())
{
cout << "play" << endl; // prints "play" ok
song->play(); // but doesn't sound anything
Gosu::sleep(100);
}
if(input().down(Gosu::kbZ) && song)
{
cout << "stop" << endl; // prints "stop" ok
song->stop();
cout << "delete" << endl; // this line is never reached
delete song;
song = NULL;
}
song->stop()
... no error displayed.delete song;
... kinda weird...
Assertion failed: section == 0, file C: \Documents and Settings\Julian Raschke\Desktop\gosu\GosuImpl/Audio/OggFile.hpp, line 94
Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill