Raised This Month: $51 Target: $400
 12% 

How to redirect sound from music channel to general?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Dragokas
Veteran Member
Join Date: Nov 2017
Location: Ukraine on fire
Old 02-02-2019 , 06:06   How to redirect sound from music channel to general?
Reply With Quote #1

Hi,

PHP Code:
#include <sourcemod>
#include <sdktools>

#define SOUND_UP_1            "ambient/atmosphere/cave_hit6.wav"
#define SOUND_UP_4            "music/zombiechoir/zombiechoir_04.wav"

public void OnPluginStart()
{
    
RegAdminCmd("sm_d"CmdDADMFLAG_ROOT"");
}

public 
Action CmdD(int clientint args)
{
    
PrintToChat(client"Playing");
    
    
float vec[3];
    
GetClientAbsOrigin(clientvec);
    
    
EmitSoundToClient(clientSOUND_UP_4_SNDCHAN_AUTO);
    
    
//EmitAmbientSound(SOUND_UP_4, vec, SOUND_FROM_WORLD, SOUL_SND_LEVEL, SND_NOFLAGS, 1.0);

SOUND_UP_1 is playing normally.
But, SOUND_UP_4, located in /music/ subfolder go to "music" channel. So if I adjust my game settings to 0 level of music volume, I can't hear that sound.
Is it possible to change sound type (without placing wav to another folder)?

I tried different SNDCHAN constants from inc, but it didn't help.
Thanks.
__________________
Expert of CMD/VBS/VB6. Malware analyst. L4D fun (Bloody Witch & FreeZone)
[My plugins] [My tools] [GitHub] [Articles] [HiJackThis+] [Donate]

Last edited by Dragokas; 02-02-2019 at 06:07.
Dragokas is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 02-02-2019 , 07:18   Re: How to redirect sound from music channel to general?
Reply With Quote #2

To my knowledge, music doesn't have its own dedicated channel. Instead, Source uses the music volume slider if the sound files are in the music directory.

You could always move it to a different directory if it's a custom sound file.
__________________
Not currently working on SourceMod plugin development.
Powerlord is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 03:00.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode