我正在尝试使用Qt开发一个多媒体程序,它从麦克风(使用QAudioInput)获取音频输入流,然后将采样的字节存储在内存中60毫秒,然后播放(使用QAudioOutput).
该文档为QAudioOuput具有完成大部分这样的一个例子,但是它使用一个文件作为数据源来代替.如何修改它以使用输入流?
什么样的XML文档描述了这个DTD?我无法理解"参考文件".
<!ELEMENT mag(paper *)>
<!ELEMENT paper(title ,author+,ref*)>
<!ELEMENT title #PCDATA>
<!ELEMENT author #PCDATA>
<!ELEMENT ref paper>
Run Code Online (Sandbox Code Playgroud) 我有一个程序,将流字节发送到另一台PC.值的范围是0到255.我像这样设置了我的serialport
sp.BaudRate = 115200;
sp.PortName = "COM53";
sp.DataBits = 8;
sp.StopBits = System.IO.Ports.StopBits.One;
sp.Parity = System.IO.Ports.Parity.None;
sp.ReadTimeout = 0;
sp.Open();
sp.DataReceived += new
System.IO.Ports.SerialDataReceivedEventHandler(sp_ DataReceived);
Run Code Online (Sandbox Code Playgroud)
然后我有了这个
void sp_DataReceived(object sender,
System.IO.Ports.SerialDataReceivedEventArgs e)
{
string Mystring = sp.ReadExisting();
byte testbyte = 254;
// Gather all the bytes until 102 is reached
foreach (byte c in Mystring)
{
if(pixelcount<102)
pixel[pixelcount] = c;
pixelcount++;
if (c 126)
Console.WriteLine("big number {0}", c);// biggest number ever printed is 127
}
//got all the bytes, now draw …Run Code Online (Sandbox Code Playgroud)