Skip to content

Commit

Permalink
Merge pull request #131 from daveneiman/upgrade_hclaps_jar
Browse files Browse the repository at this point in the history
Updgrade hclaps.jar to v.2.1; update tests.
  • Loading branch information
daveneiman authored Apr 12, 2017
2 parents eba54c5 + 6376074 commit 447db7e
Show file tree
Hide file tree
Showing 8 changed files with 128 additions and 125 deletions.
2 changes: 1 addition & 1 deletion .classpath
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<classpathentry kind="lib" path="lib/saxon9-jdom.jar"/>
<classpathentry kind="lib" path="lib/saxon9.jar"/>
<classpathentry kind="lib" path="lib/AES31.jar"/>
<classpathentry kind="lib" path="lib/hclaps.jar"/>
<classpathentry kind="lib" path="lib/hclaps-2.1.jar"/>
<classpathentry kind="lib" path="lib/stax2-api-3.0.1.jar"/>
<classpathentry kind="lib" path="lib/woodstox-core-lgpl-4.0.7.jar"/>
<classpathentry kind="lib" path="lib/log4j-1.2.17.jar"/>
Expand Down
Binary file added lib/hclaps-2.1.jar
Binary file not shown.
Binary file removed lib/hclaps.jar
Binary file not shown.
4 changes: 4 additions & 0 deletions src/edu/harvard/hul/ois/fits/tools/oisfileinfo/AudioInfo.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import org.jdom.Namespace;
import org.apache.log4j.Logger;

