Raised This Month: $32 Target: $400
 8% 

Problem With EmitSound


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Alexunder
Member
Join Date: Jun 2018
Old 01-11-2022 , 02:54   Problem With EmitSound
Reply With Quote #1

hi guys ,
EmitSound has problems with some sounds !!!
for example :
Code:
EmitSoundToAllAny("music/test1.mp3", SNDCHAN_AUTO, SNDLEVEL_NORMAL, SND_NOFLAGS, SNDVOL_NORMAL);
Not play , but :
Code:
ClientCommand(client, "play music/test1.mp3");
is play !!

with emitsound some sounds have problem to hear , but in "play *" all music it's play

all sounds is PrecacheSound in map start and all sounds bitrate is 128 with sample rate 44100 and stereo
Alexunder is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 01-11-2022 , 04:06   Re: Problem With EmitSound
Reply With Quote #2

What game ?

What is this ?
EmitSoundToAllAny
__________________
Do not Private Message @me
Bacardi is offline
Alexunder
Member
Join Date: Jun 2018
Old 01-12-2022 , 13:39   Re: Problem With EmitSound
Reply With Quote #3

Quote:
Originally Posted by Bacardi View Post
What game ?

What is this ?
EmitSoundToAllAny
CS:GO

EmitSoundAny : https://forums.alliedmods.net/showthread.php?t=237045

i also used EmitSoundToAll, the problem persisted
Alexunder is offline
PC Gamer
Veteran Member
Join Date: Mar 2014
Old 01-12-2022 , 22:26   Re: Problem With EmitSound
Reply With Quote #4

Did you try something like this?

PHP Code:
public OnMapStart()
{
    
AddFileToDownloadsTable("music/test1.mp3");
    
PrecacheSoundAny("music/test1.mp3");
}


later in code...

    
EmitSoundToAllAny("music/test1.mp3"); 
PC Gamer is offline
Alexunder
Member
Join Date: Jun 2018
Old 01-14-2022 , 17:07   Re: Problem With EmitSound
Reply With Quote #5

Quote:
Originally Posted by PC Gamer View Post
Did you try something like this?

PHP Code:
public OnMapStart()
{
    
AddFileToDownloadsTable("music/test1.mp3");
    
PrecacheSoundAny("music/test1.mp3");
}


later in code...

    
EmitSoundToAllAny("music/test1.mp3"); 
yes man , if "precache sound" it's my problem , why ClientCommand is work .. or why emitsound have problem for some music ...
Alexunder is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 01-15-2022 , 02:31   Re: Problem With EmitSound
Reply With Quote #6

Quote:
Originally Posted by Alexunder View Post
hi guys ,
EmitSound has problems with some sounds !!!
for example :
Code:
EmitSoundToAllAny("music/test1.mp3", SNDCHAN_AUTO, SNDLEVEL_NORMAL, SND_NOFLAGS, SNDVOL_NORMAL);
Not play , but :
Code:
ClientCommand(client, "play music/test1.mp3");
is play !!

with emitsound some sounds have problem to hear , but in "play *" all music it's play

all sounds is PrecacheSound in map start and all sounds bitrate is 128 with sample rate 44100 and stereo
...you skip second parameter (entity), you gave value SNDCHAN_AUTO which is 0 and played to "world" coordinate 0.0,0.0,0.0
PHP Code:
stock EmitSoundToAllAny(const String:sample[], 
                 
entity SOUND_FROM_PLAYER
                 
channel SNDCHAN_AUTO
                 
level SNDLEVEL_NORMAL
                 
flags SND_NOFLAGS
                 
Float:volume SNDVOL_NORMAL
                 
pitch SNDPITCH_NORMAL
                 
speakerentity = -1
                 const 
Float:origin[3] = NULL_VECTOR
                 const 
Float:dir[3] = NULL_VECTOR
                 
bool:updatePos true
                 
Float:soundtime 0.0
Try, do this work.
Code:
EmitSoundToAllAny("music/test1.mp3");

and should it be ?
Code:
public OnMapStart()
{
    AddFileToDownloadsTable("sound/music/test1.mp3");
    PrecacheSoundAny("music/test1.mp3");
}
remember change level, to make sure it works.
Read client console as well, what kind error it gives you.
__________________
Do not Private Message @me

Last edited by Bacardi; 01-15-2022 at 02:33.
Bacardi 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 08:50.


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