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

diogopms

  • Posts: 17
Re: BASS.NET API 2.4.7.1
« Reply #900 on: 19 Feb '11 - 19:45 »
Hi, i have one problem in Bass.net API with bassmix and bassenc..

My stream and player works fine, but after 608 seconds or 612 seconds, sometimes 574 seconds crash...

For debug my problem i played the same music many times (the track length for my test is 382464 (4 seconds +/-) and the size: 26.018 bytes


I think the problem is to call a Free() or something like that..

Thanks for your help ...

The error:


Critical code i think:
Code: [Select]
public Form1()
        {
            InitializeComponent();
            mix = new Mix();
            str = new Streaming();
            EncodeSound enc = new EncodeSound(mix._mixer);
            str.sendIcecast(enc.encodeAAC());
            mix.playMix();
            loadMusic();
        
          
        }

        private void loadMusic()
        {    
            SYNCPROC endTrack = new SYNCPROC(OnTrackSync);

            try { Track tr = new Track("c:\\mp3\\aahoras.mp3"); }
            catch (Exception e) { loadMusic(); }
          
                mix.addSong(tr.Channel);
                Bass.BASS_ChannelSetSync(tr.Channel, BASSSync.BASS_SYNC_END, 0L, endTrack, new IntPtr(0));
        }


        private void OnTrackSync(int handle, int channel, int data, IntPtr user)
        {
                mix.removeSong(tr.Channel);
                loadMusic();
        }


Track class:
Code: [Select]

 public int Channel = 0;

  private bool CreateStream()
        {
            Channel = Bass.BASS_StreamCreateFile(Filename, 0L, 0L, BASSFlag.BASS_STREAM_DECODE | BASSFlag.BASS_SAMPLE_FLOAT);
            if (Channel != 0)
            {
                TrackLength = Bass.BASS_ChannelGetLength(Channel);
                return true;
            }
            return false;
        }



« Last Edit: 19 Feb '11 - 19:53 by diogopms »

ken

  • Posts: 739
Re: BASS.NET API 2.4.7.1
« Reply #901 on: 20 Feb '11 - 14:49 »
Bernd,

Can you please update your lib for iPhone. There is a few new features in the latest build. Mixer, Encoder for example (BASS_Encode_CastInit and more).

Also in SetConfig I need BASS_CONFIG_IOS_MIXAUDIO = 34

Thanks!

/Ken

radio42

  • Posts: 4576
Re: BASS.NET API 2.4.7.2
« Reply #902 on: 21 Feb '11 - 08:31 »
21.02.2011: Version 2.4.7.2 is out!

BASS: added support for v2.4.7.3
BASSenc: added support for v2.4.7.4
Update to support all latest addon/plugin versions

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

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

Windows CE version:
  www.un4seen.com/filez/4/Bass24.Net_compact.zip

iPhone version:
  www.un4seen.com/filez/4/Bass24.Net_iphone.zip


muntablues

  • Posts: 196
Re: BASS.NET API 2.4.7.2
« Reply #903 on: 22 Feb '11 - 17:45 »
Hi Bernd

Your Waveform class has got the possibility to draw a HalfMono wave. Could you add HalfMonoFlip (or so)? I tried to RotateFlip myself but then the text is mirrored too *gg*

If you could add this feature it would be really great!

Thanks MB

LukeF

  • Guest
Re: BASS.NET API 2.4.7.2
« Reply #904 on: 27 Feb '11 - 11:27 »
Hi, I was just updating to the latest version and tried to add code for the Win7 default device follow feature. I noticed the new config option BASS_CONFIG_DEV_NOTIFY, the delegate and a BASS_SetConfigDelegate function, which however throws an error because the function is not defined in bass.dll.

You state that latest bass.net supports bass.dll 2.4.7.3 while I can only find 2.4.7.1 download here. Can you give any info on this? A device changed notification would indeed be great! I would also try to do it my own using the IMMNotification api, but if it will be coming soon through a bass update, I would wait for that of cause.

radio42

  • Posts: 4576
Re: BASS.NET API 2.4.7.2
« Reply #905 on: 1 Mar '11 - 16:37 »
The device notification system was removed in 2.4.7, because it caused problem with dynamic loading, or rather unloading. That was due to it being COM-based which meant that BASS couldn't release it when unloading (COM stuff not allowed in a DllMain function), so the notification system remained active if the app continued running after BASS was unloaded, and if a notification was triggered (eg. new device connected), it would end up trying to call a location where BASS.DLL is no longer present.
There were a few forum posts where people reported problems that were caused by it. Here's one...
   www.un4seen.com/forum/?topic=11832

It wasn't removed from Bass.Net yet...

gabsoftware

  • Posts: 30
Re: BASS.NET API 2.4.7.2
« Reply #906 on: 2 Mar '11 - 04:20 »
Hi radio42,

This certainly has been discussed before, but the Bass.Net help files integration into the MSDN library is broken when you use Visual Studio 2010. I have a message telling me that h2reg.exe cannot find the MSHelp 2.x runtime files. As you may know VS 2010 now use MS Help Viewer 1.0 instead of MS Help 2. Here is a link about migration to MS Help Viewer 1.0 : http://mshcmigrate.helpmvp.com/home

Thanks for your impressing work on Bass. Net ;)

