Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using Un4seen.Bass;
- using Un4seen.Bass.AddOn.Mix;
- namespace bassmixchk
- {
- class Program
- {
- static void Main(string[] args)
- {
- // Setup BASS Audio Lib
- SetupBassLibrary();
- // init BASS
- if (Bass.BASS_Init(-1, 44100, BASSInit.BASS_DEVICE_DEFAULT, IntPtr.Zero))
- {
- // create mixer stream
- int Mixer = BassMix.BASS_Mixer_StreamCreate(44100, 2, BASSFlag.BASS_MIXER_NONSTOP);
- // play back the mixer stream
- Bass.BASS_ChannelPlay(Mixer, true);
- // print message
- Console.WriteLine("Mixer_StreamCreate(): Handle=" + Mixer.ToString());
- // wait for key
- while (!Console.KeyAvailable)
- {
- System.Threading.Thread.Sleep(25);
- }
- // stop mixer
- Bass.BASS_ChannelStop(Mixer);
- / free BASS
- Bass.BASS_Free();
- }
- }
- static void SetupBassLibrary()
- {
- // we must register BASS.NET to be able to run in console, otherwise will crash on Unix without X Server
- BassNet.Registration("<email>", "<regkey>"); // get a freeware key by registering on http://bass.radio42.com/
- // load BASS plugins from current directory
- Bass.BASS_PluginLoadDirectory(Environment.CurrentDirectory);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement