private Player() { var enginedir = AppDomain.CurrentDomain.BaseDirectory; if (Is64Bit) { enginedir = Path.Combine(enginedir, @"Engine\x64"); } else { enginedir = Path.Combine(enginedir, @"Engine\x86"); } Bass.Load(enginedir); BassMix.Load(enginedir); BassCd.Load(enginedir); BassFx.Load(enginedir); Bass.PluginLoad(enginedir + "\\bass_aac.dll"); Bass.PluginLoad(enginedir + "\\bass_ac3.dll"); Bass.PluginLoad(enginedir + "\\bass_ape.dll"); Bass.PluginLoad(enginedir + "\\bass_mpc.dll"); Bass.PluginLoad(enginedir + "\\bass_spx.dll"); Bass.PluginLoad(enginedir + "\\bass_tta.dll"); Bass.PluginLoad(enginedir + "\\bassalac.dll"); Bass.PluginLoad(enginedir + "\\bassdsd.dll"); Bass.PluginLoad(enginedir + "\\bassflac.dll"); Bass.PluginLoad(enginedir + "\\bassopus.dll"); Bass.PluginLoad(enginedir + "\\basswma.dll"); Bass.PluginLoad(enginedir + "\\basswv.dll"); Bass.PluginLoad(enginedir + "\\bassmidi.dll"); _callback = MyDownloadProc; _maxfft = (int)(DataFlags.Available | DataFlags.FFT2048); }
/// <summary>Create a stream from Url.</summary> public static int CreateStream(string Url, int Offset, BassFlags Flags, DownloadProcedure Procedure, IntPtr User = default(IntPtr)) { var h = BASS_HLS_StreamCreateURL(Url, Offset, Flags | BassFlags.Unicode, Procedure, User); if (h != 0) { ChannelReferences.Add(h, 0, Procedure); } return(h); }
/// <summary>Create a stream from Url.</summary> public static int CreateStream(string Url, int Offset, BassFlags Flags, DownloadProcedure Procedure, IntPtr User = default(IntPtr), int Frequency = 0) { var h = BASS_DSD_StreamCreateURL(Url, Offset, Flags | BassFlags.Unicode, Procedure, User, Frequency); if (h != 0) { Extensions.ChannelReferences.Add(h, 0, Procedure); } return(h); }
/// <exception cref="System.InvalidOperationException"> /// The AddOn does not support streaming over the internet. /// </exception> public int CreateStream(string Url, int Offset, BassFlags Flags, DownloadProcedure Procedure, IntPtr User = default(IntPtr)) { if (!SupportsURL) { throw new InvalidOperationException(DllName + " does not support streaming over internet"); } EnsureFunction("BASS_" + ID + "_StreamCreateURL", ref MStreamCreateURL); return(MStreamCreateURL(Marshal.StringToBSTR(Url), Offset, Flags | BassFlags.Unicode, Procedure, User)); }
public NetworkDecoder(string Url, Resolution BufferKind = Resolution.Short, Action <BufferProvider> callback = null) : base(BufferKind) { this.Url = Url; if (callback != null) { call = callback; proc = new DownloadProcedure(Callback); } Down_Handler = new SyncProcedure(OnDownloadCompleted); Handle = Bass.CreateStream(Url, 0, BufferKind.ToBassFlag() | BassFlags.Decode | BassFlags.Unicode, (callback != null ? proc : null), IntPtr.Zero); Bass.ChannelSetSync(Handle, SyncFlags.Downloaded, 0, Down_Handler, IntPtr.Zero); }
public AudioEngine() { DefaultDeviceIndex = -1; Log = new AudioEngineLog(); Log.Info("Audio Engine Load started"); SetNativeLibPath(); LoadLibs(); _LastVolume = 1.0f; _updateTimer = new DispatcherTimer { Interval = TimeSpan.FromMilliseconds(40), IsEnabled = false }; _updateTimer.Tick += TimerTick; Log.Info("Setting output to Default Device..."); PlayBackDeviceIndex = -1; _streamDloadProc = new DownloadProcedure(StreamDownloadProcedure); Chapters = new ObservableCollection <Chapter>(); ExtensionProvider = new ExtensionProvider(); }
private static void PerformQueuedDownload(DownloadProcedure download, WebProxy proxy) { try { var tab = download.Parser.Parse(download.Url, proxy); if (tab != null) { tab.Source = download.Url; tab.SourceType = TablatureSourceType.Download; } download.Tab = tab; download.State = DownloadState.Completed; } catch { download.State = DownloadState.Failed; } }
static extern int BASS_HLS_StreamCreateURL(string Url, int Offset, BassFlags Flags, DownloadProcedure Procedure, IntPtr User);
static extern int BASS_DSD_StreamCreateURL(string Url, int Offset, BassFlags Flags, DownloadProcedure Procedure, IntPtr User, int Frequency = 0);
public static extern int CreateStream([MarshalAs(UnmanagedType.LPStr)] string Url, int Offset, BassFlags Flags, DownloadProcedure Procedure, IntPtr User = default(IntPtr), int Frequency = 44100);