Cog Files


Sound Reference


These are cog verbs dealing with sound


ChangeSoundPitch

ChangeSoundVol

GetSoundLen

PlaySong

PlaySoundClass

PlaySoundGlobal

PlaySoundLocal

PlaySoundPos

PlaySoundThing

SectorSound

SetMusicVol

StopSound


ChangeSoundPitch()

Changes a sound's pitch over time.

Use: ChangeSoundPitch(int channel, flex NewPitch, flex ChangeTime);


ChangeSoundVol()

Changes the sound volume.

Use: ChangeSoundVol(int ref , flex volume, flex FadeInTime);


GetSoundLen()

Returns the length of a sound. Helps keep dialouges in order within the game.

Use: GetSoundLen(wav);

Example: Sleep(GetSoundLen(wav)); This will sleep the cog until the sound is finished playing.


PlaySong()

Inputs the CD values for playing music.

Use: PlaySong(int starttrack, int endtrack, int loopinto);


PlaySoundClass()

? Not Used in JK

?


PlaySoundGlobal()

Plays a sound to everyone in a Multiplayer game . See Sound Flags

Use: channel = PlaySoundGlobal(wav , flex volume, flex pan ,int flags); pan is -1.0=full left , 1.0 full right , 0.0 center


PlaySoundLocal()

Plays a sound locally on the local computer only See Sound Flags

Use: channel = PlaySoundLocal(wav,flex volume, flex pan ,int flags); pan is -1.0=full left , 1.0 full right , 0.0 center


PlaySoundPos()

Plays a sound from a designated vector referenced location.. May be used with things, surface centers, etc... See Sound Flags

Use: PlaySoundPos(wav, vector position, flex volume, flex mindistance, flex maxdistance, flags);

Use of Pos: Here are two methods to get a pos.

For a thing: GetThingPos(thing);

For a surface: GetSurfaceCenter(surface);


PlaySoundThing()

Plays a sound linked to a thing. See Sound Flags

Use: PlaySoundThing(sound, thing, vol flex, flex mindist, flex maxdist, flag);


SectorSound()

Plays a sound from designated sector.

Use: SectorSound(sector, wav, flex volume);


SetMusicVol()

Sets the volume for the CD Track that is currently playing. Used when dialogues play to make them audible.

Use: SetMusicVol(flex volume);


StopSound()

Stops a sound from being played on the passed channel.

Use: StopSound(int channel, flex FadeOut);