Improved API of SoundGenerator