DetectCuePoints throws Exception thrown: 'System.IndexOutOfRangeException'

Started by Chris Oakley,

Chris Oakley

I'm struggling with an issue which I cannot fathom. I've tried to replicate it away from the main project but it works fine, so I'm hoping the brain trust might be able to offer up some suggestions.

In VB.NET I'm having crashes on the line:
Dim _ret As Boolean = Un4seen.Bass.Utils.DetectCuePoints(_mixitem.StreamId, 10, _cuein, _cueout, 0, 0, 2)
It properly crashes out with this error:
Exception thrown: 'System.IndexOutOfRangeException' in Bass.Net.dll

Original I used the BlockSize value of 0.5 and that caused the same problem, but on a different audio file. I then upped it to 10 and it worked.

I've then had the same problem on a different file, so upped it to 30 and now it's working again.

Interesingly both files are FLAC files.

I open the file with:
Dim _stream As Integer = Bass.BASS_StreamCreateFile("c:\temp\audio\202986.flac", 0, 0, BASSFlag.BASS_STREAM_DECODE Or BASSFlag.BASS_STREAM_PRESCAN)So nothing unusual there.

It's got me completely stumped. I can obviously trap the error and code around it, but if I'm going to do that I may as well not have the code in there at all.

Anyone any thoughts on what could be going on with this line?

Ian @ un4seen

DetectCuePoints is a BASS.Net-specific function, so it'll probably need Bernd to chime in, but to perhaps narrow it down, please check what BASS_ChannelGetInfo says about the troublesome files/streams.

radio42

Note, that 0 dB doesn't make much sense as an cuein resp. cueout threshold. Better try e.g. -20 dB or below.

Can you try (i.e. add the BASSFlag.BASS_SAMPLE_FLOAT option at stream creation - which is needed internally):
Dim _stream As Integer = Bass.BASS_StreamCreateFile("c:\temp\audio\202986.flac", 0, 0, BASSFlag.BASS_SAMPLE_FLOAT Or BASSFlag.BASS_STREAM_DECODE Or BASSFlag.BASS_STREAM_PRESCAN)
Dim _ret As Boolean = Un4seen.Bass.Utils.DetectCuePoints(_stream, 10, _cuein, _cueout, -24, -24, 2)