import edu.harvard.hcl.hclaps.bwav.InvalidWaveHeaderException;
import edu.harvard.hcl.hclaps.bwav.WAVEFile;
import edu.harvard.hcl.hclaps.bwav.chunks.FormatChunk;
import edu.harvard.hcl.hclaps.util.ByteConvertor;
Expand Down Expand Up @@ -99,6 +100,9 @@ private Element doWav(Element root, File file) throws FitsToolException {
catch (FileNotFoundException e) {
throw new FitsToolException("File "+file.getName() + " not found",e);
}
catch (InvalidWaveHeaderException e) {
throw new FitsToolException("Problem with HCLAPS Wave Header: " + e.getMessage(), e);
}

Element metadata = new Element("metadata",fitsNS);
Element audioMetadata = new Element("audio",fitsNS);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,57 +1,57 @@
<?xml version="1.0" encoding="UTF-8"?>
<fits xmlns="http://hul.harvard.edu/ois/xml/ns/fits/fits_output" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hul.harvard.edu/ois/xml/ns/fits/fits_output http://hul.harvard.edu/ois/xml/xsd/fits/fits_output.xsd" version="0.8.3" timestamp="5/15/15 9:31 AM">
<identification>
<identity format="Waveform Audio" mimetype="audio/x-wave" toolname="FITS" toolversion="0.9.0">
<tool toolname="OIS Audio Information" toolversion="0.1" />
<tool toolname="Droid" toolversion="6.1.5" />
<tool toolname="Jhove" toolversion="1.5" />
<tool toolname="file utility" toolversion="5.04" />
<tool toolname="Exiftool" toolversion="10.00" />
<version toolname="Droid" toolversion="6.1.5">0 PCM Encoding</version>
<externalIdentifier toolname="Droid" toolversion="6.1.5" type="puid">fmt/142</externalIdentifier>
<externalIdentifier toolname="Droid" toolversion="6.1.5" type="puid">fmt/703</externalIdentifier>
</identity>
</identification>
<fileinfo>
<size toolname="Jhove" toolversion="1.5">898136</size>
<filepath toolname="OIS File Information" toolversion="0.2" status="SINGLE_RESULT">/Users/dab980/git/fits/testfiles/test.wav</filepath>
<filename toolname="OIS File Information" toolversion="0.2" status="SINGLE_RESULT">test.wav</filename>
<fslastmodified toolname="OIS File Information" toolversion="0.2" status="SINGLE_RESULT">1417618273000</fslastmodified>
</fileinfo>
<filestatus>
<well-formed toolname="Jhove" toolversion="1.5" status="SINGLE_RESULT">true</well-formed>
<valid toolname="Jhove" toolversion="1.5" status="SINGLE_RESULT">true</valid>
</filestatus>
<metadata>
<audio>
<numSamples toolname="OIS Audio Information" toolversion="0.1" status="SINGLE_RESULT">299159</numSamples>
<sampleRate toolname="OIS Audio Information" toolversion="0.1">96000</sampleRate>
<audioDataEncoding toolname="OIS Audio Information" toolversion="0.1" status="CONFLICT">PCM</audioDataEncoding>
<audioDataEncoding toolname="Jhove" toolversion="1.5" status="CONFLICT">PCM audio in integer format</audioDataEncoding>
<audioDataEncoding toolname="Exiftool" toolversion="9.13" status="CONFLICT">Microsoft PCM</audioDataEncoding>
<blockAlign toolname="OIS Audio Information" toolversion="0.1" status="SINGLE_RESULT">3</blockAlign>
<time toolname="OIS Audio Information" toolversion="0.1" status="SINGLE_RESULT">458028579</time>
<channels toolname="OIS Audio Information" toolversion="0.1">1</channels>
<bitDepth toolname="OIS Audio Information" toolversion="0.1">24</bitDepth>
<wordSize toolname="OIS Audio Information" toolversion="0.1" status="SINGLE_RESULT">3</wordSize>
<offset toolname="OIS Audio Information" toolversion="0.1">46</offset>
<byteOrder toolname="Jhove" toolversion="1.5" status="SINGLE_RESULT">LITTLE_ENDIAN</byteOrder>
<duration toolname="Exiftool" toolversion="9.13" status="SINGLE_RESULT">3.12 s</duration>
</audio>
</metadata>
<statistics fitsExecutionTime="1014">
<tool toolname="MediaInfo" toolversion="0.7.71" status="did not run" />
<tool toolname="OIS Audio Information" toolversion="0.1" executionTime="253" />
<tool toolname="ADL Tool" toolversion="0.1" status="did not run" />
<tool toolname="Droid" toolversion="6.1.5" executionTime="460" />
<tool toolname="Jhove" toolversion="1.5" executionTime="926" />
<tool toolname="file utility" toolversion="5.04" executionTime="922" />
<tool toolname="Exiftool" toolversion="9.13" executionTime="900" />
<tool toolname="NLNZ Metadata Extractor" toolversion="3.6GA" status="did not run" />
<tool toolname="OIS File Information" toolversion="0.2" executionTime="235" />
<tool toolname="OIS XML Metadata" toolversion="0.2" status="did not run" />
<tool toolname="ffident" toolversion="0.2" executionTime="755" />
<tool toolname="Tika" toolversion="1.3" executionTime="397" />
</statistics>
</fits>

<?xml version="1.0" encoding="UTF-8"?>
<fits xmlns="http://hul.harvard.edu/ois/xml/ns/fits/fits_output" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hul.harvard.edu/ois/xml/ns/fits/fits_output http://hul.harvard.edu/ois/xml/xsd/fits/fits_output.xsd" version="1.1.0" timestamp="4/6/17 12:11 PM">
<identification>
<identity format="Waveform Audio" mimetype="audio/x-wave" toolname="FITS" toolversion="1.1.0">
<tool toolname="OIS Audio Information" toolversion="0.1" />
<tool toolname="Droid" toolversion="6.1.5" />
<tool toolname="Jhove" toolversion="1.16" />
<tool toolname="file utility" toolversion="5.04" />
<tool toolname="Exiftool" toolversion="10.00" />
<version toolname="Droid" toolversion="6.1.5">0 PCM Encoding</version>
<externalIdentifier toolname="Droid" toolversion="6.1.5" type="puid">fmt/142</externalIdentifier>
<externalIdentifier toolname="Droid" toolversion="6.1.5" type="puid">fmt/703</externalIdentifier>
</identity>
</identification>
<fileinfo>
<size toolname="Jhove" toolversion="1.16">898136</size>
<filepath toolname="OIS File Information" toolversion="0.2" status="SINGLE_RESULT">/Users/dan179/git/git-daveneiman/fits/testfiles/test.wav</filepath>
<filename toolname="OIS File Information" toolversion="0.2" status="SINGLE_RESULT">test.wav</filename>
<fslastmodified toolname="OIS File Information" toolversion="0.2" status="SINGLE_RESULT">1446674963000</fslastmodified>
</fileinfo>
<filestatus>
<well-formed toolname="Jhove" toolversion="1.16" status="SINGLE_RESULT">true</well-formed>
<valid toolname="Jhove" toolversion="1.16" status="SINGLE_RESULT">true</valid>
</filestatus>
<metadata>
<audio>
<numSamples toolname="OIS Audio Information" toolversion="0.1" status="SINGLE_RESULT">299159</numSamples>
<sampleRate toolname="OIS Audio Information" toolversion="0.1">96000</sampleRate>
<audioDataEncoding toolname="OIS Audio Information" toolversion="0.1" status="CONFLICT">PCM</audioDataEncoding>
<audioDataEncoding toolname="Jhove" toolversion="1.16" status="CONFLICT">PCM audio in integer format</audioDataEncoding>
<audioDataEncoding toolname="Exiftool" toolversion="10.00" status="CONFLICT">Microsoft PCM</audioDataEncoding>
<blockAlign toolname="OIS Audio Information" toolversion="0.1" status="SINGLE_RESULT">3</blockAlign>
<time toolname="OIS Audio Information" toolversion="0.1" status="SINGLE_RESULT">458028579</time>
<channels toolname="OIS Audio Information" toolversion="0.1">1</channels>
<bitDepth toolname="OIS Audio Information" toolversion="0.1">24</bitDepth>
<wordSize toolname="OIS Audio Information" toolversion="0.1" status="SINGLE_RESULT">3</wordSize>
<offset toolname="OIS Audio Information" toolversion="0.1">46</offset>
<byteOrder toolname="Jhove" toolversion="1.16" status="SINGLE_RESULT">LITTLE_ENDIAN</byteOrder>
<duration toolname="Exiftool" toolversion="10.00" status="SINGLE_RESULT">3.12 s</duration>
</audio>
</metadata>
<statistics fitsExecutionTime="477">
<tool toolname="MediaInfo" toolversion="0.7.75" status="did not run" />
<tool toolname="OIS Audio Information" toolversion="0.1" executionTime="172" />
<tool toolname="ADL Tool" toolversion="0.1" status="did not run" />
<tool toolname="Droid" toolversion="6.1.5" executionTime="266" />
<tool toolname="Jhove" toolversion="1.16" executionTime="443" />
<tool toolname="file utility" toolversion="5.04" executionTime="414" />
<tool toolname="Exiftool" toolversion="10.00" executionTime="432" />
<tool toolname="NLNZ Metadata Extractor" toolversion="3.6GA" status="did not run" />
<tool toolname="OIS File Information" toolversion="0.2" executionTime="167" />
<tool toolname="OIS XML Metadata" toolversion="0.2" status="did not run" />
<tool toolname="ffident" toolversion="0.2" executionTime="408" />
<tool toolname="Tika" toolversion="1.10" executionTime="247" />
</statistics>
</fits>

63 changes: 0 additions & 63 deletions testfiles/output/testchunk.wav.xml

This file was deleted.

62 changes: 62 additions & 0 deletions testfiles/output/testchunk.wav_XmlUnitExpectedOutput.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
<?xml version="1.0" encoding="UTF-8"?>
<fits xmlns="http://hul.harvard.edu/ois/xml/ns/fits/fits_output" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hul.harvard.edu/ois/xml/ns/fits/fits_output http://hul.harvard.edu/ois/xml/xsd/fits/fits_output.xsd" version="1.1.0" timestamp="4/6/17 12:11 PM">
<identification>
<identity format="Waveform Audio" mimetype="audio/x-wave" toolname="FITS" toolversion="1.1.0">
<tool toolname="OIS Audio Information" toolversion="0.1" />
<tool toolname="Droid" toolversion="6.1.5" />
<tool toolname="Jhove" toolversion="1.16" />
<tool toolname="file utility" toolversion="5.04" />
<tool toolname="Exiftool" toolversion="10.00" />
<version toolname="Droid" toolversion="6.1.5">2 PCM Encoding</version>
<externalIdentifier toolname="Droid" toolversion="6.1.5" type="puid">fmt/705</externalIdentifier>
</identity>
</identification>
<fileinfo>
<size toolname="Jhove" toolversion="1.16">3986952</size>
<filepath toolname="OIS File Information" toolversion="0.2" status="SINGLE_RESULT">/Users/dan179/git/git-daveneiman/fits/testfiles/testchunk.wav</filepath>
<filename toolname="OIS File Information" toolversion="0.2" status="SINGLE_RESULT">testchunk.wav</filename>
<md5checksum toolname="OIS File Information" toolversion="0.2" status="SINGLE_RESULT">2f3b3492bcce357f62f3ebee17f47830</md5checksum>
<fslastmodified toolname="OIS File Information" toolversion="0.2" status="SINGLE_RESULT">1446674963000</fslastmodified>
</fileinfo>
<filestatus>
<well-formed toolname="Jhove" toolversion="1.16" status="SINGLE_RESULT">true</well-formed>
<valid toolname="Jhove" toolversion="1.16" status="SINGLE_RESULT">true</valid>
<message toolname="Jhove" toolversion="1.16" status="SINGLE_RESULT">Chunk type 'FLLR' ignored offset=910</message>
<message toolname="Jhove" toolversion="1.16" status="SINGLE_RESULT">Chunk type 'MD5 ' ignored offset=3986310</message>
<message toolname="Jhove" toolversion="1.16" status="SINGLE_RESULT">Chunk type 'axml' ignored offset=3986366</message>
</filestatus>
<metadata>
<audio>
<numSamples toolname="OIS Audio Information" toolversion="0.1" status="SINGLE_RESULT">1323000</numSamples>
<sampleRate toolname="OIS Audio Information" toolversion="0.1">44100</sampleRate>
<audioDataEncoding toolname="OIS Audio Information" toolversion="0.1" status="CONFLICT">PCM</audioDataEncoding>
<audioDataEncoding toolname="Jhove" toolversion="1.16" status="CONFLICT">PCM audio in integer format</audioDataEncoding>
<audioDataEncoding toolname="Exiftool" toolversion="10.00" status="CONFLICT">Microsoft PCM</audioDataEncoding>
<blockAlign toolname="OIS Audio Information" toolversion="0.1" status="SINGLE_RESULT">3</blockAlign>
<time toolname="OIS Audio Information" toolversion="0.1" status="SINGLE_RESULT">0</time>
<channels toolname="OIS Audio Information" toolversion="0.1">1</channels>
<bitDepth toolname="OIS Audio Information" toolversion="0.1">24</bitDepth>
<wordSize toolname="OIS Audio Information" toolversion="0.1" status="SINGLE_RESULT">3</wordSize>
<offset toolname="OIS Audio Information" toolversion="0.1" status="CONFLICT">17048</offset>
<offset toolname="Jhove" toolversion="1.16" status="CONFLICT">17302</offset>
<byteOrder toolname="Jhove" toolversion="1.16" status="SINGLE_RESULT">LITTLE_ENDIAN</byteOrder>
<duration toolname="Exiftool" toolversion="10.00" status="SINGLE_RESULT">0:00:30</duration>
</audio>
</metadata>
<statistics fitsExecutionTime="382">
<tool toolname="MediaInfo" toolversion="0.7.75" status="did not run" />
<tool toolname="OIS Audio Information" toolversion="0.1" executionTime="4" />
<tool toolname="ADL Tool" toolversion="0.1" status="did not run" />
<tool toolname="VTT Tool" toolversion="0.1" status="did not run" />
<tool toolname="Droid" toolversion="6.1.5" executionTime="362" />
<tool toolname="Jhove" toolversion="1.16" executionTime="72" />
<tool toolname="file utility" toolversion="5.04" executionTime="96" />
<tool toolname="Exiftool" toolversion="10.00" executionTime="195" />
<tool toolname="NLNZ Metadata Extractor" toolversion="3.6GA" status="did not run" />
<tool toolname="OIS File Information" toolversion="0.2" executionTime="48" />
<tool toolname="OIS XML Metadata" toolversion="0.2" status="did not run" />
<tool toolname="ffident" toolversion="0.2" executionTime="11" />
<tool toolname="Tika" toolversion="1.10" executionTime="121" />
</statistics>
</fits>

Loading

0 comments on commit 447db7e

Please sign in to comment.