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

ReymonARG

  • Posts: 41
Re: BASS.NET API 2.4.6.2
« Reply #725 on: 20 Feb '10 - 17:57 »
I, it posible to play audio from youtube?

If posible can leave an example?  ;)


Thanks.

radio42

  • Posts: 4576
Re: BASS.NET API 2.4.6.2
« Reply #726 on: 21 Feb '10 - 12:04 »
@inagy:
Yes, as stated in the docs, the "LoadMe" method uses the external windows "kernel32.dll", "LoadLibrary" method, which of course isn't supported on Linux - so under MonoDevelop/Linux you should always use the _GetVersion functions.

@ReymonARG:
Bass.Net doesn't support that yet - but you might take a look to the BASS_DSHOW add-on.

ReymonARG

  • Posts: 41
Re: BASS.NET API 2.4.6.2
« Reply #727 on: 22 Feb '10 - 15:56 »
@ReymonARG:
Bass.Net doesn't support that yet - but you might take a look to the BASS_DSHOW add-on.

Thanks.


Just a little question, I can use Bass.Midi to get the key press from a USB-Midi Interface?

If It posible I think that yes, because I read something like that in the "API OffLine Help", can you leave me a example, no problem if is in C. I am a C++ Developer but I am working now with C#.


Big Thanks.



radio42

  • Posts: 4576
Re: BASS.NET API 2.4.6.2
« Reply #728 on: 22 Feb '10 - 16:23 »
BASS.NET contains a "radio42.Multimedia.Midi" namespace, which contains various classes (like "Midi", "MidiShortMessage" etc.) which can be used to communicate with external Midi devices (like sending or receiving Midi short messages).
This is not to mixed up with the BASSmidi add-on, which can be used to playback midi files!

There is no ready made sample for the "radio42.Multimedia.Midi" namespace, but the documentation of BASS.NET contains various example code snippets on how to use it, e.g. like this one:
Using the MidiShortMessage with an MIDIINPROC:
Code: [Select]
using radio42.Multimedia.Midi;
...
private MIDIINPROC _midiProc;
private int _midiInHandle;
...
// Open the Midi device #2
_midiProc = new MIDIINPROC(MyMidiProc);
MIDIError ret = Midi.MIDI_InOpen(ref _midiInHandle, 2, _midiProc, IntPtr.Zero, MIDIFlags.MIDI_IO_STATUS);
if (ret == MIDIError.MIDI_OK)
{
  // supply the device with 2 buffers
  AddSysExBuffer(_midiInHandle, 1024);
  AddSysExBuffer(_midiInHandle, 1024);
  // Start the device
  ret = Midi.MIDI_InStart(_midiInHandle);
}
...
// when not needed anymore...stop the device
Midi.MIDI_InReset(_midiInHandle);
// and close the device
Midi.MIDI_InClose(_midiInHandle);
...
// prepare receiving system-exclusive messages
private void AddSysExBuffer(IntPtr handle, int size)
{
  // prepare a empty midi header
  MIDI_HEADER header = new MIDI_HEADER(size);
  header.Prepare(true, handle);
  // If the header was perpared successfully.
  if (header.HeaderPtr != IntPtr.Zero)
  {
    // Add the buffer to the InputDevice.
    Midi.MIDI_InAddBuffer(handle, header.HeaderPtr);
  }
}
...
private MidiShortMessage _shortMsg  = null;
private MidiSysExMessage _sysExMsg  = null;

