public function testMp3Stream()
 {
     $sourceMedia = 'filename.flac';
     $outputFilename = 'testing.mp3';
     $kbps = 128;
     $start = 'start';
     $end = NULL;
     $byteGoal = 100;
     $command = 'foo';
     $transcoder = m::mock('Transcoder');
     $transcoder->shouldReceive('command')->with($sourceMedia, $kbps, $start, $end)->andReturn($command);
     $transcodedSizeEstimator = m::mock('TranscodedSizeEstimator');
     $transcodedSizeEstimator->shouldReceive('estimatedBytes')->once()->with(0, $kbps)->andReturn($byteGoal);
     $streamer = m::mock('Streamer');
     $streamer->shouldReceive('outputStream')->once()->with($command, $byteGoal);
     $headerBuilder = m::mock('HeaderBuilder');
     $headerBuilder->shouldReceive('putHeader')->once()->with($outputFilename, $byteGoal);
     $audioInspector = m::mock('AudioInspector');
     $audioInspector->shouldReceive('getLength')->once()->andReturn(0);
     $mp3Stream = new Mp3Stream($transcoder, $streamer, $headerBuilder, $audioInspector, $transcodedSizeEstimator);
     $mp3Stream->output($sourceMedia, $outputFilename, $kbps, $start, $end);
 }
<?php

use Captbaritone\TranscodeToMp3Stream\Mp3Stream;
require_once __DIR__ . '/vendor/autoload.php';
$mp3Stream = new Mp3Stream();
$sourceMedia = 'example.flac';
$outputFilename = 'example.mp3';
$kbps = 128;
$start = 3.6;
$end = 7.3;
$mp3Stream->output($sourceMedia, $outputFilename, $kbps, $start, $end);