Improvements to IMySoundBlock interface.

Kristian Williams shared this feedback 5 years ago
Submitted

Currently it's not possible for a Programmable Block to accurately detect if an

IMySoundBlock
is playing audio.


This means that it isn't possible to restore an IMySoundBlock to it's original state after starting / stopping audio.


Examples could be a loudspeaker which might (or might not) play a background audio, which needs to be stopped or started if an alarm is sounded.


This issue is further compounded by a second issue: calling

IMySoundBlock.Play()
will reset an already playing track, so you can't just assume it's not playing and run the method.


My two suggestions:

1. Add

bool IMySoundBlock.IsPlaying { get; }
to the interface to test the current state of the audio.

2. Alter

void IMySoundBlock.Play()
so it has no effect when the block is already playing.

Replies (1)

photo
1

Can confirm the same issues apply to the ModAPI as well. There is no isPlaying function, and in general no way to determine if a sound block is actively playing a sound.


These functions exist within Space Engineers, inside the MySoundBlock class. This is not whitelisted

Leave a Comment
 
Attach a file