public void MyMidiProc(IntPtr handle, MIDIMessage msg, IntPtr instance, IntPtr param1, IntPtr param2)
{
  // handle all Midi messages here
  if(msg == MIDIMessage.MIM_OPEN)
  {
    // nothing to do
  }
  else if(msg == MIDIMessage.MIM_CLOSE)
  {
    // handle is from now on invalid
  }
  else if(msg == MIDIMessage.MIM_DATA)
  {
    // process the message...
    _shortMsg = new MidiShortMessage(param1, param2, _shortMsg);
    Console.WriteLine(_shortMsg.ToString());
  }
  else if(msg == MIDIMessage.MIM_MOREDATA)
  {
    // we are not fast enough in this callback to keep up...
    // the input device is sending messages to fast
    ...
  }
  else if(msg == MIDIMessage.MIM_LONGDATA)
  {
    // process the message...
    // param1 will contain the pointer to the MIDI_HEADER
    _sysExMsg  = new MidiSysExMessage(true, handle, param1, _sysExMsg);
    if (_sysExMsg.IsDone)
    {
      Console.WriteLine(_sysExMsg.ToString());
    }
    // add a new buffer
    // since we must constantly provide new buffers until we finished recording
    AddSysExBuffer(handle, 1024);
  }
  else if(msg == MIDIMessage.MIM_ERROR)
  {
    // process the invalid message...
    ...
  }
  else if(msg == MIDIMessage.MIM_LONGERROR)
  {
    // process the invalid message...
    // param1 will contain the pointer to the MIDI_HEADER
    MIDI_HEADER header = new MIDI_HEADER(param1);
    header.Unprepare(true, handle);
    // add a new buffer
    // since we should constantly provide new buffers until we finished recording
    AddSysExBuffer(handle, 1024);
  }
}

Florentino

  • Guest
Re: BASS.NET API 2.4.6.2
« Reply #729 on: 24 Feb '10 - 22:33 »
Hello,
I'm trying to play ICEcast or Shoutcast streams using BASS.NET API. This worked fine until I did a upgrade to BASS.NET API 2.4.6.2 (and an upgrade of bass.dll to the current version as well). Since then I can't create a stream and I get error code BASS_ERROR_ILLPARAM.
Code: [Select]
           
Bass.BASS_Init(-1, 44100, BASSInit.BASS_DEVICE_DEFAULT, IntPtr.Zero))
int stream = Bass.BASS_StreamCreateURL("http://stream002.radio.hu/mr7.mp3", 0, BASSFlag.BASS_DEFAULT, null, IntPtr.Zero);
Bass.BASS_ChannelPlay(stream, false);
I tried multiple other stream urls but the result is always the same, the Bass.BASS_StreamCreateURL call returns 0 and the error code is BASS_ERROR_ILLPARAM: Does anybody know what is going wrong?
Thanks

radio42

  • Posts: 4576
Re: BASS.NET API 2.4.6.2
« Reply #730 on: 25 Feb '10 - 09:54 »
I have just tried your exact code here, but unfortunately I am unable to reproduce the issue.
Can please check in your debugger, if really the latest dlls of BASS.NET and BASS have been loaded?
May be some older/mixed versions have been loaded...

Florentino

  • Guest
BASS.NET API 2.4.6.2
« Reply #731 on: 25 Feb '10 - 17:57 »
Hello,
I replaced all bass.dll I found on my PC with the newest version. I deleted all older Bass.NET.dll as well. But the error persists. I updatet my test code:
Code: [Select]
Assembly ass = Assembly.GetAssembly(typeof(Bass));
Console.WriteLine("Bass.NET: " + ass.GetName().Version);
Console.WriteLine("Bass: " + Bass.BASSVERSION);
Bass.BASS_Init(-1, 44100, BASSInit.BASS_DEVICE_DEFAULT, IntPtr.Zero);
int stream = Bass.BASS_StreamCreateURL("http://stream002.radio.hu/mr7.mp3", 0, BASSFlag.BASS_DEFAULT, null, IntPtr.Zero);
if (stream != 0)
{
      // play the stream channel
      Bass.BASS_ChannelPlay(stream, false);
}
else
{
      // error creating the stream
      Console.WriteLine("Stream error: {0}", Bass.BASS_ErrorGetCode());
}
This outputs:

Bass.NET: 2.4.6.2
Bass: 516
Stream error: BASS_ERROR_ILLPARAM

So I'm quite sure that it's not caused by old or mixed dll versions, but I'm totally clueless. Any further idea?

radio42

  • Posts: 4576
Re: BASS.NET API 2.4.6.2
« Reply #732 on: 26 Feb '10 - 10:59 »
That really sounds strange.
What about the provided BASS.NET samples (especially the NetRadio one)?
Does they also generate the same error?

Florentino

  • Guest
