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

riesm

  • Posts: 51
Re: BASS.NET API 2.4.6.8
« Reply #850 on: 27 Oct '10 - 02:21 »
In perhaps less stronger words (but do agree though), I feel the same. I am holding off upgrades, because I still need to support BassVideo in my apps (Bass_Dshow still not getting to the same quality). You might want to release the BassVideo calls seperately, so we could load them together with BASS.NET? Many thanks in advance for at least considering releasing the BassVideo calls.

radio42

  • Posts: 4576
Re: BASS.NET API 2.4.6.8
« Reply #851 on: 27 Oct '10 - 08:21 »
This is not up to me!
The developer of BassVideo told me, that I should remove support for BassVideo from Bass.Net - as he even wanted to come up with his own .Net wrapper.
So I guess you need to talk to the BassVideo developer to solve this...

Latch

  • Posts: 90
Re: BASS.NET API 2.4.6.8
« Reply #852 on: 27 Oct '10 - 17:43 »
This is not up to me!
The developer of BassVideo told me, that I should remove support for BassVideo from Bass.Net - as he even wanted to come up with his own .Net wrapper.
So I guess you need to talk to the BassVideo developer to solve this...

Well, it would appeared he lied to you.  There is no mention at all about BassVideo on his web site anymore.  You aren't legally obligated to him in any way.  You certainly have the right to make a .Net wrapper for it since he obviously isn't.  I'm sure you still kept the code for it.  Why not just make a "secret" BassVideoWrap.dll out of your old code and send it to us few developers who need it.  It's just not fair to pull support for something that is needed by many apps.  Making us people who've paid you money should be a higher priority over a guy who never sent you a dime AND lied to you.  Always put your customers first and you can't go wrong.  Besides, it's good Karma  ;)

radio42

  • Posts: 4576
Re: BASS.NET API 2.4.6.8
« Reply #853 on: 27 Oct '10 - 23:05 »
I'll see if I can find my old source code for BassVideo and simply post it here...

Here is the 'old', 'original' C# source code for BassVideo:
www.un4seen.com/filez/4/BassVideo.zip

NOTE: This is provided as is - you might need to adjust the source to get it working for you. No further support is given on it!
« Last Edit: 28 Oct '10 - 08:46 by radio42 »

Latch

  • Posts: 90
Re: BASS.NET API 2.4.6.8
« Reply #854 on: 28 Oct '10 - 20:35 »
I'll see if I can find my old source code for BassVideo and simply post it here...

Here is the 'old', 'original' C# source code for BassVideo:
www.un4seen.com/filez/4/BassVideo.zip

NOTE: This is provided as is - you might need to adjust the source to get it working for you. No further support is given on it!

Thank you  ;D

Latch

  • Posts: 90
Re: BASS.NET API 2.4.6.8
« Reply #855 on: 29 Oct '10 - 03:06 »
Well, I used a utility to convert the C# code to VB.Net.  Then I realized a few things had changed since the last Bass.Net that we had, that used the last known working copy of BassVideo (2.4.1.3).  Also, there were some things missing like the BASSVIDEOFLAGS enums (which I was able to piece back together myself) and a couple of methods like BASS_Video_Init and BASS_Video_SetConfig which are obviously crucial for it to work.  Needless to say, after a couple hours work, I'm back to square one.

Maybe you can enlighten me on some things.  Is this code supposed to work with BassVideo 2.4.1.3 or was there a more recent version we should use, or is it for an older version?  ...and what happened to the missing flags and proceedures?


radio42

  • Posts: 4576
Re: BASS.NET API 2.4.6.8
« Reply #856 on: 29 Oct '10 - 07:20 »
It was the most recent version I had - as said above...no futher support on this one!

ken

  • Posts: 739
Re: BASS.NET API 2.4.6.8
« Reply #857 on: 29 Oct '10 - 12:04 »
How do I write a stream created by "BASS_StreamCreate" to a file? without run the channel via BassEncoder.  Can I write to file in STREAMPROC?

/Ken

radio42

  • Posts: 4576
Re: BASS.NET API 2.4.6.8
« Reply #858 on: 29 Oct '10 - 13:51 »
That depends which file format you are targeting.
However, the STREAMPROC only delivers the raw sample data in PCM format.
So even if you want to write a .wav file you need to write the WAV header yourself.
And if you want to write an .mp3 target file, you definitly need to encode it - so here BASSenc is definitly needed!
Why don't you want to use BASSenc?

ken

  • Posts: 739
