var fileName = "D:/ready.mp3";
DevicesCollection sound_devices = new DevicesCollection();
Device sound_device_output = new Device(sound_devices[1].DriverGuid);
sound_device_output.SetCooperativeLevel(new WindowInteropHelper(this).Handle, CooperativeLevel.Normal); //設定設備協作級別
SecondaryBuffer secondary_buffer = new SecondaryBuffer(fileName, sound_device_output); //值不在預期的范圍內
secondary_buffer.Play(0, BufferPlayFlags.Looping);//設定緩沖區為回圈播放
也不知道啥原因。試了各種辦法,查了各種資料,都沒解決,有知道的大佬幫忙解答下么,謝謝了~
SecondaryBuffer有個多載引數是用檔案流。我把音頻流放進去也還是報錯,應該不是音頻檔案路徑問題。
sound_device_output音頻設備有兩個,兩個都試了,沒用。
macsoft.directx.directsound.dll也替換了好幾個版本,沒用。
真令人頭禿~
轉載請註明出處,本文鏈接:https://www.uj5u.com/net/8453.html
標籤:C#