Re: BASS.NET API 2.4.6.2
« Reply #733 on: 26 Feb '10 - 23:01 »
Hello,
I made some further analysis:
1. When I downgrade to Bass.NET 2.4.4.4 again, everything works fine again!
2. The NetRadio example works but only after installing BASSWMA.dll. In fact when I debugged the example I saw that the stream wasn't opened by Bass.BASS_StreamCreateURL (this fails), but by BassWma.BASS_WMA_StreamCreateFile
Any ideas?

Kobold

  • Guest
Re: BASS.NET API 2.4.6.2
« Reply #734 on: 1 Mar '10 - 11:08 »
Same error here: the result of Bass.BASS_StreamCreateURL is always 0.
Please fix this.

Regards, Kobold

radio42

  • Posts: 4576
Re: BASS.NET API 2.4.6.2
« Reply #735 on: 1 Mar '10 - 12:22 »
Can you please try to reproduce the problem with the latest pre-version:
www.un4seen.com/filez/4/Bass24.Net_pre.zip

Also make sure to use the latest BASS version, as Ian recently changed BASS_StreamCreateURL to support the UNICODE flag - which Bass.Net now uses by default.

Kobold

  • Guest
Re: BASS.NET API 2.4.6.2
« Reply #736 on: 1 Mar '10 - 15:25 »
I have try it, but same error.

radio42

  • Posts: 4576
Re: BASS.NET API 2.4.6.2
« Reply #737 on: 1 Mar '10 - 16:06 »
OKi, I just had a chat with Ian. The UNICODE flag isn't included in the official version yet.
So here is a new version of BASS.NET, in which I don't use the UNICODE flag anymore.
Please (re)download and try again:
www.un4seen.com/filez/4/Bass24.Net_pre.zip

Sorry for the confusion.

Kobold

  • Guest
Re: BASS.NET API 2.4.6.2
« Reply #738 on: 1 Mar '10 - 21:27 »
Thanks, problem solved.  ;)

Regards, Kobold

Speed78

  • Posts: 4
Re: BASS.NET API 2.4.6.2
« Reply #739 on: 1 Mar '10 - 23:07 »
Dear all,


I use this sample code to encode an internet-stream. My problem is that the MP3 Tag IDv2 will not be set although I used "objTag.tagType = BASSTag.BASS_TAG_ID3V2". Only the IDv1 Tag will be written. Is this a bug?


--------------------
      mobjEncoder = New EncoderLAME(mintStreamHandle)

      If Not IO.File.Exists("C:\1.mp3") Then
        mobjEncoder.OutputFile = "C:\1.mp3"
        mobjEncoder.LAME_Bitrate = EncoderLAME.BITRATE.kbps_128
        mobjEncoder.LAME_Mode = EncoderLAME.LAMEMode.Stereo
        mobjEncoder.LAME_TargetSampleRate = EncoderLAME.SAMPLERATE.Hz_44100
        mobjEncoder.LAME_Quality = EncoderLAME.LAMEQuality.Quality

        Dim objTag As New Un4seen.Bass.AddOn.Tags.TAG_INFO
        Dim intChannelData As IntPtr = Bass.BASS_ChannelGetTags(mintStreamHandle, BASSTag.BASS_TAG_META)

        If intChannelData = IntPtr.Zero Then
          Throw New Exception(Bass.BASS_ErrorGetCode.ToString)
        End If
        objTag.UpdateFromMETA(intChannelData, True, True)

        objTag.tagType = BASSTag.BASS_TAG_ID3V2

        mobjEncoder.TAGs = objTag
        mobjEncoder.Start(Nothing, IntPtr.Zero, False)
  End If
--------------------


Addionally I've 1-2 requests ;) or maybe can give me a short hint to solve my problem.

At the moment I get an internet stream and encode it to an mp3 file. I check if the output file exists. If the file doesn't exists I set the property "OutputFile" to a filename and write the ID-tags. If the file exists I use the Encoding-Callback Method to append the data to the file. The problem is if I append the data to the file the ID-Tag will not be used because (If I remember correctly) the ID-Tag (v1) will be set at the end of the file. So here my feature request(s)