radio42

  • Posts: 4576
Re: BASS.NET API 2.4.7.2
« Reply #907 on: 2 Mar '11 - 09:51 »
Yes, I know this.
Currently Bass.Net comes with MSHelp 1.x (.chm) and 2.x (VS2005/8).
VS2010 integration would require a 3rd set of help files...meaning another couple of MB.
So I am not sure about it yet - maybe I just provide the .chm file in the future or provide dedicated downloads just for the help system in question.

luke

  • Posts: 19
Re: BASS.NET API 2.4.7.2
« Reply #908 on: 2 Mar '11 - 11:45 »
The device notification system was removed in 2.4.7, because it caused problem with dynamic loading, or rather unloading. That was due to it being COM-based which meant that BASS couldn't release it when unloading (COM stuff not allowed in a DllMain function), so the notification system remained active if the app continued running after BASS was unloaded, and if a notification was triggered (eg. new device connected), it would end up trying to call a location where BASS.DLL is no longer present.
There were a few forum posts where people reported problems that were caused by it. Here's one...
   www.un4seen.com/forum/?topic=11832

It wasn't removed from Bass.Net yet...

Okay that makes sense. Time for some com interop then...

Lakerfield

  • Guest
Re: BASS.NET API 2.4.7.1
« Reply #909 on: 4 Mar '11 - 11:28 »
Hi, I have some problems with bass.net api using Visual Studio 10. When I try to run samples I have badImageformatexception HRESULT: 0x8007000B. I have added reference , lib files are the executable directory. Everything should work fine. I have also Visual Studio 2005 installed, may this be a problem?

The bass.dll is a 32 bit library. Just change the sample to a 32 bit program.

Project properties > Build tab > Platform target dropdown:
Change from "Any CPU" to x86  :)

Screenshot available @ http://lakerfield.eu/post/2011/03/04/BASSNET-BadImageFormatException.aspx

radio42

  • Posts: 4576
Re: BASS.NET API 2.4.7.3
« Reply #910 on: 12 Mar '11 - 19:32 »
12.03.2011: Version 2.4.7.3 is out!

BASSenc: added support for v2.4.8.0
Update to support all latest addon/plugin versions

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

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

mp3quiz

  • Guest
BassEnc.BASS_Encode_Start advice
« Reply #911 on: 16 Apr '11 - 14:02 »
Hi,

I'm wanting to encode mp3 and wav tracks to new wave file and be able to change the starting position and the length of the encoded wave file.

It appear that this meets my requirements:
Code: [Select]
BassEnc.BASS_Encode_Start(Stream2, "output.wav", BASSEncode.BASS_ENCODE_PCM, Nothing, IntPtr.Zero, 0)


However I do not want to hear the source file when encoding but I can only get output if the flag of Bass.BASS_StreamCreateFile is set to something other than "BASSFlag.BASS_STREAM_DECODE" and I hear the source.

Code: [Select]
this produces an empty file