Re: BASS.NET API 2.4.6.8
« Reply #859 on: 29 Oct '10 - 14:20 »
That depends which file format you are targeting.
However, the STREAMPROC only delivers the raw sample data in PCM format.
So even if you want to write a .wav file you need to write the WAV header yourself.
And if you want to write an .mp3 target file, you definitly need to encode it - so here BASSenc is definitly needed!
Why don't you want to use BASSenc?

I get data as "push-callback" from a online music service, and want to save that to disc without encoding it again (audio is in ogg)

radio42

  • Posts: 4576
Re: BASS.NET API 2.4.6.8
« Reply #860 on: 29 Oct '10 - 16:08 »
I don't know what the 'online-music' service is actually delivering in your STREAMPROC.
But probably it doesn't deliver you all the header data...but...
What have you tried it already?

And I am not sure if that is a specific Bass.Net question - or more something general?

ken

  • Posts: 739
Re: BASS.NET API 2.4.6.8
« Reply #861 on: 29 Oct '10 - 16:34 »
I don't know what the 'online-music' service is actually delivering in your STREAMPROC.
But probably it doesn't deliver you all the header data...but...
What have you tried it already?

And I am not sure if that is a specific Bass.Net question - or more something general?

I just read that it's raw PCM data, so I think I need to use the Encoder (it do work with Encoder). 
http://developer.spotify.com/en/libspotify/docs/structsp__session__callbacks.html#33a31478b8de1882ad7847ad033fbaeb


hellbundy

  • Posts: 30
Re: BASS.NET API 2.4.6.8
« Reply #862 on: 31 Oct '10 - 12:29 »
Hi.

I was using Bass.Net API 2.4.6.5 version. I installed the new one (2.4.6.8).
Now I get the below error in VB.NET 2008;

Warning   1   Could not resolve this reference. Could not locate the assembly "Bass.Net, Version=2.4.6.5, Culture=neutral, PublicKeyToken=b7566c273e6ef480, processorArchitecture=MSIL". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors.   WindowsApplication1

It doesn't accept the new reference... Is there a solution for this.

Thanks.

radio42

  • Posts: 4576
Re: BASS.NET API 2.4.6.8
« Reply #863 on: 31 Oct '10 - 13:19 »
Looks like you are still somehow referencing the old version.
Have you tried to remove the existing one and add the new one.
Actually I have never heard about such an issue before.

hellbundy

  • Posts: 30
Re: BASS.NET API 2.4.6.8
« Reply #864 on: 31 Oct '10 - 13:26 »
That's right. It's looking for the old one.
But I uninstalled it. Installed the new one but somehow I couldn't add the new reference.
Thank you for your reply.

hellbundy

  • Posts: 30
Re: BASS.NET API 2.4.6.8
« Reply #865 on: 31 Oct '10 - 13:38 »
Now I tried it with a new project and it works fine..

ken

  • Posts: 739
Re: BASS.NET API 2.4.6.8
« Reply #866 on: 31 Oct '10 - 14:08 »
How do I easiest "upmix" an mono channel to a stereo channel?

WASAPI gives me a mono channel (from a USB mic as input device that is proberly a mono device) even if I set chans as 2.
Code: [Select]
_BassWasapiHandlerIn = new BassWasapiHandler(audioDevIn.DeviceID, false, audioDevIn.MixFreq, 2, 0f, 0f);
_recChannel = _BassWasapiHandlerIn.InputChannel;


I'm trying this but output file from encoder i zero byte.
Code: [Select]
BASS_CHANNELINFO _info = Bass.BASS_ChannelGetInfo(_recChannel);

if (_info.chans == 1)
{
      int _convMixer = BassMix.BASS_Mixer_StreamCreate(44100, 2, BASSFlag.BASS_SAMPLE_FLOAT | BASSFlag.BASS_STREAM_DECODE);
      BassMix.BASS_Mixer_StreamAddChannel(_convMixer, _recChannel, BASSFlag.BASS_MIXER_FILTER);

       _encoderMP2 = new EncoderTooLAME(_convMixer);
       _encoderMP2.InputFile = null;
       _encoderMP2.OutputFile = _FileName;
       _encoderMP2.TOO_Bitrate = BitRate;
       _encoderMP2.Start(null, IntPtr.Zero, false);
}
« Last Edit: 31 Oct '10 - 16:27 by ken »

radio42

  • Posts: 4576
Re: BASS.NET API 2.4.6.8
« Reply #867 on: 31 Oct '10 - 19:38 »
Have you checked BASS_ErrorGetCode after each Bass call? What does it return?

ken

  • Posts: 739
Re: BASS.NET API 2.4.6.8
« Reply #868 on: 1 Nov '10 - 09:27 »
Have you checked BASS_ErrorGetCode after each Bass call? What does it return?

