BASS.NET API 2.4.18.2

Started by radio42,

ken

Tag's why not. A nice feature to tags would be info of the audiofile like freq, bitrate, cbr/vbr, type (PCM/MP3/VOB...) and so on.  I know most of them is in BASS_CHANNELINFO, but have all in on function would be grat, just set the filename and get back a class with all tags and file info.  Or?

radio42

Adding the "BASS_CHANNELINFO" struct to the TAG_INFO class would theoretically be possible.

But regarding the VBR info I guess that's not possible, since the only way to get that info is to check every frame header of the file...which I am not going to implement ;-)

ken

I wonder how WinAmp get if it is a CBR or VBR file:

Looks like this if it's a VBR (in WinAmp info), and the "bitrate" label change all the time:

QuoteSize: 4302848 bytes
Header found at: 273 bytes
Encoder Delay: 576, Zero Padding: 2256
Length: 215 seconds
MPEG-1 layer 3
160kbit (VBR), 8261 frames
44100Hz Joint Stereo
CRCs: No, Copyrighted: No
Original: Yes, Emphasis: None

radio42

It is an old issue here.
BASS does investigate all the MP3 frames...so BASS could know (like Winamp), but unfortunately this info is dropped in BASS...do a little search in the forum...and you'll find some solutions.

However, this is definitly not a BASS.NET issue, since it wouldn't make sense for BASS.NET to read all the MP3 audio frame again...just to get this info... ;-)

Regarding the TAG_INFO stuff.
The next version will get additional members in the TAG_INFO struct:
- albumartist
- bpm
- channelinfo (like you requested)

radio42

08.12.2006: Version 2.3.0.9 is out!

Misc.WaveForm: the Wave property now supports a setter.
- new  WaveFormLoadFromMemory and WaveFormSaveToMemory added.
- new GetMarker, GetMarkers and GetMarkerCount method added
- new GetCuePoints methods added (silence detection)
- bug-fix in CreateBitmap when drawing markers and SyncPlayback was used 

BassTAG: support for even reading older ID3v2.2.0 added
- so far ID3v2.4.0 and ID3v2.3.0 had been supported
- TAG_INFO structure enhanced by: albumartist, bpm and channelinfo   

BassAsio 1.0.0.0 final support added
- new BASS_ASIO_ChannelEnableMirror method added
- new BASS_ASIO_ChannelSetVolume method added
- new BASS_ASIO_ChannelGetVolume method added
- BassAsioHandler class enhanced:
   . new methods SetMirror,  RemoveMirror and PauseMirror added
   . new properties Volume, VolumeMirror, Pan and PanMirror added 

Midi: new namespace Ten53.Multimedia.Midi added
- new Midi class covering Midi communication via the Win32 Multimedia API (winmm.dll)
- new MidiInputDevice and MidiOutputDevice class for sending/receiving any MIDI command/message
- new MidiShortMessage class supporting constucting and or unpacking any Midi data message
- native support for system-exclusive messages

Utils: 32/64-bit bug-fix in DMAZeroMemory, DMACopyMemory, DMAMoveMemory, DMAFillMemory

Samles adjusted:
- Simple now shows the new WaveForm.GetCuePoints
- PlugInbug-fix
- AsioRecording now shows the BassAsioHandler.SetMirror
- new MidiDevices sample added

Here are the full versions (including all help systems and samples):
- Bass23.Net11.zip
- Bass23.Net20.zip

