Mono c#SoundPlayer不起作用

时间:2017-02-25 14:28:54

标签: c# mono raspberry-pi raspbian playsound

我尝试从安装了Raspbian的Raspberry Pi 3播放声音。我已经安装了单声道。我在Windows上测试过,运行良好。但是在Raspbian上运行时。我没有收到任何错误消息,也没有声音。

public void PlaySound()
{
    try
    {
        using (var file = new FileStream("example.wav",
            FileMode.Open, FileAccess.Read, FileShare.Read))
        {
            var player = new SoundPlayer(file);
            player.PlaySync();
        }
    }
    catch (Exception e)
    {
        Console.WriteLine("Sound failed to play");
    }
}

单声道版

Mono JIT compiler version 3.2.8 (Debian 3.2.8+dfsg-10)
Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
TLS:           __thread
SIGSEGV:       normal
Notifications: epoll
Architecture:  armel,vfp+hard
Disabled:      none
Misc:          softdebug
LLVM:          supported, not enabled.
GC:            sgen

0 个答案:

没有答案