Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FEAT: Updated audio outputs to conform to the AES57-2011 spec #944

Merged
merged 2 commits into from
Aug 21, 2024

Conversation

carlwilson
Copy link
Member

Copied from #357 contributed by @pwinckles, thanks! Apologies the PR was old enough to make merging difficult. My only contribution was the JSON handler output.

The AES output that JHOVE currently generates does not conform to the AES57-2011 spec. The schema can be found here.

This commit updates JHOVE to produce a valid AES57-2011 document. The bulk of the changes are related to how times and durations are reported. The original code generated a structure like this:

<tcf:duration tcf:frameCount="30" tcf:timeBase="1000" tcf:videoField="FIELD_1" tcf:countingMode="NTSC_NON_DROP_FRAME">
  <tcf:hours>0</tcf:hours>
  <tcf:minutes>0</tcf:minutes>
  <tcf:seconds>12</tcf:seconds>
  <tcf:frames>29</tcf:frames>
  <tcf:samples tcf:sampleRate="S44100">
    <tcf:numberOfSamples>121</tcf:numberOfSamples>
  </tcf:samples>
  <tcf:filmFraming tcf:framing="NOT_APPLICABLE" xsi:type="tcf:ntscFilmFramingType"/>
</tcf:duration>

The same information is now represented like this:

<aes:duration editRate="44100" factorNumerator="1" factorDenominator="1">571951</aes:duration>

Another change affects the "channelAssignment" element. This element does not have a "mapLocation" attribute, as the current code adds. Instead, AES57-2011 uses two new attributes "leftRightPostion" and "frontRearPosition". Detailed descriptions of this attributes can be found on this page. I could not determine a way to map all of the possible JHOVE "mapLocations" to the new AES attributes (for example, what does "SURROUND" mean?), so I decided to leave them out rather than include potentially inaccurate data.

(As an aside, I suspect that the way that JHOVE is currently mapping channel location for 4-channel AIFF audio is incorrect. Per spec, it should be LEFT, CENTER, RIGHT, SURROUND. JHOVE maps it as LEFT, RIGHT, CENTER, SURROUND.)

Fixes #362 #367
Closes #357

Copied from #357 contributed by @pwinckles, thanks! Apologies the PR was old enough to make merging difficult. My only contribution was the JSON handler output.

The AES output that JHOVE currently generates does not conform to the AES57-2011 spec. The schema can be found [here](https://www.loc.gov/standards/amdvmd/audiovideoMDschemas.html).

This commit updates JHOVE to produce a valid AES57-2011 document. The bulk of the changes are related to how times and durations are reported. The original code generated a structure like this:
```xml
<tcf:duration tcf:frameCount="30" tcf:timeBase="1000" tcf:videoField="FIELD_1" tcf:countingMode="NTSC_NON_DROP_FRAME">
  <tcf:hours>0</tcf:hours>
  <tcf:minutes>0</tcf:minutes>
  <tcf:seconds>12</tcf:seconds>
  <tcf:frames>29</tcf:frames>
  <tcf:samples tcf:sampleRate="S44100">
    <tcf:numberOfSamples>121</tcf:numberOfSamples>
  </tcf:samples>
  <tcf:filmFraming tcf:framing="NOT_APPLICABLE" xsi:type="tcf:ntscFilmFramingType"/>
</tcf:duration>
```
The same information is now represented like this:
```xml
<aes:duration editRate="44100" factorNumerator="1" factorDenominator="1">571951</aes:duration>
```
Another change affects the "channelAssignment" element. This element does not have a "mapLocation" attribute, as the current code adds. Instead, AES57-2011 uses two new attributes "leftRightPostion" and "frontRearPosition". Detailed descriptions of this attributes can be found on [this page](https://rucore.libraries.rutgers.edu/open/projects/openwms/index.php?sec=guides&sub=metadata&pg=t_sound-qual). I could not determine a way to map all of the possible JHOVE "mapLocations" to the new AES attributes (for example, what does "SURROUND" mean?), so I decided to leave them out rather than include potentially inaccurate data.

(As an aside, I suspect that the way that JHOVE is currently mapping channel location for 4-channel AIFF audio is incorrect. [Per spec](http://www-mmsp.ece.mcgill.ca/Documents/AudioFormats/AIFF/Docs/AIFF-1.3.pdf), it should be LEFT, CENTER, RIGHT, SURROUND. JHOVE maps it as LEFT, RIGHT, CENTER, SURROUND.)

Fixes #362 #367
Closes #357
@carlwilson carlwilson added the feature New functionality to be developed label Aug 21, 2024
@carlwilson carlwilson added this to the JHOVE 1.32 milestone Aug 21, 2024
@carlwilson carlwilson self-assigned this Aug 21, 2024
- removed unused constants; and
- improved string comparisons.
@carlwilson carlwilson merged commit ea4d025 into integration Aug 21, 2024
6 checks passed
@carlwilson carlwilson deleted the fix/aes57-2011 branch August 21, 2024 09:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New functionality to be developed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

AES output does not conform to the AES57-2011 spec
1 participant