PHP code example of tbetool / ffmpeg-music-combine

1. Go to this page and download the library: Download tbetool/ffmpeg-music-combine library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

tbetool / ffmpeg-music-combine example snippets


$data = [
    [
        'path' => '/path/to/music/1.mp3',
        'start' => <start time in seconds>,
        'end' => <end time in seconds>
    ],
    [
        'path' => '/path/to/music/2.mp3',
        'start' => <start time in seconds>,
        'end' => <end time in seconds>
    ]
];

$final_music = $music->combine(json_encode($data));

try {
    $final_music = $music->combine(json_encode($data));
} catch (Exception $exception) {
    echo $exception->getMessage();
}