BASS.NET API 2.4.17.5

Started by radio42, 5 Dec '05 - 18:08

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.


Renegade

Quote from: radio42 on 29 Mar '06 - 16:53...
- Misc.Visuals enhanced: new methods GetFrequencyFromPosX and GetAmplitudeFromPosY added.
...

Hey! That's not fair! You're not allowed to read my mind!  ;)

Thanks Bernd! That's exactly what I wanted.  :)

pern

Just a question if i can do this with your C# API:

I'm building a Sound to light / Light Chaser controller and i want to controll it from a C# program.

So what i need is

1: Bass beat extractor to trigg the chaser.
2: Sound to light - Volume extraction for four bands : Bass, Middle 1, middle 2, and treble.

Is this possible ?

radio42

Yes, I think all you described is possible.
But all that is possible via BASS - BASS.NET is only the C# wrapper ;-)

The only thing which you might find useful in addition is the beat detection via the BASS.NET "Misc.BPMCounter"class, which only exists in BASS.NET...

Regarding the Volume extraction for four bands this could easily be done via BASS_ChannelGetData and receiving FFT sample...some manual analysation is hence still required on your side ;-)

pern

Thanks ,

Is the Volume extraction something you are planning ??

Like :  FromFreq - ToFreq  ,  returns: avg value (And Max value? )

radio42

It is all there already in BASS...take a look to the FFT data in BASS_ChannelGetData(...)

And you'll have in BASS.NET a "Utils" class with methods which helps you to convert an FFT index to frequency etc.

James

Does anyone have a simple example of taking a byte[] of wav audio and downsampling from one sample rate to another, changing from stereo to mono ,and outputting to a new byte[] ?

many thanks in advance

radio42

For downsampling you might also use BASSMix which supports changing the samplerate as well as converting from stereo to mono (e.g. via the new Matrix Mixing function).

pern

I have now tested the BPMCounter class a little bit, it would be great to be able to:

- Set a fixed release time as an option.
- Select Low Pass detection only.

Any chance for adding these ?

radio42


pern

Thanks ;-)

If you need beta-testing of it, just let me know.