小编Dre*_*ult的帖子

适用于.NET的跨平台音频库

要求:

  • 实时从麦克风获取原始输入
  • 实时播放原始输入

我似乎无法从谷歌搜索到这一点.有没有人用过类似的东西?

我正在使用C#,它需要在Windows,Linux和Mac上运行,后两者需要使用Mono.

我可能愿意使用p/invoke,但我对本机代码并不是特别熟悉,而且很难.如果有人可以建议一个本地图书馆,我会试一试.

.net c# audio microphone

10
推荐指数
2
解决办法
3450
查看次数

Mono - XDocument.Load因LoadOptions.PreserveWhitespace而失败

使用Mono版本2.10.5,以下代码在任何XML文档上都失败:

using System;
using System.Collections.Generic;
using System.Linq;
using System.IO;
using System.Xml.Linq;

namespace TestXDocument
{
    class MainClass
    {
        public static void Main (string[] args)
        {
            Stream s = File.Open("Settings.xml", FileMode.Open);
            XDocument d = XDocument.Load(s, LoadOptions.PreserveWhitespace);
            s.Close();
            d.Save("Settings.xml");
        }
    }
}
Run Code Online (Sandbox Code Playgroud)

只有在XDocument.Load使用LoadOptions.PreserveWhitespace时才会发生这种情况.有关如何解决这个问题或解决问题的任何想法?

在Linux Mint 12和Ubuntu 11.10上测试过.

这是例外:

 Unhandled Exception: System.InvalidOperationException: This XmlWriter does not accept Text at this state Prolog.
  at System.Xml.XmlTextWriter.ShiftStateContent (System.String occured, Boolean allowAttribute) [0x00000] in <filename unknown>:0 
  at System.Xml.XmlTextWriter.WriteString (System.String text) [0x00000] in <filename unknown>:0 
  at System.Xml.DefaultXmlWriter.WriteString (System.String text) …
Run Code Online (Sandbox Code Playgroud)

c# mono linq-to-xml

5
推荐指数
1
解决办法
1706
查看次数

标签 统计

c# ×2

.net ×1

audio ×1

linq-to-xml ×1

microphone ×1

mono ×1