20 Jun '13 - 06:27 *
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: Speed problem  (Read 665 times)
benji333
Posts: 6


« on: 11 Aug '10 - 12:16 »
Reply with quoteQuote

Hi everybody,

i've got a problem with some mixer-channels.
I have a "source" - channel from a File, wich is plugged into a mixerchannel. Tis mixer is then put into another mixer and that one is played out to the output-device. When I start the source, it is played with twice as fast as it should be. When I pause the application in Visual Studio, the speed is normal. What can I do? The only thing I found in the forum was not o use Channel_GetData on mixer, but I don't do that.

Some Code:
//Create the "Output"-Mixer
int snd = BassMix.BASS_Mixer_StreamCreate(44100, 2, BASSFlag.BASS_SAMPLE_FLOAT);
Channels.AddSend(snd, name);
mixerStallSync = new SYNCPROC(OnMixerStall);
Bass.BASS_ChannelSetSync(snd, BASSSync.BASS_SYNC_STALL, 0L, mixerStallSync, IntPtr.Zero);
Bass.BASS_ChannelPlay(snd, false);
Bass.BASS_ChannelSetDevice(snd, -1);

//Create the first mixer
mx = BassMix.BASS_Mixer_StreamCreate(44100, 2, BASSFlag.BASS_SAMPLE_FLOAT | BASSFlag.BASS_MIXER_NONSTOP | BASSFlag.BASS_STREAM_DECODE);
mixerStallSync2 = new SYNCPROC(OnMixerStall2);
Bass.BASS_ChannelSetSync(mx, BASSSync.BASS_SYNC_STALL, 0L, mixerStallSync2, IntPtr.Zero);
BassMix.BASS_Mixer_StreamAddChannel(snd, mx, BASSFlag.BASS_MIXER_DOWNMIX | BASSFlag.BASS_MIXER_PAUSE);
BassMix.BASS_Mixer_ChannelPlay(mx);

//The source
int stream = Bass.BASS_StreamCreateFile("test.mp3", 0, 0, BASSFlag.BASS_SAMPLE_FLOAT | BASSFlag.BASS_STREAM_PRESCAN | BASSFlag.BASS_STREAM_DECODE);
BassMix.BASS_Mixer_StreamAddChannel(mx, stream, BASSFlag.BASS_MIXER_DOWNMIX | BASSFlag.BASS_MIXER_PAUSE);
BassMix.BASS_Mixer_ChannelPlay(stream);


Thanks for every help I get,
Yours Benjamin
Logged
Ian @ un4seen
Administrator
Posts: 15366


« Reply #1 on: 11 Aug '10 - 16:20 »
Reply with quoteQuote

I have a "source" - channel from a File, wich is plugged into a mixerchannel. Tis mixer is then put into another mixer and that one is played out to the output-device. When I start the source, it is played with twice as fast as it should be. When I pause the application in Visual Studio, the speed is normal. What can I do? The only thing I found in the forum was not o use Channel_GetData on mixer, but I don't do that.

Using BASS_ChannelGetData on the output mixer ("snd") would be fine as it would read from the mixer's output buffer, but using it on the sources ("mx" or "stream") would cause speed/skipping problems as it would take data directly from the sources (which would then not be available to be played by the output mixer). The same applies to BASS_ChannelGetLevel. Are you using either of those functions on the sources? If so, you could make use of the BASS_MIXER_BUFFER flag and BASS_Mixer_ChannelGetData/Level functions instead.
Logged
benji333
Posts: 6


« Reply #2 on: 11 Aug '10 - 22:43 »
Reply with quoteQuote

Yes, I'm using the Bass_ChannelGetLevel() on the mx and the snd Stream. Where does the BASS_MIXER_BUFFER goes to?
Logged
Ian @ un4seen
Administrator
Posts: 15366


« Reply #3 on: 12 Aug '10 - 15:05 »
Reply with quoteQuote

The BASS_MIXER_BUFFER flag can be used in BASS_Mixer_StreamAddChannel/Ex calls (or BASS_Mixer_ChannelFlags).
Logged
benji333
Posts: 6


« Reply #4 on: 13 Aug '10 - 15:08 »
Reply with quoteQuote

Yeah, it works.

Thanks very much
Benjamin
Logged
Pages: [1]
  Reply  |  Print  
 
Jump to:  

Powered by SMF 1.1.18 | SMF © 2013, Simple Machines