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

stevenmmm

  • Posts: 114
Re: BASS.NET API 2.4.5.0
« Reply #650 on: 22 Aug '09 - 11:27 »
radio42, its not always documented whats changed with some of the addons eg. i cant find anything that says what has changed with BASS_ALAC.
So would it be possible to include a brief statement in the release notes about what support has been added?
And secondly, its quite difficult in my case to update and distribute the latest bass.net, so am i right in thinking i can replace with addons without having to upgrade to the latest bass.net eg. just distribute the latest bass_alac.dll using an older bass.net (I appreciate i wouldnt be easily able to utilise new flags etc)

radio42

  • Posts: 4576
Re: BASS.NET API 2.4.5.0
« Reply #651 on: 23 Aug '09 - 22:09 »
Yes, that is correct.
Very often the version numbers of the add-ons change due to bug fixes without any real API changes.
So in such case you can savely replace the add-on without changing the BASS.NET API.
With respect to the version history.
The add-ons should keep their own API chages documented in their own version history - as more info is also not available on my side.
Unluckily this sometimes is not perfect and so the BASS.NET doc can not be better than the original ;-)

stevenmmm

  • Posts: 114
Re: BASS.NET API 2.4.5.0
« Reply #652 on: 24 Aug '09 - 10:27 »
thanks for the information. I guess what i find confusing is the bass.net release notes saying its adding support for new version x of an addon which to me makes it sound like something has been changed on the bass.net side. I agree that ideally the addons would have their own release notes

radio42

  • Posts: 4576
Re: BASS.NET API 2.4.5.1
« Reply #653 on: 25 Aug '09 - 15:33 »
25.08.2009: Version 2.4.5.1 is out!

BASSMIDI: added support for v2.4.4.0


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

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

riesm

  • Posts: 51
Re: BASS.NET API 2.4.5.1
« Reply #654 on: 31 Aug '09 - 13:55 »
Hi Bernd,

I have just compiled my program using your latest BASS.NET version and found that tag reading seems to be broken. I have used something like this in my program and it always worked for both .MP3 and .WMA files. Now it seems to only work for .MP3 files. See the code:
Code: [Select]
        If Bass.BASS_Init(-1, 44100, BASSInit.BASS_DEVICE_DEFAULT, Me.Handle, Nothing) = False Then
            MessageBox.Show("BASS INIT ERROR")
            End
        End If
        Bass.BASS_PluginLoadDirectory(My.Application.Info.DirectoryPath)


        'Get Tags here
        Dim channel As Integer
        Dim mTags As Un4seen.Bass.AddOn.Tags.TAG_INFO

        channel = Bass.BASS_StreamCreateFile(sFile, 0, 0, BASSFlag.BASS_DEFAULT)
        mTags = New Un4seen.Bass.AddOn.Tags.TAG_INFO(sFile)

        txtTags.Text = "Tags: " & ControlChars.CrLf
        txtTags.Text &= vbCrLf & "Artist       = " & mTags.artist
        txtTags.Text &= vbCrLf & "Title        = " & mTags.title
        txtTags.Text &= vbCrLf & "Track        = " & mTags.track
        txtTags.Text &= vbCrLf & "Album        = " & mTags.album
        txtTags.Text &= vbCrLf & "Album Artist = " & mTags.albumartist
        txtTags.Text &= vbCrLf & "Duration     = " & mTags.duration
        txtTags.Text &= vbCrLf & "Year         = " & mTags.year
        txtTags.Text &= vbCrLf & "BPM          = " & mTags.bpm
        txtTags.Text &= vbCrLf & "Mood         = " & mTags.mood
        txtTags.Text &= vbCrLf & "Rating       = " & mTags.rating
        txtTags.Text &= vbCrLf & "Tagtype      = " & mTags.tagType


        'Release Stream
        Bass.BASS_StreamFree(channel)
        Bass.BASS_Free()

If I run this code on a MP3 file it seems to work, however when run on a WMA file, only the Title and Duraction tag return something. The Title tag seems to be the filename without the extension. WMA files also give a TagType of -1.

This code worked in previous versions of your DLL. Is there something you can do or do I need to rewrite this?

One last question. The 'Rating' tag does not seem to work at all? I have used both a rating in Windows 7 and MP3TAG and BASS.NET does not seem to pick the rating up. Anything I oversee here?

Thanks in advance for looking into this.

