# Sound spectrum problem

**URL:** https://forum.kirupa.com/t/sound-spectrum-problem/301647
**Category:** Uncategorized
**Created:** [December 13, 2009, 7:05am UTC](https://forum.kirupa.com/t/sound-spectrum-problem/301647 "2009-12-13T07:05:45Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![lope](https://avatars.discourse-cdn.com/v4/letter/l/43a26b/32.png) [@lope](https://forum.kirupa.com/u/lope)
#### Post date: [December 13, 2009, 7:05am UTC](https://forum.kirupa.com/t/sound-spectrum-problem/301647/1 "2009-12-13T07:05:45Z")

</div>

i have this in my enter frame while song plays:

```auto
if (_spectrumOpened && !SoundMixer.areSoundsInaccessible()) {
    doLineSpectrum();
}

```

yet, its still tracing an error:

SecurityError: Error #2121: Security sandbox violation: SoundMixer.computeSpectrum: file:///K|/flash%20%20sites%5Factionscript%203/%5F%5F%5F%5FCLASSES/mp3%20player%2044.swf cannot access . This may be worked around by calling Security.allowDomain.

```auto

function doLineSpectrum():void {

    g.clear();
    g.lineStyle(_spectrumLineThickness, _spectrumColor);
    g.moveTo(0, spectrum_mc.spectrumBg_mc.height / 2);
    try {
        SoundMixer.computeSpectrum(_byteArr);

        for (var i:int=0; i<256; i++) {
            var num:Number = - _byteArr.readFloat() * _spectrumAmplifier + spectrum_mc.spectrumBg_mc.height / 2;
            g.lineTo(i * _spectrumLength, num);
        }
    } catch (er:Error) {
        trace(er);
    }
}

```

if this returns false: !SoundMixer.areSoundsInaccessible() why am i getting Security sandbox violation ?
