-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Playing / Not playing states and/or audio file duration #60
Comments
looking into this now |
ok, |
if you want to show audiowaves, we can probably do that with https://github.com/bbc/waveform-data.js. I’d prefer to use canvas instead of full d3 to reduce the amount of the built that needs to be downloaded by the user |
I tried this const audioContext = new AudioContext()
var reader = new FileReader()
reader.addEventListener('loadend', () => {
webAudioBuilder(audioContext, reader.result, (error, waveform) => {
if (error) {
console.log(`\nerror ==============================`)
console.log(error)
return
}
console.log(waveform.duration)
})
})
reader.readAsArrayBuffer(blob) But unfortunately it fails with My last hope is that we can record the volume/time during the actual recording and store this information together with the audio file, then use that. But I gotta postpone this |
Ideally for both the pre-saved audio and the list of saved and uploaded audio I could have some way of showing in the UI that an audio file is playing and knowing when it has finished playing. Even better if I can get a stop event and a duration to work with. I don't see this is essential, but would be valuable experience add.
Right now
play()
innotes-list.js
returns a promise, which is fine for confirming that it has begun, but I don't see a way to sense that it has completed.The text was updated successfully, but these errors were encountered: