How to play non-PCM file or convert it to PCM on the fly ?

前端 未结 3 1162
悲哀的现实
悲哀的现实 2021-01-20 01:44

The following code works with some wav files, but with others I get, \"InvalidOperationException was unhandled. Message=Sound API only supports playing PCM wave files.\"

3条回答
  •  [愿得一人]
    2021-01-20 01:49

    The way to do it is to use newkie's code at: http://www.codeproject.com/Articles/175030/PlaySound-A-Better-Way-to-Play-Wav-Files-in-C?msg=4366037#xx4366037xx

    In my case, at least, I had to change all of the lowercase x's to uppercase x's, though, to get it to work.

提交回复
热议问题