Cheers,
riesm

riesm

  • Posts: 51
Re: BASS.NET API 2.4.5.1
« Reply #655 on: 31 Aug '09 - 15:20 »
Hello Bernd,

Just looked over my code again and I found the culprit. I used the BASS_PluginLoadDirectory method and I noticed that it read BASSVideo.DLL before BASSWMA.DLL. Removing the BASSVideo.DLL did the trick. So I probably need to manually load the plugins in the right order to solve this problem. Sorry for taking your time (if you already did that is).

Cheers,
riesm

radio42

  • Posts: 4576
Re: BASS.NET API 2.4.5.1
« Reply #656 on: 31 Aug '09 - 16:07 »
;-)
No problem - I was just testing it and couldn't find any issues.

Note, that it seems, that the current BASS_Video add-on doesn't look pretty much stable and hasn't been updated for quite a while - so I am not even sure, if you should use it at all?

riesm

  • Posts: 51
Re: BASS.NET API 2.4.5.1
« Reply #657 on: 31 Aug '09 - 16:52 »
BassVideo is the only way I know of, to use video in my application. But yes, you are absolutely right in the fact that it is awfully unstable.

One more question though, I mentioned the Rating tag in my previous post, but still none of my MP3 files show any rating whatsoever. Something I do wrong?

Thx,
riesm

mrRdo

  • Posts: 15
Re: BASS.NET API 2.4.5.1
« Reply #658 on: 2 Sep '09 - 21:22 »
Hello,

I've been testing reading cart chunk data from a WAV file.  I know that the data chunk exists within the file however the following code doesn't work.

The error returned is 'BASS_ERROR_NOTAVAIL', however I know the cart chunk exists within the audio file.

I'm using bass.net v2.4.5.0, and bass.dll v2.4.3.1

I've just adapted the code contained within the help file.

Code: [Select]
Dim stream As Integer = Bass.BASS_StreamCreateFile(sFilename, 0, 0, BASSFlag.BASS_STREAM_DECODE)

If Not stream = 0 Then

     Dim p As IntPtr = Bass.BASS_ChannelGetTags(stream, BASSTag.BASS_TAG_RIFF_CART)

     If p = IntPtr.Zero Then
           If Bass.BASS_ErrorGetCode = BASSError.BASS_ERROR_HANDLE Then
                 ReportError("Handle Error") 'this writes an error log to a file
           ElseIf Bass.BASS_ErrorGetCode = BASSError.BASS_ERROR_NOTAVAIL Then
                 ReportError("Tag not found")
           End If
     End If

     If Not p = IntPtr.Zero Then
         Dim cart As BASS_TAG_CART = DirectCast(Marshal.PtrToStructure(p, GetType(BASS_TAG_CART)), BASS_TAG_CART)


         sArtist = cart.Artist
         sTitle = cart.Title
     End If

End If

radio42

  • Posts: 4576
Re: BASS.NET API 2.4.5.1
« Reply #659 on: 2 Sep '09 - 22:20 »
Can you provide the wav file in question, where the cart chunk reading is not working.
I have actually tested it here with various WAV files which contains a cart chunk and it works well here.
So maybe there is something 'wrong'/'special' with your wav file?


mrRdo

  • Posts: 15
Re: BASS.NET API 2.4.5.1
« Reply #660 on: 2 Sep '09 - 22:29 »
Sure, I will load it to my FTP server and PM you the download link.

I am absolutely sure the wav file has the correct chunk... the code doesn't work with the demonstration file which you can download from the cart chunk website either.

radio42

  • Posts: 4576
Re: BASS.NET API 2.4.5.1
« Reply #661 on: 3 Sep '09 - 16:52 »
I just tried it out here and it reads the cart chuck just fine.

So may be you are not using the latest versions?
Make sure to use:
a) the latest BASS.NET version 2.4.5.1
b) the latest BASS version: 2.4.3.1

