|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
playing & re-playing 7 .wav filesI have 7 .wav files in C:\ directory [named: 1.wav, 2.wav, ..., 7.wav], I'd play them all by clicking on "cmdStart" button on a Visual Basic 2005- Windows Application Form. I thought I should use this segment of code to get this thing done: Private Sub cmdStart_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdStart.Click Dim i As Integer = 1 While i < 8 My.Computer.Audio.Play("C:\" & i & ".wav", AudioPlayMode.Background) i += 1 End While End Sub But when I run the application, it ONLY plays the last .wav file (7.wav) !! What I need is to play them all, one by one, that is, 1.wav .. then 2.wav .. then ..etc.. until 7.wav, AND i also want to re-loop [re-play these files] this operation ( that is, after finishing the first loop of these 7 .wav files, the application should start over again from 1.wav ... till 7.wav ... and so on ..) ! what code line or segment should i add to the above segment to get this done !! I'd highly appreciate your help guys !! Thanx in advance ! On Thu, 25 May 2006 06:52:02 -0700, Mr. Murad Jamal
<MrMuradJa***@discussions.microsoft.com> wrote: Show quoteHide quote >Dear guys, If this is simply background sounds for the app, this will proabaly>I have 7 .wav files in C:\ directory [named: 1.wav, 2.wav, ..., 7.wav], I'd >play them all by clicking on "cmdStart" button on a Visual Basic 2005- >Windows Application Form. > >I thought I should use this segment of code to get this thing done: > > > >Private Sub cmdStart_Click(ByVal sender As System.Object, ByVal e As >System.EventArgs) Handles cmdStart.Click > > Dim i As Integer = 1 > > While i < 8 > My.Computer.Audio.Play("C:\" & i & ".wav", >AudioPlayMode.Background) > i += 1 > End While > > End Sub > > > > >But when I run the application, it ONLY plays the last .wav file (7.wav) !! >What I need is to play them all, one by one, that is, 1.wav .. then 2.wav .. >then ..etc.. until 7.wav, AND i also want to re-loop [re-play these files] >this operation ( that is, after finishing the first loop of these 7 .wav >files, the application should start over again from 1.wav ... till 7.wav ... >and so on ..) ! > >what code line or segment should i add to the above segment to get this done >!! >I'd highly appreciate your help guys !! > >Thanx in advance ! work (air code), but you will probably need to put this in it's own thread for best performance. Dim i As Integer = 1 While i < 8 My.Computer.Audio.Play("C:\" & i & ".wav", AudioPlayMode.WaitToComplete) If i = 7 then i = 1 Else i += 1 End While End Sub Gene thanx alot this is awesome .. i will try to use background worker for putting
it on its own thread !! Show quoteHide quote "gene kelley" wrote: > On Thu, 25 May 2006 06:52:02 -0700, Mr. Murad Jamal > <MrMuradJa***@discussions.microsoft.com> wrote: > > >Dear guys, > >I have 7 .wav files in C:\ directory [named: 1.wav, 2.wav, ..., 7.wav], I'd > >play them all by clicking on "cmdStart" button on a Visual Basic 2005- > >Windows Application Form. > > > >I thought I should use this segment of code to get this thing done: > > > > > > > >Private Sub cmdStart_Click(ByVal sender As System.Object, ByVal e As > >System.EventArgs) Handles cmdStart.Click > > > > Dim i As Integer = 1 > > > > While i < 8 > > My.Computer.Audio.Play("C:\" & i & ".wav", > >AudioPlayMode.Background) > > i += 1 > > End While > > > > End Sub > > > > > > > > > >But when I run the application, it ONLY plays the last .wav file (7.wav) !! > >What I need is to play them all, one by one, that is, 1.wav .. then 2.wav .. > >then ..etc.. until 7.wav, AND i also want to re-loop [re-play these files] > >this operation ( that is, after finishing the first loop of these 7 .wav > >files, the application should start over again from 1.wav ... till 7.wav ... > >and so on ..) ! > > > >what code line or segment should i add to the above segment to get this done > >!! > >I'd highly appreciate your help guys !! > > > >Thanx in advance ! > > If this is simply background sounds for the app, this will proabaly > work (air code), but you will probably need to put this in it's own > thread for best performance. > > Dim i As Integer = 1 > > While i < 8 > My.Computer.Audio.Play("C:\" & i & ".wav", > AudioPlayMode.WaitToComplete) > If i = 7 then > i = 1 > Else > i += 1 > End While > > End Sub > > Gene >
Problem loading XML
Application.Exit How To Force Copy One File To Another datagrid current record Problems with URL Syntax Possible to monitor changes in array (with event)? Debug.WriteLine Doesn't Produce Output Re: How to Use a Screen Saver app within My Application? How do I add a MSI file to Prerequisite list? Stripping just the filename |
|||||||||||||||||||||||