AnalyzeAudioWorkflowOperationHandler extends AbstractWorkflowOperationHandler { public WorkflowOperationResult start(final WorkflowInstance workflowInstance, JobContext context) throws WorkflowOperationException { logger.debug("Running analyze audio workflow operation on workflow {}", workflowInstance.getId()); try { return analyze(workflowInstance.getMediaPackage(), workflowInstance.getCurrentOperation()); } catch (Exception e) { throw new WorkflowOperationException(e); } }  WorkflowOperationResult start(final WorkflowInstance workflowInstance, JobContext context); static final String SOX_AONLY_PROFILE; }
@Test public void testAudioVideo() throws Exception { operationInstance.setConfiguration("source-tags", ""); operationInstance.setConfiguration("source-flavor", "*/video-audio"); operationInstance.setConfiguration("source-flavors", ""); operationInstance.setConfiguration("force-transcode", "false"); WorkflowOperationResult result = operationHandler.start(instance, null); Assert.assertEquals(Action.CONTINUE, result.getAction()); Assert.assertEquals("Resulting mediapackage has the wrong number of tracks", 3, result.getMediaPackage() .getElements().length); Track[] tracks = result.getMediaPackage().getTracks(new MediaPackageElementFlavor("presentation", "video-audio")); Assert.assertEquals("Resulting mediapackage has the wrong number of tracks", 1, tracks.length); TrackImpl audioVideo = (TrackImpl) tracks[0]; Assert.assertEquals(-20f, audioVideo.getAudio().get(0).getRmsLevDb().floatValue(), 0.001d); }
@Test public void testAudioContainer() throws Exception { operationInstance.setConfiguration("source-tags", ""); operationInstance.setConfiguration("source-flavor", "*/container-audio"); operationInstance.setConfiguration("source-flavors", ""); operationInstance.setConfiguration("force-transcode", "true"); WorkflowOperationResult result = operationHandler.start(instance, null); Assert.assertEquals(Action.CONTINUE, result.getAction()); Assert.assertEquals("Resulting mediapackage has the wrong number of tracks", 3, result.getMediaPackage() .getElements().length); Track[] tracks = result.getMediaPackage().getTracks( new MediaPackageElementFlavor("presentation", "container-audio")); Assert.assertEquals("Resulting mediapackage has the wrong number of tracks", 1, tracks.length); TrackImpl audioVideo = (TrackImpl) tracks[0]; Assert.assertEquals(-20f, audioVideo.getAudio().get(0).getRmsLevDb().floatValue(), 0.001d); }
@Test public void testAudio() throws Exception { operationInstance.setConfiguration("source-tags", ""); operationInstance.setConfiguration("source-flavor", "*/audio"); operationInstance.setConfiguration("source-flavors", ""); operationInstance.setConfiguration("force-transcode", "false"); WorkflowOperationResult result = operationHandler.start(instance, null); Assert.assertEquals(Action.CONTINUE, result.getAction()); Assert.assertEquals("Resulting mediapackage has the wrong number of tracks", 3, result.getMediaPackage() .getElements().length); Track[] tracks = result.getMediaPackage().getTracks(new MediaPackageElementFlavor("presentation", "audio")); Assert.assertEquals("Resulting mediapackage has the wrong number of tracks", 1, tracks.length); TrackImpl audioVideo = (TrackImpl) tracks[0]; Assert.assertEquals(-20f, audioVideo.getAudio().get(0).getRmsLevDb().floatValue(), 0.001d); }