English | Português
An ASI mod for SA:MP that lets you control the volume of audio streams played by the server (PlayAudioStreamForPlayer) with the /vl command, without touching the game's own sounds.
| SA:MP version | Status |
|---|---|
| 0.3.7 R1 | Tested, working |
| 0.3.7 R3 / R4 | Not tested |
| 0.3.7 R2, R5, 0.3.DL | Not supported |
You need an ASI Loader installed (CLEO and SAMPFUNCS already include one).
- Download
AudioStreamVolume.asifrom Releases. - Copy it to your GTA San Andreas folder, next to
samp.exe. - Join a server. The chat will show:
[AudioStream] Active! Volume: 100% - use /vl (0-100)
AudioStreamVolume.ini is created automatically on first run.
| Command | Action |
|---|---|
/vl 50 |
Sets the audio stream volume to 50% |
/vl 0 |
Mutes the audio stream |
/vl |
Shows the current volume |
The final volume is the game's radio volume multiplied by the /vl percentage. 3D distance falloff and muting when the game window loses focus keep working as normal.
[General]
; Idioma / Language: pt = Portugues, en = English
Language=en
[AudioStream]
; Volume dos audio streams do servidor (0-100). Tambem pode ser alterado com /vl
; Server audio stream volume (0-100). Can also be changed with /vl
Volume=100
[Log]
; 0 = desativado / disabled, 1 = ativado / enabled (AudioStreamVolume.log)
Enabled=0- Language:
ptoren. If empty or invalid, the Windows language is used. - Volume: 0 to 100. Updated automatically when you use
/vl. - Enabled:
1writesAudioStreamVolume.lognext to the.asi, which is useful for reporting problems.
You can edit the file with the game open; changes are applied within half a second.
SA:MP plays audio streams with BASS (bass.dll). Its stream thread runs a loop every 20 ms that calls BASS_SetConfig(BASS_CONFIG_GVOL_STREAM, volume) with the game's radio volume, so any volume set from outside is overwritten right away.
The mod finds that loop in samp.dll memory by pattern (push 5; call ...; push 14h; call Sleep), follows the call to SA:MP's internal BASS thunk and redirects it to its own function. That function scales the value by the /vl percentage and then calls the real BASS_SetConfig. This is a single 5-byte patch, with no hooking library.
Development by Shazanxz - github.com/Shazanxz
All rights reserved. You may view the code and use the official release for personal play. Copying, modifying, rewriting, reusing, redistributing or selling any part of this project requires prior written permission from the author. See LICENSE and contact Shazanxz.