BASS.NET API 2.4.18.2

Started by radio42,

radio42

#20
Hi Nick,

normally a "System.BadImageFormatException" is indicating that the file image of an executable program is invalid or the application is not a managed assembly.

So, there could be various reasons:
a) some files got corrupted (eg. during download or install)
a) the file image gets corrupted during runtime due to a memory failure
c) you are running a .Net 1.1 lib against a .Net 2.0 environment (the VS2005 beta had some bugs here!)
d) You've tried to load an assembly built against a newer version of the CLR than was running.

So I assume either c) or d) is your problem!

So make sure (when using the samples):
1. that the referenced BASS .NET API version is matching your CLR (eg. .Net 2.0)
    -> maybe due to your conversion you need to replace the BASS .NET API library reference
2. when starting an application (runtime) that really the .Net 2.0 CLR is loaded and not the old .Net 1.1

Here is nice article about it:
http://blogs.msdn.com/suzcook/

So I bet you have some mixed projects, e.g. referencing a BASS .NET API 1.0 lib in a VS2005 project...

radio42

BASS .NET API version 2.2.0.11:

What has changed added?
- we support all the latest Bass and Add-On versions!

And we added full native Tag support to the internal Un4seen.Bass.AddOn.Tags namespace.
This includes reading any pictures from the tags - which currently works for all ID3v2 and WMA tagged files.

So the TAG_INFO class now has the following new properties/methods:

/// <summary>
/// Returns the number of pictures which are available.
/// </summary>
/// <remarks>Pictures are only available for ID3v2 and WMA tags.</remarks>
int PictureCount

/// <summary>
/// Returns a picture image.
/// </summary>
/// <param name="i">The zero-based index (number) of the picture to get.</param>
/// <returns>The image of the picture on success or NULL if no picture is available (at that index).</returns>
Image PictureGetImage(int i)

/// <summary>
/// Returns the description of a picture.
/// </summary>
/// <param name="i">The zero-based index (number) of the picture to access.</param>
/// <returns>The description of the picture on success or NULL if no picture is available.</returns>
string PictureGetDescription(int i)

/// <summary>
/// Returns the type of the picture.
/// </summary>
/// <param name="i">The zero-based index (number) of the picture to access.</param>
/// <returns>The type of the picture on success or NULL if no picture is available (at that index).</returns>
string PictureGetType(int i)

/// <summary>
/// Returns all native text tags.
/// </summary>
/// <returns>A string array containing all native tags as being gathered.</returns>
string[] NativeTags

/// <summary>
/// Returns a certain native tag.
/// </summary>
/// <param name="tagname">The name of the native tag to retrieve (case-sensitive!) - e.g. use "TPE1" to query for the artist of ID3v2 tags.</param>
/// <returns>The value of the tag or NULL if tag with that name could be found.</returns>
/// <remarks>If multiple tags with the same name do exist, only the first tag value will be returned.</remarks>
string NativeTag(string tagname)

cablehead

Do you recommend uninstalling .10 first? Or just installing .11 over it?

veetid

Is it available for download anywhere yet?

thanks,
veetid

radio42

yes, it is already there - Ian just needs to change the web.

and Yes, you can installing over any other version without problems.

Guest

Please update for the new BassMix call "BASS_Mixer_StreamAddChannelEx"

radio42

radio42

01.03.2006: Version 2.2.0.12 is out!

- some documentation updates.
- supporting latest BASSmix beta (new BASS_Mixer_StreamAddChannelEx method)

Note: It is already up, Ian just needs to update the version number on the web...

ken

#28
NetRadio example "crash" (MetaSync) when a new metadata is sent from a shoutcast server, (song changes)  (ver 2.2.0.12)

try this broadcast: http://217.118.212.70:8500

radio42

I have just tested it...here it is not crashing ?
I listened to the stream for over 45 minutes and all went okay ?!

Where exactly is it crashing (line of code) ?

