Added tests for audio concatenation

This commit is contained in:
Lasse Lehtinen 2018-03-23 17:37:29 +02:00
commit 633bb60dc6
4 changed files with 42 additions and 0 deletions

View file

@ -625,3 +625,11 @@ $app->register(new FFMpeg\FFMpegServiceProvider(), array(
## License
This project is licensed under the [MIT license](http://opensource.org/licenses/MIT).
Music: "Favorite Secrets" by Waylon Thornton
From the Free Music Archive
[CC BY NC SA](http://creativecommons.org/licenses/by-nc-sa/3.0/us/)
Music: "Siesta" by Jahzzar
From the Free Music Archive
[CC BY SA](https://creativecommons.org/licenses/by-sa/3.0/)

View file

@ -0,0 +1,34 @@
<?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 = [
__DIR__ . '/../files/Jahzzar_-_05_-_Siesta.mp3',
__DIR__ . '/../files/02_-_Favorite_Secrets.mp3',
];
$audio = $ffmpeg->open(current($files));
$this->assertInstanceOf('FFMpeg\Media\Audio', $audio);
$filename = __DIR__ . '/output/concat-output.mp3';
if (is_file($filename)) {
unlink($filename);
}
$audio->concat($files)->saveFromSameCodecs($filename, TRUE);
$this->assertFileExists($filename);
unlink($filename);
}
}

Binary file not shown.

Binary file not shown.