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

ken

  • Posts: 739
Re: BASS.NET API 2.4.2.0
« Reply #550 on: 18 Nov '08 - 21:34 »
Bernd,

Do you have any ideas or code example on how I can "send" audio with BASS over TCP/IP in my network, with low latency (don't wanna use Shoutcast or WMA streaming) ?

/Ken

radio42

  • Posts: 4574
Re: BASS.NET API 2.4.2.0
« Reply #551 on: 19 Nov '08 - 11:44 »
No, sorry I don't have such.

ken

  • Posts: 739
Re: BASS.NET API 2.4.2.0
« Reply #552 on: 19 Nov '08 - 21:44 »
No, sorry I don't have such.

Bummer, I guess you hade answer for everything Bernd...  ;)

anomaly

  • Posts: 3
Re: BASS.NET API 2.4.2.0
« Reply #553 on: 19 Nov '08 - 22:06 »
HI ALL

I wonder WaveForm class supports a line drawing of an uncalibrated signal.

Thanks

radio42

  • Posts: 4574
Re: BASS.NET API 2.4.2.0
« Reply #554 on: 19 Nov '08 - 22:15 »
@anomaly:
Can you explain a little bit more of what you mean by "line drawing of an uncalibrated signal"?

@ken:
The theory is pretty simply. Create a socket on the sending side and send the data (byte[]) via TCP/IP. This either from within a DSPPROC or directly from a decoding channel.
On the receiver side do the same (but create a listener socket) and there you can create a PUSH stream via BASS_StreamCreate and call BASS_StreamPutData to put the byte[] received to the stream. That's it ;-)

anomaly

  • Posts: 3
Re: BASS.NET API 2.4.2.0
« Reply #555 on: 20 Nov '08 - 00:27 »
@anomaly:
Can you explain a little bit more of what you mean by "line drawing of an uncalibrated signal"?

Sorry for my English
... I'm curious, whether does the WaveForm class draw waves accurately in the same way as Sony Sound Forge(or some other audio editor) does?

radio42

  • Posts: 4574
Re: BASS.NET API 2.4.2.0
« Reply #556 on: 20 Nov '08 - 08:23 »
Being honest, I have no clue how they (the others) draw the wave form ;-)
But as far as I can tell (as I coded the wave form) it is as accurate as possible.

However, I guess the audio signal is always 'calibrated' - as you have fixed and defined scales and values, e.g. using floating point channels: 0=-indev.dB, 1=0dB etc.
So the respective sample data values are defined and such calibrated (if I get your term right).

The wave form implementation shows all values in the range between silent (-indevdB) and max (0dB).

ken

  • Posts: 739
Re: BASS.NET API 2.4.2.0
« Reply #557 on: 20 Nov '08 - 09:28 »
@ken:
The theory is pretty simply. Create a socket on the sending side and send the data (byte[]) via TCP/IP. This either from within a DSPPROC or directly from a decoding channel.
On the receiver side do the same (but create a listener socket) and there you can create a PUSH stream via BASS_StreamCreate and call BASS_StreamPutData to put the byte[] received to the stream. That's it ;-)

Yes, that I get, but handeling lost data ands so on... I did find a library for audio over IP, and what I understand built on BASS. Unfortently is a ActiveX component. http://lakeofsoft.com/vcx/index.html

anomaly

  • Posts: 3
Re: BASS.NET API 2.4.2.0
« Reply #558 on: 22 Nov '08 - 12:37 »
Using Sony Sound Forge software 8.0 ...


Using BASS.NET API 2.4.2.0 ...


