Author Topic: BASS_WMA_EncodeOpenNetwork() with WMA Pro multi-channel  (Read 1915 times)

3delite

  • Posts: 926
Hi!

Trying to use BASS_WMA_EncodeOpenNetwork() with WMA Pro flag and if I specify more then 2 channels I can not connect to it from my app. (get a BASS_ERROR_FILEOPEN error) and WMP 11 can't connect either. Same config with 2 channels seem working.

Trying on Windows XP Pro 32bit and W7 Pro 64bit.

Also it seems BASS_ErrorGetCode, after failing BASS_WMA_EncodeOpenNetwork(), for example port in use, gives back -1.

Thank you!

Ian @ un4seen

  • Administrator
  • Posts: 21017
Please show the parameters that you are using in the BASS_WMA_EncodeOpenNetwork call.

3delite

  • Posts: 926
Ok, here it is:

Code: [Select]
function TFormConfig.Start(Channels: Cardinal; Float32: Boolean): Boolean;
var
    BitRate: Cardinal;
    Flags: Cardinal;
begin
    Result := False;

    if CheckBoxVBR.Checked
        then BitRate := StrToInt(ComboBox1.Text)
        else BitRate := StrToInt(ComboBox1.Text) * 1000;

    Flags := BASS_WMA_ENCODE_SCRIPT;
    if CheckBoxWMAPro.Checked then begin
        Flags := Flags OR BASS_WMA_ENCODE_PRO;
    end;
    if Float32 then begin
        Flags := Flags OR BASS_SAMPLE_FLOAT;
    end;

    PluginInstance.EHandle := BASS_WMA_EncodeOpenNetwork(WMAB_Samplerate, Channels, Flags, BitRate, SpinEditPort.Value, SpinEditClients.Value);
    if (PluginInstance.EHandle = 0) then begin
        MessageDlg('Can''t initialize encoding. Please check parameters, try using a different port number.' + #13#10 + 'BASS error code: ' + IntToStr(BASS_ErrorGetCode), mtError, [mbOk], 0);
        Exit;
    end;

    BASS_WMA_EncodeSetTag(PluginInstance.EHandle, 'Title', PChar(EditTitle.Text), BASS_WMA_TAG_UNICODE); // set WMA title tag
    BASS_WMA_EncodeSetTag(PluginInstance.EHandle, nil, nil, 0); // done setting tags

    BASS_WMA_EncodeSetNotify(PluginInstance.EHandle, @ClientConnect, Pointer(Self)); // setup client notification
    ...

The values are:

Code: [Select]
WMAB_Samplerate = 48000
Channels = 6
Flags = 147712
BitRate = 256000
SpinEditPort.Value = 8010
SpinEditClients.Value = 5

PluginInstance.EHandle = 1

3delite

  • Posts: 926
Any news on this issue? I'd like to publish my app. tonight, this is the only problem left.

Ian @ un4seen

  • Administrator
  • Posts: 21017
Are your BASS_WMA_EncodeWrite calls failing with a BASS_ERROR_UNKNOWN error code? If so, I think I'm able to reproduce the same problem. Internally, the IWMWriter::BeginWriting function is failing with a NS_E_AUDIO_CODEC_NOT_INSTALLED error. I'm trying to find an explanation and solution for that.

3delite

  • Posts: 926
Yes, BASS_WMA_EncodeWrite() call fails with a BASS_ERROR_UNKNOWN.

3delite

  • Posts: 926
Any progress on this issue?

Ian @ un4seen

  • Administrator
  • Posts: 21017
Yep, here's an update for you to try...

   www.un4seen.com/stuff/basswma.dll

Let me know if the problem still occurs with it.

3delite

  • Posts: 926
Thank you very much, seems working fine. :)

Ian @ un4seen

  • Administrator
  • Posts: 21017
Jolly good :)