Author Topic: Calling BASS_ChannelSetAttribute(..., BASS_ATTRIB_GRANULE, ...) always fails  (Read 607 times)

daniel_mor

  • Posts: 18
I am developing a voice chat plugin. This is a dynamic library for Windows 7/8/10/11.
And it would be nice if the recording stream would issue data in fixed portions so that the codec could work with them and send them to the network.
But the attempt to set the BASS_ATTRIB_GRANULE is interrupted by an error (BASS_ERROR_NOTAVAIL).
I tried to set different values, tried to change the frequency but without result.

BASS library version: 2.4.17

Code: [Select]
gRecordStream = BASS_RecordStart(44100, 1, BASS_RECORD_PAUSE, NULL, NULL);
if (gRecordStream == NULL) return false;
if (BASS_ChannelSetAttribute(gRecordStream, BASS_ATTRIB_GRANULE, 512) == FALSE)
{
    std::printf("error: %u", BASS_ErrorGetCode()); // error: 37 (BASS_ERROR_NOTAVAIL)
    return false;
}

daniel_mor

  • Posts: 18
I deeply apologize for my stupidity. I didn't notice that I forgot to pass RecordProc callback. I need to give my brain a rest.  ;D