Author Topic: BASS.NET API 2.4.17.5  (Read 1128254 times)

radio42

  • Posts: 4839
Re: BASS .NET API 2.3.0.5 !
« Reply #75 on: 3 Sep '06 - 17:48 »
Something like this will follow in the next version yes !

ken

  • Posts: 752
DSP_StreamCopy
« Reply #76 on: 1 Oct '06 - 21:45 »
Hi!

When I useing DSP_StreamCopy how can I apply a separate DSP (like a EQ and IIR delay) on only the copied stream

I like to do like this (induvidual EQ/IR/Vol on each copied stream):

"MP3" > StreamCopy > EQ > IIR > Volume > SpeakerFront
           StreamCopy > EQ > IIR > Volume > SpeakerRear
           StreamCopy > EQ > IIR > Volume > SpeakerCenter

cablehead

  • Posts: 315
Re: BASS .NET API 2.3.0.5 !
« Reply #77 on: 2 Oct '06 - 01:33 »
C# example of BassVis....anytime soon?

radio42

  • Posts: 4839
Re: BASS .NET API 2.3.0.5 !
« Reply #78 on: 4 Oct '06 - 08:15 »
Quote
When I useing DSP_StreamCopy how can I apply a separate DSP (like a EQ and IIR delay) on only the copied stream
Use the "StreamCopy" property of the "DSP_StreamCopy" class.
As written in the documentation - this is the copied stream being played out.
The "StreamCopy" is the created stream handle to which you can apply any DSP or FX - whatsoever, it is a normal BASS channel.

Quote
C# example of BassVis....anytime soon?
Don't think so - since there is already a VB example present. It should be easy to convert that to C# I guess.

ken

  • Posts: 752
Re: BASS .NET API 2.3.0.5 !
« Reply #79 on: 4 Oct '06 - 22:29 »
Can I show the waveform like this, just the half wave (mono) ?



If not can you please add this feature to the next update?

radio42

  • Posts: 4839
Re: BASS .NET API 2.3.0.5 !
« Reply #80 on: 4 Oct '06 - 23:01 »
You might already:
If you are using the newer "WaveForm2" class...:

1) Set the property:
WF2.DrawWaveForm = WaveForm2.WAVEFORMDRAWTYPE.Mono;

2) When drawing the actual waveform in a eg. picturebox, call:
this.pictureBox1.BackgroundImage = WF2.CreateBitmap( this.pictureBox1.Width, this.pictureBox1.Height*2, _zoomStart, _zoomEnd, true);

When setting the size 2 times the actual picturebox size, only the upper half of the waveform would be draw as visible.
The same applies to the original "WaveForm" class.

ken

  • Posts: 752
Re: BASS .NET API 2.3.0.5 !
« Reply #81 on: 5 Oct '06 - 09:25 »
Thx! worked perfect! Why did't I think like that   ;)

Works on the "old" WF. class olso.
« Last Edit: 5 Oct '06 - 09:35 by ken »

big_gun

  • Posts: 353
Re: BASS .NET API 2.3.0.5 !
« Reply #82 on: 28 Oct '06 - 08:55 »
I do have a question.

I have a firewire mixer, that when I play mp3s in winamp, it registers +3 to +5 db on the mixer itself (leds). When I monitor the main input from the asio drivers, it never gets more than -1 db.

Code: [Select]
aLev = (BassAsio.BassAsio.BASS_ASIO_ChannelGetLevel(True, ChanID) * 32768)
Debug.WriteLine("Level: " + (Bass.Utils.LevelToDB(lLev, 32768)).ToString)

I can't tell if it's my code, or the mixer is screwy! Which one is it?

Thanks,

Rick
« Last Edit: 28 Oct '06 - 10:10 by big_gun »

ken

  • Posts: 752
Re: BASS .NET API 2.3.0.5 !
« Reply #83 on: 28 Oct '06 - 17:30 »
Encode to MP2

I found a version of "lame.exe" that convert to MP2, can I use this just replacing the regular Lame.exe, or even better a option on the encoder for MP3/MP2.

Download "tooLame" here: http://www.videohelp.com/tools?tool=tooLame


