BASS_WMA_EncodeGetRates error 37

Started by Pedro Leonardo,

Pedro Leonardo

Hi.
I have an application that records stream. Everything was fine until I tried to record this address "http://evpp.mm.uol.com.br:1935/band/bandnewsfm_vit/playlist.m3u8" several other addresses work normally, but this one returns error 37. What could it be? Windows 10 and 11.  Stream runs but does not record.


var Rates: PDWord;
    Flags: Cardinal;
    Info: BASS_CHANNELINFO;
begin
     ComboBR3.Clear;
     BASS_ChannelGetInfo(chan, Info);


    Rates := BASS_WMA_EncodeGetRates(Info.freq, Info.chans, 0 );

    if (Rates = nil) then begin
       showmessage('Codec não encontrado ou parametro não suportado  =  ' +inttostr(Bass_ErrorGetCode())) ;
      //  ComboBR3.Text := 'Erro...';
      //  ComboBR3.Enabled := False;
        Exit;
    end else begin
        ComboBR3.Enabled := True;
        while (Rates^ <> 0) do begin
            if (Flags AND BASS_WMA_ENCODE_RATES_VBR) > 0
                then ComboBR3.Items.Add(IntToStr(Rates^))
                else ComboBR3.Items.Add(IntToStr(Rates^ div 1000));
            Inc(Rates);
        end;
        ComboBR3.ItemIndex:= 0;
    end;


Regads

MB_SOFT

that stream has a sample rate of 11025 hz

from your code it seems you're trying to record on WMA format?

not sure if the WMA profile you're using support 11025 hz.

Pedro Leonardo

#2
Hi, Yes I record wma. I based it on netradio sources. The stream is 11025, 2 channels 10000 Hz. If I put 1 channel (mono) it generates the audio, but with low rotation. How do I know if the profile supports 11025? Is there a solution to this problem?


Sorry the English.
Regards.

Ian @ un4seen

It looks like the WMA codec only supports 11025hz in mono (not stereo) for some reason. Do you need to write a WMA file or could you use a different format instead? There are BASSenc add-ons for MP3/Vorbis/Opus encoding (FLAC too for lossless).

Pedro Leonardo

Hi, Ian. It can be any other format. You help me?

Regards

Ian @ un4seen

You can write MP3/Vorbis/Opus files with the BASSenc_MP3/OGG/OPUS add-ons (you will need BASSenc too), something like this:

encoder = BASS_Encode_MP3_StartFile(stream, NULL, BASS_ENCODE_QUEUE | BASS_ENCODE_AUTOFREE, filename);

encoder = BASS_Encode_OGG_StartFile(stream, NULL, BASS_ENCODE_QUEUE | BASS_ENCODE_AUTOFREE, filename);

encoder = BASS_Encode_OPUS_StartFile(stream, NULL, BASS_ENCODE_QUEUE | BASS_ENCODE_AUTOFREE, filename);

Please see each function's documentation for the options available.