BufferGeometry
Object3D
Raycaster
Camera
CubeCamera
PerspectiveCamera
OrthographicCamera
StereoCamera
Clock
Curve
CurvePath
Path
Shape
ShapePath
ArrowHelper
AxesHelper
BoxHelper
Box3Helper
CameraHelper
DirectionalLightHelper
GridHelper
PolarGridHelper
HemisphereLightHelper
PlaneHelper
PointLightHelper
SkeletonHelper
SpotLightHelper
Light
PointLight
RectAreaLight
SpotLight
DirectionalLight
HemisphereLight
LightShadow
PointLightShadow
AnimationLoader
AudioLoader
BufferGeometryLoader
CompressedTextureLoader
CubeTextureLoader
DataTextureLoader
FileLoader
ImageBitmapLoader
ImageLoader
Loader
LoaderUtils
MaterialLoader
ObjectLoader
TextureLoader
LoadingManager
Material
Box2
Box3
Color
Cylindrical
Euler
Frustum
Interpolant
Line3
MathUtils
Matrix3
Matrix4
Plane
Quaternion
AnimationAction
AnimationClip
AnimationMixer
AnimationObjectGroup
AnimationUtils
keyframeTrack
PropertyBinding
PropertyMixer
BooleanKeyframeTrack
QuaternionKeyframeTrack
StringKeyframeTrack
Audio
AudioAnalyser
AudioContext
AudioListener
PositionalAudio

Audio.disconnect()

Audio.disconnect() 方法用于断开音频源和音频目标的连接。

语法

audio.disconnect(destination);

参数

  • destination:音频目标。如果不提供此参数,则断开所有连接。

示例

const context = new AudioContext();

const oscillator = context.createOscillator();
const gainNode = context.createGain();

// 将振荡器连接到增益节点
oscillator.connect(gainNode);

// 将扬声器连接到增益节点
gainNode.connect(context.destination);

// 断开扬声器和增益节点的连接
gainNode.disconnect(context.destination);

// 所有连接都已断开

注意事项

  • 如果没有提供 destination 参数,则会断开音频源和所有音频目标之间的所有连接。

参考链接