1. Will it be possible in the future to write the tag whenever I want? At the moment I only can write tags to a new file (OutputFile must be set!). It will be usefull to write the tags later (Maybe if the Encoding is stopped)? OR

2. Will it be possible in the future to append an encoded file when "OutputFile" is set? OR

Does anybody have a better idea to solve my problem?

Kind regards

Rainer Budde


radio42

  • Posts: 4576
Re: BASS.NET API 2.4.6.2
« Reply #740 on: 2 Mar '10 - 11:29 »
No, that is not a bug, as the "tagType" is not evaluated by the command-line encoder.

Currently the following logic applies to the EncoderLAME:
If the "OutputFile" is not NULL and the "TAGs" property is set, than the '--tt', '--ta', '--tl', '--ty', '--tc', '--tn', '--tg' command-line options are set according to the given TAGs object.

This means the default tag settings options of lame.exe will apply, which are stated in the lame.exe help as follows:
Note: A version 2 tag will NOT be added unless one of the input fields won't fit in a version 1 tag (e.g. the title string is longer than 30 characters), or the '--add-id3v2' or '--id3v2-only' options are used, or output is redirected to stdout.

So if you want to enforce writing of ID3v2 tags, then you might simply add the following line to your code:
Code: [Select]
mobjEncoder.LAME_CustomOptions = "--add-id3v2"
Regarding your other questions:
No, there are no plans to add direct TAG editing to BASS.NET.
Currently only the tagging features as provided by the command-line encoders are supported, which means the appropriate tagging command-line options are set when calling/starting the encoder.
But it will not be possible with BASS or BASS.NET to modify the tags after the encoding has finished.
But you might simply use any other 3rd party tagging lib, if that is what you need?!
« Last Edit: 2 Mar '10 - 11:33 by radio42 »

Speed78

  • Posts: 4
Re: BASS.NET API 2.4.6.2
« Reply #741 on: 2 Mar '10 - 19:19 »
Thank you for your comment. With '--id3v2-only' I don't have a problem appending files. The reason for this is that the IDv2 Tag will be written at the beginning of a file. If I append some data I don't need to rewrite the file.

Kind regards

Rainer

mrRdo

  • Posts: 15
Re: BASS.NET API 2.4.6.2
« Reply #742 on: 9 Mar '10 - 01:07 »
I've been experiencing some strange results with the waveform marker names.

If I use MARKERDRAWTYPE.NamePositionTop, MARKERDRAWTYPE.NamePositionBottom or MARKERDRAWTYPE.NamePositionAlternate the names appear to be drawn outside of the visible waveform image... i.e. too high or too low.  The only one that produces a result that can be seen is the NamePositionMiddle.

I use the following code to set the draw style for the markers.

Code: [Select]
WF.DrawMarker = Misc.WaveForm.MARKERDRAWTYPE.Line Or Misc.WaveForm.MARKERDRAWTYPE.Name Or Misc.WaveForm.MARKERDRAWTYPE.NameBoxFillInverted Or Misc.WaveForm.MARKERDRAWTYPE.NamePositionAlternate
Anybody else experienced this?

radio42

  • Posts: 4576
Re: BASS.NET API 2.4.6.3
« Reply #743 on: 22 Mar '10 - 17:18 »
22.03.2010: Version 2.4.6.3 is out!

BASS: added support for v2.4.5.17
BASSmix: added support for v2.4.4.0
BASS_SFX: added support for v2.4.2.1
BASS_DSHOW: added support for v2.4.0.5
General:
  - Misc.WaveForm: rendering speed increased

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

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

radio42

  • Posts: 4576
Re: BASS.NET API 2.4.6.4
« Reply #744 on: 7 Apr '10 - 20:18 »
07.04.2010: Version 2.4.6.4 is out!

General:
  - Misc.WaveForm: zooming bug-fix

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

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

GMar

  • Posts: 1
Re: BASS.NET API 2.4.6.4
« Reply #745 on: 8 Apr '10 - 22:11 »
hi all

I'm new here


i downloaded viewon.TV that us bass.net 2.3.* after search i decide to upgrade to latest version, after changing dll i got some error about changes happen from version to version, so i start correcting them, now here is the problem:

