24 May '13 - 21:34 *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
 
   Home   Help Search Login Register  
Pages: [1]
  Reply  |  Print  
Author Topic: BASSAttribute.BASS_ATTRIB_VOL changes system volume  (Read 531 times)
valfis86
Posts: 4


« on: 27 May '12 - 10:02 »
Reply with quoteQuote

Hello.

I am using Bass.NET and I am trying to find a way to adjust only the current streams volume. I'am using the Bass.BASS_ChannelSetAttribute method using the BASSAttribute.BASS_ATTRIB_VOL parameter, as suggested in the help files. But the current volume of the system also changes. I have also tried the other volume flags but the systems volume always changes too.

Any suggestions?

thanks for help, Valentin
« Last Edit: 27 May '12 - 10:09 by valfis86 » Logged
gnag
Posts: 160


« Reply #1 on: 27 May '12 - 20:54 »
Reply with quoteQuote

Hello valfis86,

you can use BassMIX too for changing the Volume. I made a quick Console Application Demo in C# to show you how it is done. It starts with the normal Volume and after the Users presses a Key it goes down to 40% Volume.

static void Main(string[] args)
        {
            //Init
            Bass.BASS_Init(-1, 44100, BASSInit.BASS_DEVICE_DEFAULT, IntPtr.Zero);

            //Create Mixer
            int mixer = BassMix.BASS_Mixer_StreamCreate(44100, 2, BASSFlag.BASS_DEFAULT);

            //Create Source Channel
            int play_stream = Bass.BASS_StreamCreateFile("test1.mp3", 0, 0, BASSFlag.BASS_STREAM_DECODE);

            //Add Source Channel to Mixer
            BassMix.BASS_Mixer_StreamAddChannel(mixer, play_stream, BASSFlag.BASS_DEFAULT);

            Console.WriteLine("Press Key to start Playback");
            Console.ReadKey();


            //Start Playback
            Bass.BASS_ChannelPlay(mixer, false);

            //Wait for Userinput
            Console.WriteLine("Press Key to apply Envelope (Volume 40%)");
            Console.ReadKey();

            //Create nodes for Envelope and apply them
            BASS_MIXER_NODE[] nodes = new BASS_MIXER_NODE[1];
            nodes[0].pos = 0;
            nodes[0].val = 0.4f;
            BassMix.BASS_Mixer_ChannelSetEnvelope(play_stream, BASSMIXEnvelope.BASS_MIXER_ENV_VOL, nodes, 1);

            //Keep Console Window open
            Console.ReadKey();
        }
Logged
Ian @ un4seen
Administrator
Posts: 15276


« Reply #2 on: 28 May '12 - 15:50 »
Reply with quoteQuote

I am using Bass.NET and I am trying to find a way to adjust only the current streams volume. I'am using the Bass.BASS_ChannelSetAttribute method using the BASSAttribute.BASS_ATTRIB_VOL parameter, as suggested in the help files. But the current volume of the system also changes. I have also tried the other volume flags but the systems volume always changes too.

It shouldn't be possible for a stream's BASS_ATTRIB_VOL setting to affect the system volume. Are you absolutely certain that it is, eg. do you see the output device's volume slider move (in the device properties "Levels" page) with a BASS_ChannelSetAttribute call? BASS_SetVolume does set the system volume though, so perhaps you are also using that function somewhere?
Logged
valfis86
Posts: 4


« Reply #3 on: 28 May '12 - 22:10 »
Reply with quoteQuote

Realy cool, it works exactly as I wanted. Thanks alot!

Kind Regards, Valentin
Logged
Pages: [1]
  Reply  |  Print  
 
Jump to:  

Powered by SMF 1.1.18 | SMF © 2013, Simple Machines