volume for sound expressions in simulator #10678
Open
+8
−6
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
fixes microsoft/pxt-microbit#5193
This pull request introduces support for specifying volume in sound expressions. The changes primarily focus on updating the
playSoundExpressionAsync
and related methods to include avolume
parameter, and ensuring compatibility with existing components that utilize these methods.Enhancements to sound expression functionality:
pxtsim/sound/soundexpression.ts
: Added avolume
property to thePendingSound
interface and updated the__playSoundExpression
andplaySoundExpressionAsync
methods to accept avolume
parameter. Adjusted the internal logic to pass thevolume
value through the sound playback pipeline. [1] [2] [3] [4] [5]Updates to components using sound expressions:
webapp/src/components/soundEffectEditor/SoundEffectEditor.tsx
: Updated the call toplaySoundExpressionAsync
to include a default volume value of127
.webapp/src/components/soundEffectEditor/SoundGallery.tsx
: Modified the call toplaySoundExpressionAsync
to include a default volume value of127
.