ffmpeg-mappable-media/tests/Functional/AudioConcatenationTest.php
2021-11-27 00:20:01 +01:00

31 lines
777 B
PHP

<?php
namespace Tests\FFMpeg\Functional;
use FFMpeg\Format\Audio\Mp3;
use FFMpeg\Media\Audio;
class AudioConcatenationTest extends FunctionalTestCase
{
public function testSimpleAudioFileConcatTest()
{
$ffmpeg = $this->getFFMpeg();
$files = array(
realpath(__DIR__ . '/../files/Jahzzar_-_05_-_Siesta.mp3'),
realpath(__DIR__ . '/../files/02_-_Favorite_Secrets.mp3'),
);
$audio = $ffmpeg->open(reset($files));
$this->assertInstanceOf('FFMpeg\Media\Audio', $audio);
clearstatcache();
$filename = __DIR__ . '/output/concat-output.mp3';
$audio->concat($files)->saveFromSameCodecs($filename, TRUE);
$this->assertFileExists($filename);
unlink($filename);
}
}