where is: BASS_CD_GetDriveDescription
or
BASS_FX_DSPCOMPRESSOR
and so on ... (about 5 other i think)

some changes like : BASS_FX_DSP_GetParameters has been addressed
                                    "BASS_FX_DSP_GetParameters *removed* (use BASS_FXGetParameters)"
                           complete and clear

but what about others that changed and i have no clue about them!!? (nothing found about them in "BASS.NET Version History")

i searched posts and topics with no luck (try :BASS_FX_DSPCOMPRESSOR)
so I'm tired of try and need someone hand to bring me up.

(your dll is great: with no doubt)

thanks


radio42

  • Posts: 4576
Re: BASS.NET API 2.4.6.4
« Reply #746 on: 9 Apr '10 - 07:42 »
If you open the Bass.Net help (Bass.Net.chm) you'll find a complete chapter called "Upgrading from Previous Versions".
Here you'll find all your answers, e.g.:

BASSCD: BASS_CD_GetDriveDescription and BASS_CD_GetDriveLetter removed
Use BASS_CD_GetInfo to retrieve the drive letter and description

BASS_FX: BASS_FX_DSP_xxx
BASS_FX now uses the BASSFX plugin system (see BASS_ChannelSetFX, BASS_FXGetParameters, BASS_FXSetParameters, BASS_ChannelRemoveFX, BASS_FXReset). The effect names, structure names, flags are changed e.g: BASS_FX_DSPFX_PHASER to BASS_FX_BFX_PHASER, BASS_BFX_PHASER to BASS_BFX_PHASER (Exception BASS_FX_DSPFX_SWAP renamed to BASS_FX_BFX_MIX; BASS_FX_DSPFX_S2M removed). The BASS_FX_BFX_MIX effect also has a new behavior!

bober

  • Guest
Re: BASS.NET API 2.4.6.4
« Reply #747 on: 14 Apr '10 - 01:19 »
Doesnt work under VB.net 2010

radio42

  • Posts: 4576
Re: BASS.NET API 2.4.6.4
« Reply #748 on: 14 Apr '10 - 08:41 »
What "doesn't work"?
You can always open the Bass.Net.chm file manually from the windows start menu in the Bass.Net API entry.

MarquelMedia

  • Posts: 7
Re: BASS.NET API 2.4.6.4
« Reply #749 on: 15 Apr '10 - 00:51 »
Using C# Express 2008....

I created an app that recieves and plays an internet stream (Internet Radio Player)...

The app works fine on my system.... i deploy the application via clickonce to my server and had 4 separate people download and install the program, however on their machines the audio will not play!!!!

1.) I have referenced the Bass.Net.dll in my program
2.) I have included the bass.dll file to be copied to my output folder

*** AND BOTH ARE THERE - EVEN ON THE END USERS PC's ***

3.) I went back and tried with adding the >>> basswma.dll <<< and using that to call the stream. !no sucess here!
4.) I tride to use >>> Bass.LoadMe("bass.dll"); <<< !no sucess here either!

I tried all i can think of and i get the same results: audio plays on my pc / does not play on other pc's!!!!!

Please Help... As I Have A Deadline Im Trying To Meet....

Code Sippet:

Code: [Select]
....

namespace MyPlayer
{
    public partial class Content : Form
    {
       
