Author Topic: BASS.NET API 2.4.12.7  (Read 783577 times)

radio42

  • Posts: 4576
Re: BASS.NET API 2.4.6.7
« Reply #825 on: 16 Sep '10 - 12:24 »
@vasaka:
yes, this is really strange!!!
I was able to reproduce it by even using the same code as in the netradio example.

Even more funny is, that the following will actually work:
Code: [Select]
Bass.BASS_Init(-1, 44100, BASSInit.BASS_DEVICE_DEFAULT, this.Handle);
Bass.BASS_PluginLoad("basswma.dll");
Bass.BASS_SetConfig(BASSConfig.BASS_CONFIG_NET_PLAYLIST, 1);
Bass.BASS_SetConfig(BASSConfig.BASS_CONFIG_NET_PREBUF, 0);

int chan = Bass.BASS_StreamCreateURL(@"http://78.46.54.158:1146", 0, BASSFlag.BASS_STREAM_BLOCK | BASSFlag.BASS_STREAM_AUTOFREE, null, IntPtr.Zero);
if (chan == 0)
    chan = BassWma.BASS_WMA_StreamCreateFile(@"http://78.46.54.158:1146", 0L, 0L, BASSFlag.BASS_STREAM_BLOCK | BASSFlag.BASS_STREAM_AUTOFREE);

if (chan != 0)
    Bass.BASS_ChannelPlay(chan, false);
Meaning in the above code sample the first "BASS_StreamCreateURL" will return 0 - but the second "BASS_WMA_StreamCreateFile" succeed!
Even thought the BASS_PluginLoad call was successfull!

Funny to see, that in the native basswma example a single "BASS_StreamCreateURL" seems to work - I would have no idea why?

The only difference I see between the native netradio sample, is that Bass.Net uses the UNICODE flag with BASS_StreamCreateURL.

And YES - this is it!
I just internally removed the UNICODE flag and see...now even the first "BASS_StreamCreateURL" succeeds!

So I guess this one is an issue for Ian...

Ian @ un4seen

  • Administrator
  • Posts: 20437
Re: BASS.NET API 2.4.6.7
« Reply #826 on: 16 Sep '10 - 13:58 »
BASSWMA does indeed need updating for the BASS_UNICODE flag support that was added to BASS_StreamCreateURL in BASS 2.4.6. Here is an update to try...

   www.un4seen.com/stuff/basswma.dll

Let me know if you still have any trouble with it.

radio42

  • Posts: 4576
Re: BASS.NET API 2.4.6.7
« Reply #827 on: 16 Sep '10 - 14:19 »
Yepp - that did the trick!

radio42

  • Posts: 4576
Re: BASS.NET API 2.4.6.8
« Reply #828 on: 17 Sep '10 - 17:06 »
17.09.2010: Version 2.4.6.8 is out!

BASSWMA: added support for v2.4.4.0
General:
  - WaveForm: ColorMiddleLeft, ColorMiddleRight properties added
  - WaveForm: PixelFormat property added

Full Install:
  www.un4seen.com/filez/4/Bass24.Net.zip

Lib only:
  www.un4seen.com/filez/4/Bass24.Net_update.zip


as

  • Guest
Re: BASS.NET API 2.4.6.8
« Reply #829 on: 21 Sep '10 - 09:12 »
i can not find bassasio.dll

Chris

  • Posts: 1810
Re: BASS.NET API 2.4.6.8
« Reply #830 on: 21 Sep '10 - 10:15 »

vasaka

  • Posts: 5
Re: BASS.NET API 2.4.6.8
« Reply #831 on: 22 Sep '10 - 20:28 »
Thank you for helping me, I wasn't able to reply earlier.
Quote
www.un4seen.com/stuff/basswma.dll
This link is broken. Can you upload it again, please?

Markus

  • Guest
Re: BASS.NET API 2.4.6.8
« Reply #832 on: 27 Sep '10 - 08:52 »
Morning!

I have two players. Each player run in its own thread. (so it has its own stream)
When both players are running and I will exit my program, I can only stop (BASS_ChannelStop(stream)) and free (BASS_StreamFree(stream)) the first player.
When I try to stop the second player the applications hangs.

I init the devices in my main form (i have to do this because of the handle???).

Any ideas ?


radio42

  • Posts: 4576
Re: BASS.NET API 2.4.6.8
« Reply #833 on: 27 Sep '10 - 09:06 »
No, but it look like maybe there is something wrong in your code.
Are you using Bass.Net?
What prog language?
Can you post your code of the two players:
- how you create the threads
- how you create the players
- how you stop them
- etc.

Markus

  • Guest
