Author Topic: BASS_WMA_EncodeGetRates error 37  (Read 266 times)

Pedro Leonardo

  • Posts: 89
BASS_WMA_EncodeGetRates error 37
« on: 18 Jun '24 - 18:41 »
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.


Code: [Select]
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

  • Posts: 491
Re: BASS_WMA_EncodeGetRates error 37
« Reply #1 on: 18 Jun '24 - 19:36 »
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

  • Posts: 89
Re: BASS_WMA_EncodeGetRates error 37
« Reply #2 on: 18 Jun '24 - 20:09 »
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.
« Last Edit: 18 Jun '24 - 20:56 by Pedro Leonardo »

Ian @ un4seen

  • Administrator
  • Posts: 25884
Re: BASS_WMA_EncodeGetRates error 37
« Reply #3 on: 19 Jun '24 - 16:43 »
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

  • Posts: 89
Re: BASS_WMA_EncodeGetRates error 37
« Reply #4 on: 19 Jun '24 - 18:21 »
Hi, Ian. It can be any other format. You help me?

Regards

Ian @ un4seen

  • Administrator
  • Posts: 25884
Re: BASS_WMA_EncodeGetRates error 37
« Reply #5 on: 20 Jun '24 - 11:46 »
You can write MP3/Vorbis/Opus files with the BASSenc_MP3/OGG/OPUS add-ons (you will need BASSenc too), something like this:

Code: [Select]
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.