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

[EXTENSION] EngineSound


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Knagg0
SourceMod Donor
Join Date: Dec 2005
Location: Germany
Old 06-12-2007 , 11:56   [EXTENSION] EngineSound
Reply With Quote #1

This extension allows you to call some functions of the enginesound interface

Install:
1. Extract 'enginesound.ext.dll' and 'enginesound.ext.so' to the 'addons/sourcemod/extensions' folder.
2. Extract 'enginesound.inc' to the 'addons/sourcemod/scripting/include' folder.

Natives:
Code:
/**
 * Prefetchs a given sound.
 *
 * @param sample		Name of the sound.
 * @noreturn
 */
native PrefetchSound(const String:sample[]);

/**
 * Gets the duration of a given sound.
 *
 * @param sample		Name of the sound.
 * @return			The duration.
 */
native Float:GetSoundDuration(const String:sample[]);

/**
 * Emit a given sound to one/all client(s).
 *
 * @param client		Index of the client to 'emit' the sound to (0 = all).
 * @param entity		Index of the entity to 'emit' the sound from.
 * @param channel		Channel of the sound.
 * @param sample		Name of the sound.
 * @param volume		Volume of the sound.
 * @param attenuation		Attenuation of the sound.
 * @param flags			Flags of the sound.
 * @param pitch			Pitch of the sound.
 * @param origin		Origin of the sound ({0.0,0.0,0.0} = ignore)
 * @param direction		Direction of the sound ({0.0,0.0,0.0} = ignore)
 * @param updateposition	Update the position of the sound (e.g. when the sound is attached to a player and he moves)
 * @param soundtime		How long the sound should play.
 * @param speakerentity
 * @noreturn
 */
native EmitSound(client, entity, channel, const String:sample[], Float:volume, Float:attenuation, flags=0, pitch=PITCH_NORM, Float:origin[3]={0.0,0.0,0.0}, Float:direction[3]={0.0,0.0,0.0}, bool:updateposition=true, Float:soundtime=0.0, speakerentity=-1);

/**
 * Emit a given sound to one/all client(s).
 * Same as EmitSound but it uses the soundlevel instead of attenuation.
 *
 * @param client		Index of the client to 'emit' the sound to (0 = all).
 * @param entity		Index of the entity to 'emit' the sound from.
 * @param channel		Channel of the sound.
 * @param sample		Name of the sound.
 * @param volume		Volume of the sound.
 * @param level			Soundlevel of the sound.
 * @param flags			Flags of the sound.
 * @param pitch			Pitch of the sound.
 * @param origin		Origin of the sound ({0.0,0.0,0.0} = ignore)
 * @param direction		Direction of the sound ({0.0,0.0,0.0} = ignore)
 * @param updateposition	Update the position of the sound (e.g. when the sound is attached to a player and he moves)
 * @param soundtime		How long the sound should play.
 * @param speakerentity
 * @noreturn
 */
native EmitSoundL(client, entity, channel, const String:sample[], Float:volume, soundlevel_t:level, flags=0, pitch=PITCH_NORM, Float:origin[3]={0.0,0.0,0.0}, Float:direction[3]={0.0,0.0,0.0}, bool:updateposition=true, Float:soundtime=0.0, speakerentity=-1);

/**
 * I don't know ^^
 * "Emit a sentence and also a close caption token for the sentence as appropriate."
 *
 * @param client		Index of the client to 'emit' the sound to (0 = all).
 * @param entity		Index of the entity to 'emit' the sound from.
 * @param channel		Channel of the sound.
 * @param sentence		Sentence of the sound.
 * @param volume		Volume of the sound.
 * @param level			Soundlevel of the sound.
 * @param flags			Flags of the sound.
 * @param pitch			Pitch of the sound.
 * @param origin		Origin of the sound ({0.0,0.0,0.0} = ignore)
 * @param direction		Direction of the sound ({0.0,0.0,0.0} = ignore)
 * @param updateposition	Update the position of the sound (e.g. when the sound is attached to a player and he moves)
 * @param soundtime		How long the sound should play.
 * @param speakerentity
 * @noreturn
 */
native EmitSentenceByIndex(client, entity, channel, sentence, Float:volume, soundlevel_t:level, flags=0, pitch=PITCH_NORM, Float:origin[3]={0.0,0.0,0.0}, Float:direction[3]={0.0,0.0,0.0}, bool:updateposition=true, Float:soundtime=0.0, speakerentity=-1);

/**
 * Stops an 'emited' sound of a given entity.
 *
 * @param entity		Index of the entity.
 * @param channel		Channel of the sound.
 * @param sample		Name of the sound.
 * @noreturn
 */
