source-academy/modules

Sounds: More immediate audio feedback needed

Closed this issue · 2 comments

Currently, the play function leads to the creation of a sound in the sound tab, but the sound does not play. This misses an opportunity of direct feedback for the learner. Each time, the learner needs to click on the play button in order to hear the sound.

I propose that the sound tab opens automatically when the play function creates a sound. If there are multiple sounds in the tab, the tab should display the first one, and play it automatically.

With the current way audio is played, there is no way to wait for an to finish audio track finish playing. This means that so long as there are multiple calls to play the sound is still playing error will always pop up (This was not an issue before because only a single sound would be supported).

If there are synchronous solutions for waiting for sounds to finish, this issue would be less complex. Execution could pause on a call to play until the sound finishes playing.

An update: We actually have a play function that provides immediate feedback:
play_concurrently, see: https://source-academy.github.io/modules/documentation/functions/sound.play_concurrently.html