Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

AudioDecoder should let you specify an format for resulting AudioData

Abierto
#859 2 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
5/5
Tiempo estimado
Más de una semana
Aptitud para principiantes
30/100
Tipo de issue
Nueva funcionalidad
Claridad
Bastante claro
Estado de actividad
Estancado

Línea de trabajo

Comienza revisando las definiciones de WebCodecs AudioDecoder y AudioData, especialmente AudioData.copyTo; después, inspecciona el WPT citado del codificador de audio y sus channelNumberVariationTests. Se considera terminado cuando la especificación define un formato decodificado predeterminado y una sobrescritura de configuración, y las pruebas afectadas se comportan de forma coherente.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

The User Agent is free to choose how the decoding will be performed and what format it will use when creating the AudioData.

In theory, how the data is stored should indeed be an implementation details.

However, what format is chosen will impact on how AudioData.copyTo will behave and how it will interpret the planeIndex parameter.
Additionally, there's a few WPTs that relies on the decoded AudioData to be interleaved and error otherwise (such as https://wpt.live/webcodecs/audio-encoder.https.any.js and its channelNumberVariationTests)

AudioData::copyTo
"The output AudioSampleFormat for the destination data. If not provided, the resulting copy will use this AudioData’s [[format]"

With the default option, if we were to call copyTo with a planeIndex value of 0 and the AudioData was interleaved, we would copy all planes.
While if the AudioData was planar, copyTo with a planeIndex of 0 would copy only that particular plane.

That the internal UA choice on what to use impact the default behaviour for later created objects and change the behaviour means that it cannot be considered an implementation detail, it's not transparent and is directly observable.
And real-life experience already shows web compatibility between Chrome and Firefox (such as https://w3c.github.io/webcodecs/samples/audio-video-player/audio_video_player.html where the code expects the decoded AudioData to be planar and will have an exception as it attempts to copy the planar data in an array of float) as it doesn't specify what format to use with copyTo)

So we should specify what the default format the AudioDecoder should use and provide the ability to override it in the configuration.

Lenguaje dominante
HTML
Estrellas
1.3k
Forks
192
Merge medio
21 h 7 min
PR fusionados (30 d)
8

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de w3c/webcodecs

Todos los issues de w3c/webcodecs

Issues similares

Más issues de Backend & API Design

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.