Getting the duration of an audio file on drop
See original GitHub issueIs it possible to get the duration of audio files on drop? I’m wanting to do something like this
onDrop(files) {
files.forEach((file) => {
console.log(file.duration);
})
}
Issue Analytics
- State:
- Created 7 years ago
- Reactions:2
- Comments:5
Top Results From Across the Web
How to get the duration of audio in Python?
Use: It returns audio length in seconds. The value returned is in float(by default).
Read more >How to get the correct duration from an audio file with large ...
I want to drag'n'drop local files to receive file info like duration, bitrate and file size. I only managed to receive the file...
Read more >Audio Duration Calculator
This utility calculates the duration of audio files (both uncompressed, PCM/IEEE FP audio, such as .WAV, .W64 .AIFF/.AIF and also compressed files such...
Read more >HTML DOM Audio duration Property
The duration property returns the length of an audio, in seconds. Note: Different browsers return different values. In the example above, Opera 18+...
Read more >How to play video and audio files on Dropbox
Play video or audio files on dropbox.com or the Dropbox mobile app. Share your videos, or open a video or audio file someone...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Anyone else who might want to do this I solved it by doing the following
Not sure if this is the right way to do it but it works for what I’m doing
@muhilham @kumar88kanishk @pbirsinger
Revisiting this old topic because I was searching for the same solution. I was able to gather the video duration by using this code. In my scenario, I am allowing for a single video upload, hence the
file[0]array selection. Hope someone finds this helpful in the future!