Author Topic: Error on BASS_ChannelGetData while retrieving data for the FFT  (Read 288 times)

xphere

  • Posts: 2
Hi!

I am just doing a mp3 playback with some FFT analysis, but I have seen that when I do a new "BASS_ChannelSetPostion" on the stream, the next call to "BASS_ChannelGetData" raises the following error:

Code: [Select]
avcore\audiocore\client\audioclient\audioclientcore.cpp(1925)\AUDIOSES.DLL!00007FFF9DC30283: (caller: 00007FFF84BC3075) ReturnHr(1) tid(1174) 88890005

My code looks like this:
When a new position is requested to the song player, I do this:
Code: [Select]
QWORD bytes = BASS_ChannelSeconds2Bytes(str, runTime); // convert seconds to bytes
if (FALSE == BASS_ChannelSetPosition(str, bytes, BASS_POS_BYTE)) { // seek there
BASS_err = BASS_ErrorGetCode();
if (BASS_err > 0 && BASS_err != BASS_ERROR_POSITION)
LOG->Error("BASS_ChannelSetPosition returned error: %i", BASS_ErrorGetCode());
}

if (FALSE == BASS_Start())
LOG->Error("BASS_Start returned error: %i", BASS_ErrorGetCode());

if (FALSE == BASS_ChannelPlay(str, FALSE))
LOG->Error("BASS_ChannelPlay returned error: %i", BASS_ErrorGetCode());

BASS_ChannelSetAttribute(str, BASS_ATTRIB_VOL, volume);

An then, I do the FFT analysis:
Code: [Select]
float fft[512] = {0.0f};
if (-1 == BASS_ChannelGetData(str, fft, BASS_DATA_FFT1024)) { // get the FFT data
int BASS_err = BASS_ErrorGetCode();
if ((BASS_err > 0) && (BASS_err != BASS_ERROR_ENDED))
LOG->Error("BASS_ChannelGetData returned error: %i", BASS_err);
}

The "funny" of this is that "BASS_ChannelGetData" method does not return -1, so the error is not logged, but the error is displayed in the Output window of Visual studio.

EDIT: The error is only raised when I change the position of the song (calling BASS_ChannelSetPosition). If I just let the music play, the error does not appear, and the FFT data is properly retrieved.

Do you know what I am doing wrong?

Thanks in advance!!!!

NOTE: I am using bass 2.4, and the error happens on 32 and 64bit versions.
NOTE2: I am not forcing manual updates... everything is "by default".
« Last Edit: 31 May '19 - 11:01 by xphere »

Ian @ un4seen

  • Administrator
  • Posts: 21991
That message looks like it's coming from WASAPI within the BASS_Start call. The 88890005 code is AUDCLNT_E_NOT_STOPPED, which means that the output has already been started. It shouldn't cause a problem. It isn't crashing, is it?

xphere

  • Posts: 2
Thanks for replying Ian.

No, is not crashing at all, everything sounds fine, and program does not stop... but it's strange that the error is raised when calling "BASS_ChannelGetData", and only when I do before a "BASS_ChannelSetPosition", isn't it?

Ian @ un4seen

  • Administrator
  • Posts: 21991
Perhaps there is a little delay before the message appears in the Output window. Do you still see it if you remove the BASS_Start call?