Author Topic: Two question about bass, hurry !  (Read 305 times)

terry_zhou82

  • Posts: 19
Two question about bass, hurry !
« on: 12 Jun '17 - 16:07 »
hello,guy
I'm a fans of  bass.dll  ;D,but today,I've two question,Can you help me? I use the Delphi.
1. how to support  .asx file? like: http://www.xxx.com/32.asx
I Use the basswma.dll and basswma.pas.and in the code. I wrote like this

BASS_PluginLoad('basswma.dll', 0);
BASS_SetConfig(BASS_CONFIG_WMA_ASX,0); // show error.as below:
//[DCC Error] Unit1.pas(237): E2003 Undeclared identifier: '  BASS_SetConfig'
[DCC Error] Unit1.pas(237): E2003 Undeclared identifier: 'BASS_CONFIG_WMA_ASX'

BASS_SetConfig(BASS_CONFIG_NET_PLAYLIST, 1); // enable playlist processing
BASS_SetConfig(BASS_CONFIG_NET_PREBUF, 0); // minimize automatic pre-buffering, so we can do it (and display it) instead

what can i do ?

2. I want to now how many times passed as I begin to play the mp3 file or International Radio times ?
I want to show it like this :playing(00:02)

Thank you un4seen
I'm waitting for your early reply.
 

Ian @ un4seen

  • Administrator
  • Posts: 20336
Re: Two question about bass, hurry !
« Reply #1 on: 12 Jun '17 - 17:12 »
1. how to support  .asx file? like: http://www.xxx.com/32.asx
I Use the basswma.dll and basswma.pas.and in the code. I wrote like this

BASS_PluginLoad('basswma.dll', 0);
BASS_SetConfig(BASS_CONFIG_WMA_ASX,0); // show error.as below:
//[DCC Error] Unit1.pas(237): E2003 Undeclared identifier: '  BASS_SetConfig'
[DCC Error] Unit1.pas(237): E2003 Undeclared identifier: 'BASS_CONFIG_WMA_ASX'

BASS_SetConfig(BASS_CONFIG_NET_PLAYLIST, 1); // enable playlist processing
BASS_SetConfig(BASS_CONFIG_NET_PREBUF, 0); // minimize automatic pre-buffering, so we can do it (and display it) instead

what can i do ?

BASS_CONFIG_WMA_ASX isn't a valid option (since BASSWMA 2.4). You can just set BASS_CONFIG_NET_PLAYLIST to 1 to add support for ASX in BASS_StreamCreateURL when BASSWMA is loaded.

2. I want to now how many times passed as I begin to play the mp3 file or International Radio times ?
I want to show it like this :playing(00:02)

You can use BASS_ChannelGetPosition and BASS_ChannelBytes2Seconds to get that, like this:

Code: [Select]
QWORD bytepos = BASS_ChannelGetPosition(handle, BASS_POS_BYTE); // get current position in bytes
double secpos = BASS_ChannelBytes2Seconds(handle, bytepos); // translate it to seconds

terry_zhou82

  • Posts: 19
Re: Two question about bass, hurry !
« Reply #2 on: 13 Jun '17 - 04:34 »
can you give me a code of asx? thankyou  :'(

terry_zhou82

  • Posts: 19
Re: Two question about bass, hurry !
« Reply #3 on: 13 Jun '17 - 09:24 »
@un4seen
thank you ,the time problem i can solved.but the asx is doesn't , I got the example from your netradio . the code  as below
.....
  chan := BASS_StreamCreateURL(PWideChar(url), 0, BASS_STREAM_BLOCK or BASS_STREAM_STATUS or BASS_STREAM_AUTOFREE, @StatusProc, nil);  // in this code ? I add the code of asx ? or not
.....
    DoMeta();
    BASS_ChannelSetSync(chan, BASS_SYNC_META, 0, @MetaSync, nil);
    // play it!
    BASS_ChannelPlay(chan, FALSE);
  end;
  cthread := 0;
end;

thank you  sir

Chris

  • Posts: 1808
Re: Two question about bass, hurry !
« Reply #4 on: 13 Jun '17 - 15:02 »
Quote
.....
  chan := BASS_StreamCreateURL(PWideChar(url), 0, BASS_STREAM_BLOCK or BASS_STREAM_STATUS or BASS_STREAM_AUTOFREE, @StatusProc, nil);  // in this code ? I add the code of asx ? or
something like this
Code: [Select]
BASS_SetConfig(BASS_CONFIG_NET_PLAYLIST, 1); // enable playlist processing
url := 'xx.com/test.asx';
chan := BASS_StreamCreateURL(PWideChar(url), 0, BASS_STREAM_BLOCK or BASS_STREAM_STATUS or BASS_STREAM_AUTOFREE, @StatusProc, nil);

terry_zhou82

  • Posts: 19
Re: Two question about bass, hurry !
« Reply #5 on: 13 Jun '17 - 15:49 »
think you for your code
but it does not work...maybe i have another error ?

Ian @ un4seen

  • Administrator
  • Posts: 20336
Re: Two question about bass, hurry !
« Reply #6 on: 13 Jun '17 - 16:20 »
Are still loading BASSWMA.DLL via BASS_PluginLoad? If not, you should do so. Also check the return value of each call, and use BASS_ErrorGetCode to get an error code in case of a failure. If you're having the problem with a particular URL, please tell what that is.

terry_zhou82

  • Posts: 19
Re: Two question about bass, hurry !
« Reply #7 on: 14 Jun '17 - 02:15 »
thank you sir,
I'm loading basswam.dll on formcreate  //I use the delphi
the website is true, I use the windows media player can play
and the bass_errorget code is 41  //unkonwn file type

O, I don't know,where's my code error?

Are still loading BASSWMA.DLL via BASS_PluginLoad? If not, you should do so. Also check the return value of each call, and use BASS_ErrorGetCode to get an error code in case of a failure. If you're having the problem with a particular URL, please tell what that is.

Ian @ un4seen

  • Administrator
  • Posts: 20336
Re: Two question about bass, hurry !
« Reply #8 on: 14 Jun '17 - 17:01 »
Is the BASS_PluginLoad call reporting success, ie. non-0 return value? If so, please post the URL that you are having the problem with.