Re: BASS.NET API 2.4.6.8
« Reply #834 on: 27 Sep '10 - 09:38 »
I'm using BASS.NET.
with C# (Win) + Mono (Ubuntu)


Creating Threads:

Code: [Select]
Thread th = new Thread(new ThreadStart(Run));     
th.Start();


Run() Method is a Statemachine:
Code: [Select]
while (!_finished)
{
  switch(threadState){
   
      case PlayerState.Loading:
          DoLoad();
          break;
      case PlayerState.Waiting: // do nothing;
          break;
      case PlayerState.Playing:
          DoPlay();
          break;
      case PlayerState.Stopped:
          DoStop(false);
          break;
      case PlayerState.FadeIn:
          DoFadeIn();
          break;
      case PlayerState.FadeOut:
          DoFadeOut();
          break;
      case PlayerState.Initialized:
          DoInit();
          break;
      case PlayerState.Paused:
          DoPause();
          break;
      case PlayerState.Finished:
          DoFinished();
          break;
      case PlayerState.PositionChanged:
          DoPositionChanged();
          break;
      case PlayerState.VolumeChanged:
          DoVolumeChanged();
          break;
      case PlayerState.Reload:
          DoReload();
          break;
      default: throw new Exception("player state + " + threadState + " unknown!");
          break;
  }
  Thread.Sleep(150);



Starting threads in my main form:

Code: [Select]
piPlayer1.Start();
piPlayer2.Start();

Stop threads:

Code: [Select]
if (_stream != 0)
{
  Bass.BASS_ChannelIsActive(_stream);
  Console.WriteLine("BASS_ChannelIsActive: " + Bass.BASS_ErrorGetCode());

  Bass.BASS_ChannelStop(_stream);
  Console.WriteLine("Bass.BASS_ChannelStop: " + Bass.BASS_ErrorGetCode());

  Bass.BASS_StreamFree(_stream);
  Console.WriteLine("Bass.BASS_StreamFree: " + Bass.BASS_ErrorGetCode());
}


Create Stream:

Code: [Select]
BASSFlag flag = BASSFlag.BASS_SAMPLE_FLOAT | BASSFlag.BASS_STREAM_AUTOFREE;

switch (_speaker)
{
    case 1: flag = flag | BASSFlag.BASS_SPEAKER_FRONT;
        break;
    case 2: flag = flag | BASSFlag.BASS_SPEAKER_REAR;
        break;
    case 3: flag = flag | BASSFlag.BASS_SPEAKER_CENLFE;
        break;
    case 4: flag = flag | BASSFlag.BASS_SPEAKER_REAR2;
        break;
    default:
        break;
}

Bass.BASS_ChannelIsActive(_stream);
Console.WriteLine("Bass.BASS_ChannelIsActive: " + Bass.BASS_ErrorGetCode());

Bass.BASS_SetDevice(_device);
Console.WriteLine("Bass.BASS_SetDevice: " + Bass.BASS_ErrorGetCode());

Bass.BASS_StreamFree(_stream);
Console.WriteLine("Bass.BASS_StreamFree: " + Bass.BASS_ErrorGetCode());

this._stream = Bass.BASS_StreamCreateFile(_tempFile, 0, 0, flag);
Console.WriteLine("Bass.BASS_StreamCreateFile: " + Bass.BASS_ErrorGetCode());


Markus

  • Guest
Re: BASS.NET API 2.4.6.8
« Reply #835 on: 28 Sep '10 - 13:56 »
what about the thread handling...

is there a thread for every stream/player ?
is there only one thread for the bass lib?

radio42

  • Posts: 4576
Re: BASS.NET API 2.4.6.8
« Reply #836 on: 28 Sep '10 - 16:59 »
Is "_stream" a local member in each thread class?

Regarding the BASS threads you should better post that in a non-Bass.Net post - as this is not related to Bass.Net, but handled by native BASS.
But as far as I know dowsn't BASS create a thread for each stream.

So I guess Ian might have to look at it, as this might be a Linux specific issue?!

Markus

  • Guest
Re: BASS.NET API 2.4.6.8
« Reply #837 on: 28 Sep '10 - 17:09 »
yes. _stream is a local member in each thread class.

i've tested some things....

when i create the stream in my main gui, the player doesn't jerk when i do something in the gui (loading lists from db or such things).
when i create the stream in my player class (in the main gui i have objects of this class with methods like create, play, ...) the player jerks.


so what is the best thing?

- create threads in the main gui for each "player" (stream) ?
OR
- no threads for players - only the bass.net methods ?

thx

Renegade

  • Posts: 160
Re: BASS.NET API 2.4.6.8
« Reply #838 on: 7 Oct '10 - 08:13 »
I'm having some issues that I just can't solve.

VERSIONS:
Bass: 2.4.6.0
Bass.Net: 2.4.6.8
BassFX: 2.4.6.0

From the Bass.Net sample projects:

In here (from SimpleFX.cs):
_StreamFX = BassFx.BASS_FX_TempoCreate(_Stream, BASSFlag.BASS_FX_FREESOURCE | BASSFlag.BASS_SAMPLE_FLOAT | BASSFlag.BASS_SAMPLE_LOOP);

_Stream is fine, but _StreamFX is 0.

In here (from Simple.cs):
_stream = Bass.BASS_StreamCreateFile(_fileName, 0, 0, BASSFlag.BASS_SAMPLE_FLOAT | BASSFlag.BASS_STREAM_PRESCAN);
if (_stream != 0 && Bass.BASS_ChannelPlay(_stream, false) )

_stream is 0.

The error code returned is:
BASS_ERROR_UNKNOWN

In my own project, I get the same problems.

I've just updated things, and am using all the latest DLLs.

I'm stumped. Nothing has really changed. The sample projects even have the same problem, so it's not just me.

I must be missing something. Is there some kind of environmental factor that I need to take in to account?

« Last Edit: 7 Oct '10 - 08:19 by Renegade »

Renegade

  • Posts: 160
Re: BASS.NET API 2.4.6.8
« Reply #839 on: 7 Oct '10 - 08:16 »
I should mention that the SetFX project plays. (SetFX.cs)

So this here works:

// play the stream
if (_Stream != 0 && Bass.BASS_ChannelPlay(_Stream, false) )


Renegade

  • Posts: 160
Re: BASS.NET API 2.4.6.8
« Reply #840 on: 7 Oct '10 - 10:35 »
Grrr...

Please forget the two posts above, unless you know what's going on.

It works now. No significant changes. No config alterations. No different flags. It just works.

No idea what was going on there.

Baffled.

I rebooted 3x before I posted above. Now all of a sudden, it works. Stunned. I did nothing more than read documentation and play with some inconsequential code.

These are not the errors you are looking for. Move along. :)