radio42

  • Posts: 4839
Re: BASS .NET API 2.3.0.5 !
« Reply #84 on: 29 Oct '06 - 08:33 »
Take a look to the Misc namespace: Thay are already there:
"EncoderTooLAME" as well as "EncoderTwoLAME" - both are supported and both create MP2.

ken

  • Posts: 752
Re: BASS .NET API 2.3.0.5 !
« Reply #85 on: 29 Oct '06 - 14:50 »
opps. sorry, I will from now read the doc...  :D

ken

  • Posts: 752
Re: BASS .NET API 2.3.0.5 !
« Reply #86 on: 29 Oct '06 - 15:29 »
I just tested MP2 recording and I don't get it to work, a file is created but it's 0 kB. I don't see any wrong in my code, or...? MP3 recording works just fine. I tested both EncoderTwoLAME and EncoderTooLAME, and I have the encoders (exe).


Code: [Select]

private EncoderLAME lame;
private EncoderTwoLAME lameMP2;

public void StartRecording(int soundcardIndex,string filename, int bitRate, bool encodetoMP2)
        {
// init your recording device (we use the default device)
            if (!Bass.BASS_RecordInit(soundcardIndex))
                Console.WriteLine("Rec: Bass_RecordInit error!");

            _recProc = new RECORDPROC(RecordingHandler);
            // start recording at 44.1kHz, stereo
            _recHandle = Bass.BASS_RecordStart(44100, 2, BASSRecord.BASS_DEFAULT, _recProc, 0);
           
            if (_recHandle == Bass.FALSE)
                Console.WriteLine("Rec: BASS_RecordStart error!");

            // set up a ready-made DSP (here the PeakLevelMeter)
            _plm = new DSP_PeakLevelMeter(_recHandle, 1);
            //_plm.CalcRMS = true;
            //_plm.Notification += new EventHandler(_plm_Notification);

            if (encodetoMP2)
            {
                lameMP2 = new EncoderTwoLAME(_recHandle);
                lameMP2.InputFile = null;
                lameMP2.OutputFile = filename + ".MP2";
                lameMP2.TWO_Bitrate = bitRate;
               
                lameMP2.Start(null, 0);

                if (!lameMP2.EncoderExists)
                {
                    Console.WriteLine("Rec: twoLAME.EXE can not be found...");

                }
               
            }
            else
            {

                lame = new EncoderLAME(_recHandle);
                lame.InputFile = null;
                lame.OutputFile = filename + ".MP3";
                lame.LAME_Bitrate = bitRate;
                lame.LAME_Mode = EncoderLAME.LAMEMode.Stereo;
                lame.LAME_TargetSampleRate = (int)EncoderLAME.SAMPLERATE.Hz_44100;
                lame.LAME_Quality = EncoderLAME.LAMEQuality.Quality;
                lame.Start(null, 0);

                if (!lame.EncoderExists)
                {
                    Console.WriteLine("Rec: LAME.EXE can not be found...");

                }

            }
}


radio42

  • Posts: 4839
Re: BASS .NET API 2.3.0.5 !
« Reply #87 on: 29 Oct '06 - 17:04 »
What bitrates are you using?
TwoLAME and TooLAME are very restrictive with the combo of samplerate, bitrate.
Also note, that they only support 16-bit.

But I'll make a short test as well to be sure....(even if I did that already when implementing)...but you never know ;_)

ken

  • Posts: 752
Re: BASS .NET API 2.3.0.5 !
« Reply #88 on: 29 Oct '06 - 17:37 »
Hi!

I tested 192, 256 and 320.

Isn't "BASSRecord.BASS_DEFAULT" 16 bit?

I also do not get this working:

Code: [Select]
EncoderTwoLAME _twoLame = new EncoderTwoLAME(0);
 _twoLame.TWO_Bitrate = bitRate;
BaseEncoder.EncodeFile(inpFile, outputFile + ".MP2", _twoLame, new BaseEncoder.ENCODEFILEPROC(FileEncodingNotification), true, false);
               
« Last Edit: 29 Oct '06 - 17:39 by ken »

ken

  • Posts: 752
