Skip to content
Snippets Groups Projects
Commit a2d7e652 authored by Karishma Chadha's avatar Karishma Chadha
Browse files

Recording names should start at 1, and let the vm create fresh names as needed.

parent 8b81ef31
No related branches found
No related tags found
No related merge requests found
...@@ -77,8 +77,7 @@ class RecordModal extends React.Component { ...@@ -77,8 +77,7 @@ class RecordModal extends React.Component {
format: '', format: '',
dataFormat: 'wav', dataFormat: 'wav',
rate: this.state.sampleRate, rate: this.state.sampleRate,
sampleCount: clippedSamples.length, sampleCount: clippedSamples.length
name: `recording ${this.props.vm.editingTarget.sprite.sounds.length}`
}; };
// Load the encoded .wav into the storage cache and get resulting // Load the encoded .wav into the storage cache and get resulting
...@@ -92,6 +91,9 @@ class RecordModal extends React.Component { ...@@ -92,6 +91,9 @@ class RecordModal extends React.Component {
// update vmSound object with md5 property // update vmSound object with md5 property
vmSound.md5 = `${md5}.${vmSound.dataFormat}`; vmSound.md5 = `${md5}.${vmSound.dataFormat}`;
// The VM will update the sound name to a fresh name
// if the following is already taken
vmSound.name = 'recording 1';
this.props.vm.addSound(vmSound).then(() => { this.props.vm.addSound(vmSound).then(() => {
this.props.onClose(); this.props.onClose();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment