Author Topic: BASS_RecordStart() and BASS_SAMPLE_FLOAT  (Read 1455 times)

3delite

  • Posts: 907
BASS_RecordStart() and BASS_SAMPLE_FLOAT
« on: 6 Dec '08 - 14:31 »
Hi!

Trying to create a floating point recording channel but the channel I get is 0.
Is this a driver issue or I am missing something?

The BASS_StreamCreate() can give a floating point channel.

The code is:

Code: [Select]
        //* Test if float channels are available
        if TryFloatChannel then begin
            Floatable := BASS_StreamCreate(44100, 2, BASS_SAMPLE_FLOAT, nil, 0); // try creating FP stream
            if Floatable <> 0 then begin
                BASS_StreamFree(Floatable); // floating-point channels are supported!
                FloatChannel := True;
            end else begin
                FloatChannel := False;
            end;
        end else FloatChannel := False;

        //* Initialize recording
        Res := BASS_ChannelStop(RecordChannel);
        Res := BASS_RecordFree;
        Res := BASS_RecordInit(Device);
        i := 0;
        while BASS_RecordSetInput(i, BASS_INPUT_OFF, -1)
            do i := i + 1;
        BASS_RecordSetInput(RecInput, BASS_INPUT_ON, -1);
        //* Record callback every 500ms
        Flags := MAKELONG(0, 500);
        if FloatChannel
            then Flags := Flags OR BASS_SAMPLE_FLOAT;
        if StartPaused
            then Flags := Flags OR BASS_RECORD_PAUSE;
        RecordChannel := BASS_RecordStart(SampleRate, NoOfChannels, Flags, @RecordCallback, Pointer(Self));
        if RecordChannel = 0 then begin
            Result := False;
            Exit;
        end;

Tried enabling BASS_CONFIG_FLOATDSP with BASS_SetConfig() but doesn't help.
BASS_ErrorGetCode() gives -1.

EDIT: I am using WinXP Pro SP3 with kXDrivers, tried on a Vista system and works perfectly.

Regards
3delite
« Last Edit: 6 Dec '08 - 17:00 by 3delite »