Solved

*.wav file NOT playing in TMediaPlayer

Posted on 2004-04-28
6
1,391 Views
Last Modified: 2008-01-16
In my Delphi 7 app, I download a *.wav file from the internet by creating a file stream and writing the file to that.  All works well.  I can then open the file in "Windows Media Player 8.00.00.4487" and it plays just fine.

However, If I attempt to play the file in the Delphi TMediaPlayer (which is what I need to do), I get an error every time that says: "raised exception class EMCIDeviceError with message 'No wave device is installed that can play files in the current format.  To install a wave device, go to Control Panel, click Printers and Other Hardware, and then click Add Hardware.'.

Well, if the Windows Media Player can play it, why can't Delphi's TMediaPlayer?  I would assume that both players have access to the same codecs, do they not?

Can someone tell me how I might remedy this problem in such a way that the application can be released to the masses?

Thanks,
Derrick
0
Comment
Question by:dbetts
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
6 Comments
 
LVL 11

Expert Comment

by:shaneholmes
ID: 10942990

   forget the Mediaplayer  there is an API
function called PlaySound which will play the wave for you directly ANd
allow you to play it from memory rather than disk

 if you choose to...
                               
Shane
0
 
LVL 11

Expert Comment

by:shaneholmes
ID: 10943016
PlaySound( 'filename.wav', 0, snd_Async);

Shane
0
 
LVL 11

Accepted Solution

by:
shaneholmes earned 125 total points
ID: 10943041
oh yeah, make sure if you use PlaySound, you add MMSystem to your uses clause...


If would try it to see if it plays that wav file... if it does than try testing it again with TMedia Player



    Media.DeviceType := dtWaveAudio;
    Media.FileName := <wav file>;  {include path if necessary}
    Media.Open;
    Media.Play;

Shane
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:dbetts
ID: 10944031
Thanks Shane.

The problem was with the DeviceType.  I has it set to Auto and apparently the *.wav file didn't have proper header info to tell the TMediaPlayer what type it was.

I changed that, but now I cannot hear the wav file.  I have tried it with the PlaySound function you suggested and the TMediaPlayer.  Neither produces the sound.

I no longer have any troubles opening the file, I just can't hear it.

If I open the file in Windows Media Player, I can hear it just fine.

Any ideas?

Derrick
0
 
LVL 11

Expert Comment

by:shaneholmes
ID: 10944062
maybe ints a volume issue now... with in delphi... try setting the volumn by code...

Shane
0
 

Author Comment

by:dbetts
ID: 10945275
Thanks.

As it turns out it was a problem with the *.wav files that were being created.  Delphi couldn't play them, but Windows Media PLayer could.

We have notified the vendor and it is being resolved.

Thanks Shane,
Derrick
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question