BASS.NET API 2.4.17.8

Started by radio42,

radio42

You might use "BASS_Encode_Write" with a user created buffer containing only 0 (zero) values.
Use BASS_ChannelSeconds2Bytes" to calculate the number of bytes needed for 1 second.
And call the 'write' at the end of your encoding.

radio42

31.03.2007: Version 2.3.1.2 is out!

BassVIS 2.3.0.5: support added.
BassMix: new method BASS_Mixer_ChannelFlags added
WaveForm: modified GetCuePoints to allow different threshold for cue in and out

BassFan

Quote from: radio4231.03.2007: Version 2.3.1.2 is out!

BassVIS 2.3.0.5: support added.
BassMix: new method BASS_Mixer_ChannelFlags added
WaveForm: modified GetCuePoints to allow different threshold for cue in and out


Thanks..
Change now my NET Samples for BassVis.

Greets BassFan

ken

Quote from: radio42You might use "BASS_Encode_Write" with a user created buffer containing only 0 (zero) values.
Use BASS_ChannelSeconds2Bytes" to calculate the number of bytes needed for 1 second.
And call the 'write' at the end of your encoding.

I try to add silece at the end like this but I don't get it working.. Please help me :-)


public void ConvertAudioAddSilence(string inpFile, string outputFile, TimeSpan silenceLenght)
        {
                    int _stream = Bass.BASS_StreamCreateFile(inpFile, 0, 0, BASSStream.BASS_STREAM_DECODE);

           
                    lameTooLame = new EncoderTooLAME(_stream);
                    lameTooLame.InputFile = null;
                    lameTooLame.OutputFile = outputFile + ".MP2";
                    lameTooLame.TOO_Bitrate = 256;
                    lameTooLame.Start(null, 0);

                    _fileName = outputFile + ".MP2";

                    if (!lameTooLame.EncoderExists)
                    {
                       
                    }

                    //Encode the input audiofile
                    byte[] encBuffer = new byte[65536];
                    while (Bass.BASS_ChannelIsActive(_stream) == (int)BASSActive.BASS_ACTIVE_PLAYING)
                    {
                        Bass.BASS_ChannelGetData(_stream, ref encBuffer[0], encBuffer.Length);
                    }

                   
                   // Add some silence...
                    float _dur = (float)silenceLenght.Seconds;
                    byte[] silentBuffer = new byte[65536];
                    for(int i=0; i<(int)Bass.BASS_ChannelSeconds2Bytes(_stream, _dur);i++)
                    {
                        Bass.BASS_ChannelGetData(_stream, ref silentBuffer[0], (int)Bass.BASS_ChannelSeconds2Bytes(_stream, _dur));
                    }

                    lameTooLame.Stop();

                    Console.WriteLine("DONE!");
        }


ken

Ok, got it working! Did like this:


public void ConvertAudioAddSilence(string inpFile, string outputFile, TimeSpan silenceLenght)
        {
                    int _stream = Bass.BASS_StreamCreateFile(inpFile, 0, 0, BASSStream.BASS_STREAM_DECODE);

           
                    lameTooLame = new EncoderTooLAME(_stream);
                    lameTooLame.InputFile = null;
                    lameTooLame.OutputFile = outputFile + ".MP2";
                    lameTooLame.TOO_Bitrate = 256;
                    lameTooLame.Start(null, 0);

                    _fileName = outputFile + ".MP2";

                    if (!lameTooLame.EncoderExists)
                    {
                       
                    }


                    byte[] encBuffer = new byte[65536]; // our dummy encoder buffer (32KB x 16-bit - size it as you like)
                    while (Bass.BASS_ChannelIsActive(_stream) == (int)BASSActive.BASS_ACTIVE_PLAYING)
                    {
                        Bass.BASS_ChannelGetData(_stream, ref encBuffer[0], encBuffer.Length);
                    }


                    float _dur = (float)silenceLenght.Seconds;
                    int _bytesLength= (int)Bass.BASS_ChannelSeconds2Bytes(_stream, _dur);
                    byte[] silentBuffer = new byte[_bytesLength];
                   
                    Un4seen.Bass.AddOn.Enc.BassEnc.BASS_Encode_Write(_stream, ref silentBuffer[0], _bytesLength);

                    lameTooLame.Stop();

                    Console.WriteLine("DONE!");
        }


radio42

04.04.2007: Version 2.3.1.3 is out!