Latch

  • Posts: 90
Re: BASS.NET API 2.4.6.8
« Reply #841 on: 14 Oct '10 - 21:34 »
Is it possible for you to create a secondary implementation when creating a new waveform?  Currently you need to refer to a file, and that's fine for audio files, but with BassDSHOW, it would be nice to get a waveform for videos as well.  Maybe refer to the audio stream as opposed to a file?  Just a thought.

Renegade

  • Posts: 160
Re: BASS.NET API 2.4.6.8
« Reply #842 on: 15 Oct '10 - 04:11 »
Is it possible for you to create a secondary implementation when creating a new waveform?  Currently you need to refer to a file, and that's fine for audio files, but with BassDSHOW, it would be nice to get a waveform for videos as well.  Maybe refer to the audio stream as opposed to a file?  Just a thought.

Good question. I've not tried this out yet.

radio42

  • Posts: 4576
Re: BASS.NET API 2.4.6.8
« Reply #843 on: 15 Oct '10 - 07:39 »
The "RenderStart" method of the WaveForm cloass also allows you to specify an already prepared decoding stream instead of a file.
So if BASS_DSHOW offers the creation of decoding streams you might use the WaveForm with it.

Latch

  • Posts: 90
Re: BASS.NET API 2.4.6.8
« Reply #844 on: 16 Oct '10 - 20:30 »
The "RenderStart" method of the WaveForm cloass also allows you to specify an already prepared decoding stream instead of a file.
So if BASS_DSHOW offers the creation of decoding streams you might use the WaveForm with it.

Unfortunately that doesn't work.  It also doesn't render a waveform for any audio now either.  I think the problem is in the fact that in the NEW method for creating the waveform, in order to have a callback proceedure for background wave generation, you have to specify the file name as well.  Here's my code and you can see the old "commented out" renderstart method I previously used.

