使用C / C ++在Windows中通过串行(COM)端口发送wav文件 [英] Sending a wav file through serial (COM) port in Windows using C/C++

查看:120
本文介绍了使用C / C ++在Windows中通过串行(COM)端口发送wav文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我必须准备一个c / c ++程序,通过Windows中的串口(使用API​​)发送音频文件(从麦克风输入录制的* .wav文件)内容,并通过COM端口本身在目标系统接收它。我在使用传输的通信技术中有大小(100kbps)约束。所以需要将其作为零件发送。如何读取文件内容并通过COM端口发送?

目前我准备了一个程序来录制麦克风输入并将其存储在本地(如* .wav文件)。但我的实际要求是将麦克风输入直接发送到目标系统并且必须实时播放?是否可以将麦克风音频实时发送到目标系统并在其中播放(带宽为100Kbps)?

请帮我解决问题..如果有任何示例程序请提供。 ...

I have to prepare a c/c++ program to send a audio file(*.wav file recorded from mic input) contents through serial port in windows(using API) and to receive it at a destination system through COM port itself . I have size (100kbps) constrains in the communication technology using to transfer. So need to send it as parts. How can I read the file content and send it through COM port?
Currently I have prepared a program to record mic input and to store it locally(as *.wav file). But my actual requirement is to send the mic input directly to the destination system and have to play it in real time? Is it possible to send the mic audio real time to the destination system & to play in it(with 100Kbps bandwidth)?
Please help me to solve the issue..if have any sample program please provide....

推荐答案

无论其来源或类型如何,发送任何数据都完全相同。您只需要以适当大小的块读取它,并通过接口传输到接收器PC。接收器然后将其存储在文件中或直接发送到播放器软件。您是否可以通过100Kbps限制执行此操作是您需要自己尝试的,不可能推测是否有足够的带宽来保持媒体播放器的运行。
Sending any data is exactly the same regardless of its source or type. You just need to read it in blocks of some appropriate size and transmit across the interface to the receiver PC. The receiver then either stores it in a file or sends it direct to the player software. Whether you can do this with the 100Kbps restriction is something you need to try for yourself, it's impossible to speculate whether that is enough bandwidth to keep the media player going.


这篇关于使用C / C ++在Windows中通过串行(COM)端口发送wav文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