20 May '13 - 02:21 *
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: BASSMix Double Speed Issue  (Read 516 times)
Orry Verducci
Posts: 9


« on: 24 May '12 - 01:09 »
Reply with quoteQuote

I'm developing an application at the moment using BASS and BASSMix (through BASS.Net). My application has 2 'players', which at first I created as two seperate streams, which worked fine. Now I want to mix the two streams together so that I can apply a DSP to the mix, as well as use WASAPI. I've changed the streams to decode only and created a mixer stream which is set to non stop. My issue is when I play one of the mixer channels, it plays back at double speed (stuttering forward continuously, rather than sounding like it is at the wrong sample rate), plus when I pause the channel it seems the stream carries on decoding rather than pausing.

Is there anything obvious that would explain this?
Logged
muntablues
Posts: 191


« Reply #1 on: 24 May '12 - 10:33 »
Reply with quoteQuote

Have you added some visual effect on your decoding channels? Maybe these effect "steal" data from your channel. I got the same problem...

Edit: See this one: http://www.un4seen.com/forum/?topic=12230.0;hl=play+too+fast
Logged
Orry Verducci
Posts: 9


« Reply #2 on: 25 May '12 - 16:26 »
Reply with quoteQuote

Thanks, I had a VU meter that was causing the problem.

I have a small issue now however, which is that there is about a half a second delay between pausing/seeking a source stream and the action actually taking place (e.g. if I press a pause button, which fires BASS_Mixer_ChannelPause, it carries on playing for about half a second until it pauses). Hitting play is instant as it should be, but is the only action that is.

Any suggestions for removing the delay?
Logged
Ian @ un4seen
Administrator
Posts: 15244


« Reply #3 on: 25 May '12 - 17:13 »
Reply with quoteQuote

The extra delay when using the mixer is due to the mixer's playback buffer. The size of the buffer is determined by the BASS_CONFIG_BUFFER setting at its creation, so you can reduce the delay by lowering that (it defaults to 500ms) via BASS_SetConfig. For a small buffer, you will also need to lower the update period via the BASS_CONFIG_UPDATEPERIOD setting, as that limits how low the buffer can go. For example, to give the mixer a 100ms buffer, you might do something like this...

BASS_SetConfig(BASS_CONFIG_UPDATEPERIOD, 40); // set the update period to 40ms
BASS_SetConfig(BASS_CONFIG_BUFFER, 100); // set the buffer length to 100ms
mixer=BASS_Mixer_StreamCreate(...); // create the mixer

If you would like to pause everything that the mixer is playing, you can avoid any extra delay by pausing the mixer (via BASS_ChannelPause) instead of its source(s).

Regarding your VU meter... if you would like to get the level of a mixer source for that, you can add the BASS_MIXER_BUFFER flag to its BASS_Mixer_StreamAddChannel call and then use BASS_Mixer_ChannelGetLevel (instead of the usual BASS_ChannelGetLevel).
Logged
Orry Verducci
Posts: 9


« Reply #4 on: 25 May '12 - 21:06 »
Reply with quoteQuote

Cheers Ian, I had assumed it was the buffer but I was trying the mixer buffer config setting. Works perfectly now.
Logged
Pages: [1]
  Reply  |  Print  
 
Jump to:  

Powered by SMF 1.1.18 | SMF © 2013, Simple Machines