#Region "WaveForm Subs"
    Private Sub ShowWaveForm()
        ' setup waveform
        SetupWaveForm()
        DrawWave()
    End Sub
    Private Sub DrawWave(Optional ByVal highQuality As Boolean = False)
        If Not wf Is Nothing Then
            Me.pbPosition.BackgroundImage = wf.CreateBitmap(Me.pbPosition.Width, Me.pbPosition.Height, -1, -1, highQuality)
            If wf.IsRenderingInProgress Then Exit Sub
        Else
            Me.pbPosition.BackgroundImage = Nothing
        End If
    End Sub
    Private Sub SetupWaveForm()
        wf = New WaveForm(frmMain.PlayerTemp.Path, New WAVEFORMPROC(AddressOf MyWaveFormCallback), Me)
        wf.FrameResolution = 0.01
        wf.DrawEnvelope = False
        wf.CallbackFrequency = 500 ' in milliseconds
        wf.ColorBackground = My.Settings.skinFormBackColor ' Color.Black
        wf.ColorLeft = My.Settings.skinWaveformForeColor ' Color.FromArgb(255, 0, 0, 85) ' Color.MidnightBlue
        wf.ColorRight = My.Settings.skinWaveformForeColor ' Color.FromArgb(255, 0, 0, 85) ' Color.MidnightBlue
        'wf.RenderStart(True, BASSFlag.BASS_SAMPLE_FLOAT Or BASSFlag.BASS_STREAM_PRESCAN)
        wf.RenderStart(frmMain.PlayerTemp.Stream, True)
    End Sub
    Private Sub MyWaveFormCallback(ByVal framesDone As Integer, ByVal framesTotal As Integer, ByVal elapsedTime As TimeSpan, ByVal finished As Boolean)
        ' will be called during rendering...
        DrawWave(False)
        If finished Then
            DrawWave(True)
        End If
    End Sub
#End Region

radio42

  • Posts: 4576
Re: BASS.NET API 2.4.6.8
« Reply #845 on: 17 Oct '10 - 12:24 »
That's strange here it just works fine (also with decoding stream not using any filename)!
But I am not using BASS_DSHOW!
So can you please omit any BASS_PluginLoad("bass_dshow.dll") to avoid loading/using BASS_DSHOW and try it again without BASS_DSHOW.
It seems that there might be a problem with loading BASS_DSHOW, as in another post someone also reported a strange when BASS_DHOW was loaded/used. So maybe this is the cause of the problem?

Latch

  • Posts: 90
Re: BASS.NET API 2.4.6.8
« Reply #846 on: 18 Oct '10 - 04:08 »
That's strange here it just works fine (also with decoding stream not using any filename)!
But I am not using BASS_DSHOW!
So can you please omit any BASS_PluginLoad("bass_dshow.dll") to avoid loading/using BASS_DSHOW and try it again without BASS_DSHOW.
It seems that there might be a problem with loading BASS_DSHOW, as in another post someone also reported a strange when BASS_DHOW was loaded/used. So maybe this is the cause of the problem?

Well then that's a problem because our app needs to play video and we are replacing the old BassVideo plugin with the new Bass_DSHOW.  Since Bass.Net no longer supports BassVideo, we either have to keep the old Bass and Bass.Net engine to use BassVideo which I'd rather not because that means we can never move forward with all the other improvements, or just get Bass_DSHOW to work, which would be much more preferrable.



radio42

  • Posts: 4576
Re: BASS.NET API 2.4.6.8
« Reply #847 on: 18 Oct '10 - 09:21 »
Yes, but is that  (BASS_DSHOW) the problem?
Can you confirm that?

However, I can not do much about this:
a) BassVideo can not be supported by Bass.Net any longer, because the developer doesn't want that
b) If BASS_DSHOW is the cause of the problem, I guess it needs to be fixed in BASS_DSHOW!

Latch

  • Posts: 90
Re: BASS.NET API 2.4.6.8
« Reply #848 on: 19 Oct '10 - 15:48 »
Yes, but is that  (BASS_DSHOW) the problem?
Can you confirm that?

However, I can not do much about this:
a) BassVideo can not be supported by Bass.Net any longer, because the developer doesn't want that
b) If BASS_DSHOW is the cause of the problem, I guess it needs to be fixed in BASS_DSHOW!

When Bass_DSHOW is loaded the old method of referring to the file still works, but obviously it doesn't work for videos.  That would stand to reason that Bass_DSHOW isn't affecting other files.  I've waited over a year to finally replace BassVideo with something better but it would seem that Bass_DSHOW has the same issues.  I wish they could just make it work like every other "file type" plugin where you can use all the built-in bass methods and the plugin simply acts like an interpreter.

Latch

  • Posts: 90
Re: BASS.NET API 2.4.6.8
« Reply #849 on: 26 Oct '10 - 23:11 »
I REALLY REALLY wish you would put back in support for BassVideo.  I realise the guy has stopped developing it, but you need to remember there are many of us who still need to use it until Bass_DSHOW is completely working (which may be a while).  It leaves me stuck using the 2.4.2 version of Bass.Net which also forces me to use older versions of Bass and its add-ons as well.  There is SO much I can't do.  I would like to also use the new BassWASAPI and can't.  I think I heard you mention that the developer of Bassvideo asked you to pull it, but seriously what would it hurt to have it in there?  You made the developer happy by removing it, but you've angered a lot more people in the process.  It's just one object off your AddOn class and doesn't bloat the assembly so why not make some of us happy and just add it back in?