What is better solution for playing sounds in .net application: Audio from DirectX lib or System.Media.SoundPlayer?

StackOverflow https://stackoverflow.com/questions/7808591

سؤال

As i know SoundPlayer plays only .wav files..And what is the point of it if Audio can play any format(if you have the right codec)? Isnt it better to just use Audio in your classes and be happy?

هل كانت مفيدة؟

المحلول

The biggest reason why you might not want to use Audio would be due to the dependency on DirectX. Granted with systems today that isn't typically an issue as DirectX support is pretty much there across the board.

The key here is "built in" functionality which is what SoundPlayer is, and extension type functionality which is what Audio is.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top