סאונד

xtaza2

New member
סאונד

זאת שאלה פשוטה שבטח נשאלה פה הרבה.. איך אני מוסיף קובץ wav לתוכנית שלי בויזואל? וגם איך אני יכול לקבוע כמה פעמים הקובץ יתנגן ואיך אני מפסיק את הסאונד?
 

עצמונאי

New member
API

לפי מה שאני יודע אין פונקציה של VB כדי להפעיל קובץ כזה אבל אני בטוח שיש פונקצית API שעושה את זה אם תחפש באתר WWW.DR-VB.CO.IL תוכל אפילו למצאו קודים לדוגמה שמפעילים קבצים מדיה. בהצלחה.
 

Lucciano

New member
ה API ופונקציה שמפעילה אותו

Private Const SND_APPLICATION = &H80 ' look for application specific association Private Const SND_ALIAS = &H10000 ' name is a WIN.INI [sounds] entry Private Const SND_ALIAS_ID = &H110000 ' name is a WIN.INI [sounds] entry identifier Private Const SND_ASYNC = &H1 ' play asynchronously Private Const SND_FILENAME = &H20000 ' name is a file name Private Const SND_LOOP = &H8 ' loop the sound until next sndPlaySound Private Const SND_MEMORY = &H4 ' lpszSoundName points to a memory file Private Const SND_NODEFAULT = &H2 ' silence not default, if sound not found Private Const SND_NOSTOP = &H10 ' don't stop any currently playing sound Private Const SND_NOWAIT = &H2000 ' don't wait if the driver is busy Private Const SND_PURGE = &H40 ' purge non-static events for task Private Const SND_RESOURCE = &H40004 ' name is a resource name or atom Private Const SND_SYNC = &H0 ' play synchronously (default) Private Declare Function PlaySound _ Lib "winmm.dll" _ Alias "PlaySoundA" _ (ByVal lpszName As String, _ ByVal hModule As Long, _ ByVal dwFlags As Long) As Long Sub Play(sndFile As String) PlaySound sndFile, ByVal 0&, SND_FILENAME Or SND_ASYNC End Sub​
 

xtaza2

New member
אוקי תודה מצאתי כבר, ושאלה נוספת

שלא קשורה לנושא הזה.. עשיתי טיימר שבנוי ממאיות שניה שניות ודקות.. אבל שהספרה בטיימר היא בחן 1 ל9 זה מציג רק ספרה אחת.. אני רוצה שזה יראה ככה 01, 02, 03 וכו'.. איך אני עושה את זה? הכוונה שהשעון יראה לדוגמא כך : 09:04:26 ולא כך : 9:4:26
 

xtaza2

New member
ממ לא הבנתי.. וגם, עוד שאלה

אפ תוכל להסביר יותר מה לעשות וגם איך אני יכול להשמיע קבצי mp3?
 

פאשה0

New member
הסבר

שורה הבאה
Format(1, "00")​
תחזיר את "01". במקרה שלך אם משתנים h, m ,s מכילות שעה דקה ושניה, אז כדי לקבל משהו בסגנון 10:07:01, צריך לבצע קוד הבא:
Format(h, "00") + ":" + Format(m, "00") + ":" + Format(s, "00")​
 

מס1

New member
הרבה יותר פשוט

Format$(YourTime, "hh:mm:ss")​
וזה יעשה זאת
 
למעלה