jonnebonne
31st December 2004 00:35 UTC
Play MIDI files
Hi :)
I have searched around because I want my installer to play a *.midi-file... I have tryed many diffrent functions.. but I can't get this to work! Here is something I tryed..:
;--------------------------------
;common
!define APP_NAME "PlaySound"
!define SND_NAME "C:\Documents and Settings\User\Desktop\Song.midi"
Name "${APP_NAME}"
OutFile "${APP_NAME}.exe"
InstallDir "$PROGRAMFILES\${APP_NAME}"
;--------------------------------
;Pages, Interface Settings, Languages
SetCompressor lzma
!include "MUI.nsh"
!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_LANGUAGE "English"
!define MUI_ABORTWARNING
;--------------------------------
;Installer Functions
Function .onInit
InitPluginsDir
SetOutPath "C:\Documents and Settings\User\Desktop\"
File "${SND_NAME}"
; no-loop or loop
; System::Call 'winmm.dll::PlaySoundA(t "$PLUGINSDIR\${SND_NAME}", i 0, i 0x00020003) i .R0'
System::Call 'winmm.dll::PlaySoundA(t "$PLUGINSDIR\${SND_NAME}", i 0, i 0x0002000b) i .R0'
FunctionEnd
;--------------------------------
;Installer Sections
Section "Dummy Section" SecDummy
; to stop sound at the end of INSTALL page - optional
System::Call 'winmm.dll::PlaySoundA(i 0, i 0, i 0) i .R0'
SectionEnd
Can someone please help me?
Thanks!
Joel
31st December 2004 01:06 UTC
I recommend something like:
!define SND_NAME "C:\Documents and Settings\User\Desktop\Song.midi"
;..
File /oname=$PLIGINSDIR\song.midi ${SND_NAME}
System::Call 'winmm.dll::PlaySoundA(t "$PLUGINSDIR\song.midi", i 0, i 0x0002000b) i .R0'
;..
Takhir
31st December 2004 09:16 UTC
Attached script can also play mp3 ;)
Takhir
31st December 2004 10:05 UTC
PlaySound works with wavetable (wav) files. With mci please note, that "play repeat" may be not supported, so better use
...
SendMessage $0 0x0465 0 "STR:play"
Afrow UK
31st December 2004 10:59 UTC
Note the
STR:play
:D
-Stu
jonnebonne
31st December 2004 11:36 UTC
Thanks all!
But I still can't play midi files :(
All I try I get error messages that it can't find the file or some error with something else... Does theese codes work for you?
BTW: I have also tryed whit the full path (C:\something\NSIS\Plugins\ instead of just $PLUGINSDIR) and rename my midi-file to *.mid...
Tnx!:)
Takhir
31st December 2004 12:55 UTC
this work even on Win98 ;)
Package includes midi file
Dkom
1st January 2005 13:31 UTC
Is it possible to play tracker files (mod, xm) in installer (maybe after install of http://download.dsp-worx.de/MODSourc..._Installer.zip)?
Is it possible to set playback volume for midi music (for example to set system volume to middle value before starting playback)? In many cases all system volume may be at max. value, and when I launch installer - it's to loud...
pospec
9th May 2008 08:41 UTC
The msvfw32.dll::MCIWndCreate is logging some info into file $EXEPATH.log. I tried to delete the log in .onGUIEnd, but it can't be deleted until installer exits. I'd like to have no logging.
How to get rid of logging? There is nothing about it in MSDN :(