sounds
Good day,
I am creating an application that can play sounds on my program i used the snippet of VB.net
i am using this code to play some sounds
My.Computer.Audio.Play(".wav")
all i want is to random pictures and the sounds associated on that pictures will be played...
I ma having problem with the sounds..
would i used Dictionary or List..
any suggestions
thanks
cyberdaemon
Junior Poster in Training
56 posts since Nov 2010
Reputation Points: 10
Solved Threads: 1
>>all i want is to random pictures and the sounds associated on that pictures will be played...
How do you plan to add the images and sounds to get recognized?
.From a File?.From My.Resources?.Full.Paths coded into your app.?
codeorder
Posting Virtuoso
1,913 posts since Aug 2010
Reputation Points: 255
Solved Threads: 384
@codeorder maybe from a file...
once the application appear i want to randomize the images together with sound associated with it. let say the image is A the sound should be "A" also. if the image is cloud the sound should be "CLOUD"..
i am using this code..
My.Computer.Audio.Play(".wav")
just to play the audio of each images..
thanks
cyberdaemon
Junior Poster in Training
56 posts since Nov 2010
Reputation Points: 10
Solved Threads: 1
File.Content:
img1.png|sound1.wav
img2.png|sound2.wav
img3.png|sound3.wav
Imports System.IO
Public Class Form1
Public myMediaFolder As String = Environment.GetFolderPath(Environment.SpecialFolder.Desktop) & "\TEMP\"
Private myMediaListFile As String = myMediaFolder & "myMediaList.txt"
Private arMedia() As String, iTemp As Integer, rnd As New Random, chrMain As String = "|"
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
If File.Exists(myMediaListFile) Then arMedia = File.ReadAllLines(myMediaListFile) '// load file.
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If Not arMedia.Length = 0 Then
iTemp = rnd.Next(0, arMedia.Length) '// get random #.
With arMedia(iTemp)
MsgBox(.Split(chrMain).GetValue(0) & vbNewLine & _
.Split(chrMain).GetValue(1))
End With
End If
End Sub
End Class
Hope this helps.:)
codeorder
Posting Virtuoso
1,913 posts since Aug 2010
Reputation Points: 255
Solved Threads: 384
@codeorder thanks it helps me alot..
once again my friend thank you.. GOD Bless. You save my day
cyberdaemon
Junior Poster in Training
56 posts since Nov 2010
Reputation Points: 10
Solved Threads: 1