Mp3ToWav Mig+QA
Created: 2012-05-21 10:53:07
Last updated: 2013-04-24 09:12:25
Preview
Run
Run this Workflow in the Taverna Workbench...
Workflow Components
Authors (1)
Bolette Ammitzbøll Jurik, The SCAPE Project, The State and University Library, Aarhus, Denmark |
Titles (1)
Descriptions (1)
Migrates Mp3 files from input List to Wav files and performs QA. The QA steps include File Format Validation, Significant Property Comparison and migrationQA file content comparison (all CLI). This workflow matches solution SO4 on the SCAPE opf wiki, see http://wiki.opf-labs.org/display/SP/SO4+Audio+mp3+to+wav+Migration+and+QA+Workflow
|
Dependencies (0)
Inputs (2)
Name |
Description |
mp3_list |
Fileurl as Value with list of MP3 input files
|
output_files |
|
Processors (10)
Name |
Type |
Description |
Mp3_to_Wav_Migrate_Validate_Compare |
workflow |
|
Input_file_to_mp3_file_list |
localworker |
ScriptList split = new ArrayList();
if (!string.equals("")) {
String regexString = "\n";
if (regex != void) {
regexString = regex;
}
String[] result = string.split(regexString);
for (int i = 0; i < result.length; i++) {
if (!result[i].startsWith("#")) {
split.add(result[i]);
}
}
}
|
regex_value |
stringconstant |
Value\n |
Read_Text_File |
localworker |
ScriptBufferedReader getReader (String fileUrl, String encoding) throws IOException {
InputStreamReader reader;
try {
if (encoding == null) {
reader = new FileReader(fileUrl);
} else {
reader = new InputStreamReader(new FileInputStream(fileUrl),encoding);
}
}
catch (FileNotFoundException e) {
// try a real URL instead
URL url = new URL(fileUrl);
if (encoding == null) {
reader = new InputStreamReader (url.openStream());
} else {
reader = new InputStreamReader (url.openStream(), encoding);
}
}
return new BufferedReader(reader);
}
StringBuffer sb = new StringBuffer(4000);
if (encoding == void) {
encoding = null;
}
BufferedReader in = getReader(fileurl, encoding);
String str;
String lineEnding = System.getProperty("line.separator");
while ((str = in.readLine()) != null) {
sb.append(str);
sb.append(lineEnding);
}
in.close();
filecontents = sb.toString();
|
encoding_value |
stringconstant |
Valueutf8 |
outputToLogs |
localworker |
Scriptif (!outputdir.endsWith("/")) {
outputdir += "/";
}
output = outputdir + "logs";
dirFile = new File(output);
File dirFile = new File(output+"/1");
dirFile.mkdirs(); |
Write_Output |
externaltool |
|
Beanshell |
beanshell |
|
Write_Output_2 |
externaltool |
|
Beanshell_2 |
beanshell |
|
Beanshells (14)
Name |
Description |
Inputs |
Outputs |
Beanshell |
|
passThru
wait
|
passed
|
Beanshell_2 |
|
passThru
wait
|
passed
|
MPG321WavOutputFileName |
|
mp3
dir
|
wav
|
waiter |
|
wait
passThru
|
passed
|
BeanshellIfElse |
|
nodelist
|
trueOut
falseOut
|
BeanshellCopy |
|
run
filename
|
fileout
|
ExtractFromFFprobe |
|
ffprobe_output
|
duration
hz
channels
bitsPerSample
bitrate
|
ExtractFromFFprobe_2 |
|
ffprobe_output
|
duration
hz
channels
bitsPerSample
bitrate
|
compareBitsPerSample |
|
first
second
|
equals
|
compareHz |
|
first
second
|
equals
|
compareDuration |
|
first
second
maxDiff
|
similar
firstLong
secondLong
|
compareChannels |
|
first
second
|
equals
|
and |
|
inputvaerdier
|
and
|
and_2 |
|
inputvaerdier
|
and
|
Outputs (1)
Name |
Description |
Mp3_to_Wav_Migrate_Validate_Compare_Success |
|
Datalinks (16)
Source |
Sink |
Input_file_to_mp3_file_list:split |
Mp3_to_Wav_Migrate_Validate_Compare:input_mp3 |
Beanshell_2:passed |
Mp3_to_Wav_Migrate_Validate_Compare:output_files |
regex_value:value |
Input_file_to_mp3_file_list:regex |
Read_Text_File:filecontents |
Input_file_to_mp3_file_list:string |
mp3_list |
Read_Text_File:fileurl |
encoding_value:value |
Read_Text_File:encoding |
output_files |
outputToLogs:outputdir |
Input_file_to_mp3_file_list:split |
Write_Output:mp3 |
output_files |
Write_Output:outputdir |
Mp3_to_Wav_Migrate_Validate_Compare:Success |
Write_Output:success |
Write_Output:STDOUT |
Beanshell:wait |
Mp3_to_Wav_Migrate_Validate_Compare:Success |
Beanshell:passThru |
output_files |
Write_Output_2:outputdir |
Write_Output_2:STDOUT |
Beanshell_2:wait |
outputToLogs:output |
Beanshell_2:passThru |
Beanshell:passed |
Mp3_to_Wav_Migrate_Validate_Compare_Success |
Uploader
License
All versions of this Workflow are
licensed under:
Version 2 (latest)
(of 2)
Credits (1)
(People/Groups)
Attributions (0)
(Workflows/Files)
None
Shared with Groups (1)
Featured In Packs (0)
None
Log in to add to one of your Packs
Attributed By (0)
(Workflows/Files)
None
Favourited By (0)
No one
Statistics
Other workflows that use similar services
(0)
There are no workflows in myExperiment that use similar services to this Workflow.
Comments (1)
Log in to make a comment
This is the sort of workflow that it would make a lot of sense to use Components in. You'd translate the innermost, highly stereotypical parts (i.e., the invocations of the tools and their immediate wrappers that do the command construction and information extraction) into components and then use them throughout the workflow.