Stream2 = Bass.BASS_StreamCreateFile("sometrack.mp3", 0, 0, BASSFlag.BASS_STREAM_DECODE)
Bass.BASS_ChannelPlay(Stream2, False)
BassEnc.BASS_Encode_Start(Stream2, "output.wav", BASSEncode.BASS_ENCODE_PCM, Nothing, IntPtr.Zero, 0)

this creates the file but I hear the source

Stream2 = Bass.BASS_StreamCreateFile("sometrack.mp3", 0, 0, BASSFlag.BASS_STREAM_AUTOFREE)
Bass.BASS_ChannelPlay(Stream2, False)
BassEnc.BASS_Encode_Start(Stream2, "output.wav", BASSEncode.BASS_ENCODE_PCM, Nothing, IntPtr.Zero, 0)

That's the first issue..

I then expect to be able to use code like this:

Code: [Select]
'Dim length As Integer = CInt(Bass.BASS_ChannelSeconds2Bytes(stream2, 0.03))
Dim startbyte As Long = Bass.BASS_ChannelSeconds2Bytes(stream2, 3.0)
Dim endbyte As Long = Bass.BASS_ChannelSeconds2Bytes(stream2, 10.0)
Dim totalbytes = endbyte - startbyte
Bass.BASS_ChannelSetPosition(stream2, startbyte, BASSMode.BASS_POS_BYTES)

to start the source at the start position, but what I cannot work out is how I would set a stopping position.

I'm guessing I would need a for loop to check on the current position and then when it was = > totalbytes stop the encoding. But I have no idea what the code inside the loop would need to be?

Would anyone be kind enough to steer me in the right direction to solve these two things?

Many thanks in advance
Mark

radio42

  • Posts: 4576
Re: BASS.NET API 2.4.7.3
« Reply #912 on: 19 Apr '11 - 19:18 »
BASS_ChannelPlay can not be used for decoding streams!
You instead need to call BASS_ChannelGetData to query the sample data from it.
This will also automatically 'feed' the encoder.
Take a look to the BASS_Encode_Start documentation, it should contain a sample.

qdc

  • Posts: 13
Re: BASS.NET API 2.4.7.3
« Reply #913 on: 5 May '11 - 11:00 »
since this is topic where everybody put their question about bass.net ive got mine
Is it even possible to make Waveform using Waveform class from buffer
i mean not out of file
there are plaenty of examples using Waveform on files or on file streams
i havent seen it used on "user sample stream" or on IntPtr
i tried doing it but havnt got any luck so far
is it possible to use for example this overload of renderstart method
WaveForm.RenderStart Method (Boolean, BASSFlag, IntPtr, Int64)
can you give me some simple example

radio42

  • Posts: 4576
Re: BASS.NET API 2.4.7.3
« Reply #914 on: 6 May '11 - 08:09 »
The WaveForm class needs a decoding stream to render the WaveForm from.
As such a decoding stream can either be created automatically when using a filename to create it from or you as the user must provide a valid decoding stream to it yourself.
So it is not possible to just give an IntPtr pointing to whatever data to the WaveForm class - you need to provide a valid decoding stream to the class.
But that one can of course be a user stream e.g. created via BASS_StreamCreate or BASS_StreamCreateUser.

muntablues

  • Posts: 196
Re: BASS.NET API 2.4.7.2
« Reply #915 on: 6 May '11 - 08:25 »
Hi Bernd

Your Waveform class has got the possibility to draw a HalfMono wave. Could you add HalfMonoFlip (or so)? I tried to RotateFlip myself but then the text is mirrored too *gg*

If you could add this feature it would be really great!

Thanks MB

Just want to ask again, if my wish is possible.

Thanks MB


radio42

  • Posts: 4576
Re: BASS.NET API 2.4.7.4
« Reply #916 on: 19 May '11 - 15:43 »
Can you explain a bit more what you mean by HalfMonoFlip?

radio42

  • Posts: 4576
Re: BASS.NET API 2.4.7.4
« Reply #917 on: 19 May '11 - 15:45 »
19.05.2011: Version 2.4.7.4 is out!

BASS: added support for v2.4.7.7
BASSCD: added support for v2.4.5.0
BASSMIDI: added support for v2.4.6.3
BASSenc: added support for v2.4.8.2
BASS_FX: added support for v2.4.7.0
Update to support all latest addon/plugin versions

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

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

