-1

I have this data:

  • Bit speed: 276 kilobytes/seconds
  • File size: 6.17 MB
  • Channels: 2
  • Layer: 3
  • Frequency: 44100 HZ

How can I retrieve the audio duration in seconds or milliseconds?

1 Answers1

0

You can't. To get the duration you need the sampling rate in samples per second but also the number of channels (mono, stereo, etc.), and the sample length in bytes (1 to 3 usually). And unless it is a raw audio there is also additional data that takes some space. 276kpbs does not help here. If it is a mP3 the file is compressed, you simply can't just by looking at the file size.

Dominique Lorre
  • 1,168
  • 1
  • 10
  • 19