Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can anybody help me with mediaplayer in VB?

Status
Not open for further replies.

pmhs

Programmer
Jun 23, 2002
12
PT
Hi! I'm a newbie here, so I really don't know how these forums work, but I have this problem that I wish you could help me solve.
I'm trying to insert sounds in a program for my college course. The program basically allows the user to search a database and add, remove & edit records from the database. It is a very simple program, but I would like to insert some sounds to give it a multimedia touch (and get a better classification from the professor also!), so I inserted the windows media player class in projects>components menu. Then I inserted a media player object in the form, putting the visible property to false.
Next, I call the open method telling him the path of the file to play. Next, I call the play method and he plays the sound in run time but terminates the program and gives me the following message:

Run-time error '-2147467259 (80004005)':
Method 'Play' of object 'IMediaPlayer2' failed

I can't seem to work this one out. Can somebody help me?
Here is the code I've wrote:

Private Sub Form_Load()

frmSplash.cmdSair.Visible = False
frmSplash.Show vbModeless
frmSplash.Refresh
frmSplash.mplSplash.Open "C:\bark.wav"
frmSplash.mplSplash.Play
 
I've got it!
no need to bother!
thankx anyway!
 
Hi
I have the same problem with Windows Media Player:

Run-time error '-2147467259 (80004005)':
Method 'Play' of object 'IMediaPlayer2' failed

Since I can't find the solution,can you tell me how did you solve the problem?

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top