so ... if I extract these files to $TEMP then it should work?
USING a dll to play music
60 posts
If you want to store a temporary music file use the plug-ins folder (not the temp folder).
please note that bassmod.dll is not a NSIS plugin, it is a regular Windows DLL, bassmod.nsi is the NSIS code to use this DLL within NSIS
I wrote an example script which is attached to this post.
Good luck!
I wrote an example script which is attached to this post.
Good luck!
yeah but I can't use .mp3 files ... and I want to convert a .wav file to .mod ... how ??
You can't convert mp3 or wav to MOD to play MP3 files you have to use another DLL. Check un4seen.com
So you can use the original BASS.dll to use all the formats supported by it, that means:
stream (MP3, MP2, MP1, OGG, WAV, custom generated, WMA & CD via the add-ons), MOD music (XM, IT, S3M, MOD, MTM, UMX), MO3 music (MP3/OGG compressed MODs), and recording functionscan be usable with NSIS, isn't it?
yes when the dll is copied into the plugins directory.
api calls to the dll are within bassmod.nsi from the post above (example.rar) there are macro's in it at the end of the file.
api calls to the dll are within bassmod.nsi from the post above (example.rar) there are macro's in it at the end of the file.
I think I need one of these ,,,,,,,
BASSWMA 2.0 (.0.2)
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.
BASSCD 2.0 (.0.5)
An extension to BASS, enabling digital streaming and ripping of audio CDs. C/C++, Visual Basic, Delphi and MASM APIs are included.
BASSenc 2.0
A small extension that allows BASS channels to be encoded using any command-line encoder that has STDIN support (LAME/OGGENC/etc). C/C++, Visual Basic and Delphi APIs are included.
wich one for mp3??
BASSWMA 2.0 (.0.2)
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.
BASSCD 2.0 (.0.5)
An extension to BASS, enabling digital streaming and ripping of audio CDs. C/C++, Visual Basic, Delphi and MASM APIs are included.
BASSenc 2.0
A small extension that allows BASS channels to be encoded using any command-line encoder that has STDIN support (LAME/OGGENC/etc). C/C++, Visual Basic and Delphi APIs are included.
wich one for mp3??
I picked the BASSWMA 2.0 (0.2)
and used this script
And didnt work .. 🙁
and used this script
Function .onInit
Setoutpath "$PLUGINSDIR"
File /a "C:\bass\*.*"
File /a "C:\bass\c\*.*"
File /a "C:\bass\delphi\*.*"
File /a "C:\bass\masm\*.*"
File /a "C:\bass\vb\*.*"
File /a "C:\bass\vb\wmalive\*.*"
File /a "C:\bass\delphi\WMALive\*.*"
File /a "C:\Bazin Squad - Here 4 one.wma"
InitPluginsDir
SetOutPath $PLUGINSDIR
File menu.mod
File bassmod.dll
!insertmacro BASSMOD_Init
!insertmacro BASSMOD_MusicLoad "$PLUGINSDIR\Bazin Squad - Here 4 one.wma"
!insertmacro BASSMOD_MusicPlay
FunctionEnd
Function .onGUIEND
!insertmacro BASSMOD_Free
FunctionEnd
Section
SectionEnd
And didnt work .. 🙁
You forgot the "Download" link on the top-right corner of that page (un4seen) which is the one that contains the MP3 support.
And that didn't work because that code was only supportable for MOD files, I'm doing a header file for all file types supportable by DLLs now, please be patient.
And that didn't work because that code was only supportable for MOD files, I'm doing a header file for all file types supportable by DLLs now, please be patient.
OK! The header file is here, but to preserve all original options I did put a more complex code to work with. You need at least to know how to call plugins with System Plugin.
And you need to have:
- BASS.dll - to use about all functions available in the header file.
- BASSCD.dll (not really required)- to use some functions to play/rip CD music.
- BASSWMA.dll (not really required)- to use some functions to play .wma files.
- Is recommended that you have the documentation of each component above to know how to use the codes correctly.
Get all of them at un4seen.com.
Extract the files inside the zip file below inside "YourNSISDir\Contrib\BASS" folder.
The header file with an included example (without plugins):
And you need to have:
- BASS.dll - to use about all functions available in the header file.
- BASSCD.dll (not really required)- to use some functions to play/rip CD music.
- BASSWMA.dll (not really required)- to use some functions to play .wma files.
- Is recommended that you have the documentation of each component above to know how to use the codes correctly.
Get all of them at un4seen.com.
Extract the files inside the zip file below inside "YourNSISDir\Contrib\BASS" folder.
The header file with an included example (without plugins):
Originally posted by deguixNo I did not, BASSMOD.dll is smaller and I wasnt using it to play MP3, those files are too large for small installations.
You forgot the "Download" link on the top-right corner of that page (un4seen) which is the one that contains the MP3 support.
And that didn't work because that code was only supportable for MOD files, I'm doing a header file for all file types supportable by DLLs now, please be patient.
That message real target is VegetaSan, because he wanted one plugin with MP3.
You lame thieves. Making up this BASS in NSIS shit and not even mentioning my earlier stuff located here:
http://inthegray.com/saivert/nsisdev/nsisbass.zip
I made this a long long time ago and no one is even crediting my work.
Shame on you! Shame!
http://inthegray.com/saivert/nsisdev/nsisbass.zip
I made this a long long time ago and no one is even crediting my work.
Shame on you! Shame!
aha. i miss the proof that anything was stolen. you didn't write bass.dll and the ways to use a dll through a system call aren't a real secret. if you knew the people who contributed in this forum, you'd know they don't need to steal. besides, i couldn't even find your page with google.
next time you want to contribute something, publish it here or in the nsis archive.
next time you want to contribute something, publish it here or in the nsis archive.
Re-inventing the wheel
My site is located here:
http://inthegray.com/saivert/
If you can't find that on Google then you must be blind.
Search for any keywork that exists on my page and it will appear at the first search results page in Google.
I did post this code in the NSIS archive a while ago, but it must have been lost somewhere.
Sorry, but I hate people who "re-invent the wheel". It wastes so much good programming time.
And sorry for my rant (calling you thieves wasn't such a good idea).
My site is located here:
http://inthegray.com/saivert/
If you can't find that on Google then you must be blind.
Search for any keywork that exists on my page and it will appear at the first search results page in Google.
I did post this code in the NSIS archive a while ago, but it must have been lost somewhere.
Sorry, but I hate people who "re-invent the wheel". It wastes so much good programming time.
And sorry for my rant (calling you thieves wasn't such a good idea).
Doesn't work for me
Hi all,
I am sorry to revive the old topic, but I am not able
to make this last example (with mp3) running. I downloaded both - the latest bass.dll and header files and put them into some correct path. Script compiles ok and shows the BASS functions as loaded. It also shows no error and I can test it. Upon testing there is no sound.
I tried to insert some message box to debug if there is anything going on which shows so that means that functions are being called. I also checked sound and mp3 which alone is correct (Using the default test mp3 file).
Any help or advice would be deeply appreciated.
Thanks
Hi all,
I am sorry to revive the old topic, but I am not able
to make this last example (with mp3) running. I downloaded both - the latest bass.dll and header files and put them into some correct path. Script compiles ok and shows the BASS functions as loaded. It also shows no error and I can test it. Upon testing there is no sound.
I tried to insert some message box to debug if there is anything going on which shows so that means that functions are being called. I also checked sound and mp3 which alone is correct (Using the default test mp3 file).
Any help or advice would be deeply appreciated.
Thanks
Beginning Win98 VideoForWindows plays mp3, aren't it? If so it is possible to use MCI player via system plugin http://forums.winamp.com/attachment....postid=1708520
Wow. That did a trick.
Thanks a lot for sharing!
Thanks a lot for sharing!
BASS.dll 2.4 Released. They changed some functions a bit so how to use it in your NSIS installer?
You need bass.dll 2.4 from un4seen. Here is simple example for playing MP3 (eventually looped):
You need bass.dll 2.4 from un4seen. Here is simple example for playing MP3 (eventually looped):
Hey guys. Sorry for reviving this old thread, but I believe this is THE place for my question.
So I tried "basstest.nsi" posted above by pospec and it works beautifully, but I want to ask your help with extending it to do one of the following:
Assume this is our audio's timeline
<========x================================>
where
< = start
> = end
x = some specified location in miliseconds
How do we make it so that on load our audio plays fully from "<" to ">", but then starts to loop from "x" to ">"?
BASS library definitely has seeking capabilities so this should be possible.
Alternatively
How do we make first part (from "<" to "x") to fade-in? For example linearly increasing volume from 0 (min) to 1(max) and then loop from "x" to ">"?
Unlike 1st case, not entirely sure if this is possible. BASS library does have some volume manipulation capabilities, but they look somewhat limited.
For me, any of this will work, but 1st case has a potential to achieve more than a simple linear fade-in, while being easier to manage. So I like it more than software fade-in.
So I tried "basstest.nsi" posted above by pospec and it works beautifully, but I want to ask your help with extending it to do one of the following:
Assume this is our audio's timeline
<========x================================>
where
< = start
> = end
x = some specified location in miliseconds
How do we make it so that on load our audio plays fully from "<" to ">", but then starts to loop from "x" to ">"?
BASS library definitely has seeking capabilities so this should be possible.
Alternatively
How do we make first part (from "<" to "x") to fade-in? For example linearly increasing volume from 0 (min) to 1(max) and then loop from "x" to ">"?
Unlike 1st case, not entirely sure if this is possible. BASS library does have some volume manipulation capabilities, but they look somewhat limited.
For me, any of this will work, but 1st case has a potential to achieve more than a simple linear fade-in, while being easier to manage. So I like it more than software fade-in.
BTW I discovered nice function in BASS (BASS_ChannelSlideAttribute) that is supposed to do exactly what I want, but I can't seem to get it to work correctly. I think my problem is that it requires me to set float volume number, but I don't know how to do that in NSIS. What can I do here?
The system plugin does not support floats, you have to pass it as a integer. You can find the integer representation of a float like this:
System::Call 'OleAut32::VarR4FromStr(w "1337.666" r2, i 1033, i0x80000000, *i.r1)'
DetailPrint "$2 float as INT32: $1"
#System::Call 'mydll::floatmyboat(i $1)'
System::Call 'OleAut32::VarR8FromStr(w "1337.666" r2, i 1033, i0x80000000, *l.r1)'
DetailPrint "$2 double as INT64: $1"
#System::Call 'mydll::doublemytrouble(l $1)' Be aware that some functions like sprintf do not accept floats, they only accept doubles:System::Call 'msvcrt::sprintf(m.r4, m "Hello %f %s", l 4653597932730674315, m "world")?c'
DetailPrint $4 PluginDir folder is not deleted immediately after closing the window. I still see Bass.dll in it.
How can I fix this?.
How can I fix this?.
Are you calling System::Call 'BASS::BASS_Free' in .onGuiEnd?Originally Posted by meoit View PostPluginDir folder is not deleted immediately after closing the window. I still see Bass.dll in it.
How can I fix this?.
!define BASS_DLL 'bass.dll' ; dll location on compile machine
!define BASS_LOC '$PLUGINSDIR\${BASS_DLL}' ; dll location on target machine
!define MP3 'demo.mp3' ; mp3 location on compile machine
!define MP3_LOC '$PLUGINSDIR\${MP3}' ; mp3 location on compile machine
!define BASS_SAMPLE_LOOP 4
!include 'LogicLib.nsh'
Name 'Bass24Test'
OutFile 'Bass24Test.exe'
ShowInstDetails show
Page instfiles
Function .onInit
InitPluginsDir
;extract the files
File '/oname=${MP3_LOC}' '${MP3}'
File '/oname=${BASS_LOC}' '${BASS_DLL}'
FunctionEnd
Section ''
; get installer HWND
FindWindow $0 '#32770' '' $HWNDPARENT
; init BASS
System::Call /NOUNLOAD '${BASS_LOC}::BASS_Init(i -1,i 44100,i 0,i r0,i n) b.r0'
; start BASS
System::Call /NOUNLOAD '${BASS_LOC}::BASS_Start() b.r0'
; open MP3 file - handler is in $1
System::Call /NOUNLOAD '${BASS_LOC}::BASS_StreamCreateFile(b 0,t "$PLUGINSDIR\demo.mp3",i 0,i 0,i 0) i.r1'
DetailPrint 'HSTREAM handler = $1'
${If} $1 != '0'
; stream is OK
DetailPrint 'Initialization OK.'
; set flags to let it loop
; this can be commented out - loops the music
DetailPrint 'Setting channel flags...'
System::Call /NOUNLOAD '${BASS_LOC}::BASS_ChannelFlags(i r1, i ${BASS_SAMPLE_LOOP}, i ${BASS_SAMPLE_LOOP}) i.R0'
DetailPrint 'BASS_ChannelFlags returned $R0'
; start the music!
System::Call /NOUNLOAD '${BASS_LOC}::BASS_ChannelPlay(i r1, b 0) i.R1'
DetailPrint 'BASS_ChannelPlay returned $R1'
${EndIf}
SectionEnd
Function .onGUIEnd
;free BASS
System::Call '${BASS_LOC}::BASS_StreamFree(i) v (r1)'
System::Call '${BASS_LOC}::BASS_Stop() b () .r0'
System::Call '${BASS_LOC}::BASS_Free'
FunctionEnd
......................
PluginDir folder is still not deleted.
!define BASS_LOC '$PLUGINSDIR\${BASS_DLL}' ; dll location on target machine
!define MP3 'demo.mp3' ; mp3 location on compile machine
!define MP3_LOC '$PLUGINSDIR\${MP3}' ; mp3 location on compile machine
!define BASS_SAMPLE_LOOP 4
!include 'LogicLib.nsh'
Name 'Bass24Test'
OutFile 'Bass24Test.exe'
ShowInstDetails show
Page instfiles
Function .onInit
InitPluginsDir
;extract the files
File '/oname=${MP3_LOC}' '${MP3}'
File '/oname=${BASS_LOC}' '${BASS_DLL}'
FunctionEnd
Section ''
; get installer HWND
FindWindow $0 '#32770' '' $HWNDPARENT
; init BASS
System::Call /NOUNLOAD '${BASS_LOC}::BASS_Init(i -1,i 44100,i 0,i r0,i n) b.r0'
; start BASS
System::Call /NOUNLOAD '${BASS_LOC}::BASS_Start() b.r0'
; open MP3 file - handler is in $1
System::Call /NOUNLOAD '${BASS_LOC}::BASS_StreamCreateFile(b 0,t "$PLUGINSDIR\demo.mp3",i 0,i 0,i 0) i.r1'
DetailPrint 'HSTREAM handler = $1'
${If} $1 != '0'
; stream is OK
DetailPrint 'Initialization OK.'
; set flags to let it loop
; this can be commented out - loops the music
DetailPrint 'Setting channel flags...'
System::Call /NOUNLOAD '${BASS_LOC}::BASS_ChannelFlags(i r1, i ${BASS_SAMPLE_LOOP}, i ${BASS_SAMPLE_LOOP}) i.R0'
DetailPrint 'BASS_ChannelFlags returned $R0'
; start the music!
System::Call /NOUNLOAD '${BASS_LOC}::BASS_ChannelPlay(i r1, b 0) i.R1'
DetailPrint 'BASS_ChannelPlay returned $R1'
${EndIf}
SectionEnd
Function .onGUIEnd
;free BASS
System::Call '${BASS_LOC}::BASS_StreamFree(i) v (r1)'
System::Call '${BASS_LOC}::BASS_Stop() b () .r0'
System::Call '${BASS_LOC}::BASS_Free'
FunctionEnd
......................
PluginDir folder is still not deleted.
Bumping threads is rude! 😠 Yesterday was a Sunday, you can't expect immediate help every time.Originally Posted by meoitSomeone help me 🙂
Now you have pissed me off so you are going to have to help yourself.
I would suggest that you comment out every single plug-in call except BASS_Free and then start adding them back until it breaks. Also, only the very last Call should be without /NOUNLOAD.
Another method is to play audio plugin nsisbass.dll
For more example visit:https://www.dynaverse.net/forum/inde...3379134.0.html
For more example visit:https://www.dynaverse.net/forum/inde...3379134.0.html
Thanks to you reply.
I see this file very old, from 2008. It is appropriate for the latest version of the current BASS.dll ?.
I see this file very old, from 2008. It is appropriate for the latest version of the current BASS.dll ?.
It does not work with the newer version bass.dll
It works only with these plug-ins
It works only with these plug-ins