Bass_FX 2.3.0.2: support added (NOTE: not yet released by Jobnik, but will be soon ;-)
- BEAT:
    . Added Beat position detection for decoded streams BASS_FX_BPM_BeatDecodeGet
    . Added new functions: BASS_FX_BPM_BeatCallbackReset, BASS_FX_BPM_BeatSetParameters, BASS_FX_BPM_BeatGetParameters
- REVERSE:
    . Multi-channel support
    . Added new feature to change playing direction from Reverse to Forward and vice-versa BASS_FX_ReverseSetDirection, BASS_FX_ReverseGetDirection
- BPM:
    . Fixed: one more critical bug in BPM functions
- DSP:
    . BASS_FX_DSPFX_PEAKEQ: Improved effect and reduced CPU usage, Fixed: a bug, preventing using fQ if fBandwidth < 0.1f, Changed: fQ min limit to 0.1f
    . BASS_FX_DSPFX_ECHO3: Fixed: a bug in BASS_FX_DSP_GetParameters, that would return a wrong lChannel value
- TEMPO:
    . Setting functions name changed: BASS_FX_TempoSettingSet to BASS_FX_TempoSetOption
    . BASS_FX_TempoSettingGet to BASS_FX_TempoGetOption
    . BASS_FX_TEMPO_SETTING_xxx to BASS_FX_TEMPO_OPTION_xxx

Misc: bug fix in BaseEncoder.EncoderExists property.


Note: BASS_FX 2.3.0.2. will soon be released. So this release already covers the new BASS_FX version.
It is realease a bit early here, sice I'll be on vacation the next 2 weeks ;-)
So have fun!

GermaniX

Hi,

big thx - and a nice vacation on eastern! Viel Spaß!


(: JOBnik! :)

Hi ;D

BASS_FX 2.3.0.2 is released.

One more update, that isn't updated for .NET yet, is removing of the BASS_FX_ERROR_STEREO error code and replacing it with BASS_ERROR_FORMAT error code.

ken

I get error when calling BassWa.BASS_WADSP_Config even in the sample code.

QuoteA call to PInvoke function 'Bass.Net!Un4seen.Bass.AddOn.Wa.BassWa::BASS_WADSP_Config' has unbalanced the stack. This is likely because the managed PInvoke signature does not match the unmanaged target signature. Check that the calling convention and parameters of the PInvoke signature match the target unmanaged signature.

Any suggestions?

radio42

Which versions are you using ?
Make sure to use BASS v2.3.0.2 with BASS.NET 2.3.1.3 and BASS_WADSP 2.3.0.0.

I just tested the C# sample provided with BASS.NET and had no issues.

However, it might also be, that the Winamp DSp plugin you are using is not well implemented - which one are you testing?

ken

#210
Quote from: radio42Which versions are you using ?
Make sure to use BASS v2.3.0.2 with BASS.NET 2.3.1.3 and BASS_WADSP 2.3.0.0.

I just tested the C# sample provided with BASS.NET and had no issues.

However, it might also be, that the Winamp DSp plugin you are using is not well implemented - which one are you testing?

Yes I have the latest versions.

But I found out a strange thing. If I run the project in VS2005 then I get the error, but If I runt the exe in bin folder I don't get the error and it works...!!  Same on several DSP plugins.

radio42

That's really strange, since I also tested the stuff in debug mode from the VS2005 environement!
Do you have maybe any other odd reference to an older BASS or BASS_WADSP version located somewhere else - e.g. the system32 folder?

radio42

07.05.2007: Version 2.3.1.4 is out!

BASSmix: support for latest version added:
- new BASS_MIXER_PAUSE flag:
  (to be used with BASS_Mixer_StreamAddChannel(Ex) and BASS_Mixer_ChannelFlags)
- new BASS_Mixer_ChannelSetSync and BASS_Mixer_ChannelRemoveSync methods added
- new inernal methods BASS_Mixer_ChannelIsActive, BASS_Mixer_ChannelPause and BASS_Mixer_ChannelPlay added

BASS: new BASS_CONFIG_MUSIC_VIRTUAL config option

Misc:
- WaveForm and WaveForm2 classes are now collapsed into WaveForm class (WaveForm2 class removed)!
- BroadCast modified: AutoConnect and Connect will now AutoReconnect even in case the initial connect fails.

riesm

Hi,

Because of the change in the waveform class (the merge of the two), there seems to be compatibility issues with older saved waveforms. The older waveforms cannot be loaded anymore. Is there a workaround?

Second question is that I don't really like the new split waveforms (as apposed to the old single wave form). Is there a way to have it reverted to one waveform?

