### Check Audio Bot Status - C# Source: https://context7.com/edren-baton-team/audioplayer/llms.txt Queries the status and presence of audio bots within the system. This includes checking if a specific bot ID is active, if a player is an audio bot, retrieving all active bots, or getting a specific bot by its container. ```csharp using AudioPlayer.API; using Exiled.API.Features; using System.Collections.Generic; // Check if bot ID exists bool botExists = 99.IsAudioPlayer(); if (botExists) { Log.Info("Bot with ID 99 is active"); } // Check if a player is an audio bot Player player = Player.Get(5); if (player.IsAudioPlayer()) { Log.Info("This player is an audio bot"); } // Get all active audio bots IList allBots = AudioController.GetAllGetAudioPlayer(); foreach (AudioPlayerBot bot in allBots) { Log.Info($"Bot ID: {bot.ID}, Name: {bot.Name}"); } // Get specific bot AudioPlayerBot targetBot = AudioController.TryGetAudioPlayerContainer(99); if (targetBot != null) { Log.Info($"Found bot: {targetBot.Name}, Volume: {targetBot.Volume}"); } ``` -------------------------------- ### Spawn Audio Bot - C# Source: https://context7.com/edren-baton-team/audioplayer/llms.txt Creates a new virtual audio bot entity in the game. The bot can be customized with a specific ID, badge text and color, name, and role. It returns the spawned bot object or null if the spawn fails. ```csharp using AudioPlayer.API; using PlayerRoles; using VoiceChat; // Spawn a basic audio bot with default settings (ID 99) AudioPlayerBot bot = AudioController.SpawnDummy(); // Spawn a custom audio bot with specific configuration AudioPlayerBot customBot = AudioController.SpawnDummy( id: 100, badgeText: "Music Bot", bagdeColor: "red", name: "DJ Server", roleTypeId: RoleTypeId.Overwatch, ignored: true ); // Check if spawn was successful if (customBot != null) { Log.Info($"Successfully spawned audio bot with ID {customBot.ID}"); } ``` -------------------------------- ### Spawn Audio Bot Source: https://context7.com/edren-baton-team/audioplayer/llms.txt Creates a new audio bot entity in the game that serves as an audio source. Bots can be spawned with default or custom configurations including ID, name, badge, role, and ignore status. Successful spawns return an AudioPlayerBot instance for further control. ```APIDOC ## Spawn Audio Bot ### Description Creates a new audio bot entity in the game that can play audio files. The bot appears as an NPC with customizable name, badge, and role. ### Method AudioController.SpawnDummy() ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - id (int) - Optional - Bot ID (default 99) - badgeText (string) - Optional - Badge text - badgeColor (string) - Optional - Badge color - name (string) - Optional - Bot name - roleTypeId (RoleTypeId) - Optional - Role type (e.g., RoleTypeId.Overwatch) - ignored (bool) - Optional - Whether to ignore the bot (default false) ### Request Example ``` using AudioPlayer.API; using PlayerRoles; using VoiceChat; // Spawn a basic audio bot with default settings (ID 99) AudioPlayerBot bot = AudioController.SpawnDummy(); // Spawn a custom audio bot with specific configuration AudioPlayerBot customBot = AudioController.SpawnDummy( id: 100, badgeText: "Music Bot", bagdeColor: "red", name: "DJ Server", roleTypeId: RoleTypeId.Overwatch, ignored: true ); // Check if spawn was successful if (customBot != null) { Log.Info($"Successfully spawned audio bot with ID {customBot.ID}"); } ``` ### Response #### Success Response - AudioPlayerBot (object) - The spawned bot instance #### Response Example ``` AudioPlayerBot bot = AudioController.SpawnDummy(); // Returns non-null bot object on success ``` ``` -------------------------------- ### Play Audio File - C# Source: https://context7.com/edren-baton-team/audioplayer/llms.txt Plays an audio file through a specified audio bot. It supports playback to all players via a chosen voice channel or to a list of specific player IDs. Options include looping, volume control, and shuffling. ```csharp using AudioPlayer.API; using VoiceChat; using System.Collections.Generic; // Get existing audio bot AudioPlayerBot bot = AudioController.TryGetAudioPlayerContainer(99); if (bot != null) { // Play audio to all players via Intercom channel bot.PlayAudioFromFile( path: "/path/to/audio/file.ogg", loop: false, volume: 100, channel: VoiceChatChannel.Intercom, shuffle: false, logdebug: false, @continue: true ); // Play audio to specific players only List playerIds = new List { 1, 5, 10 }; bot.PlayFromFilePlayer( players: playerIds, path: "/path/to/music.ogg", loop: true, volume: 80, channel: VoiceChatChannel.Proximity, shuffle: false, logdebug: false, @continue: true ); } ``` -------------------------------- ### Control Audio Playback Source: https://context7.com/edren-baton-team/audioplayer/llms.txt Manages ongoing audio playback including queue additions, volume changes, channel switching, looping, and stopping. Allows precise control over the audio queue position and clearing options. Volume ranges from 0-100. ```APIDOC ## Control Audio Playback ### Description Manages audio playback with queue operations, volume adjustments, and stopping playback. ### Method AudioPlayerBot.AddAudioEnqueue() AudioPlayerBot.Volume AudioPlayerBot.VoiceChatChannel AudioPlayerBot.Loop AudioPlayerBot.StopAudio() ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - path (string) - Required for AddAudioEnqueue - Path to .ogg file - position (int) - Optional - Queue position (-1 for end, default -1) - volume (int) - Set 0-100 - channel (VoiceChatChannel) - Set voice channel - loop (bool) - Enable/disable looping - clearAudioList (bool) - Optional for StopAudio - Clear queue on stop (default true) ### Request Example ``` using AudioPlayer.API; using VoiceChat; AudioPlayerBot bot = AudioController.TryGetAudioPlayerContainer(99); if (bot != null) { // Add audio to queue at end (-1 position) bot.AddAudioEnqueue("/path/to/song1.ogg", -1); // Add audio at specific position in queue bot.AddAudioEnqueue("/path/to/song2.ogg", 0); // Adjust volume during playback (0-100) bot.Volume = 75; // Change voice channel bot.VoiceChatChannel = VoiceChatChannel.Radio; // Enable/disable looping bot.Loop = true; // Stop audio and clear queue bot.StopAudio(clearAudioList: true); // Stop audio but keep queue bot.StopAudio(clearAudioList: false); } ``` ### Response #### Success Response - void - Control applied #### Response Example ``` // No return value; settings updated ``` ``` -------------------------------- ### Control Audio Playback - C# Source: https://context7.com/edren-baton-team/audioplayer/llms.txt Manages audio playback on an audio bot, including adding songs to a queue, adjusting volume, changing the voice channel, enabling/disabling looping, and stopping playback with or without clearing the queue. ```csharp using AudioPlayer.API; using VoiceChat; AudioPlayerBot bot = AudioController.TryGetAudioPlayerContainer(99); if (bot != null) { // Add audio to queue at end (-1 position) bot.AddAudioEnqueue("/path/to/song1.ogg", -1); // Add audio at specific position in queue bot.AddAudioEnqueue("/path/to/song2.ogg", 0); // Adjust volume during playback (0-100) bot.Volume = 75; // Change voice channel bot.VoiceChatChannel = VoiceChatChannel.Radio; // Enable/disable looping bot.Loop = true; // Stop audio and clear queue bot.StopAudio(clearAudioList: true); // Stop audio but keep queue bot.StopAudio(clearAudioList: false); } ``` -------------------------------- ### Check Audio Bot Status Source: https://context7.com/edren-baton-team/audioplayer/llms.txt Queries the existence and details of audio bots in the system. Supports checks by ID, player reference, listing all bots, or retrieving specific instances for inspection of properties like name and volume. ```APIDOC ## Check Audio Bot Status ### Description Queries existing audio bots and validates their presence in the system. ### Method int.IsAudioPlayer() Player.IsAudioPlayer() AudioController.GetAllGetAudioPlayer() AudioController.TryGetAudioPlayerContainer() ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - id (int) - For IsAudioPlayer or TryGetAudioPlayerContainer - Bot or player ID - player (Player) - For IsAudioPlayer - Player reference ### Request Example ``` using AudioPlayer.API; using Exiled.API.Features; using System.Collections.Generic; // Check if bot ID exists bool botExists = 99.IsAudioPlayer(); if (botExists) { Log.Info("Bot with ID 99 is active"); } // Check if a player is an audio bot Player player = Player.Get(5); if (player.IsAudioPlayer()) { Log.Info("This player is an audio bot"); } // Get all active audio bots IList allBots = AudioController.GetAllGetAudioPlayer(); foreach (AudioPlayerBot bot in allBots) { Log.Info($"Bot ID: {bot.ID}, Name: {bot.Name}"); } // Get specific bot AudioPlayerBot targetBot = AudioController.TryGetAudioPlayerContainer(99); if (targetBot != null) { Log.Info($"Found bot: {targetBot.Name}, Volume: {targetBot.Volume}"); } ``` ### Response #### Success Response - bool - Existence check - IList - List of all bots - AudioPlayerBot - Specific bot #### Response Example ``` AudioPlayerBot bot = AudioController.TryGetAudioPlayerContainer(99); // Returns bot object or null ``` ``` -------------------------------- ### Play Audio File Source: https://context7.com/edren-baton-team/audioplayer/llms.txt Plays an audio file through the audio bot to all players or specific targets via voice channels. Supports options for looping, volume, channel selection, shuffling, and continuing playback. Audio files must be .ogg format with mono channel at 48000 Hz. ```APIDOC ## Play Audio File ### Description Plays an audio file through the audio bot to all players or specific players via designated voice channels. ### Method AudioPlayerBot.PlayAudioFromFile() AudioPlayerBot.PlayFromFilePlayer() ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - path (string) - Required - Path to .ogg file - loop (bool) - Optional - Enable looping (default false) - volume (int) - Optional - Volume level 0-100 (default 100) - channel (VoiceChatChannel) - Required - Voice channel (e.g., Intercom, Proximity) - shuffle (bool) - Optional - Shuffle mode (default false) - logdebug (bool) - Optional - Enable debug logging (default false) - continue (bool) - Optional - Continue from current position (default true) - players (List) - Optional - Specific player IDs (for PlayFromFilePlayer) ### Request Example ``` using AudioPlayer.API; using VoiceChat; using System.Collections.Generic; // Get existing audio bot AudioPlayerBot bot = AudioController.TryGetAudioPlayerContainer(99); if (bot != null) { // Play audio to all players via Intercom channel bot.PlayAudioFromFile( path: "/path/to/audio/file.ogg", loop: false, volume: 100, channel: VoiceChatChannel.Intercom, shuffle: false, logdebug: false, @continue: true ); // Play audio to specific players only List playerIds = new List { 1, 5, 10 }; bot.PlayFromFilePlayer( players: playerIds, path: "/path/to/music.ogg", loop: true, volume: 80, channel: VoiceChatChannel.Proximity, shuffle: false, logdebug: false, @continue: true ); } ``` ### Response #### Success Response - void - Playback initiated #### Response Example ``` // No return value; audio starts playing ``` ``` -------------------------------- ### Disconnect Audio Bot - C# Source: https://context7.com/edren-baton-team/audioplayer/llms.txt Removes an audio bot from the game and releases its resources. Bots can be disconnected by their ID, or by directly calling the Destroy method on the bot object. The presence of a bot can be verified after disconnection. ```csharp using AudioPlayer.API; // Disconnect specific bot by ID AudioController.DisconnectDummy(99); // Alternative: Get bot and destroy directly AudioPlayerBot bot = AudioController.TryGetAudioPlayerContainer(100); if (bot != null) { bot.Destroy(); } // Verify bot is disconnected bool stillExists = AudioController.IsAudioPlayer(100); Log.Info($"Bot exists: {stillExists}"); // Should be false ``` -------------------------------- ### Disconnect Audio Bot Source: https://context7.com/edren-baton-team/audioplayer/llms.txt Removes an audio bot from the game, cleaning up its resources and stopping any playback. Can be done by ID or directly on a bot instance. Post-disconnect checks confirm removal. ```APIDOC ## Disconnect Audio Bot ### Description Removes an audio bot from the game and cleans up its resources. ### Method AudioController.DisconnectDummy() AudioPlayerBot.Destroy() ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - id (int) - Required for DisconnectDummy - Bot ID to disconnect ### Request Example ``` using AudioPlayer.API; // Disconnect specific bot by ID AudioController.DisconnectDummy(99); // Alternative: Get bot and destroy directly AudioPlayerBot bot = AudioController.TryGetAudioPlayerContainer(100); if (bot != null) { bot.Destroy(); } // Verify bot is disconnected bool stillExists = AudioController.IsAudioPlayer(100); Log.Info($"Bot exists: {stillExists}"); // Should be false ``` ### Response #### Success Response - void - Bot disconnected #### Response Example ``` // No return value; bot removed ``` ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.