How to create very basic left/right equal power panning with createPanner();

前端 未结 3 1992
情歌与酒
情歌与酒 2020-12-09 13:54

I am looking at the web audio API spec and the panning node uses three values to create a 3D spectrum for sound. I was wondering if in order to create a basic 2D \"equal pow

3条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-09 14:19

    The panner node defaults to "HRTF" (Head Related Transfer Function) which is a stereo convolution engine and it is designed for 3D sound.

    In order to have basic panning functionality and lower resource usage you need to set panningModel attribute to "equalpower".

    var panner = context.createPanner();
    panner.panningModel = "equalpower";
    panner.setPosition(1,0,0);
    

    Check the documentation for more details.

提交回复
热议问题