import { addAudio } from './addAudio';
export const audioSourceDistanceK = 1.43;
/**
 * Add a point sound to a HNode.
 * A point sound is a helper for addAudio where radius is use to define the size of the audio source.
 * The audio will get stronger the closer you get to the source.
 * radius in meters, approximately.
 * @example
 * ```
 * const cube = getPrefab({ p: [0, 0, 5] });
 * addPointSound(cube, 'a_am_birds_and_insects_01', 10);
 * addTo(root, cube);
 * ```
 */
export const addPointSound = (node, id, radius = 10, volume) => {
    radius = radius * audioSourceDistanceK;
    const minAttenuationDist = radius * 0.25;
    const maxAttenuationDist = radius;
    const startPlayingDist = radius * 1.01;
    volume = volume || 2;
    return addAudio(node, { id, minAttenuationDist, maxAttenuationDist, startPlayingDist, volume });
};
//# sourceMappingURL=addPointSound.js.map