| |
|
|
|
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
|
|
|
| |
|
|