import { addAudio } from './addAudio';
import { audioSourceDistanceK } from './addPointSound';
/**
 * Add a sound cell where the sound is being played with the same volume within the radius.
 * A sound cell is good for example rooms where you want sound playing but not outside of it.
 * radius in meters, approximately.
 * @example
 * ```
 * const soundCenter = getGroup({ p: [0, 1, 0] });
 * addSoundCell(soundCenter, 'a_mu_bass_meant_jazz_kevin_macleod_01', 10);
 * addTo(root, soundCenter);
 * ```
 */
export const addSoundCell = (node, id, radius = 10, volume) => {
    radius = radius * audioSourceDistanceK;
    const minAttenuationDist = radius;
    const maxAttenuationDist = radius;
    const startPlayingDist = radius * 1.01;
    volume = volume || 2;
    return addAudio(node, { id, minAttenuationDist, maxAttenuationDist, startPlayingDist, volume, rollOffFactor: 1 });
};
//# sourceMappingURL=addSoundCell.js.map