Re: BASS .NET API 2.3.0.5 !
« Reply #89 on: 1 Nov '06 - 11:55 »
But I'll make a short test as well to be sure....(even if I did that already when implementing)...but you never know ;_)

radio42, did you get MP2 encoding to work? I still don't get it to work, however I do.

radio42

  • Posts: 4839
Re: BASS .NET API 2.3.0.5 !
« Reply #90 on: 2 Nov '06 - 13:25 »
;-) Which version of TwoLAME are you using ;-)

If you take a look to: http://rarewares.org/mp3.html
You will find an extra build called : "twoLame 0.3.8a Release"

This version was generated on MY personal request, since the default release uses the 'libsndfile' library, which does NOT support reading from STDIN !

The special "twoLame 0.3.8a Release" indeed supports STDIN !

So please make sure to use that version ;-)

But...if you are talking about MP2 encoding.
I am personally using "tooLAME 0.2l", since that one is a little cleaner when it comes to compatibility and is pretty good for broadcasting when using higher bitrate (but if you paln to use MP2 I guess you will anyhow use it with higher bitrates >= 192kbps).

ken

  • Posts: 752
Re: BASS .NET API 2.3.0.5 !
« Reply #91 on: 2 Nov '06 - 18:16 »
Thx!

I did not have the twoLame "a" version and tooLame "l" version

Now "tooLame" records/converts just fine. But somehow "TwoLame"s  recorded file sounds like "pink noice"...

Anyway I will use "tooLame" and yes I use bitrates 192 and up. Thanks again.

 
« Last Edit: 2 Nov '06 - 18:20 by ken »

radio42

  • Posts: 4839
Re: BASS .NET API 2.3.0.5 !
« Reply #92 on: 2 Nov '06 - 20:44 »
Yepp, I just tested it again...in his new build of TwoLAME he did swap the byte order...thats why you get the pink noise...so I needed to remove my "-x" switch from the command-line being generated.
I'll fix that in the next release comming up these days!

In addition I found another little bug inside "twoLAME.exe" which causes twolame.exe to crash - whenever you stop the encoder.
So I contacted the developer and pleased him to fix that...so til that pls use tooLAME.exe.

I'll make a post when TwoLAME.exe is fully fixed :-)
« Last Edit: 2 Nov '06 - 21:14 by radio42 »

ken

  • Posts: 752
Re: BASS .NET API 2.3.0.5 !
« Reply #93 on: 2 Nov '06 - 22:25 »

Yes "twoLAME.exe" crashed for me to when I stop encoding.

Thanks again!

ken

  • Posts: 752
Re: BASS .NET API 2.3.0.5 !
« Reply #94 on: 2 Nov '06 - 22:56 »
Can all Encoders be used for "live recording" ?

I tested quickly "live recording" (like my example in previous post) with EncoderOGG and EncoderWinampAACplus and EncoderWMA, but no file is written.

If I use the same encoders for "converting" a file with "BaseEncoder.EncodeFile" then it work. So far I only got MP2 and MP3 to encode a "live recording".


ken

  • Posts: 752
Re: BASS .NET API 2.3.0.5 !
« Reply #95 on: 2 Nov '06 - 23:16 »
OK, more (stupid) questions.

Ripp a CD track and convert to MP2/MP3 "on the fly". I supose it's posible. I just need a poit in the right way. I did like this and that was not the way to do it ...

Code: [Select]
_CDstream = BassCd.BASS_CD_StreamCreate(cdPlayer, trackIndex, BASSStream.BASS_STREAM_DECODE);

lameTooLame = new EncoderTooLAME(_CDstream);
lameTooLame.InputFile = null;
lameTooLame.OutputFile = outFilename + ".MP2";
lameTooLame.TOO_Bitrate = bitRate;
lameTooLame.Start(null, 0);

if (!lameTooLame.EncoderExists)
{
      Console.WriteLine("Rec: tooLAME.EXE can not be found...");

}


radio42

  • Posts: 4839
Re: BASS .NET API 2.3.0.5 !
« Reply #96 on: 3 Nov '06 - 17:43 »
First: The guy from TwoLAME found the bug and is updating RareWares with a new version TwoLAME 0.3.8b later today. However, I'll also ship a newer BASS.NET version this weekend which in addition fixes the bit-swapping flag...

