Raised This Month: $ Target: $400
 0% 

[CS:GO] Playing multiple sound files at ones


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
dilalmon
AlliedModders Donor
Join Date: Apr 2013
Old 03-26-2015 , 01:48   [CS:GO] Playing multiple sound files at ones
Reply With Quote #1

How does one play multiple sound files at once?
Because it's CS:GO, I'm using the "*" trick on EmitSound.

It looks like when I try to play the next sound file, the previous file cuts off. They all use these settings:

Code:
                 entity = SOUND_FROM_PLAYER, 
                 channel = SNDCHAN_AUTO, 
                 level = SNDLEVEL_NORMAL, 
                 flags = SND_NOFLAGS, 
                 Float:volume = SNDVOL_NORMAL, 
                 pitch = SNDPITCH_NORMAL,
dilalmon is offline
dilalmon
AlliedModders Donor
Join Date: Apr 2013
Old 03-26-2015 , 19:54   Re: [CS:GO] Playing multiple sound files at ones
Reply With Quote #2

Is this not possible with plugins?
dilalmon is offline
RedSword
SourceMod Plugin Approver
Join Date: Mar 2006
Location: Quebec, Canada
Old 03-26-2015 , 21:49   Re: [CS:GO] Playing multiple sound files at ones
Reply With Quote #3

I ran on a similar problem a long time ago and I believe I just toyed around with different channels.

I believe there is either one channel that allows more than 1 sound at a time or you should use two channels, they shouldn't conflict with each other.

Sorry for the incertitude,

Red
__________________
My plugins :
Red Maze
Afk Bomb
RAWR (per player/rounds Awp Restrict.)
Kill Assist
Be Medic

You can also Donate if you appreciate my work
RedSword is offline
dilalmon
AlliedModders Donor
Join Date: Apr 2013
Old 03-26-2015 , 22:06   Re: [CS:GO] Playing multiple sound files at ones
Reply With Quote #4

That's a little bit of light of hope.
Can you remember what channel it was?

If I were to use multiple channels, where can I find EMPTY ones?
dilalmon is offline
RedSword
SourceMod Plugin Approver
Join Date: Mar 2006
Location: Quebec, Canada
Old 03-26-2015 , 22:35   Re: [CS:GO] Playing multiple sound files at ones
Reply With Quote #5

I can't remember anything for certain.

It might have been that I wasn't using any EmitSound, but rather
Code:
ClientCommand(client, "play *%s", sample);
nop

Red

EDIT : Ugh, just tested the above in my CSGO client (with no plugins); 1 sound max at a time :/
__________________
My plugins :
Red Maze
Afk Bomb
RAWR (per player/rounds Awp Restrict.)
Kill Assist
Be Medic

You can also Donate if you appreciate my work

Last edited by RedSword; 03-26-2015 at 22:47.
RedSword is offline
dilalmon
AlliedModders Donor
Join Date: Apr 2013
Old 03-27-2015 , 19:15   Re: [CS:GO] Playing multiple sound files at ones
Reply With Quote #6

Shame. Are there any channels we can use as plugin devleopers?
dilalmon is offline
hleV
Veteran Member
Join Date: Mar 2007
Location: Lithuania
Old 03-28-2015 , 06:53   Re: [CS:GO] Playing multiple sound files at ones
Reply With Quote #7

PHP Code:
enum
{
    
SNDCHAN_REPLACE = -1,        /**< Unknown */
    
SNDCHAN_AUTO 0,            /**< Auto */
    
SNDCHAN_WEAPON 1,            /**< Weapons */
    
SNDCHAN_VOICE 2,            /**< Voices */
    
SNDCHAN_ITEM 3,            /**< Items */
    
SNDCHAN_BODY 4,            /**< Player? */
    
SNDCHAN_STREAM 5,            /**< "Stream channel from the static or dynamic area" */
    
SNDCHAN_STATIC 6,            /**< "Stream channel from the static area" */
    
SNDCHAN_VOICE_BASE 7,        /**< "Channel for network voice data" */
    
SNDCHAN_USER_BASE 135        /**< Anything >= this is allocated to game code */
}; 
I am not sure if channel values (8 - 134) and (136 - ?) are usable and can't test right now, but you may want to give them a try. Basically each sound you want to play simultaneously should be emited (using Emit* functions) using different channel. I'm not sure how command "play" works and whether it uses any channel. You may want to try and mix "play" and Emit* if you're short on channels.
__________________
hleV is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 03-28-2015 , 17:17   Re: [CS:GO] Playing multiple sound files at ones
Reply With Quote #8

I was under the impression that you can use any channel you wish. I believe channel number is a byte, so values 1-255 should be valid.

However, do note that Source SDK 2013 games bump both SNDCHAN_VOICE_BASE and SNDCHAN_USER_BASE up by 1 each, as they add an additional channel as a second voice channel in position 7 (used by TF2's announcer).

I wouldn't be surprised if CS:S and CS:GO use this for radio voices.
__________________
Not currently working on SourceMod plugin development.

Last edited by Powerlord; 03-28-2015 at 17:19.
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 05:11.


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