Here is the code I am using (C#):
Code: [Select]
IntPtr cart = Bass.BASS_ChannelGetTags(stream, BASSTag.BASS_TAG_RIFF_CART);
if (cart != IntPtr.Zero)
    BASS_TAG_CART cart = (BASS_TAG_CART)Marshal.PtrToStructure(p, typeof(BASS_TAG_CART));

In addition you might also try to use the build-in tag reading via:
"Un4seen.Bass.AddOn.Tags.BASS_TAG_GetFromFile"

mrRdo

  • Posts: 15
Re: BASS.NET API 2.4.5.1
« Reply #662 on: 4 Sep '09 - 12:06 »
I can confirm that I'm using the most up-to-date bass.dll and bass.net.dll files.

Does the following code look ok to you?

Code: [Select]
private bool ReadCartChunk(string sFilename)

    int stream = Bass.BASS_StreamCreateFile(sFilename, 0, 0, BASSFlag.BASS_DEFAULT);
    if (!(stream == 0)) {
        UpdateList2("Checking for cartchunk");
       
        IntPtr p = Bass.BASS_ChannelGetTags(stream, BASSTag.BASS_TAG_RIFF_CART);
       
        if (p == IntPtr.Zero) {
            return false;
            if (Bass.BASS_ErrorGetCode == BASSError.BASS_ERROR_HANDLE) {
                UpdateList2("Handle Error");
            }
            else if (Bass.BASS_ErrorGetCode == BASSError.BASS_ERROR_NOTAVAIL) {
                UpdateList2("Cartchunk tag not found");
            }
        }
       
        if (!(p == IntPtr.Zero)) {
            return true;
            BASS_TAG_CART cart = (BASS_TAG_CART)Marshal.PtrToStructure(p, typeof(BASS_TAG_CART));
           
            sArtist = cart.Artist;
               
            sTitle = cart.Title;
        }
    }
    else {
        return false;
       
    }
}

radio42

  • Posts: 4576
Re: BASS.NET API 2.4.5.1
« Reply #663 on: 4 Sep '09 - 13:40 »
Yes and No - since I don't know what you want to do.
But there are a few lines of code which will never be called! (since you first call "return false/true").
So sArtist, sTitle would never be set...

mrRdo

  • Posts: 15
Re: BASS.NET API 2.4.5.1
« Reply #664 on: 4 Sep '09 - 14:27 »
Agreed, however

Code: [Select]
        IntPtr p = Bass.BASS_ChannelGetTags(stream, BASSTag.BASS_TAG_RIFF_CART);
       
        if (p == IntPtr.Zero) {
            return false;
            if (Bass.BASS_ErrorGetCode == BASSError.BASS_ERROR_HANDLE) {
                UpdateList2("Handle Error");
            }
            else if (Bass.BASS_ErrorGetCode == BASSError.BASS_ERROR_NOTAVAIL) {
                UpdateList2("Cartchunk tag not found");
            }
        }

always returns the error "BASS_ERROR_NOTAVAIL"

radio42

  • Posts: 4576
Re: BASS.NET API 2.4.5.1
« Reply #665 on: 7 Sep '09 - 17:51 »
Also in this code section: you first call "return false"!
So all the other code will not be evaluated - so may be your error comes from some other lines of code?!

As said, I tested the cart chunk reading here with various wav files (which all contained a cart chunk):
- your provided file
- the official test files from the EBU
- with some external files
- with self-created wav files
All files have been read correctly.

So I still must assume, that there is some other code error somewhere in your app.

So please write a very small test app, which does nothing else than reading the cart chunk and see what results you get.
You might also try the provided C# sample called "Simple" and try to reproduce the issue with this one...actually I was so far not able.

iblsysteme

  • Posts: 6
Hello,
I need help with the image tag
To retrieve the image that is in the media to be displayed in a PictureBox

this in VB.Net

Thank you in advance

Ps: I searched all the forum in May I found nothing

radio42

  • Posts: 4576
Re: BASS.NET API 2.4.5.1
« Reply #667 on: 8 Sep '09 - 08:05 »
With BASS.NET you can use the "BassTags.BASS_TAG_GetFromFile Method" to retrieve a TAG_INFO structure.
An example in vb.net is given in the help document of BASS.NET.

Once you got an instance of TAG_INFO, you can call the following properties/methods to retrieve any picture tags:
a) Call "TAG_INFO.PictureCount" to retrieve the total number of picture tags available
b) Call either "TAG_INFO.PictureGet(i)" or "TAG_INFO.PictureGetImage(i)" to retrieve the picture tag at index i.

Code: [Select]
Dim tagInfo As TAG_INFO = BassTags.BASS_TAG_GetFromFile(fileName)
If Not (tagInfo Is Nothing) Then
  If (tagInfo.PictureCount > 0)
    Dim image As Image = tagInfo.PictureGetImage(0)
    ...
  End If
