Click here to Skip to main content
15,888,096 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
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....
Posted

1 solution

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.
 
Share this answer
 
Comments
JackDingler 9-Oct-13 15:52pm    
This is correct.

Further wave files have a number of settings that effect the number of channels, and quality of the data. The higher the quality, the larger the byte size of the wave file.

The encoding of the wav file makes a difference also. PCM files tend to be the largest, but are also lossless.

Lossy encodings, like mp3 files, sacrifice fidelity for file size.

So before you can even begin answer your question, you need to define what level of fidelity you need.
the vacuum 10-Oct-13 2:02am    
Only need low frequency signals, so 11KHZ sampling frequency & 16 bit resolution is enough.My plan is to do it as part by part so I first implemented part to capture the sound from mic and to record it with required quality as .wav file, it's working. Now my main issue is to transfer it to the destination system through serial COM port within my transmission limits(100 Kbps) without any loss of data. I gone through serial comm related articles, my understanding is that.. have to do comm buffer management & flow control mechanisms for the effective transfer(and for playing it real time at the destination PC).
JackDingler 10-Oct-13 10:43am    
You might want to look into the ZModem Protocol. It was designed for slow connection speeds. Source code should be available on the net with a bit of searching. It should be possible to modify it to be a streaming protocol.
Richard MacCutchan 10-Oct-13 10:40am    
I think you meant to reply to OP, not me.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900