return (int) (audio.getAudioElement().getVolume() * 100d);
}
@Override
public boolean play() {
AudioElement elem = audio.getAudioElement();
elem.pause();
try {
// IE9 has been seen to throw an exception here
elem.setCurrentTime(0);
} catch (Exception ignore) {
}
if (elem.getCurrentTime() != 0) {
/*
* Workaround Chrome's inability to play the same audio twice:
* http://code.google.com/p/chromium/issues/detail?id=71323
* http://code.google.com/p/chromium/issues/detail?id=75725
*/
createAudioElement();
}
elem.play();
// best guess is that the sound played, so return true
return true;
}