p5.Gain.amp() throws this.node.volume is undefined
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 25/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Estancado
- Stack tecnológico
- javascript
- Área
- audio-video-rtc
Línea de trabajo
Start with the p5.Gain.amp() and SoundFile.setVolume() implementations and their tests, then trace how their output nodes are created for p5.js v2. Reproduce the reported errors with the linked sketch and check the volume APIs against the documented behavior. Done means both APIs adjust volume without throwing; an open pull request is already linked to this issue.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Example on this sketch: https://editor.p5js.org/leocb/sketches/qYCmn3F2x
Environment:
- p5.js: 2.3.4 (CDN)
- p5.sound: 0.4.1 (CDN:
https://cdn.jsdelivr.net/npm/[email protected]/dist/p5.sound.min.js) - Browser: Firefox (latest, macOS)
Description:
When using p5.sound v0.4.1 with p5.js v2, the volume-control APIs appear to be broken or missing.
p5.Gain.amp() throws a TypeError:
Calling gain.amp(level) on a p5.Gain instance produces:
TypeError: can't access property "rampTo", this.node.volume is undefined
This suggests the internal node object created by the library (likely a Tone.js node, given that p5.sound is an abstraction over Tone.js) does not expose a volume property in this version. The amp() method seems to be trying to call rampTo on an undefined volume object.
Workaround:
Accessing the underlying Web Audio GainNode directly bypasses the broken high-level API and works correctly:
// For p5.SoundFile:
soundFile.output.gain.value = level;
// For p5.Gain:
gain.output.gain.value = level;
This confirms that the audio graph is correctly constructed and the output node is a valid GainNode, but the wrapper methods (amp and setVolume) are not functioning as expected in this version.
Expected behavior:
gain.amp(level)should adjust the gain node's volume without throwing an error, as described in the reference.soundFile.setVolume(level)should exist and adjust the volume as documented.
Steps to reproduce:
- Load p5.js v2 and p5.sound v0.4.1.
- Create a
p5.Gainand connect aSoundFileto it. - Call
gain.amp(0.5)indraw()→ observe therampToerror. - Alternatively, call
soundFile.setVolume(0.5)→ observe the "not a function" error.
- Lenguaje dominante
- JavaScript
- Estrellas
- 60
- Forks
- 28
- Merge medio
- 8 h 53 min
- PR fusionados (30 d)
- 2
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de processing/p5.sound.js
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
processing/p5.sound.js#132 · 2 comentarios ·
-
play() stays silent after pause() then stop()Posiblemente ocupada @ksen0 la tomó hace 3 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
processing/p5.sound.js#131 · 3 comentarios · 1 asignado ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
processing/p5.sound.js#130 · 1 comentario ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
processing/p5.sound.js#127 · 3 comentarios ·
-
Add currentTime() methodAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
processing/p5.sound.js#113 · 1 comentario · 1 reacción ·
Todos los issues de processing/p5.sound.js
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
githubnext/gh-aw-workshop#5522 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Dayset/ps2-elite-kd#119 ·
-
Add: Hindi Hits LogoAbiertocheck:passed logos:add
Dificultad 1/5 Menos de una hora Aptitud para principiantes 76/100
Los mantenedores suelen responder en 1 día
-
area:models enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Los mantenedores suelen responder en 1 día
-
scout
Dificultad 1/5 1-3 horas Aptitud para principiantes 88/100
oskarrough/agent-ide#43 ·