native StopSound(entity, channel, const String:sample[]);

/**
 * Emit an 'ambient' sound that isn't spatialized.
 *
 * @param sample		Name of the sound.
 * @param volume		Volume of the sound.
 * @param pitch			Pitch of the sound.
 * @param flags			Flags of the sound.
 * @param soundtime		How long the sound should play.
 * @noreturn
 */
native EmitAmbientSound(const String:sample[], Float:volume, pitch=PITCH_NORM, flags=0, Float:soundtime=0.0);
Changelog:
Quote:
1.0.0.0 (5/12/07)
  • First release
Attached Files
File Type: zip enginesound.zip (40.5 KB, 1213 views)
File Type: zip enginesound_src.zip (10.3 KB, 634 views)
__________________

MFZB Gaming Community

[ www.mfzb.de ]

Knagg0 is offline
FlyingMongoose
Veteran Member
Join Date: Mar 2004
Old 06-12-2007 , 12:09   Re: [EXTENSION] EngineSound
Reply With Quote #2

neat, good work, I'm using tempent's emitsound right now tho and it works for me....
__________________
Please do NOT PM for support.

Only ask for support in plugin threads.

TunedChaos.com - Precision Tuned Game Servers
FlyingMongoose is offline
Olly
Senior Member
Join Date: Mar 2007
Location: UK
Old 06-12-2007 , 13:25   Re: [EXTENSION] EngineSound
Reply With Quote #3

hehe nice.. I was playing around with EmitSound using a sigscan, but nothing happened hehe, i think i used a bad channel or something though ><
__________________
Tumblr Me: http://raspberryteen.tumblr.com


// Yarrrr!
Olly is offline
Send a message via MSN to Olly
1695
Senior Member
Join Date: Jan 2006
Old 07-13-2007 , 07:59   Re: [EXTENSION] EngineSound
Reply With Quote #4

Does it still usefull since sound extention is included in sourcemod build ?
1695 is offline
Knagg0
SourceMod Donor
Join Date: Dec 2005
Location: Germany
Old 07-13-2007 , 08:27   Re: [EXTENSION] EngineSound
Reply With Quote #5

Quote:
Originally Posted by 1695 View Post
Does it still usefull since sound extention is included in sourcemod build ?
Yes, for plugins that still use this extension.
But they should be updated and use the build in natives.
__________________

MFZB Gaming Community

[ www.mfzb.de ]

Knagg0 is offline
.Dare Devil.
Veteran Member
Join Date: Sep 2010
Old 02-11-2012 , 09:02   Re: [EXTENSION] EngineSound
Reply With Quote #6

thakns, its very useful for me.

I have question about it.
I dont understand 2 params.

PHP Code:
 * @param origin        Origin of the sound ({0.0,0.0,0.0} = ignore)
 * @
param direction        Direction of the sound ({0.0,0.0,0.0} = ignore
If origin is 0.0,0.0,0.0 and i call this func player index, will this sound follow the player?
Or i need to check player origin all the time?


param direction question.
------------------------

What is it, and what it do?
.Dare Devil. is offline
naris
AlliedModders Donor
Join Date: Dec 2006
Old 02-15-2012 , 20:04   Re: [EXTENSION] EngineSound
Reply With Quote #7

Quote:
Originally Posted by .Dare Devil. View Post
thakns, its very useful for me.
Actually, no it isn't.

You should not use this EVER.

Use the built in SourceMod natives instead!

http://docs.sourcemod.net/api/index....ad=file&id=34&
naris is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 02-16-2012 , 10:08   Re: [EXTENSION] EngineSound
Reply With Quote #8

Quote:
Originally Posted by naris View Post
Actually, no it isn't.

You should not use this EVER.

Use the built in SourceMod natives instead!

http://docs.sourcemod.net/api/index....ad=file&id=34&
Except for GetSoundDuration, for which Sound Info Library's GetSoundLengthFloat can be used.
__________________
Not currently working on SourceMod plugin development.

Last edited by Powerlord; 02-16-2012 at 10:10.
Powerlord is offline
naris
AlliedModders Donor
Join Date: Dec 2006
Old 02-20-2012 , 22:52   Re: [EXTENSION] EngineSound
Reply With Quote #9

Quote:
Originally Posted by Powerlord View Post
Except for GetSoundDuration, for which Sound Info Library's GetSoundLengthFloat can be used.
The SourceMod natives also includes GetSoundDuration().
However, GetSoundDuration() is deprecated in the SourceMod version because it doesn't work. The one in this extension won't work either because they both call the same underlaying, broken, valve method...

So yeah, you are much better off using the Sound Info Library which, among other things, actually works.
naris is offline
Reply


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 15:20.


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