From 790e891ffc58cc37e33d6000d1287888a4414af1 Mon Sep 17 00:00:00 2001 From: Jacob Budin Date: Mon, 9 Sep 2013 13:10:31 -0400 Subject: [PATCH] Added Vorbis (.ogg) audio format Use requires 2 channel (stereo) audio input --- src/FFMpeg/Format/Audio/Vorbis.php | 39 +++++++++++++++++++ .../FFMpeg/Tests/Format/Audio/VorbisTest.php | 13 +++++++ 2 files changed, 52 insertions(+) create mode 100644 src/FFMpeg/Format/Audio/Vorbis.php create mode 100644 tests/FFMpeg/Tests/Format/Audio/VorbisTest.php diff --git a/src/FFMpeg/Format/Audio/Vorbis.php b/src/FFMpeg/Format/Audio/Vorbis.php new file mode 100644 index 0000000..fd241fd --- /dev/null +++ b/src/FFMpeg/Format/Audio/Vorbis.php @@ -0,0 +1,39 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace FFMpeg\Format\Audio; + +/** + * The Vorbis audio format + */ +class Vorbis extends DefaultAudio +{ + public function __construct() + { + $this->audioCodec = 'vorbis'; + } + + /** + * {@inheritdoc} + */ + public function getExtraParams() + { + return array('-strict', '-2'); + } + + /** + * {@inheritDoc} + */ + public function getAvailableAudioCodecs() + { + return array('vorbis'); + } +} diff --git a/tests/FFMpeg/Tests/Format/Audio/VorbisTest.php b/tests/FFMpeg/Tests/Format/Audio/VorbisTest.php new file mode 100644 index 0000000..7aba0b7 --- /dev/null +++ b/tests/FFMpeg/Tests/Format/Audio/VorbisTest.php @@ -0,0 +1,13 @@ +