EmitSoundAny - Cross-game sound emitting (aka CS:GO compatible) (1.0.2, 2014-03-19)
6 Attachment(s)
As of a 2018 CS:GO update, this include is no longer necessary
Warning: This only works for MP3s Version: 1.0.3 Changelog
What is EmitSoundAny So, what's the point of this? Well, it's to provide a simple include that plugins can use to have CS:GO and DOTA2 compatible sound playing. If you have read the CS:GO Quirks page, you know that CS:GO doesn't work with PrecacheSound and EmitSound without having to go through some tricks. So... I wrote this include, which neatly wraps the game detection and precaches/emits appropriately. The wrappers it includes are: Code:
stock bool:PrecacheSoundAny(const String:szPath[], bool:preload=false) Usage of this is the same as playing sounds in most game using SourceMod: PHP Code:
Edit 2: Edit to make g_bCheckedEngine actually save its value to stop GetEngineVersion from being called every time. |
Re: EmitSoundAny - Cross-game sound emitting (aka CS:GO compatible)
Ok.
Just thinking maybe it no harm add that sound char * for everygame :/ |
Re: EmitSoundAny - Cross-game sound emitting (aka CS:GO compatible)
Quote:
Also you never set g_bCheckedEngine to true ;) |
Re: EmitSoundAny - Cross-game sound emitting (aka CS:GO compatible)
Quote:
|
Re: EmitSoundAny - Cross-game sound emitting (aka CS:GO compatible)
I uploaded version 1.0.2, which includes these fixes:
|
Re: EmitSoundAny - Cross-game sound emitting (aka CS:GO compatible) (1.0.2, 2014-03-1
Very handy, they should roll it in.
|
Re: EmitSoundAny - Cross-game sound emitting (aka CS:GO compatible) (1.0.2, 2014-03-1
Quote:
|
Re: EmitSoundAny - Cross-game sound emitting (aka CS:GO compatible) (1.0.2, 2014-03-1
I changed a round sounds plugin to use this and now the sound has gone from being normal levels (using the CS:GO Quirks workaround) to being so quiet it can barely be heard. Do you have any idea why this could be?
|
Re: EmitSoundAny - Cross-game sound emitting (aka CS:GO compatible) (1.0.2, 2014-03-1
Quote:
|
Re: EmitSoundAny - Cross-game sound emitting (aka CS:GO compatible) (1.0.2, 2014-03-1
No just the fakeprecache sound method with the * before the filename. I may have foolishly saved over the changed version I made but I'll try to replicate it.
Just to be sure, even though my sounds aren't in the music folder I tried adjusting the music volume which made no difference, and tried to change the SNDLEVEL in the include which also didn't increase it at all. |
Re: EmitSoundAny - Cross-game sound emitting (aka CS:GO compatible) (1.0.2, 2014-03-1
Quote:
|
Re: EmitSoundAny - Cross-game sound emitting (aka CS:GO compatible) (1.0.2, 2014-03-1
Actually after testing with the original plugin, it seems like it's only some audio files. Checking them with mediainfo shows they're all encoded identically (all mp3's, same bitrate, same sampling rate) yet play at vastly different volumes.
I'll try to replicate with the normal volume sounds using this include and compare like for like. Do you know why some sounds would be quiet though? Edit: Sorry it's hard to tell as the plugin picks sounds at random to play at the end, but it seems there's a mixed success rate with either method. Is there a file size limit to fake precaching a sound? That's the only discriminating factor between any of my audio files. What plays consistently works, and what doesn't play consistently doesn't. All sounds can be played in WinAMP, WMP, iTunes and VLC so there's nothing iffy about the files. |
Re: EmitSoundAny - Cross-game sound emitting (aka CS:GO compatible) (1.0.2, 2014-03-1
Interestingly enough they play at normal levels on CS:S using the original, non-quirk, version of the plugin.
|
Re: EmitSoundAny - Cross-game sound emitting (aka CS:GO compatible) (1.0.2, 2014-03-1
Hi!
I found this page because i searched to a problem because my cs go server has a admin sound plugin and if i want to play a sound the following problem has cought me : Failed to load sound file can't create mixer! And i found this site for a solution...... and i just don't know whato to do this codes or what this emitting thing.... i'm lost...... so can someone help me to fix this? snd_rebuildaudiocache is not working |
Re: EmitSoundAny - Cross-game sound emitting (aka CS:GO compatible) (1.0.2, 2014-03-1
Quote:
|
Re: EmitSoundAny - Cross-game sound emitting (aka CS:GO compatible) (1.0.2, 2014-03-1
1 Attachment(s)
I've added StopSoundAny (because StopSound not work in csgo..) and works fine with csgo (other games untested).
|
Re: EmitSoundAny - Cross-game sound emitting (aka CS:GO compatible) (1.0.2, 2014-03-1
Quote:
For that matter, wouldn't playing the same sound again on a different channel with 0.0 volume not actually stop it? |
Re: EmitSoundAny - Cross-game sound emitting (aka CS:GO compatible) (1.0.2, 2014-03-1
Quote:
|
Re: EmitSoundAny - Cross-game sound emitting (aka CS:GO compatible) (1.0.2, 2014-03-1
1 Attachment(s)
Quote:
Besides, I've wrote a version after I saw your first version. Having said that, there is one problem with it... you should only use StopSoundAny on sounds you've emitted with EmitSoundAny as sounds emitted by the game engine won't necessarily start with * as they're not subject to the CS:GO Quirks restrictions. |
Re: EmitSoundAny - Cross-game sound emitting (aka CS:GO compatible) (1.0.2, 2014-03-1
Somehow the compiler crashed when i compile it :/
possibly i'm using SM 1.7.. i will have to go for traditional way to EmitSound for csgo then .. |
Re: EmitSoundAny - Cross-game sound emitting (aka CS:GO compatible) (1.0.2, 2014-03-1
do I still need to force clients to download custom content from server? i.e. from folder sound/music/MYOWNFOLDER/*.* using separate plugin?
|
Re: EmitSoundAny - Cross-game sound emitting (aka CS:GO compatible) (1.0.2, 2014-03-1
Quote:
Having said that, this is only a plugin fragment intended to be included in other plugins that need to be able to play sounds on both CS:GO and older games (like CS:S). |
Re: EmitSoundAny - Cross-game sound emitting (aka CS:GO compatible) (1.0.2, 2014-03-1
Quote:
|
Re: EmitSoundAny - Cross-game sound emitting (aka CS:GO compatible) (1.0.2, 2014-03-1
PHP Code:
|
Re: EmitSoundAny - Cross-game sound emitting (aka CS:GO compatible) (1.0.2, 2014-03-1
Quote:
Having said that, I've noticed I can't compiler the EmitSoundAny version of MapChooser Extended Sounds under 1.7. The errors it spits don't seem to make sense either. I'll have to look into that. Quote:
|
Re: EmitSoundAny - Cross-game sound emitting (aka CS:GO compatible) (1.0.2, 2014-03-1
Quote:
remember: source engine may not support wav sounds, you can use mp3 sounds. |
Re: EmitSoundAny - Cross-game sound emitting (aka CS:GO compatible) (1.0.2, 2014-03-1
Quote:
|
Re: EmitSoundAny - Cross-game sound emitting (aka CS:GO compatible) (1.0.2, 2014-03-1
Quote:
|
Re: EmitSoundAny - Cross-game sound emitting (aka CS:GO compatible) (1.0.2, 2014-03-1
Hey, I tried using your .include with my Sound plugin but the Sound didn't play and I also didn't get any Error either the Client console and Server console.
My Code looks like the following: Code:
public OnMapStart() |
Re: EmitSoundAny - Cross-game sound emitting (aka CS:GO compatible) (1.0.2, 2014-03-1
Can you give me example of StopSoundAny?
|
Re: EmitSoundAny - Cross-game sound emitting (aka CS:GO compatible) (1.0.2, 2014-03-1
Quote:
if you emit a sound of "bot/hate.wav" you can use StopSound to with "bot/hate.wav" |
Re: EmitSoundAny - Cross-game sound emitting (aka CS:GO compatible) (1.0.2, 2014-03-1
so it's something like that?
StopSoundAny(entity, _, "music/l4d/tank/1.mp3"); |
Re: EmitSoundAny - Cross-game sound emitting (aka CS:GO compatible) (1.0.2, 2014-03-1
Hi, I am working with someone else's plugin, trying to make it use this include. Here's what I've got:
PHP Code:
|
Re: EmitSoundAny - Cross-game sound emitting (aka CS:GO compatible) (1.0.2, 2014-03-1
Quote:
|
Re: EmitSoundAny - Cross-game sound emitting (aka CS:GO compatible) (1.0.2, 2014-03-1
Thanks, that got it working!!
|
Re: EmitSoundAny - Cross-game sound emitting (aka CS:GO compatible) (1.0.2, 2014-03-1
Could it be that this is not needed anymore? When I'm using this the sounds are not working, using standard sourcemod EmitSound works again.
|
Re: EmitSoundAny - Cross-game sound emitting (aka CS:GO compatible) (1.0.2, 2014-03-1
I've found a "bug".
Code:
stock EmitAmbientSoundAny(const String:name[], |
Re: EmitSoundAny - Cross-game sound emitting (aka CS:GO compatible) (1.0.2, 2014-03-1
Quote:
|
Re: EmitSoundAny - Cross-game sound emitting (aka CS:GO compatible) (1.0.2, 2014-03-1
ok, he deleted in second of my post :D
so... Still works for me. https://github.com/shanapu/MyJailbre...tSoundToAllAny |
Re: EmitSoundAny - Cross-game sound emitting (aka CS:GO compatible) (1.0.2, 2014-03-1
I have this sound: EmitAmbientSoundAny(GRAB_PATH, vec);
How to stop it? I tryed StopSoundAny(SOUND_FROM_WORLD,SNDCHAN_AUTO, GRAB_PATH); but it don't works help me please |
All times are GMT -4. The time now is 09:50. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.