SoundSource in editor

51 views
Skip to first unread message

Владимир Побединский

unread,
Nov 23, 2013, 10:05:17 AM11/23/13
to urh...@googlegroups.com
SoundSource in editor allow pick sound file. It simple hold filename of sound and it not loaded when scene loaded by application?
Or sound loaded when scene loaded and I can take pointer to Sound?

Lasse Öörni

unread,
Nov 23, 2013, 10:28:56 AM11/23/13
to urh...@googlegroups.com
When a Sound resource is picked, it is loaded and played right away.

However if it's an oneshot sound, the resource assignment actually gets cleared right after the playback is complete. This is somewhat of a bug as it makes pretty much impossible to predefine sound objects in the editor. However the same attributes are also used for network replication of sounds, so any changes to the attribute behavior must be carefully investigated to not cause other bugs.

If it's a looping sound, the resource assignment remains and should start playing again when the scene is loaded, eg. you can try with the BigExplosion sound by saving the following sound parameter file (BigExplosion.xml) next to it

<sound>
    <loop enable="true" />
</sound>

One solution would be to only make the sounds play when the scene update is enabled, however right now the Audio subsystem doesn't really support that.

Reply all
Reply to author
Forward
0 new messages