Script functions can be found here: http://wiki.frictionalgames.com/hpl2/amn..._functions
-- I have taken the liberty to copy paste the functions regarding sound --
This is for playing music:
void PlayMusic(string& asMusicFile, bool abLoop, float afVolume, float afFadeTime, int alPrio, bool abResume);
asMusicFile - the music to play + extension .ogg
abLoop - determines whether a music track should loop
afVolume - volume of the music
afFadeTime - time in seconds until music reaches full volume
alPrio - priority of the music. Note that only the music with the highest priority can be heard! 0 - highest, 1 - lower, etc
Can be used to play a sound (without any specific location):
void PlayGuiSound(string& asSoundFile, float afVolume);
Plays a sound, not using 3D.
asSoundFile - the sound to play (extension is .snt) **Acies comment: The extension might very well be .ogg - I don't know why the user set it so be .snt , but .snt works too.**
afVolume - the volume of the sound
This functions plays a sound at a specific location:
void PlaySoundAtEntity(string& asSoundName, string& asSoundFile, string& asEntity, float afFadeTime, bool abSaveSound);
Creates a sound on an entity.
asSoundName - internal name
asSoundFile - the sound to use + extension .snt
asEntity - the entity to create the sound at, can be “Player”
afFadeTime - time in seconds the sound needs to fade
abSaveSound - determines whether a sound should “remember” its state. If true, the sound is never attached to the entity! Also note that saving should on be used on looping sounds!
I think that for a "location sound" the extension must be ".snt".
Some other comments on playing sounds:
- Playgui works on every sound.
- PlaySoundAtEntity can use a scriptarea as an entity (good to create an invisible place from where the sound is played).
- The "alPrio" concerning playing music is important when stopping music.
void StopMusic(float afFadeTime, int alPrio);
afFadeTime - time in seconds until music stops
alPrio - the priority of the music that should stop
When stopping music the alPrio must be the same number as issued at Playmusic.