        public class Player
        {
            int stream;
            public Player()
            {
                Bass.BASS_Init(-1, 44100, BASSInit.BASS_DEVICE_DEFAULT, System.IntPtr.Zero);
            }
            public void LoadURL(string url)
            {
                stream = Bass.BASS_StreamCreateURL(url, 0, BASSFlag.BASS_SAMPLE_FLOAT, null, System.IntPtr.Zero);
               
// stream = BassWma.BASS_WMA_StreamCreateURL(url, 0, 0, BASSFlag.BASS_SAMPLE_FLOAT);

            }
            public void PlaySong(bool loop)
            {
                Bass.BASS_ChannelPlay(stream, false);
            }
            public void StopSong()
            {
                Bass.BASS_ChannelStop(stream);
            }
            ~Player()
            {
                Bass.BASS_Free();
            }
        }

....

private int SigStat;
        Player player;       

....

public void SChk(string host)
        {
            try
            {
                Ping ping = new Ping();
                PingReply reply = ping.Send(host);

                if (reply.Status == IPStatus.Success)
                {

                    if (SigStat == 0)
                    {
                   
                        SigStat = 1;

                        this.timer2 = new System.Timers.Timer(5000);
                        this.timer2.AutoReset = false;
                        this.timer2.Elapsed += new ElapsedEventHandler(ProcessTimerEvent2);
                        this.timer2.Start();

                        webBrowser1.Navigate(new Uri(ResourcePath2 + "\\index.html"));
                        player.LoadURL("http://pathtomystation");
                        player.PlaySong(false);
                       
                       
                    }
                    else if (SigStat == 2)
                    {
                     
                        SigStat = 1;

                        this.timer2 = new System.Timers.Timer(10000);
                        this.timer2.AutoReset = false;
                        this.timer2.Elapsed += new ElapsedEventHandler(ProcessTimerEvent2);
                        this.timer2.Start();

                        webBrowser1.Navigate(new Uri(ResourcePath2 + "\\index.html"));
                        player.LoadURL("http://pathtomystation");
                        player.PlaySong(false);                       
                    }
                    else
                    {
                     
                        this.timer2 = new System.Timers.Timer(10000);
                        this.timer2.AutoReset = false;
                        this.timer2.Elapsed += new ElapsedEventHandler(ProcessTimerEvent2);
                        this.timer2.Start();
                       
                    }                                                           
                   

                }
catch (System.Net.NetworkInformation.PingException e)
            {
                if (SigStat == 1)
                {
                    SigStat = 0;

                    this.timer2 = new System.Timers.Timer(7000);
                    this.timer2.AutoReset = false;
                    this.timer2.Elapsed += new ElapsedEventHandler(ProcessTimerEvent2);
                    this.timer2.Start();

                    webBrowser1.Navigate(new Uri(ResourcePath2 + "\\index2.html"));
                    player.StopSong();
                }
                if (SigStat == 0)
                {
                    //MessageBox.Show("Sorry... But There Are Problems With Your Internet Connection. Please Check Your Connection And Settings.");
                    this.timer2 = new System.Timers.Timer(7000);
                    this.timer2.AutoReset = false;
                    this.timer2.Elapsed += new ElapsedEventHandler(ProcessTimerEvent2);
                    this.timer2.Start();

                    webBrowser1.Navigate(new Uri(ResourcePath2 + "\\index2.html"));
                    SigStat = 2;
                    player.StopSong();
                }
                else
                {
                    this.timer2 = new System.Timers.Timer(10000);
                    this.timer2.AutoReset = false;
                    this.timer2.Elapsed += new ElapsedEventHandler(ProcessTimerEvent2);
                    this.timer2.Start();
                }
            }
        }

public Content()
        {
            InitializeComponent();
            BassNet.Registration("xxxx@xxxx.xxx", "xxxxxxxxxxxxxxxxx");
            //Bass.LoadMe("bass.dll");
            //Bass.LoadMe("basswma.dll");
            player = new Player();

            #region Declare & Implement Window Tooltips

            ToolTip toolTip1 = new ToolTip();
            toolTip1.AutoPopDelay = 6000;
            toolTip1.InitialDelay = 100;
            toolTip1.ReshowDelay = 100;
            toolTip1.ShowAlways = true;
            toolTip1.SetToolTip(this.button1, "Exit");
            toolTip1.SetToolTip(this.button2, "Minimize");

            #endregion

            #region Start Network Connection Testing

            Signal = new Thread(new ThreadStart(SignalCheck));
            Signal.Start();

            #endregion

        }

public void Content_Load(object sender, EventArgs e)
        {
            SigStat = 0;
        }

public void SignalCheck()
        {
            timer1.AutoReset = true;
            timer1.Elapsed += new ElapsedEventHandler(ProcessTimerEvent);
            timer1.Start();
        }

        public void ProcessTimerEvent(Object obj, ElapsedEventArgs e)
        {           
            SChk("http://pathtomystation");
        }

......




Like I said... all works well on my pc and the audio plays..

..but on other people's pc, my app loads up with everything running and functional except they don't get/hear any audio???