From 16c3248211ab64f34d1b284b88a2c3e63387af1b Mon Sep 17 00:00:00 2001 From: Paul Kaplan Date: Tue, 25 Jul 2017 12:12:34 -0400 Subject: [PATCH 1/2] Use soundId coming back from decodeSound --- src/containers/sound-library.jsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/containers/sound-library.jsx b/src/containers/sound-library.jsx index 9c1608fb7..fb98c070c 100644 --- a/src/containers/sound-library.jsx +++ b/src/containers/sound-library.jsx @@ -40,8 +40,8 @@ class SoundLibrary extends React.PureComponent { }; return this.audioEngine.decodeSound(sound); }) - .then(() => { - this.player.playSound(soundItem._md5); + .then(soundId => { + this.player.playSound(soundId); }); } handleItemMouseLeave () { From 8988d848f22ce0187b99a85ef99dd1ed41cb3f5f Mon Sep 17 00:00:00 2001 From: Paul Kaplan Date: Tue, 25 Jul 2017 12:56:20 -0400 Subject: [PATCH 2/2] Make sound editor work also --- src/containers/sound-editor.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/containers/sound-editor.jsx b/src/containers/sound-editor.jsx index 30bd62d84..7706b1e98 100644 --- a/src/containers/sound-editor.jsx +++ b/src/containers/sound-editor.jsx @@ -86,7 +86,7 @@ SoundEditor.propTypes = { const mapStateToProps = (state, {soundIndex}) => { const sound = state.vm.editingTarget.sprite.sounds[soundIndex]; - const audioBuffer = state.vm.runtime.audioEngine.audioBuffers[sound.md5]; + const audioBuffer = state.vm.getSoundBuffer(soundIndex); return { sampleRate: audioBuffer.sampleRate, samples: audioBuffer.getChannelData(0),