AboutSyed Rizwan Muhammad Rizvi Expertise I can answers questions regarding web based and desktop based programming in VB.Net. Which can include SOAP, XML, Custom Controls, COM Interoperability etc.
Experience Have been working in this specific area for last 2 years previously I was a VB 6 Developer with experties in other languages as well. Total 10 years of programming experience.
Question QUESTION: Salam. I want to play files like d1.mp3, d2.mp3, d3.mp3,.....,d9.mp3 continuously from d1 to d9. I want each to begin after the last one had finished playing. What I have achieved so far is that the loop only plays the last file and not the earlier ones. Please, give me some idea. I am new to >net. I am just moving from VB6 and most commands in VB6 do not work in .Net. Thank you.
ANSWER: I guess that you are not putting delay or wait statements inside your loop which actually waits for each file to finish first and then move on. You need to make blocking calls to the API which is playing the files. Otherwise if you know the length for each file you can simply put a time delay loop inside your main loop to wait for each file to finish. The controls that are normally used to play these files offer the progress of how much the file has been played you can also utilize this to cause a delay or wait.
Hope that helps.
Regards,
Rizwan
---------- FOLLOW-UP ----------
QUESTION: Thanks Rizwan. Since I am new to >net, can u please, give me a simple code snippet that will cause the wait to occur? The files do not have a uniform duration, so I cant use a delay loop. I am using the AxWindowsMediaPlayer or AxMMControl of VB 2005. Thanx.
Answer Havent used MMCOntrol for a long time I guess the following code will do the job, its more like a psuedo code so please translate properly:
For I = 1 to 9
MMControl.Play "d" & i & ".wav"
While MMControl.ISBusy or MMControl.Progress<100
'This is the delay loop which waits the MM Control is busy or the progress is not 100%
End While
Next