Here's my code:
Code: [Select]
public void GetWaveForm(string path)
        {
            TAG_INFO tag = BassTags.BASS_TAG_GetFromFile(path);
           
            // render a wave form
            WF = new WaveForm(path, MyWaveFormCallback, this);
            WF.CallbackFrequency = 500;
            WF.ColorBackground = Color.Black;
            WF.FrameResolution = (float)(tag.duration/Width/1000*50);
            switch(tag.channelinfo.chans)
            {
                case 1:
                    WF.DrawWaveForm = WaveForm.WAVEFORMDRAWTYPE.Mono;
                    break;
                case 2:
                    WF.DrawWaveForm = WaveForm.WAVEFORMDRAWTYPE.Stereo;
                    break;
            }
           
            WF.DrawEnvelope = false;           
            WF.RenderStart(true, BASSFlag.BASS_SAMPLE_MONO);
        }

        private void MyWaveFormCallback(int framesDone, int framesTotal, TimeSpan elapsedTime, bool finished)
        {
            DrawWave();
            if (finished)
            {
                //MessageBox.Show(elapsedTime.ToString());
            }
        }

        private void DrawWave()
        {
            if (WF != null)
                this.BackgroundImage = WF.CreateBitmap(this.Width, this.Height, -1, -1, false);
            else
                this.BackgroundImage = null;
        }

What do I do wrong?  ???

Sorry for my stupid questions.

radio42

  • Posts: 4574
Re: BASS.NET API 2.4.2.0
« Reply #559 on: 22 Nov '08 - 17:21 »
The BASS.NET waveform shown in your picture seems to be a 'Mono' one.
Mono is calculated internally by: (left+right)/2
So I don't know how Sound Forge calculates the image?
I aslo don't know, if your source file is a stereo or a mono stream?
So have you compared the Sound Forge one with the BASS.NET drawing type "Stereo" resp. "Dual Mono", as it seams, that Sound Forge draws left and right overlayed, which is more like "Dual Mono"?!

radio42

  • Posts: 4574
Re: BASS.NET API 2.4.3.0
« Reply #560 on: 19 Dec '08 - 15:54 »
19.12.2008: Version 2.4.3.0 is out.

BASS: updated to support v2.4.2.3
BASSmix: added support for v2.4.1.0
BASS_FX: updated to support v2.4.3.0
BASS_VST: added support for v2.4.0.6
BassVideo: updated to support v2.4.1.3
General:
  - BASS.NET now checks the BASS version being used
  - Misc.EncoderWAV: now supports RIFF LIST INFO tag writing
  - Tags.TAG_INFO: ConvertToRiffINFO and ConvertToRiffBEXT methods added
  - Tags.TAG_INFO: replaygain_track_gain and replaygain_track_peak members added
  - Utils.FixTimespan: new format SMPTE format strings added
  - Utils.GetNormalizationGain: now also returns the peak level
  - WaveForm.GetNormalizationGain: now also returns the peak level

