[GREENFOOT-333] setVolume uses up resources
Try creating several actor that create a {{GreenfootSound}} using a small wav file. Make their act() method call {{play()}} on the sound each frame (or every few frames), turn the speed slider to max (and turn down your speakers!) then run the scenario. This works fine. Then try adding a call to {{setVolume(100)}} just before the {{play()}} call. If you now run at max speed, you'll almost instantly get an error about not being able to access the sound card. Looking at the code for {{setVolume}}, the problem is that the sound is re-opened with a new line every time {{setVolume}} is called, even if it's already open.
Issue metadata
- Issue type: Bug
- Priority: Medium
- Fix versions: 2.1.1