End If

iblsysteme

  • Posts: 6
Re: BASS.NET API 2.4.5.1
« Reply #668 on: 8 Sep '09 - 08:56 »
   
Thank you for the code
because I had lost

Thank you again

iblsysteme

  • Posts: 6
Re: BASS.NET API 2.4.5.1
« Reply #669 on: 8 Sep '09 - 11:28 »
   
Re Hello,
My mp3 files sound with their own images Album
but I can still affichers in a PictureBox named defaultCover
but I placed the code you provided in my party update tags

    Friend Sub UpdatePlaylist(ByVal laPlaylist As ListView, ByVal maxVisible As Integer, ByVal topMost As Integer)
        Dim tags(6) As String
        Dim piste As Integer
        Dim i As Integer
        Dim j As Integer = topMost + maxVisible

        Try
            For i = topMost To j
                If laPlaylist.Items(i).SubItems(5).Text = "0" Then
                    Try
                        GetTag(laPlaylist.Items(i).SubItems(5).Text, tags) ' essaie de charger le tag du fichier
                    Catch ex As Exception
                        tags(0) = ""
                        tags(1) = "Pas d'info"
                        tags(2) = "Pas d'info"
                        tags(3) = "Pas d'info"
                        tags(4) = "Pas d'info"
                        tags(5) = laPlaylist.Items(i).SubItems(5).Text

                    End Try

                    If Not IsNumeric(tags(0)) Then
                        piste = 0
                    Else
                        piste = System.Convert.ToInt32(tags(0)) 'numero de piste
                    End If
                    If piste < 10 Then
                        tags(0) = piste.ToString()
                    Else
                        tags(0) = piste.ToString()
                    End If

                    'Tente de charger les données IDv3 dans la playlist
                    laPlaylist.Items(i).SubItems(0).Text = tags(0) 'piste
                    laPlaylist.Items(i).SubItems(1).Text = tags(1) 'Album
                    laPlaylist.Items(i).SubItems(2).Text = tags(2) 'Artiste
                    laPlaylist.Items(i).SubItems(3).Text = tags(3) 'Durée
                    laPlaylist.Items(i).SubItems(5).Text = tags(4) 'Source
                    laPlaylist.Items(i).SubItems(6).Text = "1"

                    Dim tagInfo As AddOn.Tags.TAG_INFO = BassTags.BASS_TAG_GetFromFile(tags(4))
                    If Not (Tag Is Nothing) Then
                        If (Tag.PictureCount > 0) Then
                            Dim img As Image = Tag.PictureGetImage(0)
                            defaultCover.Image = img
                            defaultCover.Update()
                            defaultCover.Refresh()
                        End If
                    End If

                End If
                Try

                Catch ex As Exception

                End Try
            Next
        Catch

        End Try
        tags = Nothing
        piste = Nothing
        i = Nothing
    End Sub

radio42

  • Posts: 4576
Re: BASS.NET API 2.4.5.1
« Reply #670 on: 8 Sep '09 - 13:28 »
In your code you are NOT using the 'tagInfo' instance, but a variable called 'Tag'.
I don't know what this varibal is...but it is definitly not the 'tagInfo' instance - as in my code example.
So please correct this and try it again...

iblsysteme

  • Posts: 6
Re: BASS.NET API 2.4.5.1
« Reply #671 on: 8 Sep '09 - 14:47 »
I already do anything but make

radio42

  • Posts: 4576
Re: BASS.NET API 2.4.5.1
« Reply #672 on: 8 Sep '09 - 14:53 »
??

kamuri

  • Guest
Re: BASS.NET API 2.4.5.1
« Reply #673 on: 8 Sep '09 - 17:10 »
In the version BASS.NET API 2.4.5.1, I can't find function BassVideo_Init(). Because of that, you can't load any video stream... ::)

radio42

  • Posts: 4576
Re: BASS.NET API 2.4.5.1
« Reply #674 on: 8 Sep '09 - 17:25 »
The BASS_Video add-on is currently kind of on-hold - as the developer hasn't provided any new versions for a while.
So I guess it is not a good idea to use it.

However, if you still want to try it: BASS.NET supports the latest plugin version of BASS_Video which is BassVideo v2.4.1.3.
And as this version is the add-on version, it doesn't have any "BassVideo_Init" method anymore, as it was removed from BassVideo v2.4.1.3.