English
Source / code snippets

Play Mp3 Sound

 

Source watts on the 15.07.2007 from the MMJ-Quellcodesammlung (Dietmar horn) in The Babyklappe on XProfan.Com stored:
Sound: MP3 Play
Mp3 by MCI Dieter Zornow
Declare MP3error&

Proc MP3_Open

    Parameters MP3File$

    If @NEq$(MP3File$,)

        @$ MCISend(OPEN +@Chr$(34)+MP3File$+@Chr$(34)+ TYPE MPEGVIDEO ALIAS MP3_play)
        @$ MCISend(set MP3_play time stature ms)
        @$ MCISend(set MP3_play video off)

    EndIf

ENDPROC

Proc MP3_Stop

    @$ MCISend(STOP MP3_play)
    @$ MCISend(CLOSE MP3_play)

ENDPROC

Proc MP3_Close

    @$ MCISend(CLOSE MP3_play)

ENDPROC

proc MP3_Error

    if %mcierror

        declare tz$,mess$
        let tz$=Device Error
        let mess$=Sorry, The Player can´t play this File
        @messagebox(mess$,tz$,48)
        MP3_Stop
        MP3_Close
        let MP3error&=1
        return MP3error&

    endif

    let MP3error&=0
    return MP3error&

endproc

Proc MP3_bitspersample works not always

    Declare MP3_Result&
    Let MP3_Result&=@$ MCISend(STATUS WAVE BITSPERSAMPLE)  samplerrate
    Return MP3_Result&

Endproc

Proc MP3_Play

    @$ MCISend(PLAY MP3_play)

ENDPROC

Proc MP3_PlayLoop  functions not überall

    @$ MCISend(PLAY MP3_play LOOP)

ENDPROC

Proc MP3_PlayWait

    @$ MCISend(PLAY MP3_play WAIT)

ENDPROC

Proc MP3_SeekToEnd

    @$ MCISend(SEEK MP3_play TO END) seek along To to that end

ENDPROC

Proc MP3_SeekToStart

    @$ MCISend(SEEK MP3_play TO START) seek Rückwärts To to that beginning

ENDPROC

Proc MP3_SeekTO

    Parameters pos$ in ms
    @$ MCISend(SEEK MP3_play TO +pos$) seek To to position

ENDPROC

Proc MP3_Pause

    @$ MCISend(PAUSE MP3_play)

ENDPROC

Proc MP3_Resume

    @$ MCISend(RESUME MP3_play) game to interval moreover on the equal place, play game too moreover, sometimes too semidetached interval

ENDPROC

Proc MP3_PlayMode

    Declare MP3_Result$
    Let MP3_Result$=@$ MCISend(STATUS MP3_play MODE)shows whom status (stopped, playing, paused, hardship ready)
    Return MP3_Result$

ENDPROC

Proc MP3_Break Waitplay Cancel with ESC Button

    @$ MCISend(Break MP3_play on 27)

endproc

Proc MP3_length LengthMP3 moreover under using for Umrechnung

    Declare MP3_Result$
    Let MP3_Result$=@$ MCISend(STATUS MP3_play LENGTH) length the mp3
    Return MP3_Result$

Endproc

Proc MP3_position posMp3 moreover under using for Umrechnung

    Declare MP3_Result$
    Let MP3_Result$=@$ MCISend(STATUS MP3_play POSITION) actually position
    Return MP3_Result$

Endproc

Proc LengthMP3 rechnet in minutes sec the String 00:00

    declare lang&,sek%,worth$,long$,temp$
    MP3_length
    Let lang&=@Val(@&(0))
    let sek%=@div&(lang&,1000)
    let lang&=@div&(sek%,60)
    let temp$=add$(st$(lang&),:)

    If @equ(@len(temp$),2)

        let worth$=@add$(0,temp$)

    else

        let worth$=temp$

    endif

    let sek%=@sub(sek%,@mul(lang&,60))

    If @lt(sek%,10)

        let worth$=@add$(worth$,0)
        let worth$=@add$(worth$,@st$(sek%))

    else

        let worth$=@add$(worth$,@st$(sek%))

    endif

    Return worth$

ENDPROC

Proc PosMP3 rechnet in minutes sec the String 00:00

    declare lang&,sek%,worth$,long$,temp$
    let worth$=00:00
    MP3_position
    let lang&=@Val(@&(0))
    let sek%=@div&(lang&,1000)
    let lang&=@div&(sek%,60)
    let temp$=add$(st$(lang&),:)

    If @equ(@len(temp$),2)

        let worth$=@add$(0,temp$)

    else

        let worth$=temp$

    endif

    let sek%=@sub(sek%,@mul(lang&,60))

    If @lt(sek%,10)

        let worth$=@add$(worth$,0)
        let worth$=@add$(worth$,@st$(sek%))

    else

        let worth$=@add$(worth$,@st$(sek%))

    endif

    Return worth$

Endproc

example
cls
MP3_open C:CDPlayTest_VBR.mp3
MP3_open MP3_02.MP3
MP3_bitspersample
print @&(0)
LengthMP3
print @$(0)
MP3_Play
Print klick for interval
waitinput
MP3_Pause
Print klick for moreover and Positon
waitinput
MP3_Resume goes too with play
MP3_SeekToEnd
PosMP3  In schleife inquire
print @$(0)
waitinput
MP3_Stop
MP3_Close
 
07/16/07  
 



Zum Quelltext


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

3.941 Views

Untitledvor 0 min.
Member 862464105/04/24
H.Brill10/30/23
Michael Hettner09/21/23
Sven Bader11/15/22
More...

Themeninformationen

this Topic has 1 subscriber:

unbekannt (1x)


Admins  |  AGB  |  Applications  |  Authors  |  Chat  |  Privacy Policy  |  Download  |  Entrance  |  Help  |  Merchantportal  |  Imprint  |  Mart  |  Interfaces  |  SDK  |  Services  |  Games  |  Search  |  Support

One proposition all XProfan, The there's!


My XProfan
Private Messages
Own Storage Forum
Topics-Remember-List
Own Posts
Own Topics
Clipboard
Log off
 Deutsch English Français Español Italia
Translations

Privacy Policy


we use Cookies only as Session-Cookies because of the technical necessity and with us there no Cookies of Drittanbietern.

If you here on our Website click or navigate, stimmst You ours registration of Information in our Cookies on XProfan.Net To.

further Information To our Cookies and moreover, How You The control above keep, find You in ours nachfolgenden Datenschutzerklärung.


all rightDatenschutzerklärung
i want none Cookie