[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

*.wav file NOT playing in TMediaPlayer

Posted on 2004-04-28
6
Medium Priority
?
1,408 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 500 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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 

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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

649 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