@Test public void testAudio() throws Exception { operationInstance.setConfiguration("source-tags", ""); operationInstance.setConfiguration("source-flavor", "*/audio"); operationInstance.setConfiguration("source-flavors", ""); operationInstance.setConfiguration("target-flavor", "*/normalized"); operationInstance.setConfiguration("target-tags", "norm"); operationInstance.setConfiguration("force-transcode", "true"); operationInstance.setConfiguration("target-decibel", "-30"); WorkflowOperationResult result = operationHandler.start(instance, null); Assert.assertEquals(Action.CONTINUE, result.getAction()); Assert.assertEquals("Resulting mediapackage has the wrong number of tracks", 4, result.getMediaPackage() .getElements().length); Track[] tracks = result.getMediaPackage().getTracks(new MediaPackageElementFlavor("presentation", "normalized")); Assert.assertEquals("Resulting mediapackage has the wrong number of tracks", 1, tracks.length); Assert.assertTrue(tracks[0].containsTag("norm")); TrackImpl audioVideo = (TrackImpl) tracks[0]; Assert.assertEquals(-30f, audioVideo.getAudio().get(0).getRmsLevDb().floatValue(), 0.001d); tracks = result.getMediaPackage().getTracks(new MediaPackageElementFlavor("presentation", "audio")); Assert.assertEquals("Resulting mediapackage has the wrong number of tracks", 1, tracks.length); audioVideo = (TrackImpl) tracks[0]; Assert.assertNull(audioVideo.getAudio().get(0).getRmsLevDb()); }
public WorkflowOperationResult start(final WorkflowInstance workflowInstance, JobContext context) throws WorkflowOperationException { logger.debug("Running sox workflow operation on workflow {}", workflowInstance.getId()); try { return normalize(workflowInstance.getMediaPackage(), workflowInstance.getCurrentOperation()); } catch (Exception e) { throw new WorkflowOperationException(e); } }
NormalizeAudioWorkflowOperationHandler extends AbstractWorkflowOperationHandler { public WorkflowOperationResult start(final WorkflowInstance workflowInstance, JobContext context) throws WorkflowOperationException { logger.debug("Running sox workflow operation on workflow {}", workflowInstance.getId()); try { return normalize(workflowInstance.getMediaPackage(), workflowInstance.getCurrentOperation()); } catch (Exception e) { throw new WorkflowOperationException(e); } } }
NormalizeAudioWorkflowOperationHandler extends AbstractWorkflowOperationHandler { public WorkflowOperationResult start(final WorkflowInstance workflowInstance, JobContext context) throws WorkflowOperationException { logger.debug("Running sox workflow operation on workflow {}", workflowInstance.getId()); try { return normalize(workflowInstance.getMediaPackage(), workflowInstance.getCurrentOperation()); } catch (Exception e) { throw new WorkflowOperationException(e); } }  }
NormalizeAudioWorkflowOperationHandler extends AbstractWorkflowOperationHandler { public WorkflowOperationResult start(final WorkflowInstance workflowInstance, JobContext context) throws WorkflowOperationException { logger.debug("Running sox workflow operation on workflow {}", workflowInstance.getId()); try { return normalize(workflowInstance.getMediaPackage(), workflowInstance.getCurrentOperation()); } catch (Exception e) { throw new WorkflowOperationException(e); } }  void setWorkspace(Workspace workspace); WorkflowOperationResult start(final WorkflowInstance workflowInstance, JobContext context); }
NormalizeAudioWorkflowOperationHandler extends AbstractWorkflowOperationHandler { public WorkflowOperationResult start(final WorkflowInstance workflowInstance, JobContext context) throws WorkflowOperationException { logger.debug("Running sox workflow operation on workflow {}", workflowInstance.getId()); try { return normalize(workflowInstance.getMediaPackage(), workflowInstance.getCurrentOperation()); } catch (Exception e) { throw new WorkflowOperationException(e); } }  void setWorkspace(Workspace workspace); WorkflowOperationResult start(final WorkflowInstance workflowInstance, JobContext context); static final String SOX_AONLY_PROFILE; static final String SOX_AREPLACE_PROFILE; }