0

我尝试从安装了 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
4

0 回答 0