Author Topic: RECORDPROC - buffer size  (Read 2157 times)

zydu

  • Posts: 14
RECORDPROC - buffer size
« on: 21 Feb '07 - 11:16 »
Hi

I'm running this code under BCB6 :

int CALLBACK AnalyzeStream(HRECORD handle,const void *buffer,DWORD length,DWORD user){
        Form1->Memo1->Lines->Add(length);
        return 1;
}

void __fastcall TForm1::Button1Click(TObject *Sender)
{
BASS_RecordInit(0);
BASS_RecordSetInput(2,BASS_INPUT_ON|BASS_INPUT_LEVEL|50); //select mic
HRECORD record=BASS_RecordStart(22050,1,0,&AnalizujStrumien,0);
}

I get this on output(buffer size in bytes) :

3536
4416
4424
4416
3976
4864
3976
4424
4416
3984
4416
(...)

Shouldn't it be constant of 22050*16(bitrate) / 10(callaback function period) / 8 = 4410 bytes ??

zydu

Ian @ un4seen

  • Administrator
  • Posts: 20396
Re: RECORDPROC - buffer size
« Reply #1 on: 21 Feb '07 - 18:08 »
BASS receives the sample data in chunks (generally ~10ms). So for example, it probably won't get exactly 100ms of data every 100ms - sometimes it'll be slightly more and sometimes slightly less, but it should average out to 100ms of data every 100ms.