Skip to content

Commit

Permalink
Update SoundExpanded.js
Browse files Browse the repository at this point in the history
  • Loading branch information
LilyMakesThings committed Aug 14, 2023
1 parent e510f3c commit 6a68c2d
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions extensions/Lily/SoundExpanded.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@
menus: {
attribute: {
acceptReporters: false,
items: ['length', 'channels', 'sample rate']
items: ['length', 'channels', 'sample rate', 'dataURI']
},
effect: {
acceptReporters: false,
Expand Down Expand Up @@ -271,7 +271,8 @@
if (index < 0) return 0;
const sprite = util.target.sprite;

const soundId = sprite.sounds[index].soundId;
const sound = sprite.sounds[index];
const soundId = sound.soundId;
const soundPlayer = sprite.soundBank.soundPlayers[soundId];
const soundBuffer = soundPlayer.buffer;

Expand All @@ -282,6 +283,8 @@
return soundBuffer.numberOfChannels;
case ('sample rate'):
return soundBuffer.sampleRate;
case ('dataURI'):
return sound.asset.encodeDataURI();
}
}

Expand Down

0 comments on commit 6a68c2d

Please sign in to comment.