Hey I have this program that has been working fine until I tried to open this one wav file? Not sure what the problem is or that I understand it? Do I need to find a new component to use for this file or what? I am using Delphi 4 Pro and the standard VCL component for Media Player. I am looking for a good new component that offers more help with wav and mp3 files too but not found what I am looking for yet?
-
1What does the message that comes with the exception say? That might offer a bit of a clue as to what's going on. – Mason Wheeler Mar 25 '10 at 16:01
-
It says there is not a wave device that can play the file in its current format. Then says to install a hardware device that can? Like there is not a sound card but there is one. AND IT WORKS so I have no idea what is going on. I converted the file over to an MP3 and it plays fine... I just want to fix it right though – Roy Mar 25 '10 at 19:21
2 Answers
Possible reasons for a EMCIDeviceError:
It's known that mediaplayer has problems with some MP3 files, depending from the version of the mediaplayer that is installed on the machine. Try updating mediaplayer on the problem-machine(s).
Maybe the sound drivers just need updating
You also get an EMCIDeviceError if there is no soundcard, or the drivers are corrupted, or there are no drivers at all. But then it would not play any other MP3 files, so I just mention this to help out other Forum readers.
This kind of EMCIDeviceError is raised when you provide a fully qualified filename to the TMediaPlayer.FileName property which exceeds certain no of characters. It has nothing to do with having spaces in the filepath. For example if you play sounds from the EXE directory and just provide the relative shortname, no error seems to happen. Also with absolute filename from elsewhere, if it is shorter than a certain limit, there is no error. I encountered it in XE5 and have resorted to sndPlaySound().

- 347
- 1
- 3
- 13