UNPKG

hytopia

Version:

The HYTOPIA SDK makes it easy for developers to create massively multiplayer games using JavaScript or TypeScript.

58 lines (28 loc) 1.03 kB
<!-- Do not edit this file. It is automatically generated by API Documenter. --> [Home](./index.md) &gt; [server](./server.md) &gt; [Audio](./server.audio.md) &gt; [setCutoffDistance](./server.audio.setcutoffdistance.md) ## Audio.setCutoffDistance() method Sets the cutoff distance of the audio. **Signature:** ```typescript setCutoffDistance(cutoffDistance: number): void; ``` ## Parameters <table><thead><tr><th> Parameter </th><th> Type </th><th> Description </th></tr></thead> <tbody><tr><td> cutoffDistance </td><td> number </td><td> The cutoff distance. </td></tr> </tbody></table> **Returns:** void ## Remarks The cutoff distance defines the maximum range at which the audio can be heard. Beyond this distance, the audio volume becomes zero. As the listener moves from the reference distance toward the cutoff distance, the volume decreases linearly, providing a natural spatial audio experience with smooth volume falloff based on distance.