CD Ripping:

Here is the long version ():
Code: [Select]
// "Stream (Decoding)" To "File":
int _stream = BassCd.BASS_CD_StreamCreate(cdPlayer, trackIndex, BASSStream.BASS_STREAM_DECODE);

EncoderTooLAME l2 = new EncoderTooLAME(_stream);
l2.InputFile = null; //STDIN
l2.OutputFile = "test.mp2";
l2.TWO_Bitrate = 256;
l2.Start(null, 0);
// encode the data
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 )
{
// get the decoded sample data (which auto feeds the encoder)
int len = Bass.BASS_ChannelGetData(_stream, ref encBuffer[0], encBuffer.Length);
}
// finish
l2.Stop();

And here is the short helper version (which takes a filename and uses the plugin system):
Code: [Select]
// the simple way, which can be used instead of all the above!
EncoderTooLAME l2 = new EncoderTooLAME(0);
l2.TWO_Bitrate = 256;
BaseEncoder.EncodeFile( "track1.cda", null, l2, null, true, false);

radio42

  • Posts: 4839
Re: BASS .NET API 2.3.0.6 !
« Reply #97 on: 4 Nov '06 - 18:13 »
05.11.2006: Version 2.3.0.6 is out!!

A) General stuff:
1. BASS.NET revisited to make it 64-bit compiant (at least internally) Note: current native BASS still is 32bit!
2. BassTags:
    . new BASS_TAG_GetFromFile overload to be used with files directly
    . new TAG_INFO.UpdateFromMIDILyric added
3. new SplashScreen introduced in the Freeware version and Utils.ShowAbout revisited
4. new BassNet.Registration mehod, which disables the SplashScreen

B) BASS 2.3.0.2 support added (comming soon ;-):
    . new BASS_SampleGetChannels method added
    . new BASS_SampleGetChannelCount method added

C) BASSmix:
    . BASS_MIXER_NORAMPIN and BASS_MIXER_NONSTOP (BASSStream flag) added

D) BASSwma:
    . full DRM support added (which can ONLY be used, if you aquired a DRM enabled basswma.dll and BassNet.dll)
      (if you need a WMA DRM enabled Bass.Net.dll contact me and let me know, if you use .Net1.1 or 2.0)

E) BASSmidi 2.3.0.0 support added

F) BASSenc 2.3.0.2 support added (see extra BASSenc download)
    . new ENCODENOTIFYPROC callback
    . new BASS_Encode_CastGetStats added
    . new BASS_Encode_CastSetTitle added
    . new BASS_Encode_CastInit added
    . new BASS_Encode_SetNotify added
    . new BASS_Encode_Get/SetChannel added

G) Misc:
    . BroadCast class: revisited to add new BASSenc features
    . new EncoderWAV added
    . all StreamingServer's now have a new constructor overload
    . new UseBASS property added to all StreamingServer
    . new GetListeners method added to all StreamingServer and BroadCast
    . new GetStats method added to all StreamingServer and BroadCast
    . UpdateUrl method removed

H) Samples:
    . new AsioRecording sample added
    . Encoder sample revisited to show MP3 encoding
« Last Edit: 4 Nov '06 - 18:16 by radio42 »

ken

  • Posts: 752
Re: BASS .NET API 2.3.0.6 !
« Reply #98 on: 5 Nov '06 - 16:29 »
ID3 tags. Is there a way to "detect" if the MP3 have a ID3v1 or ID3v2, or non tags ?


radio42

  • Posts: 4839
Re: BASS .NET API 2.3.0.6 !
« Reply #99 on: 5 Nov '06 - 16:47 »
Yepp ;-)

Code: [Select]
IntPtr ret = IntPtr.Zero;
// first try ID3v2
ret =  Bass.BASS_ChannelGetTags(stream, BASSTag.BASS_TAG_ID3V2);
if (ret == IntPtr.Zero)
{
    // didn't find v2, so try ID3v1
    ret = Bass.BASS_ChannelGetTags(stream, BASSTag.BASS_TAG_ID3);
}