Thanks in advance.
Cheers,
riesm

radio42

Quote from: riesmBecause of the change in the waveform class (the merge of the two), there seems to be compatibility issues with older saved waveforms. The older waveforms cannot be loaded anymore. Is there a workaround?
That's true - the inernal waveform has changed - but is more compact now than the old WaveForm2 class.
Guess the only workaround would be 'reintroduce' the old WaveForm class to BASS.NET.
Question is if that is really needed or if it wouldn't be easier to rebuild your saved WaveForms?

Quote from: riesmSecond question is that I don't really like the new split waveforms (as apposed to the old single wave form). Is there a way to have it reverted to one waveform?
Yes, that is possible with the new WaveForm class.
It has a property called "DrawWaveForm" which defines the type of from to be drawn:
WaveForm.WAVEFORMDRAWTYPE.Stereo = left and right channel drawing
WaveForm.WAVEFORMDRAWTYPE.Mono = like to old WaveForm single
WaveForm.WAVEFORMDRAWTYPE.DualMono = two in one overlapped

riesm

Quote from: radio42That's true - the inernal waveform has changed - but is more compact now than the old WaveForm2 class.
Guess the only workaround would be 'reintroduce' the old WaveForm class to BASS.NET.
Question is if that is really needed or if it wouldn't be easier to rebuild your saved WaveForms?
You're right, no problem to rebuild them. However, this code does not work anymore (i.e. it doesn't save the file and always returns False):

If WF.WaveFormSaveToFile(System.IO.Path.ChangeExtension(mTag.URL, ".wf")) = False Then
  Debug.WriteLine("MyWaveForm2Callback: Couldn't Save Wave Form")
End If

Any suggestions? At first I thought it was because the files already existed, but since I have removed them, the problem remains.

Quote from: radio42Yes, that is possible with the new WaveForm class.
It has a property called "DrawWaveForm" which defines the type of from to be drawn:
WaveForm.WAVEFORMDRAWTYPE.Stereo = left and right channel drawing
WaveForm.WAVEFORMDRAWTYPE.Mono = like to old WaveForm single
WaveForm.WAVEFORMDRAWTYPE.DualMono = two in one overlapped

Super, I had overlooked these options.

Thanks again for looking into these problems.
Cheers,
riesm

radio42

You are right - I have forgotten to mark an element in the new structure as Serializable.
So that's fixed with the update here:

.Net 1.1 build : Click here
.Net 2.0 build : Click here

Make sure to copy the included files to your install directory!

Have fun...

riesm

Super. Problem solved. A big thumbs-up for your excellent support!

Cheers,
riesm

riesm

And probably another bug; the YEAR tag in WMA files returns the bitrate rather than the year (happens when the file has no YEAR tag at all). It should probably return an empty string.

Here's the code:
'Get Tags here
channel = Bass.BASS_StreamCreateFile(sFile, 0, 0, Un4seen.Bass.BASSStream.BASS_DEFAULT)
mTags = New Un4seen.Bass.AddOn.Tags.TAG_INFO(sFile)
Un4seen.Bass.AddOn.Tags.BassTags.BASS_TAG_GetFromFile(channel, mTags)
objDataRow("ReleaseYear") = mTags.year
'NOTE: with .wma file this returns "97032" which I think is the bitrate

While we're at it. Would it be possible to enhance tag support for reading/writing embedded album art and user ratings?

Cheers,
riesm

radio42

Hi,

true - the bitrate to year was a stupid bug. It is fixed now - use the same update link as above.

Picture Tag reading support is already there:
Use the following properties/methods from your TAG_INFO instance:
- tagInfo.PictureCount
- tagInfo.PictureGetDescription
- tagInfo.PictureGetImage
- tagInfo.PictureGetType

Rating support is also there, as there is a property called "NativeTags", which returns all other format specific TAGs.


radio42

A new version of the enc_aacPlus encoder is up and can be downloaded: Here!


radio42

05.05.2007: Version 2.3.1.5 is out!

BASS_VIS: support for 2.3.1.0 added
WaveForm: rendering speed further improved.

BassFan

Quote from: radio4205.05.2007: Version 2.3.1.5 is out!

BASS_VIS: support for 2.3.1.0 added
WaveForm: rendering speed further improved.


thanks for your work ;)

greets BassFan

sawo

Does anyone have idea how to use embedded resource instead of the required string (patch\filename)?
C# .NET

radio42

Can you explain a bit more what you are trying to achieve?
If it relates to localization of resource strings take a look to the .Net "ResourceManager" class.