Answer the question
In order to leave comments, you need to log in
How to give a section of a wav file?
Good afternoon, a non-standard task has appeared that needs to be implemented in PHP.
There is an hour-long wav file on the server (site.ru/sound.wav).
It is necessary to implement the return of only part of the entire audio track according to get parameters, for example site.ru/sound.wav?start=0&end=20
I.e. start and end interval in seconds (if start = 0 and end = 20, then the first 20 seconds of the entire sound.wav are given).
PS It is necessary to give a 20-second segment, and not reproduce these seconds.
How can such functionality be implemented?
Thank you very much in advance!
Answer the question
In order to leave comments, you need to log in
take a look at https://github.com/PHP-FFMpeg/PHP-FFMpeg . I have not used it myself, but it looks like what is required))
$audio->filters()->clip(FFMpeg\Coordinate\TimeCode::fromSeconds(30), FFMpeg\Coordinate\TimeCode::fromSeconds(15));
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question