samp.directory
← Skrypty i biblioteki

Walter-Correa/SampVoice-Plus

A ground-up C++20 re-architecture of the SampVoice voice chat ecosystem engineered for high-throughput SA-MP and Open.MP.

Plugin★ 1zaktualizowano 10 godzin temuMPL-2.0C++sampctl
Otwórz na GitHubie

Zainstaluj za pomocą sampctl

sampctl package install Walter-Correa/SampVoice-Plus

Uruchom to w folderze swojego projektu. sampctl pobiera pakiet i to, od czego zależy.

Wypróbuj w kompilatorze Pawn →

Dodaje jej pliki include, razem z bibliotekami, od których zależy, do kompilatora Pawn w twojej przeglądarce, gotowe do dołączenia w skrypcie.

Zależy od 1 pakietu

README.md

SampVoice Plus

SampVoice Plus is a ground-up C++20 re-architecture of the SampVoice voice chat ecosystem engineered for high-throughput San Andreas Multiplayer (SA-MP) and open.mp 32-bit x86 servers alongside a single-file standalone Windows client (sampvoice.asi) and an optional 15-language Windows installer (SampVoice-Plus-Setup.exe).

It empowers server owners and Pawn developers to deploy real-time Global Channels, 3D Proximity Spatial Voice, Vehicle & Player-Attached Megaphones, Per-Stream Custom HUD Icons, Per-Player Global Listener Control, Smooth Parameter Sliding, and 9 DX8 DSP Audio Effects—with non-blocking UDP I/O, lock-free queues, $O(1)$ spatial grid indexing, opaque 32-bit generational handles, universal 0.3.7-R1 through 0.3.DL-R1 / open.mp client support in a single .asi file, and full backward compatibility with legacy CyberMor v3.x and AmyrAhmady (v11) clients and servers.

[!NOTE] Inspired by the original sampvoice by @CyberMor and its open.mp adaptation by @AmyrAhmady, SampVoice Plus is rebuilt from the ground up in C++20 to leave samp.dll machine code completely unpatched, eliminate external bass_fx.dll and loose asset packs, isolate audio/capture/UDP processing onto a dedicated audio thread, and harden both client and server stability.



Comparison: SampVoice Implementations

