Skip to content

Commit

Permalink
Add WPT testing AAC AudioDecoderConfig w/o description
Browse files Browse the repository at this point in the history
Add a AAC-without-AudioDecoderConfig-description WPT for bug 1891082.

Differential Revision: https://phabricator.services.mozilla.com/D221279

bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1917721
gecko-commit: c6f1b0c070ef8e32491c92dbec1f3a8ba4f96a24
gecko-reviewers: media-playback-reviewers, padenot
  • Loading branch information
ChunMinChang authored and moz-wptsync-bot committed Oct 4, 2024
1 parent 38d6fa7 commit 230b6f5
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions webcodecs/audioDecoder-codec-specific.https.any.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// META: script=/webcodecs/utils.js
// META: variant=?adts_aac
// META: variant=?mp4_aac
// META: variant=?mp4_raw_aac_no_desc
// META: variant=?mp3
// META: variant=?opus
// META: variant=?pcm_alaw
Expand Down Expand Up @@ -70,6 +71,30 @@ const MP4_AAC_DATA = {
duration: 21333
};

// By spec, if the description is absent, the bitstream defaults to ADTS format.
// However, this is added to ensure compatibility and handle potential misuse cases.
const MP4_AAC_DATA_NO_DESCRIPTION = {
src: 'sfx-aac.mp4',
config: {
codec: 'mp4a.40.2',
sampleRate: 48000,
numberOfChannels: 1,
},
chunks: [
{offset: 44, size: 241},
{offset: 285, size: 273},
{offset: 558, size: 251},
{offset: 809, size: 118},
{offset: 927, size: 223},
{offset: 1150, size: 141},
{offset: 1291, size: 217},
{offset: 1508, size: 159},
{offset: 1667, size: 209},
{offset: 1876, size: 176},
],
duration: 21333
};

const OPUS_DATA = {
src: 'sfx-opus.ogg',
config: {
Expand Down Expand Up @@ -162,6 +187,7 @@ promise_setup(async () => {
'?adts_aac': ADTS_AAC_DATA,
'?mp3': MP3_DATA,
'?mp4_aac': MP4_AAC_DATA,
'?mp4_raw_aac_no_desc': MP4_AAC_DATA_NO_DESCRIPTION,
'?opus': OPUS_DATA,
'?pcm_alaw': PCM_ALAW_DATA,
'?pcm_ulaw': PCM_ULAW_DATA,
Expand Down

0 comments on commit 230b6f5

Please sign in to comment.