### Start Source: https://managedbass.github.io/api/ManagedBass.Asio.BassAsio.html Starts the current ASIO device. ```APIDOC ## Start ### Description Starts the current Asio device. ### Parameters - **BufferLength** (Int32) - Optional - Buffer length in samples (0 = use current length). - **Threads** (Int32) - Optional - The number of processing threads to use (0 = use current number). ### Returns - **Boolean** - If successful, true is returned, else false. ``` -------------------------------- ### Start(Int32, String, EncodeFlags, String) Method Source: https://managedbass.github.io/api/ManagedBass.Enc.BassEnc_Ogg.html Starts Ogg encoding directly to an output file. ```APIDOC ## POST /start/file ### Description Start Ogg Encoding to File. ### Method POST ### Endpoint /start/file ### Parameters #### Path Parameters None #### Query Parameters - **Handle** (Int32) - Required - The channel handle (HSTREAM, HMUSIC, or HRECORD). - **Options** (String) - Optional - Encoder options (e.g., -b / --bitrate, -q / --quality). Null uses defaults. - **Flags** (EncodeFlags) - Optional - A combination of EncodeFlags. - **FileName** (String) - Required - The output filename. Null means no output file. ### Request Body None ### Request Example ```json { "Handle": 123, "Options": "-q 5", "Flags": "Default", "FileName": "output.ogg" } ``` ### Response #### Success Response (200) - **encoderHandle** (Int32) - The encoder handle if successfully started, otherwise 0. #### Response Example ```json { "encoderHandle": 789 } ``` ### Remarks EncodeStart(Int32, String, EncodeFlags, EncoderProcedure, IntPtr) is used internally. Platform-specific: Ogg Vorbis encoding requires an FPU and is not supported on platforms without one (e.g., older ARM architectures). ``` -------------------------------- ### Start(Int32, String, EncodeFlags, EncodeProcedure, IntPtr) Method Source: https://managedbass.github.io/api/ManagedBass.Enc.BassEnc_Ogg.html Starts Ogg encoding to a specified procedure (callback function). ```APIDOC ## POST /start/procedure ### Description Start Ogg Encoding to EncodeProcedure. ### Method POST ### Endpoint /start/procedure ### Parameters #### Path Parameters None #### Query Parameters - **Handle** (Int32) - Required - The channel handle (HSTREAM, HMUSIC, or HRECORD). - **Options** (String) - Optional - Encoder options (e.g., -b / --bitrate, -q / --quality). Null uses defaults. - **Flags** (EncodeFlags) - Optional - A combination of EncodeFlags. - **Procedure** (EncodeProcedure) - Optional - Callback function to receive encoded data. Null means no callback. - **User** (IntPtr) - Optional - User instance data to pass to the callback function. ### Request Body None ### Request Example ```json { "Handle": 123, "Options": "-b 192", "Flags": "Default", "Procedure": "MyCallbackFunction", "User": "0x12345678" } ``` ### Response #### Success Response (200) - **encoderHandle** (Int32) - The encoder handle if successfully started, otherwise 0. #### Response Example ```json { "encoderHandle": 456 } ``` ### Remarks EncodeStart(Int32, String, EncodeFlags, EncoderProcedure, IntPtr) is used internally. Platform-specific: Ogg Vorbis encoding requires an FPU and is not supported on platforms without one (e.g., older ARM architectures). ``` -------------------------------- ### Start Visual Plugin Source: https://managedbass.github.io/api/ManagedBass.Sfx.BassSfx.html Starts a visual plugin. Use PluginStop to stop it. ```csharp public static bool PluginStart(int Handle) ``` -------------------------------- ### Start Source: https://managedbass.github.io/api/ManagedBass.Wasapi.BassWasapi.html Starts processing the current WASAPI device or driver. ```APIDOC ## Start ### Description Starts processing the current Wasapi device/driver (endpoint). ### Response - **Returns** (Boolean) - If successful, then true is returned, else false is returned. Use LastError to get the error code. ``` -------------------------------- ### Start Source: https://managedbass.github.io/api/ManagedBass.Bass.html Starts (or resumes) the output. ```APIDOC ## Start ### Description Starts (or resumes) the output. ### Method `public static bool Start()` ### Response #### Success Response (bool) Returns `true` if successful, `false` otherwise. Use `LastError` to get the error code. ### Remarks The output is automatically started by `Init(Int32, Int32, DeviceInitFlags, IntPtr, IntPtr)`, so there is no need to use this function unless you have stopped or paused the output. When using multiple devices, the current thread's device setting (as set with `CurrentDevice`) determines which device this function call applies to. ### See Also - `Pause()` - `Stop()` ``` -------------------------------- ### StartVis Source: https://managedbass.github.io/api/ManagedBass.WA.BassWA.html Starts a visualization plugin with a specific module. ```APIDOC ## StartVis(Int32, Int32) ### Description Starts the visualization plugin and the selected module within the plugin. ### Parameters - **Plugin** (Int32) - Required - Plugin Index Number. - **Module** (Int32) - Required - Module Index Number. ``` -------------------------------- ### StartVis Method Source: https://managedbass.github.io/api/ManagedBass.WA.BassWA.html Initializes and starts a visualization plugin with a specific module index. ```csharp public static void StartVis(int Plugin, int Module) ``` -------------------------------- ### Check if ASIO Device is Started - BassAsio.IsStarted Source: https://managedbass.github.io/api/ManagedBass.Asio.BassAsio.html Checks if the current ASIO device has been started. Returns true if started, false otherwise. Use LastError to get the specific error code. ```csharp public static bool IsStarted { get; } ``` -------------------------------- ### Start Winamp DSP Source: https://managedbass.github.io/api/ManagedBass.WaDsp.BassWaDsp.html Starts a specific module of a loaded Winamp DSP plugin for a given BASS channel. ```csharp public static bool Start(int Plugin, int Module, int Handle) ``` -------------------------------- ### Start Opus Encoding to File Source: https://managedbass.github.io/api/ManagedBass.Enc.BassEnc_Opus.html Starts encoding a BASS channel to a specified file. Requires an SSE-supporting CPU on Windows and Linux for non-standard sample rates. ```csharp public static int Start(int Handle, string Options, EncodeFlags Flags, string FileName) ``` -------------------------------- ### Config Method Source: https://managedbass.github.io/api/ManagedBass.WaDsp.BassWaDsp.html Invokes the configuration dialog of a loaded and started Winamp DSP. ```APIDOC ## Config(Int32) Invokes the config dialog of a loaded and started Winamp DSP. ### Declaration ```csharp public static bool Config(int Plugin) ``` ### Parameters #### Path Parameters - **Plugin** (Int32) - Required - The plugin handle (returned by Load(String, Int32, Int32, Int32, Int32, WinampWinProcedure)). ### Returns Boolean - true on success, else false. Use LastError to get the error code. ### Remarks The Winamp DSP must have been started via Start(Int32, Int32, Int32) prior to calling this method. ``` -------------------------------- ### RecordStart (With Period) Source: https://managedbass.github.io/api/ManagedBass.Bass.html Starts a recording session with a defined period between callback invocations. ```APIDOC ## RecordStart(Int32, Int32, BassFlags, Int32, RecordProcedure, IntPtr) ### Description Starts recording with a specific period (in milliseconds) between calls to the callback function. ### Parameters - **Frequency** (Int32) - Required - The sample rate to record at. - **Channels** (Int32) - Required - The number of channels. - **Flags** (BassFlags) - Required - Any combination of Byte, Float and RecordPause. - **Period** (Int32) - Required - The period in milliseconds between calls to the callback function. - **Procedure** (RecordProcedure) - Optional - The user defined function to receive the recorded sample data. - **User** (IntPtr) - Optional - User instance data to pass to the callback function. ### Returns - **Int32** - The new recording's handle if successful, else false. ``` -------------------------------- ### RecordStart Declaration Source: https://managedbass.github.io/api/ManagedBass.Bass.html Starts a recording session with the specified frequency, channels, and flags. ```csharp public static int RecordStart(int Frequency, int Channels, BassFlags Flags, RecordProcedure Procedure, IntPtr User = null) ``` -------------------------------- ### StartPlay: Initiate Playback Source: https://managedbass.github.io/api/ManagedBass.WaDsp.BassWaDspIpc.html Simulates pressing the 'Play' button in Winamp to start playback. ```csharp SendMessage(hwnd_winamp,WM_WA_IPC,0,BassWaDspIpc.StartPlay); ``` -------------------------------- ### ACMLoad Property Declaration Source: https://managedbass.github.io/api/ManagedBass.Enc.BassEnc.html Gets or sets the ACM codec name to prioritize for supported formats. Example: 'l3codecp.acm'. ```csharp public static string ACMLoad { get; set; } ``` -------------------------------- ### Initialize BASS and Play MP3 Source: https://managedbass.github.io/api/ManagedBass.Bass.html This example demonstrates initializing the BASS library, creating an MP3 stream from a file, playing it, and then freeing the stream and BASS device. Ensure 'FILE.MP3' exists in the application's directory. ```csharp using System; using ManagedBass; namespace HelloWorld { class Program { static void Main(string[] args) { // Init BASS using the default output device if (Bass.Init()) { // Create a stream from a file var stream = Bass.CreateStream("FILE.mp3"); if (stream != 0) Bass.ChannelPlay(stream); // Play the stream // Error creating the stream else Console.WriteLine("Error: {0}!", Bass.LastError); // Wait till user presses a key Console.WriteLine("Press any key to exit"); Console.ReadKey(); // Free the stream Bass.StreamFree(stream); // Free current device. Bass.Free(); } else Console.WriteLine("BASS could not be initialized!"); } } } ``` -------------------------------- ### EncodeStart Methods Source: https://managedbass.github.io/api/ManagedBass.Enc.BassEnc.html Starts an encoding process for a given channel using various encoder types. ```APIDOC ## EncodeStart ### Description Starts an encoding process for a BASS channel. Multiple overloads exist for command-line encoders, ACM, and CoreAudio. ### Method Static Method ### Parameters - **Handle** (Int32) - The channel handle. - **Command** (String) - Encoder command line. - **Flags** (EncodeFlags) - Encoding flags. - **Procedure** (EncodeProcedure) - Callback for encoded data. - **User** (IntPtr) - User data pointer. ``` -------------------------------- ### Get Specific Winamp DSP Module Name Source: https://managedbass.github.io/api/ManagedBass.WaDsp.BassWaDsp.html Retrieves the name of a specific module from a loaded Winamp DSP plugin. Returns null if an error occurs or the module number is invalid. Useful for setup dialogs to list available modules. ```csharp public static string PluginInfoGetModuleName(int Module) ``` -------------------------------- ### Set Sample Info Example Source: https://managedbass.github.io/api/ManagedBass.Bass.html Demonstrates how to set a sample's default attributes, such as volume. Changes affect subsequently created channels, except for VAM settings which apply on next playback. ```csharp // get the sample's current info SampleInfo info; Bass.SampleGetInfo(sample, ref info); // set the default volume to 0.5 info.Volume = 0.5; // set the updated info Bass.SampleSetInfo(sample, info); ``` -------------------------------- ### POST Init Source: https://managedbass.github.io/api/ManagedBass.Bass.html Initializes an audio output device for use. ```APIDOC ## POST Init ### Description Initializes an output device with specified frequency and flags. ### Method POST ### Parameters #### Request Body - **Device** (Int32) - Optional - The device to use (-1 = default, 0 = no sound, 1 = first real device). - **Frequency** (Int32) - Optional - Output sample rate (default 44100). - **Flags** (DeviceInitFlags) - Optional - Combination of DeviceInitFlags. - **Win** (IntPtr) - Optional - Application's main window handle. - **ClsID** (IntPtr) - Optional - Class identifier for DirectSound initialization. ### Response #### Success Response (200) - **Result** (Boolean) - Returns true if successfully initialized, false otherwise. ``` -------------------------------- ### RecordInit Source: https://managedbass.github.io/api/ManagedBass.Bass.html Initializes a recording device for use. ```APIDOC ## RecordInit ### Description Initializes a recording device. This function must be called before using other recording features. ### Parameters #### Path Parameters - **Device** (Int32) - Optional - The device to use (-1 = default, 0 = first). ### Response #### Success Response (200) - **Return Value** (Boolean) - True if successful, false otherwise. ``` -------------------------------- ### GET /Bass/Algorithm3D Source: https://managedbass.github.io/api/ManagedBass.Bass.html Gets or sets the 3D algorithm used for software mixed 3D channels. ```APIDOC ## GET/SET /Bass/Algorithm3D ### Description The 3D algorithm for software mixed 3D channels. Changing this only affects subsequently created or loaded samples, musics, or streams. ### Method GET/SET ### Parameters #### Request Body - **Algorithm3D** (Algorithm3D) - The algorithm to apply. ``` -------------------------------- ### Init(Int32, AsioInitFlags) Source: https://managedbass.github.io/api/ManagedBass.Asio.BassAsio.html Initializes an Asio device or driver. ```APIDOC ## Init(Int32, AsioInitFlags) ### Description Initializes an Asio device/driver. ### Parameters - **Device** (Int32) - Required - The device to use... 0 = first device. - **Flags** (AsioInitFlags) - Required - Any combination of AsioInitFlags. ### Returns - **Boolean** - If the device was successfully initialized, true is returned, else false is returned. Use LastError to get the error code. ``` -------------------------------- ### Play Method Declaration Source: https://managedbass.github.io/api/ManagedBass.MediaPlayer.html Starts the channel playback. Returns a boolean indicating success. ```csharp public bool Play() ``` -------------------------------- ### RecordStart (Basic) Source: https://managedbass.github.io/api/ManagedBass.Bass.html Starts a recording session with specified frequency, channels, flags, and an optional callback procedure. ```APIDOC ## RecordStart(Int32, Int32, BassFlags, RecordProcedure, IntPtr) ### Description Starts recording audio. The recorded data is sent to the provided callback procedure or retrieved via ChannelGetData. ### Parameters - **Frequency** (Int32) - Required - The sample rate to record at. - **Channels** (Int32) - Required - The number of channels (1 = mono, 2 = stereo). - **Flags** (BassFlags) - Required - Any combination of Byte, Float and RecordPause. - **Procedure** (RecordProcedure) - Optional - The user defined function to receive the recorded sample data. - **User** (IntPtr) - Optional - User instance data to pass to the callback function. ### Returns - **Int32** - The new recording's handle if successful, else false. ``` -------------------------------- ### Create and Populate a Sample Source: https://managedbass.github.io/api/ManagedBass.Bass.html Initializes a new sample and populates it with a generated sine wave. ```csharp // create sample var sample = Bass.CreateSample(256, 28160, 1, 1, BassFlags.Loop | BassFlags.SampleOverrideLongestPlaying); var data = new short[128]; // data buffer for (var a = 0; a < 128; a++) data[a]= (short)(32767 * Math.Sin((double)a * 6.283185 / 64)); // sine wave // set the sample's data Bass.SampleSetData(sample, data); ``` ```csharp public static int CreateSample(int Length, int Frequency, int Channels, int Max, BassFlags Flags) ``` -------------------------------- ### RecordStart with Period Declaration Source: https://managedbass.github.io/api/ManagedBass.Bass.html Starts a recording session with a defined period in milliseconds between callback invocations. ```csharp public static int RecordStart(int Frequency, int Channels, BassFlags Flags, int Period, RecordProcedure Procedure, IntPtr User = null) ``` -------------------------------- ### Init Source: https://managedbass.github.io/api/ManagedBass.DShow.BassDShow.html Initializes the DSHOW library. This must be called before any other BASS_DSHOW methods. ```csharp public static bool Init(IntPtr hWnd, BassDShowInit Flags) ``` -------------------------------- ### Get VST Parameter Information Source: https://managedbass.github.io/api/ManagedBass.Vst.BassVst.html Retrieves detailed information about a specific VST effect parameter. Use this to get more context on parameter values. ```csharp public static BassVstParamInfo GetParamInfo(int VstHandle, int ParamIndex) ``` ```csharp public static BassVstParamInfo GetParamInfo(int VstHandle, int ParamIndex, out BassVstParamInfo Info) ``` -------------------------------- ### Initialize Asio Device Source: https://managedbass.github.io/api/ManagedBass.Asio.BassAsio.html Initializes an ASIO device. Use GetDeviceInfo to determine the number of available devices. Returns true on success, false on failure. ```csharp public static bool Init(int Device, AsioInitFlags Flags) ``` -------------------------------- ### Start Opus Encoding to Callback Source: https://managedbass.github.io/api/ManagedBass.Enc.BassEnc_Opus.html Starts encoding a BASS channel to an EncodeProcedure callback. Requires an SSE-supporting CPU on Windows and Linux for non-standard sample rates. ```csharp public static int Start(int Handle, string Options, EncodeFlags Flags, EncodeProcedure Procedure, IntPtr User) ``` -------------------------------- ### Start ASIO device Source: https://managedbass.github.io/api/ManagedBass.Asio.BassAsio.html Initializes the current ASIO device for processing. Buffer length and thread count can be specified or left at default values. ```csharp public static bool Start(int BufferLength = 0, int Threads = 0) ``` -------------------------------- ### Create Stream from Supported File Source: https://managedbass.github.io/api/ManagedBass.DShow.BassDShow.html Creates a stream from a supported file, optionally starting at a specific position. Playback will automatically start from the beginning if the specified position is unavailable. The necessary codec for video decoding must be available. ```csharp public static int StreamCreateFile(string File, int Position, IntPtr Window, BassFlags Flags) ``` -------------------------------- ### ChannelPlay Source: https://managedbass.github.io/api/ManagedBass.Bass.html Starts or resumes playback of a channel. ```APIDOC ## ChannelPlay ### Description Starts (or resumes) playback of a sample, stream, MOD music, or recording. ### Parameters #### Path Parameters - **Handle** (Int32) - Required - The channel Handle (HCHANNEL, HMUSIC, HSTREAM or HRECORD). - **Restart** (Boolean) - Optional - Restart playback from the beginning. ``` -------------------------------- ### Init Declaration Source: https://managedbass.github.io/api/ManagedBass.Bass.html Method signature for initializing an output device. ```csharp public static bool Init(int Device = null, int Frequency = 44100, DeviceInitFlags Flags = DeviceInitFlags.Default, IntPtr Win = null, IntPtr ClsID = null) ``` -------------------------------- ### Initialization and Plugin Management Source: https://managedbass.github.io/api/ManagedBass.DShow.BassDShow.html Functions for initializing the DSHOW library, loading and unloading plugins, and registering licenses. ```APIDOC ## Init ### Description Initializes the DSHOW library for use. ### Method POST ### Endpoint /Init ### Parameters #### Request Body - **hWnd** (IntPtr) - Required - The application's main window or 0 for console applications. - **Flags** (BassDShowInit) - Required - Any combination of BassDShowInit flags. ### Request Example ```json { "hWnd": "0x00000000", "Flags": "BASS_DSHOW_INIT_DEFAULT" } ``` ### Response #### Success Response (200) - **Success** (Boolean) - True if initialization is successful, false otherwise. #### Response Example ```json { "Success": true } ``` ## LoadPlugin ### Description Loads a BASS_DSHOW plugin. ### Method POST ### Endpoint /LoadPlugin ### Parameters #### Request Body - **File** (String) - Required - The plugin filename to load. ### Request Example ```json { "File": "bass_dshow.dll" } ``` ### Response #### Success Response (200) - **PluginHandle** (Int32) - The plugin handle if successful, 0 otherwise. #### Response Example ```json { "PluginHandle": 1 } ``` ## LoadPluginDS ### Description Loads a DirectShow plugin. ### Method POST ### Endpoint /LoadPluginDS ### Parameters #### Request Body - **Guid** (String) - Required - The CLSID/GUID string of the DirectShow filter to use. - **Name** (String) - Required - The name of the filter. ### Request Example ```json { "Guid": "{00000000-0000-0000-0000-000000000000}", "Name": "MyFilter" } ``` ### Response #### Success Response (200) - **PluginHandle** (Int32) - The plugin handle if successful, 0 otherwise. #### Response Example ```json { "PluginHandle": 1 } ``` ## RemovePlugin ### Description Removes a loaded plugin and frees all resources. ### Method DELETE ### Endpoint /RemovePlugin ### Parameters #### Request Body - **Plugin** (Int32) - Required - The plugin handle to remove. ### Request Example ```json { "Plugin": 1 } ``` ### Response #### Success Response (200) - **Success** (Boolean) - True if the plugin was removed successfully, false otherwise. #### Response Example ```json { "Success": true } ``` ## Register ### Description Registers your DSHOW/xVideo license. ### Method POST ### Endpoint /Register ### Parameters #### Request Body - **Email** (String) - Required - Your email address. - **Code** (String) - Required - Your registration code. ### Request Example ```json { "Email": "user@example.com", "Code": "REGCODE123" } ``` ### Response #### Success Response (200) - **Success** (Boolean) - True if registration is successful, false otherwise. #### Response Example ```json { "Success": true } ``` ``` -------------------------------- ### ChannelGetLevelRight Source: https://managedbass.github.io/api/ManagedBass.Bass.html Gets the audio level of the right channel. ```APIDOC ## ChannelGetLevelRight ### Description Gets the audio level of the right channel. ### Method GET (Implied) ### Endpoint N/A (This is a function call, not a REST endpoint) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Parameters - **Handle** (Int32) - Required - The channel handle. ### Response #### Success Response (Int32) - **Level** (Int32) - The level of the right channel. ### Response Example ```json { "level": 110 } ``` ``` -------------------------------- ### ChannelGetLevelLeft Source: https://managedbass.github.io/api/ManagedBass.Bass.html Gets the audio level of the left channel. ```APIDOC ## ChannelGetLevelLeft ### Description Gets the audio level of the left channel. ### Method GET (Implied) ### Endpoint N/A (This is a function call, not a REST endpoint) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Parameters - **Handle** (Int32) - Required - The channel handle. ### Response #### Success Response (Int32) - **Level** (Int32) - The level of the left channel. ### Response Example ```json { "level": 120 } ``` ``` -------------------------------- ### FontInit Source: https://managedbass.github.io/api/ManagedBass.Midi.BassMidi.html Initializes a soundfont from a file. ```APIDOC ## FontInit(String, FontInitFlags) ### Description Initializes a soundfont from a file (unicode). ### Parameters #### Path Parameters - **File** (String) - Required - The file name of the sound font (e.g. an .sf2 file). - **Flags** (FontInitFlags) - Required - Any combination of FontInitFlags. ### Response #### Success Response (200) - **Int32** - If successful, the soundfont's handle is returned, else 0 is returned. Use LastError to get the error code. ``` -------------------------------- ### Implement DownloadProcedure for File Saving Source: https://managedbass.github.io/api/ManagedBass.DownloadProcedure.html Example implementation of a download callback that writes incoming stream data to a local file. ```csharp var file = new FileStream("afile.mp3", FileMode.OpenOrCreate, FileAccess.Write, FileShare.Read); byte[] _buffer; ... void MyDownloadProc(IntPtr buffer, int length, IntPtr user) { if (buffer == IntPtr.Zero) { // finished downloading file.Close(); return; } if (_buffer == null || _buffer.Length < length) _buffer = new byte[length]; Marshal.Copy(buffer, _buffer, 0, length); File.Write(_buffer, 0, length); } ... var stream = Bass.CreateStream("http://www.asite.com/afile.mp3", 0, 0, MyDownloadProc, IntPtr.Zero); ``` -------------------------------- ### DeviceCount Source: https://managedbass.github.io/api/ManagedBass.Bass.html Gets the number of available playback devices. ```APIDOC ## DeviceCount ### Description Gets the number of Playback Devices available. ### Method `get;` ### Endpoint N/A (Property) ### Parameters N/A ### Request Example ```csharp int deviceCount = BASS.DeviceCount; Console.WriteLine($"Number of playback devices: {deviceCount}"); ``` ### Response #### Success Response (200) - **Int32**: The number of available playback devices. #### Response Example ```json 4 ``` ``` -------------------------------- ### Version Property Source: https://managedbass.github.io/api/ManagedBass.WaDsp.BassWaDsp.html Gets the version of the bass_wadsp.dll that is loaded. ```APIDOC ## Version Property Gets the version of the bass_wadsp.dll that is loaded. ### Declaration ```csharp public static Version Version { get; } ``` ### Property Value Version ``` -------------------------------- ### ConfigPlugin Method Source: https://managedbass.github.io/api/ManagedBass.Winamp.BassWinamp.html Displays the configuration dialog for a specific Winamp input plugin. ```csharp public static void ConfigPlugin(int Handle, IntPtr Window) ``` -------------------------------- ### GET /ChannelGetVolume Source: https://managedbass.github.io/api/ManagedBass.Asio.BassAsio.html Retrieves the volume setting of a channel. ```APIDOC ## GET /ChannelGetVolume ### Description Retrieves a channel's volume setting. ### Parameters #### Query Parameters - **Input** (Boolean) - Required - Dealing with an input channel? false = an output channel. - **Channel** (Int32) - Required - The input/output channel number... 0 = first, -1 = master. ``` -------------------------------- ### Init Source: https://managedbass.github.io/api/ManagedBass.Wasapi.BassWasapi.html Initializes a WASAPI device/driver (endpoint) for audio operations. ```APIDOC ## Init(Int32, Int32, Int32, WasapiInitFlags, Single, Single, WasapiProcedure, IntPtr) ### Description Initializes a WASAPI device/driver (endpoint). This function sets up the audio device for use, allowing for audio playback or recording. Various parameters control the sample rate, channels, buffer size, and callback procedures. ### Method Public static ### Endpoint N/A (This is a function call, not a REST endpoint) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Parameters - **Device** (Int32) - The device to use. 0 for the first device, -1 for the default output device, -2 for the default input device. Use GetDeviceInfo to enumerate available devices. - **Frequency** (Int32) - Optional. The sample rate to use. 0 uses the "mix format" sample rate. Defaults to 0. - **Channels** (Int32) - Optional. The number of channels to use. 0 uses the "mix format" channels, 1 for mono, 2 for stereo, etc. Defaults to 0. - **Flags** (WasapiInitFlags) - Optional. A combination of WasapiInitFlags. Defaults to WasapiInitFlags.Shared. - **Buffer** (Single) - Optional. The length of the device's buffer in seconds. This is a minimum; the driver may use a larger buffer. For output devices, buffer size determines latency. Defaults to null. - **Period** (Single) - Optional. The interval (in seconds) between callback function calls. 0 uses the default. If the specified period is below the minimum update period, it will be raised. Defaults to null. - **Procedure** (WasapiProcedure) - Optional. The user-defined function to process the channel. Use null to create a "push" device. Defaults to null. - **User** (IntPtr) - Optional. User instance data to pass to the callback function. Defaults to null. ### Request Example ```csharp // Initialize default output device with stereo and 44.1kHz sample rate bool success = Init(-1, 44100, 2, WasapiInitFlags.Exclusive, 0.05f, 0.01f, MyCallbackProcedure, IntPtr.Zero); // Initialize default input device with mono // bool success = Init(-2, 0, 1); ``` ### Response #### Success Response (Boolean) - **Return Value** (Boolean) - Returns true if the device was successfully initialized, otherwise false. Use LastError to get the error code. #### Response Example ```csharp // If initialization is successful, 'success' will be true. // If initialization fails, 'success' will be false and LastError can be checked. ``` ``` -------------------------------- ### GET /ChannelGetRate Source: https://managedbass.github.io/api/ManagedBass.Asio.BassAsio.html Retrieves the sample rate of a channel. ```APIDOC ## GET /ChannelGetRate ### Description Retrieves a channel's sample rate. ### Parameters #### Query Parameters - **Input** (Boolean) - Required - Dealing with an input channel? false = an output channel. - **Channel** (Int32) - Required - The input/output channel number... 0 = first. ### Response #### Success Response (200) - **Rate** (Double) - The channel's sample rate (0 = device rate). Returns -1 on error. ``` -------------------------------- ### Enumerate and Filter Recording Devices Source: https://managedbass.github.io/api/ManagedBass.Bass.html Examples demonstrating how to iterate through available recording devices to count enabled devices or locate specific hardware types like microphones. ```csharp var count = 0; DeviceInfo info; for (var a = 0; Bass.RecordGetDeviceInfo(a, out info); a++) if (info.IsEnabled) // device is enabled count++; // count it ``` ```csharp DeviceInfo info; for (var a = 0; Bass.RecordGetDeviceInfo(a, out info); a++) if (info.IsEnabled && info.Type == DeviceType.Microphone) { // found an enabled microphone // do something } ``` -------------------------------- ### GET /DoorIsOpen Source: https://managedbass.github.io/api/ManagedBass.Cd.BassCd.html Checks if a drive door is open. ```APIDOC ## GET /DoorIsOpen ### Description Checks if a drive door/tray is open. ### Method GET ### Parameters #### Query Parameters - **Drive** (Int32) - Required - The drive index to check. ### Response #### Success Response (200) - **isOpen** (Boolean) - True if open, false otherwise. ``` -------------------------------- ### Init Source: https://managedbass.github.io/api/ManagedBass.WaDsp.BassWaDsp.html Initializes the BASS_WADSP library, typically called after the main BASS initialization. ```csharp public static bool Init(IntPtr Win = null) ``` -------------------------------- ### GET /DoorIsLocked Source: https://managedbass.github.io/api/ManagedBass.Cd.BassCd.html Checks if a drive door is locked. ```APIDOC ## GET /DoorIsLocked ### Description Checks if a drive door/tray is locked. ### Method GET ### Parameters #### Query Parameters - **Drive** (Int32) - Required - The drive index to check. ### Response #### Success Response (200) - **isLocked** (Boolean) - True if locked, false otherwise. ``` -------------------------------- ### GET /ChannelBytes2Seconds Source: https://managedbass.github.io/api/ManagedBass.Bass.html Translates a byte position into time in seconds. ```APIDOC ## GET /ChannelBytes2Seconds ### Description Translates a byte position into time (seconds), based on a channel's format. ### Method GET ### Endpoint /ChannelBytes2Seconds ### Parameters #### Query Parameters - **Handle** (Int32) - The channel Handle. - **Position** (Int64) - The position in Bytes to translate. ### Response #### Success Response (200) - **Seconds** (Double) - The translated length in seconds. ``` -------------------------------- ### Free() Source: https://managedbass.github.io/api/ManagedBass.Asio.BassAsio.html Releases the currently initialized Asio device or driver. ```APIDOC ## Free() ### Description Releases the Asio device/driver. ### Returns - **Boolean** - If successful, true is returned, else false is returned. Use LastError to get the error code. ``` -------------------------------- ### SupportedFormats API Source: https://managedbass.github.io/api/ManagedBass.Bass.html Gets the Formats supported by Bass separated by ';'. ```APIDOC ## GET /api/supported/formats ### Description Gets the Formats supported by Bass, separated by a semicolon (;). The list is not necessarily complete. ### Method GET ### Endpoint /api/supported/formats ### Parameters None ### Response #### Success Response (200) - **formats** (string) - A semicolon-separated string of supported audio formats. #### Response Example ```json { "formats": "mp3;wav;ogg" } ``` ``` -------------------------------- ### Create a Tempo Stream Source: https://managedbass.github.io/api/ManagedBass.Fx.BassFx.html Demonstrates how to initialize a decoding stream and wrap it in a tempo stream using BassFx. ```csharp // create decoded stream var chan = Bass.CreateStream(FileName, Flags: BassFlags.Decode); // create a tempo stream if (chan != 0) chan = BassFx.TempoCreate(chan, BassFlags.FxFreeSource); ``` -------------------------------- ### ChannelHasFlag Source: https://managedbass.github.io/api/ManagedBass.Mix.BassMix.html Gets whether a flag is present on a mixer channel. ```APIDOC ## GET ChannelHasFlag ### Description Gets whether a flag is present on a mixer channel. ### Method GET ### Endpoint /ChannelHasFlag ### Parameters #### Query Parameters - **handle** (Int32) - Required - The mixer channel handle. - **flag** (BassFlags) - Required - The flag to check for. ### Returns #### Success Response (200) - **has_flag** (Boolean) - True if the flag is present, false otherwise. ### Request Example ``` GET /ChannelHasFlag?handle=12345&flag=Loop ``` ### Response Example ```json { "has_flag": true } ``` ``` -------------------------------- ### GET ChannelGetMatrix Source: https://managedbass.github.io/api/ManagedBass.Mix.BassMix.html Retrieves a channel's mixing matrix. ```APIDOC ## GET ChannelGetMatrix ### Description Retrieves a channel's mixing matrix, if it has one. ### Parameters #### Path Parameters - **Handle** (Int32) - Required - The handle of the mixer source channel. - **Matrix** (Single[,]) - Required - The matrix array to populate. ### Response - **Returns** (bool) - True if successful, false otherwise. ``` -------------------------------- ### Get Sample Support Properties Source: https://managedbass.github.io/api/ManagedBass.BassInfo.html Properties indicating whether specific sample formats are supported by hardware mixing. ```csharp public bool Supports16BitSamples { get; } ``` ```csharp public bool Supports8BitSamples { get; } ``` ```csharp public bool SupportsMonoSamples { get; } ``` ```csharp public bool SupportsStereoSamples { get; } ``` -------------------------------- ### POST /EncodeStart Source: https://managedbass.github.io/api/ManagedBass.Enc.BassEnc.html Sets up a user-provided encoder on a channel. ```APIDOC ## POST /EncodeStart ### Description Sets up a user-provided encoder on a channel. This is useful for platforms where external encoders are unavailable. ### Parameters #### Request Body - **Handle** (Int32) - Required - The channel handle (HSTREAM, HMUSIC, or HRECORD). - **Filename** (String) - Required - Output filename (null = no output file). - **Flags** (EncodeFlags) - Required - A combination of EncodeFlags. - **Procedure** (EncoderProcedure) - Required - Callback function to receive sample data and return encoded data. - **User** (IntPtr) - Optional - User instance data to pass to the callback function. ### Response #### Success Response (200) - **EncoderHandle** (Int32) - The encoder process handle if successfully started, else 0. ``` -------------------------------- ### GetProgramName Source: https://managedbass.github.io/api/ManagedBass.Vst.BassVst.html Gets the name of a specific program for a VST effect. ```APIDOC ## GetProgramName ### Description Gets the name of any program of a VST effect. ### Method N/A (Static Method) ### Endpoint N/A ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (string) - Returns the name of the program. #### Response Example ```json { "programName": "Chorus Effect" } ``` #### Remarks Program names are limited to 24 characters. This function does not change the selected program. ``` -------------------------------- ### GET /GetParamInfo Source: https://managedbass.github.io/api/ManagedBass.Vst.BassVst.html Retrieves common information about an editable parameter. ```APIDOC ## GET /GetParamInfo ### Description Get some common information about an editable parameter to a BassVstParamInfo class. ### Method GET ### Parameters #### Query Parameters - **VstHandle** (Int32) - Required - The VST effect handle. - **ParamIndex** (Int32) - Required - The index of the parameter. ### Response #### Success Response (200) - **Info** (BassVstParamInfo) - An instance of the BassVstParamInfo class. ``` -------------------------------- ### Device Initialization API Source: https://managedbass.github.io/api/ManagedBass.Bass.html Methods for initializing and managing audio devices. ```APIDOC ## Init ### Description Initializes the audio output device. ### Method Init(Int32, Int32, DeviceInitFlags, IntPtr, IntPtr) ### Parameters - **device** (Int32) - Required - The device index. - **freq** (Int32) - Required - Output sample rate. - **flags** (DeviceInitFlags) - Required - Initialization flags. - **win** (IntPtr) - Optional - Window handle. - **dsguid** (IntPtr) - Optional - DirectSound GUID. ``` -------------------------------- ### GetBypass Source: https://managedbass.github.io/api/ManagedBass.Vst.BassVst.html Gets the current bypass state of the effect processing. ```APIDOC ## GET /GetBypass ### Description Gets the current bypass state of the effect processing. ### Method GET ### Endpoint /GetBypass ### Parameters #### Path Parameters None #### Query Parameters - **VstHandle** (Int32) - Required - The VST effect handle as returned by ChannelSetDSP. ### Request Example ``` /GetBypass?VstHandle=12345 ``` ### Response #### Success Response (200) - **isBypassed** (Boolean) - True if the effect is bypassed, false otherwise. #### Response Example ```json { "isBypassed": false } ``` ``` -------------------------------- ### ServerInit Source: https://managedbass.github.io/api/ManagedBass.Enc.BassEnc.html Initializes a TCP server to send an encoder's output to connecting clients. ```APIDOC ## ServerInit ### Description Initializes a server to send an encoder's output to connecting clients. ### Method Static Method ### Parameters #### Path Parameters - **Handle** (Int32) - Required - The encoder handle. - **Port** (String) - Required - The IP address and port number to accept client connections on. - **Buffer** (Int32) - Required - The server's buffer length in bytes. - **Burst** (Int32) - Required - The amount of buffered data to send to new clients. - **Flags** (EncodeServer) - Required - EncodeServer flags. - **Procedure** (EncodeClientProcedure) - Required - Callback function to receive notification of clients connecting and disconnecting. - **User** (IntPtr) - Required - User instance data to pass to the callback function. ### Response #### Success Response (200) - **Return** (Int32) - The new server's port number if successful, else 0. ``` -------------------------------- ### ReverseGetSource Source: https://managedbass.github.io/api/ManagedBass.Fx.BassFx.html Get the source channel handle of the reversed stream. ```APIDOC ## ReverseGetSource ### Description Get the source channel handle of the reversed stream. ### Parameters #### Path Parameters - **Channel** (Int32) - Required - The handle of the reversed stream. ### Response #### Success Response (200) - **SourceHandle** (Int32) - The source channel handle. ``` -------------------------------- ### GET /ChannelGetLevel Source: https://managedbass.github.io/api/ManagedBass.Asio.BassAsio.html Retrieves the peak amplitude level of a channel. ```APIDOC ## GET /ChannelGetLevel ### Description Retrieves the level (peak amplitude) of a channel. ### Parameters #### Query Parameters - **Input** (Boolean) - Required - Dealing with an input channel? false = an output channel. - **Channel** (Int32) - Required - The input/output channel number... 0 = first. ### Response #### Success Response (200) - **Level** (Double) - The level of the channel, ranging from 0 (silent) to 1 (max). Returns -1 on error. ``` -------------------------------- ### ConfigPlugin Method Source: https://managedbass.github.io/api/ManagedBass.Winamp.BassWinamp.html Displays the configuration dialog for a loaded Winamp input plugin. ```APIDOC ## Method ConfigPlugin Shows the configuration dialog of the loaded Winamp input plug-in. ### Declaration ```csharp public static void ConfigPlugin(int Handle, IntPtr Window) ``` ### Parameters - **Handle** (Int32) - Required - The handle of the winamp input plugin. - **Window** (IntPtr) - Required - The application's main window... = the current foreground window. ``` -------------------------------- ### GET /ChannelGetInfo Source: https://managedbass.github.io/api/ManagedBass.Asio.BassAsio.html Retrieves detailed information about an Asio channel. ```APIDOC ## GET /ChannelGetInfo ### Description Retrieves information on an Asio channel. ### Parameters #### Query Parameters - **Input** (Boolean) - Required - Dealing with an input channel? false = an output channel. - **Channel** (Int32) - Required - The input/output channel number... 0 = first. ### Response #### Success Response (200) - **AsioChannelInfo** (Object) - An instance of the AsioChannelInfo structure. ``` -------------------------------- ### Create Dummy or Push Stream Source: https://managedbass.github.io/api/ManagedBass.Bass.html Use this to create a dummy stream, which can be used for processing audio data with DSP/FX. Ensure the stream format matches the data being fed into it. ```csharp public static int CreateStream(int Frequency, int Channels, BassFlags Flags, StreamProcedureType ProcedureType) ``` -------------------------------- ### CaptureGetDevices Source: https://managedbass.github.io/api/ManagedBass.DShow.BassDShow.html Gets the available audio or video capture devices. ```APIDOC ## CaptureGetDevices ### Description Gets the available audio or video capture devices. ### Parameters #### Path Parameters - **DeviceType** (BassDShowCapture) - Required - The type of capture device to get. - **Procedure** (EnumDevicesProcedure) - Required - The user defined callback receiving the available capture devices or null to retrieve only the number of available devices. - **User** (IntPtr) - Required - User instance data to pass to the callback function. ### Returns - **Int32** - If successful, the number of available capture devices found is returned - else 0 is returned (use LastError to get the error code). ``` -------------------------------- ### ReverbTime Property Source: https://managedbass.github.io/api/ManagedBass.DirectX8.DXReverbEffect.html Sets or gets the reverb time in milliseconds. ```csharp public double ReverbTime { get; set; } ``` -------------------------------- ### EncodeStart Source: https://managedbass.github.io/api/ManagedBass.Enc.BassEnc.html Starts an encoding process on a given channel handle with specified command-line arguments, flags, and an optional callback procedure for notifications. ```APIDOC ## EncodeStart(Int32, String, EncodeFlags, EncodeProcedure, IntPtr) ### Description Starts encoding on a channel. ### Method `EncodeStart` ### Parameters #### Path Parameters - **Handle** (Int32) - Required - The channel Handle (HSTREAM, HMUSIC, or HRECORD). - **CommandLine** (String) - Required - The encoder command-line, including the executable filename and any options. Or the output filename if the PCM flag is specified. - **Flags** (EncodeFlags) - Required - A combination of BassFlags. - **Procedure** (EncodeProcedure) - Optional - Callback function to receive the encoded data. If null, no callback is used. To receive encoded data via a callback, the encoder must output to STDOUT. - **User** (IntPtr) - Optional - User instance data to pass to the callback function. Defaults to null. ### Returns - **Int32** - The encoder process Handle if the encoder is successfully started, otherwise 0. Use LastError to get the error code. ### Remarks This function initiates an encoding process. The `CommandLine` parameter specifies the encoder executable and its arguments, or the output file if using PCM encoding. The `Flags` parameter allows for various encoding options. An optional `Procedure` callback can be provided to receive notifications about the encoded data, and `User` data can be passed to this callback. ``` -------------------------------- ### CastInit Method Source: https://managedbass.github.io/api/ManagedBass.Enc.BassEnc.html Initializes a connection to a Shoutcast or Icecast server. ```APIDOC ## CastInit ### Description Initializes a connection to a Shoutcast or Icecast server for streaming. ### Method Static Method ### Parameters - **Handle** (Int32) - The channel handle. - **Server** (String) - Server address. - **Pass** (String) - Password. - **Mount** (String) - Mount point. - **Name** (String) - Stream name. - **URL** (String) - Stream URL. - **Genre** (String) - Stream genre. - **Description** (String) - Stream description. - **Headers** (String) - Additional headers. - **Bitrate** (Int32) - Bitrate. - **Public** (Boolean) - Whether the stream is public. ``` -------------------------------- ### GET GetInfo Source: https://managedbass.github.io/api/ManagedBass.Bass.html Retrieves information about the currently active audio device. ```APIDOC ## GET GetInfo ### Description Retrieves information on the device currently being used. The target device is determined by the current thread's device setting. ### Method GET ### Parameters #### Query Parameters - **Info** (out BassInfo) - Required - BassInfo object to receive the information. ### Response #### Success Response (200) - **Result** (Boolean) - Returns true if successful, false otherwise. ``` -------------------------------- ### GET /Version Source: https://managedbass.github.io/api/ManagedBass.Bass.html Retrieves the version of the BASS library currently loaded. ```APIDOC ## GET /Version ### Description Retrieves the version of BASS that is loaded. ### Method GET ### Endpoint /Version ### Response #### Success Response (200) - **Version** (Version) - The version object of the loaded BASS library. ``` -------------------------------- ### EncodeStart Source: https://managedbass.github.io/api/ManagedBass.Enc.BassEnc.html Starts an encoding process on a specified channel, allowing for command-line configuration and optional callback handling. ```APIDOC ## POST EncodeStart ### Description Starts encoding on a channel (HSTREAM, HMUSIC, or HRECORD). The encoder is configured via a command-line string, and data can be processed via an optional callback function. ### Method POST ### Endpoint EncodeStart(Int32 Handle, String CommandLine, EncodeFlags Flags, EncodeProcedure Procedure, IntPtr User, Int32 Limit) ### Parameters #### Path Parameters - **Handle** (Int32) - Required - The channel handle (HSTREAM, HMUSIC, or HRECORD). - **CommandLine** (String) - Required - The encoder command-line, including the executable filename and options, or the output filename if the PCM flag is used. - **Flags** (EncodeFlags) - Required - A combination of BassFlags. - **Procedure** (EncodeProcedure) - Optional - Callback function to receive encoded data; null if not used. - **User** (IntPtr) - Optional - User instance data to pass to the callback function. - **Limit** (Int32) - Required - The maximum number of bytes to be encoded (0 = no limit). ### Response #### Success Response (200) - **Handle** (Int32) - The handle of the started encoder. ```