Windows CE version:
  www.un4seen.com/filez/4/Bass24.Net_compact.zip

iPhone version:
  www.un4seen.com/filez/4/Bass24.Net_iphone.zip

muntablues

  • Posts: 196
Re: BASS.NET API 2.4.7.4
« Reply #918 on: 19 May '11 - 16:13 »
You have the possibility to draw the wave in HalfMono. Low level are on bottom of the pic and high on top. I would like to have a flipped one. high levels on bottom an low level on top.

Now I flip your picture in my app but then the text is flipped too and that is not really nice.

Here is a picture what i mean...


nr1

  • Posts: 78
Re: BASS.NET API 2.4.7.4
« Reply #919 on: 18 Jun '11 - 23:26 »
hello,

is there somewhere a c# .net example / demo app that demonstrates all the possibilities of visualizing a track by using the WaveForm class?

thx

nr1

  • Posts: 78
Re: BASS.NET API 2.4.7.4
« Reply #920 on: 19 Jun '11 - 12:37 »
No example available?

I would also need to create the WaveForm based on a bass stream on that it applied some filters before (low pass / high pass / etc.). Is this somehow possible?

radio42

  • Posts: 4576
Re: BASS.NET API 2.4.7.4
« Reply #921 on: 20 Jun '11 - 08:31 »
There are several samples provided with Bass.Net.
As written in the docs they are installed to your Application User Data directory.
Once Bass.Net is installed, simply open the windows start menu, select 'Programs' and located the installed program menu 'BASS.NET API for .Net'.
In this start menu you'll find a link to all provided samples.
Regarding the WaveForm - take a look to the sample called 'Simple'.

nr1

  • Posts: 78
Re: BASS.NET API 2.4.7.4
« Reply #922 on: 20 Jun '11 - 21:22 »
Yes i know the "simple" example, i just wanted to know if there is a demo app that shows all possibilities of the WaveForm class as the help shows a lot more features that aren't used in Simple demo.

Furthermore because of my
Quote
I would also need to create the WaveForm based on a bass stream on that it applied some filters before (low pass / high pass / etc.). Is this somehow possible?
question:
I can just find WaveForm constructors that need a filename. But i want to create the WaveForm based on a bass stream (that i put some dsp/fx effects on before).
Is this somehow possible?

radio42

  • Posts: 4576
Re: BASS.NET API 2.4.7.4
« Reply #923 on: 21 Jun '11 - 09:03 »
No, there is no sample which shows ALL features of the WaveForm class. But the docs contain a few more example codes.

There is no need to specify a FileName (see the default constructor).
However, the WaveForm class needs a decoding channel (see the overloads of the 'RenderStart' method) - as such you can prepare such a decoding channel and pass it to the 'RenderStart' method.
But note, that it will in any case render ALL the sample data of that decoding channel - meaning BASS_ChannelGetData is called internally in a loop until all data has been rendered!
Only when using a 'RenderStart' overload which doesn't have a 'decodingStream' parameter the 'FileName' property is used to create a decoding stream on the fly.


nr1

  • Posts: 78
Re: BASS.NET API 2.4.7.4
« Reply #924 on: 21 Jun '11 - 21:17 »
ok thx a lot it's working now:

(little excerpt for all with similar question:)
Quote
            wave = new WaveForm(null, new WAVEFORMPROC(MyWaveFormCallback), wavePictureBox);

            wave.RenderStart(_WaveChannel, false);


        private void MyWaveFormCallback(int framesDone, int framesTotal, TimeSpan elapsedTime, bool finished)
        {
            waveCalculationProgress = Convert.ToByte((framesDone / Convert.ToSingle(framesTotal))*100);

            if (finished)
                drawWave();
        }

        private void drawWave()
        {
            wavePictureBox.BackgroundImage = wave.CreateBitmap(wavePictureBox.Width, wavePictureBox.Height, -1, -1, true);
        }

One more question:
In the simple example when zooming a waveform a moving marker that shows the playing position is shown. I would need the other way round: The marker (playing position) is always in the middle, but the background (wave) is moving / scrolling. How to do this best?