Jump to content

Problems with sound switch on/off


photo

Recommended Posts

When i wanted to do sound switch on/off by hotkey, i written

	if (engine.app.clearKeyState(APP_KEY_F3)) {
	engine.sound.setEnabled(!engine.sound.isEnabled());
	if (engine.sound.isEnabled()) {
		engine.message("sound enabled");
	} else {
		engine.message("sound disabled");
	}
}

but it is not work. sound does not switch on/off, but messages is right(engine.sound.isEnabled() returns right info, but sound state actually does not changed)

Link to comment
  • 1 month later...

There seems to be a bug on our side.

 

As a temporal workaround try using any of two ways:

1. You can set sound volume to 0 (engine.sound.setVolume)

2. You can set camera sound mask to 0 (if there is an instance of Player class, use its method setSourceMask to set it to 0)

 

If you have the sound set for channels use the second way. If the sound is not set, use the first one.

Link to comment
×
×
  • Create New...