ffmpeg-mappable-media/tests/FFMpeg/Functional/AudioConcatenationTest.php

29 lines
718 B
PHP
Raw Normal View History

2018-03-23 17:37:29 +02:00
<?php
namespace Tests\FFMpeg\Functional;
class AudioConcatenationTest extends FunctionalTestCase
{
public function testSimpleAudioFileConcatTest()
{
$ffmpeg = $this->getFFMpeg();
$files = [
realpath(__DIR__ . '/../files/Jahzzar_-_05_-_Siesta.mp3'),
realpath(__DIR__ . '/../files/02_-_Favorite_Secrets.mp3'),
];
2018-03-23 17:37:29 +02:00
2018-03-26 18:25:50 +03:00
$audio = $ffmpeg->open(reset($files));
2018-03-23 17:37:29 +02:00
$this->assertInstanceOf('FFMpeg\Media\Audio', $audio);
2018-03-26 19:03:38 +03:00
clearstatcache();
$filename = __DIR__ . '/output/concat-output.mp3';
2018-03-23 17:37:29 +02:00
$audio->concat($files)->saveFromSameCodecs($filename, true);
2018-03-23 17:37:29 +02:00
$this->assertFileExists($filename);
unlink($filename);
}
}