- NSIS Discussion
- BassMOD syntax for streaming a wma
Archive: BassMOD syntax for streaming a wma
grahama
25th October 2004 04:11 UTC
BassMOD syntax for streaming a wma
Does this seem like plausible syntax for streaming a wma with BassMod ?
Kind of like fixing my car by throwing a wrench at it ;)
System::Call /NOUNLOAD "BASSMOD::BASS_StreamCreateURL\(PChar('http://64.236.34.97:80/stream/1012'+#0),0,BASS_STREAM_BLOCK,nil,0)"
grahama
25th October 2004 04:26 UTC
I tried this as a macro
!macro BASSMOD_STREAMPLAY
System::Call 'BASSMOD::BASS_StreamCreateURL(PChar($\'http://64.236.34.97:80/stream/1012$\'+#0),0,BASS_STREAM_BLOCK,nil,0)'
!macroend
grahama
25th October 2004 04:28 UTC
got a 'encountered a systems error and needs to quit' Thought I might get lucky ;)
kichik
25th October 2004 18:56 UTC
PChar? System doesn't work with Pascal syntax ;)
Use simple quotes, the string passed is already "PChar".
Also replace nil with 0 and BASS_STREAM_BLOCK with its real value.
grahama
25th October 2004 19:21 UTC
this a little closer?
!macro BASSMOD_WMASTREAMPLAY
grahama
25th October 2004 19:25 UTC
System::Call 'BASSMOD::BASS_StreamCreateURL("http://www.mysite.com/afile.wma", 0, 0, NULL, 0)'
!macroend
grahama
25th October 2004 21:05 UTC
tried this..but it is not yet working
!include BassMod.nsi
Function .onInit
InitPluginsDir
File bassmod.dll
!insertmacro BASSMOD_Init
!insertmacro BASSMOD_MusicLoad
Section
System::Call 'BASSMOD::BASS_STREAMCREATEURL("http://www.siren.cc/Univision/fonovisa/DavidRolas_Coqueta.wma",0,0,NULL,0)'
SectionEnd
grahama
26th October 2004 00:40 UTC
replaced the NULL with 0...not quite working yet...
BASSMOD::BASS_STREAMCREATEURL("http://www.siren.cc/Univision/fonovisa/DavidRolas_Coqueta.wma",0,0,0,0)'
deguix
26th October 2004 03:21 UTC
First of all, BASSMOD doesn't support WMA, but BASSWMA does.
Second, you should define each parameter type for each one of the parameters. Like this out-topic example:
System::Call "user32::MessageBox(i $HWNDPARENT, t 'NSIS System Plug-in', t 'Test', i 0)"
I suggest you to try this below (not tested):
System::Call 'BASSWMA::BASS_WMA_StreamCreateFile(i,t "http://www.siren.cc/Univision/fonovisa/DavidRolas_Coqueta.wma",i,i,i)'
grahama
26th October 2004 04:51 UTC
no...that was a no go too :(
Do I need to call another !macro to get the stream to play. Should play automatically I from what I have read....Sure there are some on the list who have attempted this :)
grahama
26th October 2004 19:03 UTC
I posted this on the Bass forum too...
if they give me answer, I'll post it here
grahama
26th October 2004 20:32 UTC
got this back from the BASS forum:
I don't know how to make NSIS call a function from a DLL, but if it is how you say, that should work fine. Although I don't know if the "i" in there first, third, fourth and fifth parameters is just for showing purposes, because if they are like that in the source code, that seems wrong.
deguix
26th October 2004 22:21 UTC
The dll I'm using is BASSWMA:
BASSWMA 2.0 (.0.4)
An extension to BASS, enabling the playback of WMA files and streams, and also WMA file encoding and network broadcasting. Requires the Windows Media Format modules, which come installed with Windows Media Player, or can be installed separately (wmfdist.exe). C/C++, Visual Basic, Delphi and MASM APIs are included.
To work, the dll has to be in the same folder as your script at the time you compile it.
The "i"'s are parameter types, which are "integers". The same is for "t" which is "pointer to the first character of string". Maybe this is quite complicated for you, but it's how it works.
no...that was a no go too
Do I need to call another !macro to get the stream to play. Should play automatically I from what I have read....Sure there are some on the list who have attempted this
This is not another macro, this is a plugin call.
Sorry if sometimes I'm rude. I before didn't even know what System plugin was. Now that I'm pretty familiar with it, I can make a real use of it.
grahama
26th October 2004 22:57 UTC
not necessarily complicated...just new :)
I'll put the plugins in the project folder and see how it goess
grahama
27th October 2004 21:08 UTC
not quite working yet...
no errors...just not launching the wma
I posted this code to the BASS forum to...
OutFile "example.exe"
!include BassMod.nsi
;
Function .onInit
InitPluginsDir
SetOutPath $PLUGINSDIR
File "bassmod.dll"
File "basswma.dll"
!insertmacro BASSMOD_Init
System::Call "BASSWMA::BASS_WMA_StreamCreateFile(i,'http://www.siren.cc/Univision/fonovisa/DavidRolas_Coqueta.wma',i,i,i)"
FunctionEnd
;
Function .onGUIEND
!insertmacro BASSMOD_Free
FunctionEnd
;
Section
;dummy
SectionEnd
deguix
28th October 2004 00:47 UTC
You forgot a t before 'http://www.siren.cc/Univision/fonovisa/DavidRolas_Coqueta.wma', like my code mentions.
I posted this code to the BASS forum to...
Since when they can read NSIS syntax. It is quite difficult to have NSIS help on other sites than this forums. NSIS support is only available right here.
grahama
28th October 2004 05:07 UTC
yep...added the 't' to no avail
Why I posted the code....
thought there might be some NSIS folks on the base forum...who had figured this one out. Nsis is pretty easy to read and the code I posted is pretty cut and dried.
many thanks
g
deguix
28th October 2004 12:20 UTC
What is !insertmacro BASSMOD_Init and !insertmacro BASSMOD_Free on your code, initializing BASSMOD which shouldn't exist in your code for WMA? Didn't I tell you why BASSMOD isn't the correct plugin for your code?
grahama
28th October 2004 20:39 UTC
yes...I'm sure you did
on the bass forum, someone said you needed the bass [not BassMod] to work in conjunction with basswma..here is newest post from the Bass forum I try to incorporate :)
Todays Post:
As I expected, you've confused two things. Bassmod is for playing MOD-type files. It is cross-platform, but not with as many features. In order to use BassWMA, you need to use Bass, not Bassmod. Your script should be something like this (though I'm not very sure about the syntax):
OutFile "example.exe"
;
Function .onInit
InitPluginsDir
SetOutPath $PLUGINSDIR
File "bass.dll"
File "basswma.dll"
System::Call "BASS::BASS_Init(i, i, i, i, i) i(1, 44100, 0, 0, 0).r0"
; figure out if there's an error in r0, or whatever...
System::Call "BASSWMA::BASS_WMA_StreamCreateFile(i, t, i, i, i) i(0,'http://www.siren.cc/Univision/fonovisa/DavidRolas_Coqueta.wma',0,0,0).r0"
; figure out if there's an error in r0, or whatever...
System::Call "BASS::BASS_StreamPlay(i, i, i) i(r0, 0, $(BASS_SAMPLE_LOOP)).r0"
; figure out if there's an error in r0, or whatever...
FunctionEnd
;
Function .onGUIEND
System::Call "BASS::BASS_Free()"
FunctionEnd
;
Section
;dummy
SectionEnd