Raised This Month: $ Target: $400
 0% 

Problem With EmitSound


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
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
 


Thread Tools
Display Modes

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 04:57.


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