开发者

WPF's MediaPlayer not playing sounds on certain pc's

开发者 https://www.devze.com 2022-12-28 12:55 出处:网络
I made an WPF app that plays sounds using the MediaPlayer class. This works great on a lot of pc\'s, but there a开发者_运维技巧re 2 pc\'s that play regular sounds (and they also play the .wav\'s from

I made an WPF app that plays sounds using the MediaPlayer class.

This works great on a lot of pc's, but there a开发者_运维技巧re 2 pc's that play regular sounds (and they also play the .wav's from the app when opened with windows media player) but they don't play the sounds when opened from my app..

I get no error message or anything, they just refuse to play the sound..

The PCs run windows XP, but so do the other ones on which the sound plays great.

Is there any known requirement for making the MediaPlayer work in WPF? I have no idea in what direction I have to start looking..

.NET client framework 4.0 is installed on all pc's. We tested on about 6 PCs with different hardware, and on 2 of them we have no sound in the app.

Any idea?


Could have to do with the codec. WAV is simply a container file format. The actual audio data is encoded using a specific codec that must be present on the machine it's playing back on. I had a similar problem trying to play a WAV in Silverlight and when I converted to WMA it worked fine.


The problem was that Windows media player 9 was installed on these PC's. Updating to WMP 11 fixed the issue.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号