Just tested and I get BASS_OK after each call. I added BASSFlag.BASS_STREAM_AUTOFREE to BASS_Mixer_StreamAddChannel since I got BASS_ERROR_ALREADY.

But still same problem, the output from EncoderTooLAME is 0 bytes.

radio42

  • Posts: 4576
Re: BASS.NET API 2.4.6.8
« Reply #869 on: 1 Nov '10 - 11:54 »
Which TooLAME version are you using?
And have tried using "TwoLAME" instead (which seems to be better and more compatible for MP2 encoding anyhow)?

ken

  • Posts: 739
Re: BASS.NET API 2.4.6.8
« Reply #870 on: 2 Nov '10 - 10:24 »
Which TooLAME version are you using?
And have tried using "TwoLAME" instead (which seems to be better and more compatible for MP2 encoding anyhow)?

TooLAME  is version 0.2L . I also now tested with TwoLAME (0.3.12b) but same result.  When using EncoderLAME the file is 4Kb in size, but unplayable.

If must be some strange with "up-mix", since if I use a "normal" audio device (stereo) then encoding works with all encoders.

radio42

  • Posts: 4576
Re: BASS.NET API 2.4.6.8
« Reply #871 on: 2 Nov '10 - 11:05 »
When using any Encoder instance with a decoding channel, you must of course call BASS_ChannelGetData in a loop in order to pull the data through the encoder (in your case on "_convMixer") - are you NOT doing that?
Please, also take a look to the Bass.Net documentation for more info...

ken

  • Posts: 739
Re: BASS.NET API 2.4.6.8
« Reply #872 on: 2 Nov '10 - 14:31 »
When using any Encoder instance with a decoding channel, you must of course call BASS_ChannelGetData in a loop in order to pull the data through the encoder (in your case on "_convMixer") - are you NOT doing that?
Please, also take a look to the Bass.Net documentation for more info...

if I encode the channel from WASAPI
Code: [Select]
_recChannel = _BassWasapiHandlerIn.InputChannel;

All is good (when I don't use mono soundcard)

But when I try to up-mix the channel to stereo with "BassMixer" it fail.

How should I build an mono -> stereo converter that works on a "recoder channel"

radio42

  • Posts: 4576
Re: BASS.NET API 2.4.6.8
« Reply #873 on: 3 Nov '10 - 07:12 »
Yes, when using a "BassWasapiHandler.InputChannel" as the encoding source, this stream gets automatically feed by the BassWasapiHandler, as the InputChannel is implemented as a Dummy stream internally.
As the InputChannel is a dummy custom decoding stream, it can actually not be used as a mixer source stream - it can only be used to setup DSP/FX on it!

If you want to plug the WasapiInput as a source to a mixer channel (as in your example), you must do the following:
Code: [Select]
_BassWasapiHandlerIn.SetFullDuplex(0, BASSFlag.BASS_STREAM_DECODE, false);
int fullDuplexStream = _BassWasapiHandlerIn.OutputChannel;
int _convMixer = BassMix.BASS_Mixer_StreamCreate(44100, 2, BASSFlag.BASS_SAMPLE_FLOAT | BASSFlag.BASS_STREAM_DECODE);
BassMix.BASS_Mixer_StreamAddChannel(_convMixer, fullDuplexStream, BASSFlag.BASS_MIXER_FILTER)
Note, that now the "BassWasapiHandler.OutputChannel" is used, which was created as a decoding stream!

aybe

  • Posts: 145
Re: BASS.NET API 2.4.6.8
« Reply #874 on: 9 Nov '10 - 02:53 »
17.09.2010: Version 2.4.6.8 is out!

BASSWMA: added support for v2.4.4.0
General:
  - WaveForm: ColorMiddleLeft, ColorMiddleRight properties added
  - WaveForm: PixelFormat property added

Full Install:
  www.un4seen.com/filez/4/Bass24.Net.zip

Lib only:
  www.un4seen.com/filez/4/Bass24.Net_update.zip


-----

...

Thanks for the changes, I didn't see until I updated recently,

I've made some tests and, 16 bit pixel format works,
that's already half the battle for memory usage !

Sadly 8 bit doesn't but in .NET those transforms to indexed 8-bit
always requires extra work like finding the palette.
Whether WPF or Forms it's the same and I guess you didn't delve into that
what I can understand ...

I did a couple of searches around Octree and MedianCut,
found a project that does the dither but it's far too slow for intensive usage.
I started working on my own dither providing it's fast enough to process/use I'll post it in the forum.

Thank you.