Here are two compact versions (if you don't want the full installer version - only recommended for pro-users!)
- Bass23.Net11_compact.zip
- Bass23.Net20_compact.zip

Renegade

Does anyone know where I can download BASS.NET v2.2.0.14 for .NET v2.0?

Thanks

radio42

Here comes a little update to the v2.3.0.9 version:

.Net 1.1. build : http://www.un4seen.com/filez/4/Bass23.Net11_update.zip
.Net 2.0 build : http://www.un4seen.com/filez/4/Bass23.Net20_update.zip

Make sure to copy the included files to your install directory! 
 
Fix:
- BassMidi.BASS_MIDI_StreamGetMarks was not returning the correct markers!

radio42

Here comes a new little update to the v2.3.0.9 version:

.Net 1.1. build : http://www.un4seen.com/filez/4/Bass23.Net11_update.zip
.Net 2.0 build : http://www.un4seen.com/filez/4/Bass23.Net20_update.zip

Make sure to copy the included files to your install directory! 
 
Fix II:
- BassMidi.BASS_MIDI_StreamGetMarks still sometimes causes a crash!
 

 

radio42

Here comes a new little update to the v2.3.0.9 version:

.Net 2.0 build : http://www.un4seen.com/filez/4/Bass23.Net20_update.zip

Make sure to copy the included files to your install directory! 
 
Fix III:
- Windows Vista compatibility build!
- A few small internal issues have been resolved mostly with the xxxGetInfo methods.
- This was due to a different marshaling behaviour of .Net 2.0 and .Net 3.0 under Windows Vista!

radio42

05.01.2007: Version 2.3.1.0 is out!

Windows Vista and .Net 3.0 compatibility build:
A few small internal issues have been resolved mostly with the xxxGetInfo methods. This was due to a different marshaling behavior of .Net 2.0 resp. .Net 3.0 and Windows Vista. The new .Net 3.0 framework (which already comes with Windows Vista) is based on .Net 2.0. The main difference of .Net 3.0 are the several foundation extensions. So .Net 3.0 = .Net 2.0 plus foundations. BASS.NET for .Net 2.0 now also fully supports the .Net 3.0 framework!

BassTAG: small bug-fix when reading empty ID3 tags

BASS 2.3.0.2 support added:
- BASS_SampleGetChannels (Retrieval of a sample's existing channel handles)
- BASS_DATA_FFT8192 (BASS_ChannelGetData flag)
- Adjustable recording buffer with BASS_CONFIG_REC_BUFFER (BASS_SetConfig option)
- Stopping decoding channels before end with BASS_ChannelStop
- Sample channels created paused to prevent overriding before playback with BASS_SampleGetChannel
- BASS_CONFIG_MP3_CODEC *removed* !!! (Separate "MP3-FREE" version using Windows MP3 decoder)

ken

Maby offtopic...

I create an .NET 3.0 app using Bass .NET no proplem with simple playback. But using events is another thing, the invoke I used in 2.0 don't work in 3.0, I searched the net but not found a solution.

This dont work:
// .Net 2.0 or above only!   
BeginInvoke( (MethodInvoker)delegate()   
{        // This runs on the UI thread!       
this.Text = data;   
} );


I found this for 3.0, but can't get it working.

if(textbox.Dispatcher.CheckAccess())
{
   // The calling thread owns the dispatcher, and hence the UI element
   textbox.AppendText(...);
}
else
{
   // Invokation required
   textbox.Dispatcher.Invoke(DispatcherPriority.Normal, delegate);
}




help...

radio42

.Net 3.0 is actually based on the .Net 2.0 framework version but just has additional foundation components.
All code which runs under .Net 2.0 should 'normally' also run under .Net 3.0.

So what errors do you exactly get under .Net 3.0 and under which OS are running .Net 3.0 (Vista)?

However, here is some simple delegate which works fine for .Net 2.0 and .Net 3.0:
(it is taken from the C# Endoder demo code)
// in your code which is executed from a non-UI thread, call:
this.BeginInvoke(new UpdateDelegate(UpdateDisplay), new object[] { maxL, maxR });
public delegate void UpdateDelegate(int maxL, int maxR);
private void UpdateDisplay(int maxL, int maxR)
{
this.progressBarRecL.Value = maxL;
this.progressBarRecR.Value = maxR;
DrawWave();
}

ken

Yes I know 3.0 is based on 2.0 with new stuff like WPF and so. Well there is no Invoke or BeginInvoke in the framework. I think it's in System.Windows.Forms, and that is different in 2.0 and 3.0. Im doing a WPF application in .NET 3.0.

I coding an a XP Pro with .NET 3.0 installed, I have tested running the app on Vista and that works. (exept VU update).

The code you provided do you run that in .NET 3.0 WPF application, not a 2.0 app?



radio42

Nop, it is a classic .Net 2.0/.Net 3.0 Windows Forms application - so not based on the new WPF.

So I am not in case of WPF, if they are already capable of handling Invokations and if Invokations are needed at all?
Have you tried your WPF code without any "BeginInvoke"?

ken

Yes I tried without BeginInvoke (In WPF) same problem as in 2.0. (threading)

Well I have to digg more on Google, If you find time please test makeing a WPF application.

Microsoft Expression Blend is a great tool for designing WPF apps: http://www.microsoft.com/products/expression/en/expression-blend/default.mspx

Lars Vinter

Quote from: radio42- BASS_CONFIG_MP3_CODEC *removed* !!! (Separate "MP3-FREE" version using Windows MP3 decoder)

Hmm.... Newbie here :-) How do I configure Bass to use a specific mp3-decoder codec (like Lame, FhG, mad etc.) if I don't want to use the Windows MP3 decoder?
(Only talking about decoding mp3s - not encoding).

Regards

big_gun

Bass itself is a decoder, but you can use that m3_free or whatever const to use the default windows decoder.

radio42

First we need to differentiate between decoding and encoding:
For encoding (converting to MP3 or any other format) you might use the BASSenc add-on.
So encoding should be straight forward as shown in the BASSenc doc.

When it comes to decoding there are two version out:
a) The good old BASS internal decoder
b) the option to use the Windows MP3 decoder

The whole reason behind seperating these two decoders are patent and license issues.
MP3 encoding and decoding requires you as a product developer to have a legal patent license which can be obtained by Thomson.
It is not the BASS lib, but your product which needs to be licensed!
So if you are building a product based on the BASS internal decoder YOU need to buy a MP3 license from Thomson!
Unfortunately some folks would like to avoid this ;-)

The solution is using the Windows MP3 decoder!
Since here Microsoft has already paid the license for you!
So don't blame on Microsoft too much...

With version 2.3.0.1 there are now two versions of the bass.dll available:
a) the standard on in the main directory based on the BASS internal MP3 decoder
b) the on the 'mp3-free' directory which is using the Windows based MP3 decoder

If you are using the standard BASS based decoder...your product needs a Thomson license and you have to pay.
If you are using the Windows based Mp3 decoder version...all is for free.

Lars Vinter

Thank you for the reply - it did, however, give birth to a few more questions :-)

Quote from: radio42The whole reason behind seperating these two decoders are patent and license issues.
MP3 encoding and decoding requires you as a product developer to have a legal patent license which can be obtained by Thomson.

Would this be the case also if my application were to be released under GPL?

Quote from: radio42With version 2.3.0.1 there are now two versions of the bass.dll available:
a) the standard on in the main directory based on the BASS internal MP3 decoder
b) the on the 'mp3-free' directory which is using the Windows based MP3 decoder

Do you know of the differences between these two with respect to sound quality and performance?

I really want to avoid nasty mp3 side effects (flanger, weak transients etc.) by using the best available mp3-decoder. However, my application also needs to decode approx 15 streams at a time (!) - so speed is also on my mind (as the application will run on a "normal" consumer pc).

I think I'm gonna run a test both ways and see what I can learn from this, but if you have any experience in the differences between the two, it certainly would be nice to hear them upfront.