FeatureCyberMor 3.xCyberMor 4.xAmyrAhmadySampVoice Plus
CyberMor 4.x clients❌ v11 only¹✅ v4 only¹❌ v11 only¹❌ v11 and v12¹
Legacy v11 clients✅ Same protocol❌ Incompatible✅ Same protocol✅ Simultaneous¹
Server platforms⚠️ 0.3.7-R2 only⚠️ R2 and voice²⚠️ open.mp only✅ open.mp, R2/R3, DL
PC client versions⚠️ R1, R3 only⚠️ R1, R3 only⚠️ R1, R3 only✅ R1–R5, DL, omp³
Voice relay architectureIntegratedSeparate process⁴IntegratedIntegrated
Client deployment⚠️ Extra DLL + files⁵⚠️ Extra DLL + files⁵⚠️ Manual DLL + files⁵✅ Single file⁵
Backup & restore setup❌ Overwrites files❌ Overwrites files❌ No installer✅ SHA-256 backup⁶
Unpatched client & AC❌ Patches samp.dll❌ Patches samp.dll❌ Patches samp.dll✅ Zero patches⁷
Pawn.RakNet coexistence❌ Permanent hook⁸⚠️ Permanent hook⁸N/A (component)✅ One-shot hook⁸
Fixed port & bind IP❌ Ephemeral port⁹✅ Port and host⁹⚠️ Fixed port only⁹✅ Port and bind IP⁹
UDP flood protection❌ None❌ None❌ None✅ Token bucket¹⁰
GMX & filterscript safety❌ Raw pointers⚠️ Pool IDs only¹¹❌ Raw pointers✅ HandlePool cleanup¹¹
YSI y_hooks support❌ Broken¹²⚠️ Tag issue¹²⚠️ Tag issue¹²✅ Compatible¹²
Stream icons❌ Fixed icon✅ Custom PNGs¹³❌ Fixed icon✅ 7 built-in¹³
Listener & speaker control⚠️ Mic mute only¹⁴✅ Full control¹⁴⚠️ Mic mute only¹⁴✅ Full control¹⁴
Interior, VW & spectate❌ Distance only❌ Distance only⚠️ No spectate¹⁵✅ Full filtering¹⁵
Stuck speaker guard❌ Stale entries¹⁶✅ Clears on stop¹⁶❌ Inherited¹⁶✅ 400 ms timeout¹⁶
PlayAudioStream stereo❌ Mutates globals¹⁷❌ Mutates globals¹⁷❌ Mutates globals¹⁷✅ Preserves BASS¹⁷
In-game menu languages1 (Russian)5 languages¹⁸1 (Russian)✅ 15 built-in¹⁸
DX8 audio effects✅ 9 filters✅ 9 filters✅ 9 filters✅ 9 filters¹⁹
Diagnostics & talk modes❌ PTT only⚠️ Lang, PTT only❌ PTT only✅ Full suite²⁰
Jitter, FEC & PLC⚠️ FEC only²¹⚠️ Ring + PLC²¹⚠️ FEC only²¹✅ 35 ms + FEC/PLC²¹
LicenseMITMITMITMPL-2.0
Notes
  1. Protocol & 4.x compatibility: CyberMor 4.x clients send the 0xDEADC0DE magic (v4 only) and are incompatible with v11; SampVoice Plus servers accept both v11 (CyberMor 3.x, AmyrAhmady, Android launchers) and v12 (SVP1 extension) simultaneously while rejecting v4 (0xDEADC0DE).
  2. Server targets: SampVoice Plus ships both an open.mp native component and a SA-MP plugin for 0.3.7-R2, 0.3.7-R3, and 0.3.DL-R1 (32-bit Windows & Linux).
  3. PC client coverage: Strictly matches PE TimeDateStamp + AddressOfEntryPoint across 0.3.7-R1, R2, R3/R3-1, R4, R4-2, R5-1 (R5-2-MP), 0.3.DL-R1 (DL-R1-2-MP), and the open.mp launcher in a single .asi.
  4. External relay process: CyberMor 4.x requires running a separate voice process alongside the SA-MP server; the other implementations integrate the UDP voice relay inside the plugin/component.
  5. Client dependencies: CyberMor 3.x/4.x and AmyrAhmady require external bass_fx.dll and loose font/asset files; SampVoice Plus bundles everything into a single sampvoice.asi and a single server binary (sampvoice.dll / .so).
  6. Installer: Guided 15-language Inno Setup installer with SHA-256 backup and restore manifest.
  7. Anti-cheat safety: Leaves samp.dll machine code completely unpatched (Present/Reset Direct3D 9 hooks only).
  8. Pawn.RakNet / YSF coexistence: Upstream 3.x keeps a permanent GetRakServerInterface hook (#43, #54, #71, #72, #117, #118, #133, #171); CyberMor 4.x also keeps a permanent hook (with no conflict reports found); open.mp components do not use that hook; SampVoice Plus removes its one-shot hook immediately after binding.
  9. Network configuration: CyberMor 3.x uses an ephemeral OS port on INADDR_ANY (sv_voice_port was added to source in 2022, never released in 3.x); CyberMor 4.x supports voice_port & voice_host; AmyrAhmady exposes sampvoice.port without bind IP; SampVoice Plus configures both sampvoice.port and sampvoice.bind (failing loudly on invalid bind/port).
  10. Flood defense: Per-player UDP token bucket (30 pkt/s sustained, burst 10).
  11. Lifecycle safety: Legacy 3.x and AmyrAhmady use raw pointers that leak on GMX; CyberMor 4.x uses pool IDs without per-AMX tracking; SampVoice Plus pairs 32-bit generational HandlePool handles with automatic per-AMX unload cleanup.
  12. y_hooks interoperability: Legacy 3.x caches AmxLoad indices only and SV_VOID: void: breaks y_hooks; CyberMor 4.x removes key callbacks cleanly but keeps SV_VOID: void: in sampvoice.inc; AmyrAhmady uses runtime amx_FindPublic but retains void:-tagged forwards; SampVoice Plus uses empty SV_VOID: + runtime amx_FindPublic.
  13. Stream icons: SvSetIcon in CyberMor 4.x accepts custom PNGs; SvStreamSetIcon in SampVoice Plus (v12) selects from 7 built-in SVG/PNG icons (speaker, global, radio, phone, megaphone, admin, police).
  14. Mute & listener controls: 3.x and AmyrAhmady only provide mic muting (SvMutePlayer*); CyberMor 4.x provides SvEnableListener + SvEnableSpeaker; SampVoice Plus provides SvEnableListener/Disable/Check + SvMutePlayer*.
  15. World filtering: CyberMor 3.x and 4.x check streamed-in & distance only; AmyrAhmady checks interior & virtual world without spectate tracking; SampVoice Plus filters interior, virtual world, and active spectate target.
  16. Stuck speaker name (#44): Legacy 3.x/AmyrAhmady have known stale entries; CyberMor 4.x clears via OnStopStream on stop/release; SampVoice Plus enforces a 400 ms per-channel timeout plus disconnect detach.
  17. PlayAudioStream stereo (#136): Legacy 3.x and AmyrAhmady alter global GVOL_STREAM, BUFFER, and UPDATEPERIOD (and 4.x also alters UPDATETHREADS, DEV_PERIOD/DEV_BUFFER, and BASS_DEVICE_MONO); SampVoice Plus leaves BASS_Init and GVOL_STREAM untouched.
  18. UI translations: CyberMor 3.x and AmyrAhmady are Russian-only; CyberMor 4.x supports 5 languages (en + 4 .txt files); SampVoice Plus includes 15 built-in languages with real-time switching.
  19. DSP effects: All 9 DX8 audio filters via SvEffectCreate*.
  20. Client UX: Configurable menu hotkey (no longer fixed to F11), 9-state F11 diagnostics + RTT, 2s microphone hot-plug detection, and both Push-to-Talk and Toggle talk modes.
  21. Recovery pipeline: 3.x/AmyrAhmady decode FEC only and drop late frames; CyberMor 4.x has a ring buffer + FEC + PLC (with encoder FEC off); SampVoice Plus combines a 35 ms SpeakerJitterBuffer, Opus in-band FEC, 4800-sample PLC, and an adaptive 1..4-frame prebuffer cushion.

When Another Option May Fit

  • Choose CyberMor 4.x if your community already deploys CyberMor 4.x client installers (0xDEADC0DE) or specifically requires splitting the voice relay into a separate external voice process.
  • Choose AmyrAhmady if you only target open.mp with vanilla 0.3.7-R1/R3 clients and prefer a minimal MIT-licensed fork matching upstream 3.x.
  • Choose SampVoice Plus if you want universal 0.3.7-R1–0.3.DL-R1 / open.mp support in a single drop-in sampvoice.asi, compatibility with existing v11 PC and Android clients, unpatched samp.dll, fixed port/IP control, and 15-language UI.

Supported Platforms

CategorySupported Targets & Notes
Server Binariesopen.mp native component, SA-MP 0.3.7-R2 (R2-1, R2-2-1) & 0.3.7-R3 (Win/Linux x86), SA-MP 0.3.DL-R1 (Win/Linux x86).
PC ClientsSA-MP 0.3.7-R1, R2, R3/R3-1, R4, R4-2, R5-1 (R5-2-MP), 0.3.DL-R1 (DL-R1-2-MP), and open.mp launcher (strict PE timestamp + entry match).
Operating SystemsClient: Windows 7 SP1 or newer (Win32 x86 game). Server: Windows x86 or 32-bit x86 Linux (glibc 2.31+).
Android Launchers✅ Android launchers embedding SampVoice 3.x (v11) work with SampVoice Plus servers. (No SampVoice Plus Android client exists.)
Legacy CompatibilityCyberMor 3.x and AmyrAhmady (v11) clients interoperate seamlessly. CyberMor 4.x clients cannot connect and must use SampVoice Plus.
Languages (15)Indonesian (id), German (de), English (en), Spanish (es), French (fr), Italian (it), Hungarian (hu), Polish (pl), Portuguese (pt), Romanian (ro), Vietnamese (vi), Turkish (tr), Bulgarian (bg), Russian (ru), Ukrainian (uk).

Documentation Hub

GuideDescription
📖 Getting StartedClient (SampVoice-Plus-Setup.exe & manual sampvoice.asi) + server setup, configuration, and drop-in migration.
🎧 Universal Client & In-Game UISingle-file architecture, runtime R1–R5/0.3.DL PE bridge, F11 configurable hotkey, 15 live languages, and sampvoice.ini.
⚙️ Architecture & Wire ProtocolDual v11/v12 protocol, kClientBuild bit layout, CRC32C UDP validation, generational handles, and $O(1)$ spatial grid.
🔊 Audio Streams & DX8 EffectsGlobal, static local, and dynamic local streams (GStream, SLStream, DLStream), SvStreamSetIcon, parameter sliding, and 9 DX8 effects.
📚 Complete API ReferenceExhaustive reference for every native function, callback, parameter enum, handle tag, and constant in sampvoice.inc.
🛠️ Troubleshooting GuideF11 9-state diagnostics, UDP firewall/bind config, microphone recovery, talk modes, hotkey conflicts, and plugin coexistence.
🔄 Migrating from Legacy SampVoiceUpgrading players (sampvoice.asi backup/scoped [blacklist]) and servers (CyberMor 3.x/4.x & AmyrAhmady, legacy_color_format).
🔍 Zero-Install Feasibility AnalysisTechnical analysis of zero-install vs single-file sampvoice.asi tradeoffs on vanilla SA-MP / open.mp.

Client & Installation

Prerequisites & Installation Methods

Like any .asi plugin for GTA San Andreas, sampvoice.asi requires an ASI Loader and an existing SA-MP client (samp.dll + bass.dll) or open.mp launcher (official SA-MP builds are also available at sa-mp.mp/downloads).

Which download should I choose?

  • Players: Download SampVoice-Plus-Client-Installer.zip (contains both Installer/SampVoice-Plus-Setup.exe and Manual Install/sampvoice.asi).
  • Server owners: Download SampVoice-Plus-Server-Windows.zip (Windows) or SampVoice-Plus-Server-Linux.zip (Linux).

Inside SampVoice-Plus-Client-Installer.zip, pick either installation method:

MethodBest ForHow It Works
Automatic Installer (Installer/SampVoice-Plus-Setup.exe)Players without an ASI Loader or upgrading from legacy SampVoiceGuided 15-language Inno Setup installer: auto-detects GTA San Andreas, checks samp.dll/bass.dll, installs sampvoice.asi, bundles Ultimate ASI Loader (dinput8.dll, MIT) if no ASI loader exists, lets you back up or permanently uninstall legacy SampVoice (preserving SA-MP's bass.dll and vorbis*.dll), stores restore data and THIRD-PARTY-NOTICES.txt in sampvoice-plus\, and places Uninstall SampVoice Plus.lnk in the GTA root folder. Reinstalling or updating SA-MP later keeps voice working intact.
Manual Install (Manual Install/sampvoice.asi)Modded GTA setups that already have an ASI Loader (dinput8.dll, Silent's ASI Loader, or CLEO)Copy sampvoice.asi directly into your GTA San Andreas root folder (where gta_sa.exe lives — not scripts\). Nothing else needed.

Press F11 in-game to open the settings menu, rebind the hotkey, choose your microphone, tune noise/DSP filters, mute players locally, or switch among 15 languages in real time.

Configuration and player mutes (sampvoice.ini, including [blacklist] entries with server name, IP:port, and server/all scope) alongside session logs (sampvoice_plus_v<version>_log.txt) are stored automatically inside Documents\GTA San Andreas User Files\SAMP\sampvoice\ (only after SA-MP is detected; see Migrating from Legacy SampVoice). Line 1 of every client session log records the SHA-256 hash of the loaded sampvoice.asi for integrity inspection (certutil -hashfile sampvoice.asi SHA256).


Release Archives & Server Placement

Each release provides three dedicated archives (SampVoice-Plus-Setup.exe is bundled inside SampVoice-Plus-Client-Installer.zip under Installer/), with LICENSE and THIRD-PARTY-NOTICES.txt placed cleanly at the root of each archive:

SampVoice-Plus-Client-Installer.zip   <-- For Windows players
  ├── Installer/
  │     ├── SampVoice-Plus-Setup.exe
  │     └── Instructions/
  │           ├── bg - Bulgarian.txt
  │           ├── de - German.txt
  │           ├── en - English.txt
  │           ├── ... (15 languages)
  │           └── vi - Vietnamese.txt
  ├── Manual Install/
  │     ├── sampvoice.asi
  │     └── Instructions/
  │           ├── bg - Bulgarian.txt
  │           ├── de - German.txt
  │           ├── en - English.txt
  │           ├── ... (15 languages)
  │           └── vi - Vietnamese.txt
  ├── LICENSE
  └── THIRD-PARTY-NOTICES.txt

SampVoice-Plus-Server-Windows.zip     <-- For Windows servers (open.mp / SA-MP x86)
  ├── components/
  │     └── sampvoice.dll
  ├── plugins/
  │     └── sampvoice.dll
  ├── include/
  │     └── sampvoice.inc
  ├── Example.pwn
  ├── LICENSE
  └── THIRD-PARTY-NOTICES.txt

SampVoice-Plus-Server-Linux.zip       <-- For Linux servers (open.mp / SA-MP x86)
  ├── components/
  │     └── sampvoice.so
  ├── plugins/
  │     └── sampvoice.so
  ├── include/
  │     └── sampvoice.inc
  ├── Example.pwn
  ├── LICENSE
  └── THIRD-PARTY-NOTICES.txt

[!WARNING] Do not load both components/sampvoice.dll and plugins/sampvoice.dll at the same time on open.mp. SA-MP server mode supports SA-MP 0.3.7-R2 (R2-1, R2-2-1), 0.3.7-R3, and 0.3.DL-R1 on both Windows & Linux (x86). See Troubleshooting for firewall & sampvoice.bind details.

  • open.mp (config.json): Place sampvoice.dll (or sampvoice.so) inside components/. Optional tuning:
    {
      "sampvoice": {
        "port": 7778,
        "bind": "0.0.0.0",
        "threads": 4,
        "updaterate": 30,
        "legacy_color_format": false,
        "voice_status": true,
        "nearby_list": true,
        "allow_toggle_mode": true,
        "voice_occlusion": true
      }
    }
    
    Note: "port": 0 selects an automatic ephemeral port that changes on every restart and logs a [sv+:WRN] warning.
  • SA-MP 0.3.7-R2 / R3 / 0.3.DL-R1 (server.cfg): Place sampvoice.dll (or sampvoice.so) inside plugins/ and add:
    plugins sampvoice.dll    # (or sampvoice.so on Linux)
    
    # Optional tuning keys:
    sampvoice.port 7778      # 0 = automatic ephemeral port (logs a [sv+:WRN] warning)
    sampvoice.bind 0.0.0.0
    sampvoice.threads 4
    sampvoice.updaterate 30
    sampvoice.legacy_color_format 0
    sampvoice.voice_status 1
    sampvoice.nearby_list 1
    sampvoice.allow_toggle_mode 1
    sampvoice.voice_occlusion 1
    

Basic Pawn Example

#include <open.mp> // Or <a_samp>
#include <sampvoice>

#define KEY_TALK (0x42) // 'B'

new SV_DLSTREAM:g_LocalStream[MAX_PLAYERS] = { SV_NULL, ... };

public OnGameModeInit()
{
    return 1;
}

public OnPlayerConnect(playerid)
{
    if (SvGetVersion(playerid) != SV_NULL && SvHasMicro(playerid))
    {
        SvAddKey(playerid, KEY_TALK);
    }
    g_LocalStream[playerid] = SvCreateDLStreamAtPlayer(35.0, 24, playerid, 0xFFFFFFFF, "Local");
    return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
    if (g_LocalStream[playerid] != SV_NULL)
    {
        SvDeleteStream(g_LocalStream[playerid]);
        g_LocalStream[playerid] = SV_NULL;
    }
    return 1;
}

public SV_VOID:OnPlayerActivationKeyPress(SV_UINT:playerid, SV_UINT:keyid)
{
    if (keyid == KEY_TALK && g_LocalStream[playerid] != SV_NULL)
    {
        SvAttachSpeakerToStream(g_LocalStream[playerid], playerid);
    }
}

public SV_VOID:OnPlayerActivationKeyRelease(SV_UINT:playerid, SV_UINT:keyid)
{
    if (keyid == KEY_TALK && g_LocalStream[playerid] != SV_NULL)
    {
        SvDetachSpeakerFromStream(g_LocalStream[playerid], playerid);
    }
}

[!TIP] Check Example.pwn for a full demonstration including Global radio channels, SvStreamSetIcon, SvGetClientProtocol checks, DX8 walkie-talkie filters (SvEffectCreateParameq + SvEffectCreateEcho), volume sliding, and static loudspeaker streams.


Complete API Reference (Summary) — 72 Natives & 8 Callbacks

Full signatures, enums, and callback notes live in docs/api-reference.md and sampvoice.inc:

Przeczytaj resztę na GitHubie

audioopen-mpopenmppawnproximity-chatsa-mpsampsamp-pluginsamp-voipsampvoicevoice-chatvoip

Ta strona jest zbudowana z tego, co GitHub publikuje o repozytorium. samp.directory nie hostuje kodu. Zgłoś problem z tym wpisem

Walter-Correa/SampVoice-Plus: Plugin SA-MP | samp.directory