And are you using the propper BASS.dll v2.2.0.4 ?

radio42

05.03.2006: Version 2.2.0.13 is out!

- new overload for BASS_ChannelSetSync added to support BASS_SYNC_MESSAGE

ken

I think it's a threed issue, VS2005 is not so forgiving as VS2003 on that.

Line 461:  this.statusBar1.Text = Marshal.PtrToStringAnsi(new IntPtr( data ));

Cross-thread operation not valid: Control 'statusBar1' accessed from a thread other than the thread it was created on.

radio42

Arrg, that can be true - I have so far (and lazy) only tested the ugly samples on vs2003.

You are right!
Whenever BASS callbacks are involved I should have used "this.Invoke(...)" or "this.BeginInvoke(...)" together with a global delegate to call asynchroniously a method in the main UI thread.

So please exchange the last method called "MetaSync" with the the following code which will use delegate callbacks instead and should work fine.
I am going to improve the samples in the next version ;-) THX

private void MetaSync(int handle, int channel, int data, int user)
{
    // BASS_SYNC_META delivers a pointer to the metadata in data parameter...
    if (data != 0)
    {
        // NOTE: this will just deliver the first meta data string!
        // since the pointer given is typically a series of null-terminated strings!
        string txt = Marshal.PtrToStringAnsi(new IntPtr( data ));
        this.Invoke(new UpdateStatusDelegate(UpdateStatusDisplay), new object[] { txt });
    }
    // or alternatively use the TAG_INFO object
    if ( _tagInfo.UpdateFromMETA( data, false ) )
    {
        this.Invoke(new UpdateTagDelegate(UpdateTagDisplay));
    }
}

public delegate void UpdateTagDelegate();
private void UpdateTagDisplay()
{
    this.textBoxAlbum.Text = _tagInfo.album;
    this.textBoxArtist.Text = _tagInfo.artist;
    this.textBoxTitle.Text = _tagInfo.title;
    this.textBoxComment.Text = _tagInfo.comment;
    this.textBoxGenre.Text = _tagInfo.genre;
    this.textBoxYear.Text = _tagInfo.year;
}

public delegate void UpdateStatusDelegate(string txt);
private void UpdateStatusDisplay(string txt)
{
    this.statusBar1.Text = txt;
}

ken

There is a few tags that don't work. Like Lyrics and some additional tags

I use Tag&Rename 3 http://www.softpointer.com/tr.htm

radio42

Sure, as the documentation says:
- only the TEXTual tags are supported, plus Picture-Tags

So things like: Lyrics, synced Lyrics etc. are not supported and are not planned to be supported.

For exensive Tagging support I suggest using an extra lib, eg. www.audiogenie.de

big_gun

I have found a good ID3v2 tag component for .net, it's http://home.fuse.net/honnert/hundred/?UltraID3Lib

And it reads/writes tags too.

Rick

Gregory Pruden

Hi All,
I am new to everything so excuse my noobery.  I am having problems with tags using the BassTags class with FLAC, OOG and APE files.  I was hoping that it would work the same as MP3 which works great with the TAGINFO class.  It seems to work if I use the native StreamGetTags stuff.   I am using .net 2.0 and VS2005.
Do you need to see my code or a sample file?

Gregory

radio42

Yes, or I at least would need to know what exactly is not working ;-)
Are the Tags not showing up?
Are wrong Tags been shown?

And also aome Test-File(s) would be great (which you send directly to "bn AT radio42.com").

THX

radio42

29.03.2006: Version 2.2.0.14 is out!

- Upgrade to support the latest BASSmix beta (Matrix mixing).
- Matrix mixing is shown in the Encoder.cs sample. 
- C# samples modified, now using delegates to change GUI elements.
- AddOn.BassTag enhanced (checked for more tag types and little tracknumber issue solved).
- Misc.Visuals enhanced: new methods GetFrequencyFromPosX and GetAmplitudeFromPosY added.