# Turn off sound only - how

**URL:** <https://forum.kirupa.com/t/turn-off-sound-only-how/325563>\
**Category:** Uncategorized\
**Created:** [October 23, 2011, 5:06pm UTC](https://forum.kirupa.com/t/turn-off-sound-only-how/325563 "2011-10-23T17:06:08Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![drpelz](https://avatars.discourse-cdn.com/v4/letter/d/c68b51/32.png) [@drpelz](https://forum.kirupa.com/u/drpelz)\
**Post date:** [October 23, 2011, 5:06pm UTC](https://forum.kirupa.com/t/turn-off-sound-only-how/325563/1 "2011-10-23T17:06:08Z")

</div>

Hello,

I have this problem:

How do you turn off the sound in a game only? I ask because I have two buttons in my settings: turn music on/off and sound on/off. turning music on and off is really easy because it uses a specific sound channel. But How do you turn off the volume the sound only (e.g. music is still playing but not the sound of the game)?

When I mute the sound via SoundMixer.soundtransform you can’t hear anything so that’s not what I wanted to have. In my game all sounds are thrown into an array. My first idea was that I go through all sounds listed in the array and turn off the volume but that’s not working. Please - can anyone help? Thank you very much.

```auto

//not working

private var sounds:Array;
private var soundChannels:Array = [];
private var muteSoundTransform:SoundTransform = new SoundTransform();

public function muteSoundOnly():void {

muteSoundTransform.volume = 0;
            
var soundLength:int = soundChannels.length - 1;
for (var soundCtr:int = soundLength; soundCtr >= 0; soundCtr--)
{
                
    soundChannels[soundCtr].soundTransform = muteSoundTransform;
                
    }
            
}

```
