Added tests for audio concatenation
This commit is contained in:
parent
14323d12c2
commit
633bb60dc6
4 changed files with 42 additions and 0 deletions
|
|
@ -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/)
|
||||
|
|
|
|||
34
tests/Functional/AudioConcatenationTest.php
Normal file
34
tests/Functional/AudioConcatenationTest.php
Normal 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);
|
||||
}
|
||||
}
|
||||
BIN
tests/files/02_-_Favorite_Secrets.mp3
Normal file
BIN
tests/files/02_-_Favorite_Secrets.mp3
Normal file
Binary file not shown.
BIN
tests/files/Jahzzar_-_05_-_Siesta.mp3
Normal file
BIN
tests/files/Jahzzar_-_05_-_Siesta.mp3
Normal file
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue