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

radio42

  • Posts: 4576
Re: BASS .NET API 2.3.1.1 !
« Reply #200 on: 17 Mar '07 - 21:26 »
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

  • Posts: 4576
Re: BASS .NET API 2.3.1.2 !
« Reply #201 on: 1 Apr '07 - 13:51 »
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

  • Guest
Re: BASS .NET API 2.3.1.2 !
« Reply #202 on: 1 Apr '07 - 16:27 »
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


Thanks..
Change now my NET Samples for BassVis.

Greets BassFan

ken

  • Posts: 739
Re: BASS .NET API 2.3.1.1 !
« Reply #203 on: 2 Apr '07 - 09:07 »
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.

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

Code: [Select]

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

  • Posts: 739
Re: BASS .NET API 2.3.1.2 !
« Reply #204 on: 2 Apr '07 - 19:44 »
Ok, got it working! Did like this:

Code: [Select]

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

  • Posts: 4576
Re: BASS .NET API 2.3.1.3 !
« Reply #205 on: 4 Apr '07 - 22:34 »
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

  • Posts: 65
Re: BASS .NET API 2.3.1.3 !
« Reply #206 on: 4 Apr '07 - 22:45 »
Hi,

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


(: JOBnik! :)

  • Posts: 1065
Re: BASS .NET API 2.3.1.3 !
« Reply #207 on: 9 Apr '07 - 16:14 »
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

  • Posts: 739
Re: BASS .NET API 2.3.1.3 !
« Reply #208 on: 25 Apr '07 - 18:58 »
I get error when calling
Code: [Select]
BassWa.BASS_WADSP_Config even in the sample code.

Quote
A 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

  • Posts: 4576
Re: BASS .NET API 2.3.1.3 !
« Reply #209 on: 25 Apr '07 - 19:15 »
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

  • Posts: 739
Re: BASS .NET API 2.3.1.3 !
« Reply #210 on: 25 Apr '07 - 20:14 »
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?

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.
« Last Edit: 25 Apr '07 - 20:17 by ken »

radio42

  • Posts: 4576
Re: BASS .NET API 2.3.1.3 !
« Reply #211 on: 25 Apr '07 - 21:08 »
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

  • Posts: 4576
Re: BASS .NET API 2.3.1.4 !
« Reply #212 on: 8 May '07 - 08:06 »
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

  • Posts: 51
Re: BASS .NET API 2.3.1.4 !
« Reply #213 on: 16 May '07 - 20:54 »
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

  • Posts: 4576
Re: BASS .NET API 2.3.1.4 !
« Reply #214 on: 16 May '07 - 21:06 »
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?
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?

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?
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

  • Posts: 51
Re: BASS .NET API 2.3.1.4 !
« Reply #215 on: 17 May '07 - 12:40 »
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?
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):

Code: [Select]
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.

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

Super, I had overlooked these options.

Thanks again for looking into these problems.
Cheers,
riesm

radio42

  • Posts: 4576
Re: BASS .NET API 2.3.1.4 !
« Reply #216 on: 17 May '07 - 13:24 »
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

  • Posts: 51
Re: BASS .NET API 2.3.1.4 !
« Reply #217 on: 17 May '07 - 15:02 »
Super. Problem solved. A big thumbs-up for your excellent support!

Cheers,
riesm

riesm

  • Posts: 51
Re: BASS .NET API 2.3.1.4 !
« Reply #218 on: 17 May '07 - 15:14 »
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:
Code: [Select]
'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

  • Posts: 4576
Re: BASS .NET API 2.3.1.4 !
« Reply #219 on: 17 May '07 - 15:30 »
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

  • Posts: 4576
Re: BASS .NET API 2.3.1.4 !
« Reply #220 on: 1 Jun '07 - 11:44 »
A new version of the enc_aacPlus encoder is up and can be downloaded: Here!


radio42

  • Posts: 4576
Re: BASS .NET API 2.3.1.5 !
« Reply #221 on: 5 Jun '07 - 10:41 »
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

  • Guest
Re: BASS .NET API 2.3.1.5 !
« Reply #222 on: 5 Jun '07 - 13:52 »
05.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

  • Posts: 9
Re: BASS .NET API 2.3.1.5 !
« Reply #223 on: 11 Jun '07 - 12:08 »
Does anyone have idea how to use embedded resource instead of the required string (patch\filename)?
C# .NET

radio42

  • Posts: 4576
Re: BASS .NET API 2.3.1.5 !
« Reply #224 on: 11 Jun '07 - 12:50 »
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.