I played a sound with web audio api and used a gainNode to change the volume,When I changed the gainNode's value, the Decibel meter showed a number not expected.
context.createGain();
var source=context.createOscillator();
source.frequency.value=1000;
source.start();
source.connect(gainNode);
gainNode.connect(context.destination);
gainNode.gain.value=Math.pow(10, dbfs/20));
when dbfs=0,the Decibel meter showed 90 dbspl;
when dbfs=-10,the Decibel meter showed 84 dbspl;
when dbfs=-20,the Decibel meter showed 78 dbspl;
when dbfs=-30,the Decibel meter showed 72 dbspl;
when dbfs=-40,the Decibel meter showed 62 dbspl;
when dbfs=-50,the Decibel meter showed 52 dbspl;
the actual volume was not changed as expected, was there any mistake in generating the gainNode's value? I want to play the sound at 80 db spl or other specific numbers,what can be the dbfs's value and how to make the gainNode's value ?
Aucun commentaire:
Enregistrer un commentaire