F
F
fman22016-06-17 08:36:56
PHP
fman2, 2016-06-17 08:36:56

How to count the number of seconds of a WAV file using PHP?

Good afternoon!
Question within a question. I'm converting MP3 -> WAV by calling a system function from PHP, but now I need to count the number of seconds in the resulting WAV file using PHP. But how to do that? Are there any libraries for working with WAV files?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
T
ThunderCat, 2016-06-17
@fman2

ffprobe
here is an example with ffmpeg

A
ape364, 2016-06-17
@ape364

snipplr.com/view/285/read-wav-header-and-calculate...

V
Vasily Sumatokhin, 2016-06-19
@basilbasilbasil

mp3 is divided into frames, usually 1ms. I'm lying.
here - https://habrahabr.ru/post/103635/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question