NOTE: The new version already incorporates some new features of the forthcomming BASS_FX version (which isn't out yet - so lookout for the BASS_FX 2.4.3.0 version to come).

alcy

  • Posts: 4
Re: BASS.NET API 2.4.3.0
« Reply #561 on: 25 Dec '08 - 02:51 »
Problem in 2.4.3.0.
Bass.LoadMe(@"C:\test\bass"); throws TypeInitializationException.

Put bass.dll to application directory, it succeeds.
But same problem happen by loading addon(BassFx.LoadMe, etc...)


radio42

  • Posts: 4574
Re: BASS.NET API 2.4.3.0
« Reply #562 on: 28 Dec '08 - 12:10 »
I see the issue. A bug fix will be available tomorrow.


radio42

  • Posts: 4574
Re: BASS.NET API 2.4.3.1
« Reply #563 on: 29 Dec '08 - 08:39 »
29.12.2008: Version 2.4.3.1 is out.

Small Bug-Fix: An exception was raised with the 'LoadMe' methods

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

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

ken

  • Posts: 739
Re: BASS.NET API 2.4.3.1
« Reply #564 on: 29 Dec '08 - 17:09 »
I upgraded an WMA streamer project to 2.4, and now "broadCast.Notification" don't work.

Code: [Select]
_broadCast.Notification += new BroadCastEventHandler(_broadCast_Notification);

I get no new values (just zero's), and if I pull the data from via a timer I get the time but not "TotalBytesSend".

Code: [Select]
lblStatus.Text = String.Format("Audio Link Online, uptime: {0}D {1:00}:{2:00}:{3:00}, bytes send: {4:N00} KB",
                    _broadCast.TotalConnectionTime.Days, _broadCast.TotalConnectionTime.Hours, _broadCast.TotalConnectionTime.Minutes, _broadCast.TotalConnectionTime.Seconds,
                    _broadCast.TotalBytesSend / 1024);



All worked in Bass.Net 2.3.0.5 (bass 2.3.0.1, enc 2.3.0.1, basswma 2.3.0.1)

Same problem with the "streaming" example, any ideas.

/Ken

radio42

  • Posts: 4574
Re: BASS.NET API 2.4.3.1
« Reply #565 on: 30 Dec '08 - 11:16 »
Yes, the "broadcast.TotalBytesSend" property isn't supported for the "WMAcast" server.
It was removed in 2.4 for the WMAcast server.
The reason is, that in 2.4 a "UseBASS" property was introduced which changed the internal internal implementations and such the "TotalBytesSend" property is no longer supported fopr the WMAcast.
But I'll see, if I can (re)enable it...
« Last Edit: 30 Dec '08 - 12:08 by radio42 »

ken

  • Posts: 739
Re: BASS.NET API 2.4.3.1
« Reply #566 on: 30 Dec '08 - 14:34 »
But I'll see, if I can (re)enable it...

Aha, ok see if you can "fix" it.

Another thing. I send messages via "TitleUpdate" on the WMA stream, if works but sometimes I get very strange characters not the text I was sending.

Here is how I "recive" the title update:
Code: [Select]

//Set MetaSync
 mySync = new SYNCPROC(MetaSync);
 Bass.BASS_ChannelSetSync(_Stream, BASSSync.BASS_SYNC_WMA_META, 0, mySync, IntPtr.Zero);


//MetaSync function
        private void MetaSync(int handle, int channel, int data, IntPtr user)
        {
            if (_tagInfo.UpdateFromMETA(Bass.BASS_ChannelGetTags(channel, BASSTag.BASS_TAG_WMA_META), false))
            {

                foreach (string child in _tagInfo.NativeTags)
                {
                    if (child.StartsWith("Title="))
                    {
                        string _syncMsg = child.Replace("Title=", "");

                        this.Invoke(new UpdateStatusDelegate(UpdateStatusDisplay), new object[] { _syncMsg });
                        break;
                    }
                }

            } 
        }


And update tile is simply:
Code: [Select]

_broadCast.UpdateTitle("My message", "");


radio42

  • Posts: 4574
Re: BASS.NET API 2.4.3.1
« Reply #567 on: 30 Dec '08 - 16:33 »
Here is an update to try, which should now return the "TotalBytesSend" also for a WMAcast server.
  www.un4seen.com/filez/4/Bass24.Net_pre.zip

Regarding the title update:
I would have no clue what would cause that, since it internally simply calls the following:
_wmaEncoder.SetTag("Title", song);
_wmaEncoder.SetTag("CAPTION", song);
Both with the UNICODE flag. So there must be something else going wrong outside the BASS.NET side.

ken

  • Posts: 739
Re: BASS.NET API 2.4.3.1
« Reply #568 on: 30 Dec '08 - 17:04 »
Here is an update to try, which should now return the "TotalBytesSend" also for a WMAcast server.
  www.un4seen.com/filez/4/Bass24.Net_pre.zip

Regarding the title update:
I would have no clue what would cause that, since it internally simply calls the following:
_wmaEncoder.SetTag("Title", song);
_wmaEncoder.SetTag("CAPTION", song);
Both with the UNICODE flag. So there must be something else going wrong outside the BASS.NET side.

Thanks Bernd! "TotalBytesSend" works, but the "_broadCast_Notification" event don't update, I have to pull the data by a timer to get the data.

Regarding:

_wmaEncoder.SetTag("Title", song);
_wmaEncoder.SetTag("CAPTION", song);

Is the two ways or do you call both with same data?

/Ken

radio42

  • Posts: 4574
Re: BASS.NET API 2.4.3.1
« Reply #569 on: 30 Dec '08 - 17:31 »
Yes, as stated in the docs, the "DataSend" "Notification" event is not supported, if you set the servers "UseBASS" property to TRUE (which is the default in 2.4).
So it is correct, that when using a server with the UseBASS property set to TRUE, you must pull the "TotalByteSend" in your own timer routine.

big_gun

  • Posts: 352
Re: BASS.NET API 2.4.3.1
« Reply #570 on: 13 Jan '09 - 23:21 »
Spelling error in code/documentation.

Un4seen.Bass.Utils.DecodeAllData() the remarks end with "flag, since otherwise the mixer channel would never and." when it should be "flag, since otherwise the mixer channel would never end." (END instead of AND)

Rick

riesm

  • Posts: 51
Re: BASS.NET API 2.4.3.1
« Reply #571 on: 1 Feb '09 - 18:51 »
Hi radio42,

Is the latest Bass.NET compatible with the latest BASSVideo (the plugin version that is)? Or do you have something beta cooking up yet? Thx. in advance.

riesm

radio42

  • Posts: 4574
Re: BASS.NET API 2.4.3.1
« Reply #572 on: 1 Feb '09 - 21:21 »
The last BASS.NET version was made for BASSvideo 2.4.1.3 beta 3.
But I am not sure, if there are already new stuff in it - as Kenshine seems to not change his version number when adding new things - so it is kind of hard too keep up with his changes.
So if it is not working and let me know and I'll try to fix it.

riesm

  • Posts: 51
Re: BASS.NET API 2.4.3.1
« Reply #573 on: 2 Feb '09 - 14:30 »
In the .NET demo of bassvideo.dll I get the following error message:

Code: [Select]
Unable to find an entry point named 'BassVideo_StreamCreateFile' in DLL 'BassVideo.dll'.
This happens in this procedure:

Code: [Select]
    Public Sub LoadFile()
        Me.Stream = BassVideo.BASS_Video_StreamCreateFile(Filename, BASSVIDEOFlag.BASSVIDEO_AUTO_MOVE Or BASSVIDEOFlag.BASSVIDEO_AUTO_PAINT Or BASSVIDEOFlag.BASSVIDEO_AUTO_RESIZE, BASSFlag.BASS_DEFAULT, VidProc, Me.Handle)
        If Stream = 0 Then
            BassLib.BassLibrary.ThrowBassError()
            Exit Sub
        End If
        BassVideo.BASS_Video_AddVideo(Stream, pVideo2.Handle, pVideo2.ClientRectangle, BASSVIDEOFlag.BASSVIDEO_AUTO_MOVE Or BASSVIDEOFlag.BASSVIDEO_AUTO_PAINT Or BASSVIDEOFlag.BASSVIDEO_AUTO_RESIZE)

    End Sub

I am using the following DLLs:
BASS.DLL - version 2.4.1.1
BASS.NET.DLL - version 2.4.3.1
BASSVIDEO.DLL - version 2.4.1.3 (latest download from kenshin)

radio42, would you please be so kind to check my code and see if it is something I am doing wrong or if it may be something else. Thx. in advance.

NOTE: Attached the .NET demo project for bassvideo.dll

radio42

  • Posts: 4574
Re: BASS.NET API 2.4.3.1
« Reply #574 on: 2 Feb '09 - 15:19 »
Hmm, seems, that the 'latest' BassVideo API has completly changed!
So that will take me at least a couple of days in order to adopt that for BASS.NET - as there is no history log or anything provided...meaning I need to scan and check every little function again ;-(
Sorry for that, but I hope to finish that til next week...