Skip to content

SampAudioStream v2.0.0

Choose a tag to compare

@github-actions github-actions released this 19 Nov 12:59
  • Breaking API & Storage Standardization (AudioStream Naming + scriptfiles/SampAudioStream/):
    • Standardized all Pawn natives and callbacks to consistent AudioStream / ChannelAudioStream naming (SA_SetAudioStreamVolume, SA_SearchAudioStream, SA_CancelAudioStreamSearch, SA_CreateAudioStreamChannel, SA_DestroyAudioStreamChannel, SA_PlayChannelAudioStream, SA_QueueChannelAudioStream, SA_SkipChannelAudioStream, SA_StopChannelAudioStream, SA_PauseChannelAudioStream, SA_SetChannelAudioStreamVolume, SA_JoinAudioStreamChannel, SA_LeaveAudioStreamChannel, SA_IsPlayerInAudioStreamChannel, SA_GetPlayerAudioStreamChannel, SA_GetPlayerAudioStreamID, SA_GetAudioStreamInfo, OnAudioStreamSearchResults, and OnAudioStreamSearchResultItem).
    • Uses scriptfiles/SampAudioStream/ as the default runtime directory for binaries, extractor caches, configuration, and persisted channels.
    • Added background Deno v2.9.8 provisioning (extractor.js_runtime: "auto" / "deno" / "quickjs") making Deno the preferred JS challenge runtime with quickjs-ng as automatic fallback, plus single automatic extractor re-resolution and debug diagnostics on HTTP 403/410 media errors.
  • Complete Synchronized Channel Management:
    • Added optional creator tracking (creator_playerid, storing creator name at creation time + SA_SetAudioStreamChannelCreator), channel passwords (SA_SetAudioStreamChannelPass, SA_CheckAudioStreamChannelPass, password check in SA_JoinAudioStreamChannel), channel destruction policies (SA_CHANNEL_DESTROY_MANUAL, SA_CHANNEL_DESTROY_ON_DISCONNECT, SA_CHANNEL_DESTROY_ON_TIMEOUT whose countdown resets/stays paused whenever the creator is online; SA_SetAudioStreamChannelDestroy, SA_GetAudioStreamChannelDestroy, OnAudioStreamChannelDestroyed), and full introspection/queue natives (SA_GetAudioStreamChannelCount, SA_GetAudioStreamChannelID, SA_GetAudioStreamChannelInfo, SA_GetAudioStreamChannelTrack, SA_GetAudioStreamChannelQueue, SA_ClearAudioStreamChannelQueue).
    • Added channel track lifecycle callbacks (OnAudioStreamChannelTrackStart, OnAudioStreamChannelQueueEnd, OnAudioStreamChannelError) and persistence restore callback (OnAudioStreamChannelRestored).
    • Added configurable channel and queue capacity limits (channels.max_channels, channels.max_queue_per_channel).
    • Added spatial 3D channel positioning and entity attachment (SA_SetAudioStreamChannelPos, SA_ClearAudioStreamChannelPos, SA_AttachAudioStreamChannelToPlayer, SA_AttachAudioStreamChannelToVehicle), with attached sources playing without distance attenuation.
    • Added channel queue editing (SA_InsertAudioStreamChannelQueue, SA_RemoveAudioStreamChannelQueue) and loop modes (SA_SetAudioStreamChannelLoop, SA_GetAudioStreamChannelLoop supporting OFF/TRACK/QUEUE).
    • Added channel elapsed playback query (SA_GetAudioStreamChannelElapsed), indexed listener lookup (SA_GetAudioStreamChannelListener), and channel renaming (SA_SetAudioStreamChannelName).
    • Added atomic JSON channel persistence across restarts and GMX (channels.persist_channels, channels.channel_restore_grace_seconds).
  • Dynamic Range, Position, Search & Encoding Control:
    • Added SA_SetPlayerAudioStreamDistance, SA_SetAudioStreamDistance, SA_SetPlayerAudioStreamPos, and SA_SetAudioStreamPos with immediate spatial listener evaluation and MP3-frame-aligned playback resumption (?resume=) for transcoded streams (avoiding mid-frame glitches), plus clean parameter re-dispatch for passthrough streams.
    • Enhanced SA_AttachAudioStreamToPlayer and SA_AttachAudioStreamToVehicle to immediately fetch the target entity's current position (plus worldid/interiorid for players), enforce usepos = true automatically, and refresh active playback/listeners even when started with usepos = false.
    • Added bidirectional cp1252 ↔ UTF-8 text conversion for channel names, URLs/queries, queue items, and track metadata, plus error reporting (error_code, error_message[], and SA_ERR_SEARCH_FAILED) in OnAudioStreamSearchResults.
  • Processing Callback & Per-Call Direct-File Transcoding:
    • Added OnAudioStreamProcessing(playerid, streamid, const url[], bool:from_cache) alongside the bool:notify_processing = true parameter on SA_PlayAudioStreamForPlayer, SA_PlayAudioStream, and the PlayAudioStreamForPlayer hook.
    • Added bool:process_direct_audio_files = false to SA_PlayAudioStreamForPlayer, SA_PlayAudioStream, and PlayAudioStreamForPlayer so direct music file links (.mp3, .ogg, .wav, .flac, .aac, .m4a, .opus) can be selectively transcoded for full pause, volume, distance, and OnAudioStreamFinished support while keeping live radio streams and .pls/.m3u playlists in zero-slot passthrough.
  • Automatic Direct HTTP/HTTPS Passthrough, Cache Pruning & Lifecycle Reliability:
    • Enabled automatic passthrough detection for https:// native direct-audio URLs and probed audio/* radios (preserving SourceType::DirectAudio across MetadataCache hits) while always transcoding platform URLs, .m3u8 (HLS) playlists, and .m4a/.opus containers.
    • Added automatic age-based yt-dlp-cache/youtube-sigfuncs pruning (extractor.yt_dlp_cache_max_age_days, default 7 days, 0 = off, plus internal 64 MB cap protecting < 1h files) at startup and asynchronously during idle maintenance ticks, keeping challenge-solver scripts and other subdirs untouched.
    • Added automatic creator reconnection & rename tracking across OnPlayerConnect, SetPlayerName (AMX hook on SA-MP; PlayerChangeEventHandler on open.mp), and disconnect snapshot so SA_CHANNEL_DESTROY_ON_TIMEOUT resets/pauses reliably when returning; dispatched OnAudioStreamChannelDestroyed asynchronously on the next tick; enforced creator requirement for automatic channel destroy policies; grouped startup extractor/public-IP readiness logs with the banner (<= 1.5s); and packaged both .pwn and compiled -d0 .amx demo filterscripts under filterscripts/.
    • Fixed Pawn INVALID_PLAYER_ID callback mapping (-1 -> 65535 across all callbacks including global streams and channel errors) and fixed HttpStreamingServer::Stop() partial-bind cleanup hangs when an explicit port is already in use.
    • Added available_at respect (non-blocking Tick() deferral + watchdog exclusion) alongside OnAudioStreamWaiting(playerid, streamid, wait_ms) and OnAudioStreamChannelTrackWaiting(channelid, wait_ms) callbacks to notify scripts when platform playback waits for media availability.
    • Renamed the plugin/component binaries and Pawn include to SampAudioStream.dll / SampAudioStream.so and SampAudioStream.inc.
    • Added automatic YouTube anti-bot cookie fallback (scriptfiles/SampAudioStream/cookies.txt + browser discovery controlled by extractor.cookies_from_browser, Firefox-first then Chromium family) and SA_ERR_AUTH_REQUIRED (10), with step-by-step instructions in docs/youtube-cookies.md.
  • Extended Stream Controls, Channel Persistence, Seeking & Diagnostics (66 SA_* Natives, 16 Callbacks):
    • Standardized diagnostics and queue-item naming (SA_RemoveAudioStreamChannelQueue, SA_InsertAudioStreamChannelQueue, SA_IsAudioStreamExtractorReady, SA_GetAudioStreamHttpPort).
    • Added per-player muting (SA_SetPlayerAudioStreamMuted, SA_IsPlayerAudioStreamMuted), active source inspection and change notifications (SA_GetPlayerAudioStreamSource, OnPlayerAudioStreamSourceChange), global/personal stream pause (SA_PauseAudioStream), active stream listing/metrics (SA_GetAudioStreamCount, SA_GetAudioStreamID, SA_GetAudioStreamOwner, SA_GetAudioStreamElapsed, SA_GetAudioStreamURL, SA_GetAudioStreamStats), channel playlist importing (SA_QueueChannelAudioStreamPlaylist, OnAudioStreamChannelPlaylistQueued), and transcoded track seeking (SA_SeekAudioStream, SA_SeekChannelAudioStream).