Sign in to follow this  
Followers 0
Cor

Fmod sound library question

2 posts in this topic

Fmod library (playing audio files)

Need some help to get this working

Get error when compiling: Subscript used with non-Array variable

Cannot find the error, help is needed?

Fmod.dll can be download from www.fmod.org

grCor

Global Const $FSOUND_LOOP_NORMAL = 0x00000002

Dim $RetValue[7]

$MusicHandle = FMUSIC_LoadSongEx("beispielmusik.it", 0, 0, $FSOUND_LOOP_NORMAL, 0, 0)

If $MusicHandle Then
    FMUSIC_PlaySong($MusicHandle)
    FMUSIC_SetOrder($MusicHandle,0)
EndIf



;~ Public Declare Function FMUSIC_LoadSongEx Lib "fmod.dll" Alias "_FMUSIC_LoadSongEx@24" (ByVal name As String, ByVal offset As Long, ByVal length As Long, ByVal mode As FSOUND_MODES, ByRef sentencelist As Long, ByVal numitems As Long) As Long
Func FMUSIC_LoadSongEx ($name, $offset, $length, $mode, $sentencelist, $numitems)
    $RetValue = DllCall("fmod.dll", "long", "_FMUSIC_LoadSongEx@24" _
                        , "str", $name _
                        , "long", $offset _
                        , "long", $length _
                        , "long", $mode _
                        , "long", $sentencelist _
                        , "long", $numitems _
                        )
    
    Return $RetValue[0]
EndFunc

;~ Public Declare Function FMUSIC_PlaySong Lib "fmod.dll" Alias "_FMUSIC_PlaySong@4" (ByVal module As Long) As Byte
Func FMUSIC_PlaySong ($module)
    $RetValue = DllCall("fmod.dll", "short", "_FMUSIC_PlaySong@4" _
                        , "long", $module _
                        )
    
    Return $RetValue[0]
EndFunc

;~ Public Declare Function FMUSIC_SetOrder Lib "fmod.dll" Alias "_FMUSIC_SetOrder@8" (ByVal module As Long, ByVal order As Long) As Byte
Func FMUSIC_SetOrder ($module, $order)
    $RetValue = DllCall("fmod.dll", "short", "_FMUSIC_SetOrder@8" _
                        , "long", $module _
                        , "long", $order _
                        )
    
    Return $RetValue[0]
EndFunc

gr.Corhttp://www.ready4music.com35+ programs for ...

Share this post


Link to post
Share on other sites



Fmod library (playing audio files)

Need some help to get this working

Get error when compiling: Subscript used with non-Array variable

Cannot find the error, help is needed?

Fmod.dll can be download from www.fmod.org

grCor

Global Const $FSOUND_LOOP_NORMAL = 0x00000002

Dim $RetValue[7]

$MusicHandle = FMUSIC_LoadSongEx("beispielmusik.it", 0, 0, $FSOUND_LOOP_NORMAL, 0, 0)

If $MusicHandle Then
    FMUSIC_PlaySong($MusicHandle)
    FMUSIC_SetOrder($MusicHandle,0)
EndIf
;~ Public Declare Function FMUSIC_LoadSongEx Lib "fmod.dll" Alias "_FMUSIC_LoadSongEx@24" (ByVal name As String, ByVal offset As Long, ByVal length As Long, ByVal mode As FSOUND_MODES, ByRef sentencelist As Long, ByVal numitems As Long) As Long
Func FMUSIC_LoadSongEx ($name, $offset, $length, $mode, $sentencelist, $numitems)
    $RetValue = DllCall("fmod.dll", "long", "_FMUSIC_LoadSongEx@24" _
                        , "str", $name _
                        , "long", $offset _
                        , "long", $length _
                        , "long", $mode _
                        , "long", $sentencelist _
                        , "long", $numitems _
                        )
    
    Return $RetValue[0]
EndFunc

;~ Public Declare Function FMUSIC_PlaySong Lib "fmod.dll" Alias "_FMUSIC_PlaySong@4" (ByVal module As Long) As Byte
Func FMUSIC_PlaySong ($module)
    $RetValue = DllCall("fmod.dll", "short", "_FMUSIC_PlaySong@4" _
                        , "long", $module _
                        )
    
    Return $RetValue[0]
EndFunc

;~ Public Declare Function FMUSIC_SetOrder Lib "fmod.dll" Alias "_FMUSIC_SetOrder@8" (ByVal module As Long, ByVal order As Long) As Byte
Func FMUSIC_SetOrder ($module, $order)
    $RetValue = DllCall("fmod.dll", "short", "_FMUSIC_SetOrder@8" _
                        , "long", $module _
                        , "long", $order _
                        )
    
    Return $RetValue[0]
EndFunc
Everytime you make a DllCall, check the @Error variable. One of them is most likely failing...

Auto3Lib: A library of over 1200 functions for AutoIt

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0