- ©«¤l
- 109
- ¥DÃD
- 2
- ºëµØ
- 0
- ¿n¤À
- 114
- ÂI¦W
- 0
- §@·~¨t²Î
- Win7 Win10
- ³nÅ骩¥»
- Office 2019 WPS
- ¾\ŪÅv
- 20
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ²`¦`
- µù¥U®É¶¡
- 2013-2-2
- ³Ì«áµn¿ý
- 2024-11-6
|
mciSendString¨ç¼Æ¬O¥Î¨Ó¼½©ñ¦h´CÅé¤å¥óªºAPI«ü¥O¡A¥i¥H¼½©ñMPEG,AVI,WAV,MP3,µ¥µ¥¡A¨Ï¥Î¦¹API¨ç¼Æ¥i¥H³Ð«Ø¤@Ó²©öªº¼½©ñ¾¹¡A¤U±¤¶²Ð¥¦ªº¨Ï¥Î¤èªk¡G
¡@¡@¸Ó¨ç¼Æ¦³¥|ӰѼơG
²Ä¤@ӰѼơGnµo°eªº©R¥O¦r²Å¦ê¡C¦r²Å¦êµ²ºc¬O:[©R¥O][³]³Æ§O¦W][©R¥O°Ñ¼Æ].
²Ä¤GӰѼơGªð¦^«H®§ªº½w½Ä°Ï,¬°¤@«ü©w¤F¤j¤pªº¦r²Å¦êÅܶq.
²Ä¤TӰѼơG½w½Ä°Ïªº¤j¤p,´N¬O¦r²ÅÅܶqªºªø«×.
²Ä¥|ӰѼơG¦^½Õ¤è¦¡¡A¤@¯ë³]¬°¹s
ªð¦^È¡G¨ç¼Æ°õ¦æ¦¨¥\ªð¦^¹s¡A§_«hªð¦^¿ù»~¥N½X
¤@¡B±`¥Î©R¥O
1.¥´¶}¡]Open¡^¡A®æ¦¡¡GOpen ³]³Æ¦W[type ³]³Æ«¬¦¡][alias §O¦W]
Dim mName as string
mName = "f:\mpeg\mpeg1.avi"
mciSendString "open " & mName & " type MPEGVideo Alias JofornMusic parent %u Style %u notify",0&, 0, 0
¡@¨ä¤¤¡G
open ¾Þ§@©R¥O
mName ¥þ¸ô®|¤å¥ó¦W
type MPEGVideo ¬O«ü¥´¶}MPEG,AVIµ¥Ãþ«¬¡A¦pªG¤£¥[³o¤@¥y¡A´N¬O¥´¶}WAV,MP3µ¥
Alias JofornMusic ©w¸q¤F¸Ó¾Þ§@ªº§O¦W¬°movie¡A«áÄò¾Þ§@¥un«ü©ú§O¦W§Y¥i
parent %u ·½
Style %u ¼Ë¦¡
notify ³qª¾
2.¼½©ñ¡]Play¡^¡A®æ¦¡¡GPlay ³]³Æ¦W[from °_ÂI][to ²×ÂI]
mciSendString "play JofornMusic", 0&, 0, 0
mciSendString "play JofornMusic fullscreen", 0&, 0, 0 '¥þ«Ì¼½©ñ
¡@¡@3.¼È°±¡]Pause¡^¡G
mciSendString "pause JofornMusic", 0&, 0, 0
¡@¡@4.Ä~Äò¡]Resume¡^¡G
mciSendString "resume JofornMusic", 0&, 0, 0
¡@¡@5.°±¤î¡]Stop¡^¡G
mciSendString "stop JofornMusic", 0&, 0, 0
¡@¡@6.Ãö³¬¡]Colse¡^¡G
mciSendString "close JofornMusic", 0&, 0, 0
¡@¡@7.«e¶i¨ì¤U¤@Ó¦ì¸m¡G
mciSendString "step JofornMusic", 0&, 0, 0
¡@¡@8.«á°h¨ì¤W¤@Ó¦ì¸m¡G
mciSendString "step JofornMusic reverse", 0&, 0, 0
9.«e¶i©Î«á°hN Ó¦ì¸m(¨ä¤¤N<0 §Yªí¥Ü«á°h)
mciSendString "step JofornMusic by " & str(N), 0&, 0, 0
¡@¡@10.Àò¨ú·í«e¼½©ñ¦ì¸m¡G
Dim ST As String*64
mciSendString "status JofornMusic position", st, len(st), 0
¡@¡@11. Àò¨ú´CÅ骺Á`ªø«×¡G
mciSendString "status JofornMusic length", st, len(st), 0
l=val(st) 'l´N¬O©Ò¼½©ñ¤å¥óªºªø«×
¡@¡@12.Àò¨ú¼½©ñ·í«eª¬ºA¡G
Dim ST As String*64
mciSendString "status JofornMusic mode", ST, Len(ST), 0
If Left(ST, 7) = "stopped" Then (³B²z¥N½X) '¼½©ñ§¹²¦
¡@¡@13.´`Àô¼½©ñ¡G
mciSendString "play JofornMusic repeat", 0&, 0, 0
¤G¡B±±¨îÁnµ¤j¤p(1-1000)¡G
Dim V As Long
mciSendString "status JofornMusic volume",&V, len(v), 0 'V¬OÀò¨úªºµ¶q¤j¤pÈ¡C
V = 50
mciSendString "setaudio JofornMusic volume to ¼ÆÈ", 0, 0, 0 'V¬O³]¸mªºµ¶qÈ
¤T¡B³]¸m¼½©ñ¦ì¸m.(»Ý¨Æ¥ý³]©w®É¶¡®æ¦¡)¡A®æ¦¡¡GSeek ³]³Æ¦W[to ¦ì¸m| to start | to end]
Dim P1 as Long, P2 as Long
P1 = 100: P2 = 3000
mciSendString "seek JofornMusic to ", P1, 0, 0 'P1¬O·í«e°_©l¦ì¸m¡A³æ¦ì¡G²@¬í
mciSendString "seek JofornMusic to start", 0&, 0, 0 '©w¦ì¨ì¶}ÀY¦ì¸m
mciSendString "play JofornMusic", 0&, 0, 0 '©w¦ì«á¦A¼½©ñ
©ÎªÌ¡G
mciSendString "play JofornMusic FROM P1 to P2",0&, 0, 0 'P1¬O°_©l¦ì¸m¡AP2¬O°±¤î¦ì¸m¡C³æ¦ì¡G²@¬í
mciSendString "seek JofornMusic to end", 0&, 0, 0 '©w¦ì¨ì³Ì«á¦ì¸m
¥|¡B¦b«ü©w±±¥ó¤W¼½©ñµøÀW¡G
mciSendString "open AVI ¤å¥ó¦Wparent hWnd style child", 0&, 0, 0
¨ä¤¤¡AhWnd ¬O±±¥óªº¥y¬`
°õ¦æ¤Wz©R¥O¤§«á¡A¼v¤ù·|³Q©ñ¸m¦b±±¥óªº¥ª¤W¨¤¡A¥B¼v¤ùªº¤j¤p¤£¨ü±±¥ó¤j¤pªº¼vÅT¡A¦pªG·Qn§ïÅÜ
¼v¤ù¼½©ñªº¦ì¸m¤Î¤j¤p¡A¥i¥H¦b°õ¦æplay «ü¥O«e¥ý°õ¦æput «ü¥O¡A®æ¦¡¦p¤U¡G
mcisendString "put AVI ¤å¥ó¦Wwindow at XY [Width Height]", 0&, 0, 0
¨ä¤¤¡GX¡BY¬°¼v¤ù¥ª¤W¨¤§¤¼Ð¡AWidth¡BHeight¬°¼v¤ùªº¼e°ª«×
¤¡B¦pªG¼½©ñµøÀWÁÙ¥i±±¨î«G«×(1-2000)
Dim B As Long
mciSendString "status JofornMusic brightness", B, 0, 0 'B¬OÀò¨úªº«G«×È¡C
B = 50
mciSendString "setvideo JofornMusic brightness to " & B, &0, 0, 0 'B¬O³]¸mªº«G«×È
¤»¡B¿ýµ³]¸m¡G
¡@¡@¿ýµ«e¡A¥Î¥H¤U»y¥yªì©l¤Æ
¡@¡@1.³]¬°8¦ì¡G
mciSendString "set wave bitpersample 8", "", 0, 0
¡@¡@2.³]¬°11025Hz
mciSendString "set wave samplespersec 11025", "", 0, 0
¡@¡@3.³]¬°¥ßÅéÁn¡G
mciSendString "set wave channels 2", "", 0, 0
¡@¡@4.¹ê²{PCM®æ¦¡¡]¤£¤@©w¥¿½T¡^¡G
MCISENDSTRING "set wave format tag pcm","", 0, 0
¡@¡@5.¶}©l¿ýµ¡G
mciSendString "close JofornMusic",0&,0,0
mciSendString "open new type WAVEAudio alias JofornMusic",0&,0,0
mciSendString "record JofornMusic",0&,0,0
¡@¡@6.«O¦s¿ýµ¨ìc:\123.wav
mciSendString "stop JofornMusic",0&,0,0
mciSendString "save JofornMusic C:\123.wav",0&,0,0
mciSendString "close JofornMusic",0&,0,0
¤C¡B¶}Ãö¥úÅX¡G
mciSendString "set cdaudio door open", "", 0, 0 '¥´¶}
mciSendString "set cdaudio door close", "", 0, 0 'Ãö³¬
¤K¡B¨ä¥¦
¡@¡@1.³]¸m³]³Æªº¦UºØª¬ºA¡]Set¡^
Set alias_name[audio all off][audio all on][time format ms]:
Set©R¥O¥Î¨Ó³]¸m³]³Æªº¦UºØª¬ºA.¦p:ÀRµ,¦³Ánµ,®É¶¡®æ¦¡¬°²@¬íµ¥.
¡@¡@2.¨ú±o³]³Æªºª¬ºA¡]Status¡^
Status alias_name[length][mode][position]:
Status©R¥O¥Î¨Ó¨ú±o³]³Æªºª¬ºA.¦p:¸Ó´CÅé¤å¥óªºªø«×,¸Ó´CÅé¤å¥ó©Ò³Bª¬ºA,¸Ó´CÅé¤å¥óªº·í«e¦ì¸mµ¥. ªºªø«×,¸Ó´CÅé¤å¥ó©Ò³Bª¬ºA,¸Ó
´CÅé¤å¥óªº·í«e¦ì¸mµ¥.
°Ñ¦Ò¥N½X¡G
TCHAR fileName[]="D:\ͪº¤åÀÉ\my music\·Ý·Ýªwªº¯ù.mp3";
TCHAR shortName[MAX_PATH];
GetShortPathName(fileName,shortName,sizeof(shortName)/sizeof(TCHAR));
TCHAR cmd[MAX_PATH+10];
wsprintf(cmd,"play %s",shortName);
mciSendString(cmd,"",NULL,NULL);
¡]½Õ¥ÎmciSendString²Ä¤@ӰѼƶǡ§play ¤å¥ó¥þ¸ô®|¡¨´N¥i¥H¡A¡§¤å¥ó¥þ¸ô®|¡¨³Ì¦n¶Çµ´¹ï¸ô®|¡A¤£«Øijwanghepeng10¨º¼Ëȶǻ¼¤å¥ó¦W¡C
¥t¥~¦pªG¤å¥ó¥þ¸ô®|¤¤§t¦³ªÅ®æªº¸Ün¨Ï¥ÎGetShortPathNameÂà´«¦¨µu¸ô®|¡C ¡^ |
-
1
µû¤À¤H¼Æ
-
|