Advertisement
Guest User

Untitled

a guest
Sep 29th, 2014
325
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.40 KB | None | 0 0
  1. using System;
  2. using Un4seen.Bass;
  3. using Un4seen.Bass.AddOn.Mix;
  4.  
  5. namespace bassmixchk
  6. {
  7.     class Program
  8.     {
  9.         static void Main(string[] args)
  10.         {
  11.             // Setup BASS Audio Lib
  12.             SetupBassLibrary();
  13.  
  14.         // init BASS
  15.             if (Bass.BASS_Init(-1, 44100, BASSInit.BASS_DEVICE_DEFAULT, IntPtr.Zero))
  16.             {
  17.         // create mixer stream
  18.                 int Mixer = BassMix.BASS_Mixer_StreamCreate(44100, 2, BASSFlag.BASS_MIXER_NONSTOP);
  19.         // play back the mixer stream
  20.                 Bass.BASS_ChannelPlay(Mixer, true);
  21.         // print message
  22.                 Console.WriteLine("Mixer_StreamCreate(): Handle=" + Mixer.ToString());
  23.         // wait for key
  24.                 while (!Console.KeyAvailable)
  25.                 {
  26.                     System.Threading.Thread.Sleep(25);
  27.                 }
  28.         // stop mixer
  29.                 Bass.BASS_ChannelStop(Mixer);
  30.         / free BASS
  31.                 Bass.BASS_Free();
  32.             }
  33.         }
  34.  
  35.         static void SetupBassLibrary()
  36.         {
  37.             // we must register BASS.NET to be able to run in console, otherwise will crash on Unix without X Server
  38.             BassNet.Registration("<email>", "<regkey>"); // get a freeware key by registering on http://bass.radio42.com/
  39.  
  40.             // load BASS plugins from current directory
  41.             Bass.BASS_PluginLoadDirectory(Environment.CurrentDirectory);
  42.         }
  43.     }
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement