≡
Products
▼
Support
▼
Company
▼
Forum
Ambiera Forum
Discussions, Help and Support.
Create a new account
,
Search
, or Login:
Create reply in
Sounds do not stop after calling ISound::stop()
Posted by:
(you are not logged in)
Enter the missing letter in: "I?ternational"
(you are not logged in)
Text:
[quote][b]dissolete[/b] wrote: Hi. I'm having an issue stopping sounds. I am using a sound manager class to keep track of these sounds. I store ISound pointers in a map, and they are being loaded something like this: [code] irrklang::ISound * newSound = soundEngine->play2D(filepath.c_str(), false, true, true); // Check if sound was preloaded correctly if(newSound) m_soundMap.insert( std::pair<std::string, irrklang::ISound*>(soundName, newSound)); [/code] I have a member function that plays sounds no problem by doing something like this: [code] irrklang::ISound * sound = m_soundMap[soundName]; // Make sure this isn't null, god forbid a segfault happens here that would be really annoying if(sound) soundEngine->play2D(sound->getSoundSource(), looped); [/code] In another member function, I attempt to stop a sound: [code] irrklang::ISound * sound = m_soundMap[soundName]; if(sound){ sound->stop(); sound->drop(); } [/code] Peculiarly, the sound continues to play after this stop method is called. With the help of a debugger, I have determined that the sounds are being loaded, found, and played correctly. The only thing that doesn't work is stopping the sound. The stop method is being called in the correct place in my project, and it almost seems that the sound->stop() and sound->drop() are being "skipped" over, but I know this isn't the issue. I was able to force a sound to stop with the line: [code] soundEngine->removeSoundSource(sound->getSoundSource()); [/code] However, this is not necessarily what I want since I want to be able to play a sound again without calling my load method again. I've searched through the forums for a bit looking for a solution but haven't found one. Any help getting me pointed in the right direction would be superb! Thanks![/quote]
Possible Codes
Feature
Code
Link
[url] www.example.com [/url]
Bold
[b]bold text[/b]
Image
[img]http://www.example.com/image.jpg[/img]
Quote
[quote]quoted text[/quote]
Code
[code]source code[/code]
Emoticons
Copyright© Ambiera e.U. all rights reserved.
Privacy Policy | Terms and Conditions | Imprint | Contact