Skip to content

A powerful extension that brings audio playback, private sharing, and personal audio library management to sb0t-based chat servers. Features include smart caching, MyInstants.com integration, and simple slash commands for seamless audio experiences in chat rooms.

Notifications You must be signed in to change notification settings

lexicon06/Audio-Library-Extension-for-sb0t5

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 

Repository files navigation

🎵 Audio Library Extension for sb0t5

Audio Library Extension is a powerful sb0t5 extension that allows users to play, manage, cache, and send audio clips directly inside chat rooms or private messages. Audios are downloaded, converted to Base64, cached in memory, and delivered in real time to compatible web and mobile clients.


✨ Features

  • 🔊 Play audios in public chat rooms
  • 📩 Send audios via private messages
  • 🌐 Play audio directly from external URLs or MyInstants pages
  • 📚 Persistent audio library stored in JSON
  • ⚡ In-memory Base64 audio caching
  • 📊 Cache inspection and management
  • 🚀 Background audio precaching
  • 🔐 Owner-based audio removal permissions
  • 🔄 Automatic MyInstants URL extraction
  • 🧪 Debug and test commands

🛠 Requirements

  • sb0t5 server
  • .NET Framework 4.7.2
  • x86 platform target
  • iconnect reference
  • Newtonsoft.Json (13.0.3)

📦 Installation

  1. Compile the project targeting net472 (x86)
  2. Copy the generated extension.dll into your sb0t5 extensions folder
  3. Head to the UI and click the extension to install
  4. The file audios_config.json will be created automatically on first run

📁 Configuration

The extension uses a JSON file called audios_config.json to store audio entries. If the file does not exist, a default configuration with sample audios is created automatically.

Audio Entry Fields

  • Name – Friendly name shown in chat
  • Url – Direct link to the audio file
  • Owner – Owner of the audio
  • IsPublic – Public availability flag
  • AddedBy – User who added the audio
  • AddedDate – Date of creation

💬 Commands

Public Commands

  • /audios – List all available audios
  • /audio – Shortcut to list audios
  • /audio <id> – Play an audio in the room
  • /play <url> – Play audio directly from a URL or MyInstants page

Private Audio

  • /pmaudio <id> <username|id> – Send audio privately

Library Management

  • /addaudio <url> <name> – Add a new audio from URL or MyInstants
  • /removeaudio <id> – Remove an audio (owner or moderator)

Cache & Debug

  • /audiocache – Show cache stats
  • /precache – Preload all audios
  • /clearcache – Clear cached audios
  • /testlibaudio – Test first audio
  • /debug – Show debug info
  • /help – Show command help

🔗 Supported Audio Sources

  • Direct Audio URLs – MP3, WAV, OGG, M4A, AAC, WEBM, FLAC
  • MyInstants Pages – Automatically extracts audio from myinstants.com pages
  • Library Audios – Pre-configured audio entries

⚙️ Technical Notes

  • Audios are downloaded using WebClient with proxy disabled
  • Supported formats: MP3, WAV, OGG, AAC, M4A, WEBM, FLAC
  • Audio delivery uses Base64 data URIs
  • Only Extended Web & Mobile users receive audios
  • Reflection is used to access sb0t core user pool
  • Automatic MyInstants URL extraction with multiple fallback methods

📝 Usage Examples

Playing Audio

  • /play https://example.com/audio.mp3 – Direct audio file
  • /play https://www.myinstants.com/instant/funny-sound/ – MyInstants page
  • /audio 1 – Play audio #1 from library

Adding Audio

  • /addaudio https://example.com/sound.mp3 My Sound
  • /addaudio https://myinstants.com/instant/cool-effect/ Cool Effect

🧹 Cleanup & Lifecycle

  • Cache is cleared automatically on dispose
  • Downloads are protected against duplication
  • Thread-safe cache access
  • Background precaching for better performance

📜 License

This project is provided as-is for sb0t5 servers. You are free to modify and extend it for your own server.


Author: Pablo Santillán
Target Platform: sb0t5
Language: C# (.NET Framework 4.7.2)

About

A powerful extension that brings audio playback, private sharing, and personal audio library management to sb0t-based chat servers. Features include smart caching, MyInstants.com integration, and simple slash commands for seamless audio experiences in chat rooms.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages