Re-playing a stopped jingle, reproduce a part of audio before playing

Started by Couin,

Couin

Hi,

An user (the same of the other topic I just opened), reported me that if she stop a jingle before its end, when she play again this jingle, she can ear (I ear it too, on its recording) a part of audio, around 100 ms (the suit of where she stopped the first playback) before the beginning of the jingle.

In my "Play" function code, I even add a Stop even before recalling the start position (customizable).
Call BASS_ChannelStop(chan)
Call BASS_ChannelSetPosition(chan, position, BASS_POS_BYTE)
Call BASS_ChannelSlideAttribute(chan, BASS_ATTRIB_VOL, 1 10)
Call BASS_ChannelPlay(chan, BASSFALSE)

In the "Stop" function code, I use:
Call BASS_ChannelSlideAttribute(chan, BASS_ATTRIB_VOL Or BASS_SLIDE_LOG, -1, FadeOutDuration)
So the playback should stop at the end of FadeOutDuration (I should not have to add the Stop event befor SetPosition in the "Play" function).

I can not reproduce its problem at all.

Are my procedures correct?

Is there a way to "purge" any resting data of "chan" or something else, before playing it?

Thanks :)

Ian @ un4seen

That code looks fine. The BASS_ChannelSetPosition call should clear the channel's playback buffer, so that old data isn't heard. What output device is the user using? Perhaps there's a buffer in that that isn't being fully drained before stopping. You could try enabling non-stop output (before BASS_Init) and see if that helps:

BASS_SetConfig(BASS_CONFIG_DEV_NONSTOP, 1)

If you aren't already using the latest BASS.DLL build, please also try that to see if it makes any difference:

    www.un4seen.com/stuff/bass.zip

Couin

Hi Ian

I think there is something weird with its setup, because I can't reproduce its problem at all.
She uses virtual audio cables, but I don't know which one, I will ask her.

About the DLL, is it a stable version ?  Version number v32.65.18.15 instead of 2.4.17 of the download section, is it normal ?

Ian @ un4seen

Quote from: CouinI think there is something weird with its setup, because I can't reproduce its problem at all.
She uses virtual audio cables, but I don't know which one, I will ask her.

OK, I guess that's where the old data is probably buffered. Please check the BASS_INFO "latency" value with BASS_GetInfo.

Quote from: CouinAbout the DLL, is it a stable version ?  Version number v32.65.18.15 instead of 2.4.17 of the download section, is it normal ?

That's a strange version number. Where are you seeing that? You can use BASS_GetVersion to check what version of BASS.DLL is loaded by your app.

Couin

Hi Ian :)

I will check to add BASS_INFO latency return so she could report me the value.

About BASS version, I get it with this code:
        Dim GetBassVer As Variant
        Dim BassVer As Variant
       
        GetBassVer = Format(Hex(BASS_GetVersion), "00000000")
        BassVer = ""
        For i = 1 To 7 Step 2
            BassVer = BassVer & "." & val("&H" & Mid$(GetBassVer, i, 2))
        Next i
        BassVer = Mid(BassVer, 2)
It gaves me the good version number (for example 2.4.17 for dll version in the downloads section), but with the last dll of "stuff" directory, it returns the value I reported above.

If I try (with some VB6 conversion) the first method of your message https://www.un4seen.com/forum/?msg=120623, so
Debug.Print CStr(HiByte(HiWord(BASSVERSION))) & "." & CStr(LoByte(HiWord(BASSVERSION))) & "." & CStr(HiByte(LoWord(BASSVERSION))) & "." & CStr(LoByte(LoWord(BASSVERSION)))
I get 0.0.2.4 instead of 2.4.17 and same (0.0.2.4) with stuff DLL.

But with this easier way
    ' Requires reference to Microsoft Scripting Runtime
    Dim fso As FileSystemObject
    Set fso = New FileSystemObject
    Debug.Print fso.GetFileVersion("bass.dll")
    Set fso = Nothing
I get better result (2.4.17.0 for wbesite's DLL, 2.4.17.47 for "stuff" DLL).


Couin

Hi,

Her latency returns 25 ms (I get the same value).

So, after several messages exchanges, we finally spotted the problem. It occurs on jingles for which we appy some reverb. I can reproduce the problem.

Of course, I'm trying to reproduce the problem in a small test project and I can't for the moment, but this spotted problem reveal another question (I will open a new thread for this).

Edit : I get no problem on versions before implenting mixers/splitters.

Edit 2: Adding BASS_FXReset before re-play the jingle, looks remove the "not played" reverb datas.