Jump to content
Sign in to follow this  

how can i play sound using BASS.DLL

Recommended Posts


hi all

im not really good in writing a dll udf

maybe someone can help me in how i could use the BASS.DLL to play sound files ??


;; bass DLL from http://us2.un4seen.com/files/bass23.zip
;; http://www.un4seen.com/ 

Global Const $BASS_MUSIC_LOOP = 4 ; loop music

$BASS = DllOpen(@ScriptDir & "\bass.dll")

;$fName = (@ScriptDir & "\test.mp3")
$fName = DllStructCreate(@ScriptDir & "\Test.mp3")

; sample should be :: 

    HSTREAM BASS_StreamCreateFile(
    BOOL mem,
    void *file,
    DWORD offset,
    DWORD length,
    DWORD flags

; HSTREAM stream=BASS_StreamCreateFile(FALSE,"afile.mp3",0,0,0);
$handle = DllCall($BASS, "dword", "BASS_StreamCreateFile", _
        "int", False, _ ; from file .
        "ptr", DllStructGetPtr($fName), _ ;file
        "dword", 0, _   ;offset
        "dword", 0, _   ;length
        "dword", 0) ;flag

MsgBox(0, "stream create ", $handle)

BOOL BASS_ChannelPlay(
    DWORD handle,
    BOOL restart

$ret = DllCall($BASS, "dword", "BASS_ChannelPlay", "dword", $handle, "int", False)

MsgBox(0, "BASS_ChannelPlay", $ret)

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  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.