![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#21 |
|
Highly Adaptive Penguin
Join Date: May 2005
Location: United States
Posts: 247
Rep Power: 4
![]() |
Re: Streaming Audio over network
Input and Output data is successfully being added to the queues, but now I am having trouble with the PlayOutput and SendInput functions. It seems these functions aren't correctly looping through the queues, but I dont know.
Here is what I have so far: c++ Syntax (Toggle Plain Text)
|
|
|
|
|
|
#22 |
|
Expert Programmer
Join Date: Jun 2005
Posts: 810
Rep Power: 4
![]() |
Re: Streaming Audio over network
You need to change readindex when you have read something out of the queue, similar to how you are updating WriteIndex. So that the ReadIndex is chasing the WriteIndex.
Something like: c++ Syntax (Toggle Plain Text)
Note that this loop will use up as much CPU as it can. You will need to add some signalling so that the reader knows when there is data available, rather than looping and checking ReadIndex against WriteIndex. Also note that you will need to take care that your threads don't try to access the same memory at the same time. |
|
|
|
|
|
#23 |
|
Highly Adaptive Penguin
Join Date: May 2005
Location: United States
Posts: 247
Rep Power: 4
![]() |
Re: Streaming Audio over network
Thanks for the replies and advice.
|
|
|
|
|
|
#24 |
|
Highly Adaptive Penguin
Join Date: May 2005
Location: United States
Posts: 247
Rep Power: 4
![]() |
Re: Streaming Audio over network
I have revised my code a bit. The program runs, but the playback is extremely choppy. I have posted the code for anyone who wants to look at it.
Brent |
|
|
|
|
|
#25 |
|
Highly Adaptive Penguin
Join Date: May 2005
Location: United States
Posts: 247
Rep Power: 4
![]() |
Re: Streaming Audio over network
I have found some audio streaming source code online using google, and have modified it for my uses. The code compiles and runs fine, but does not seem to be transmitting audio correctly. The program is supposed to create two queues, one for input and one for output. It is supposed to constantly updates these queues( send data from input queue, and play data from output queue) but does not seem to be working. Like I said the progam compiles and runs fine by just isn't doing what it's told. I am posting the code as an attachment. Im using Borland C++ BuilderX on Win dows XP. Thanks for any help.
brent |
|
|
|
|
|
#26 |
|
Highly Adaptive Penguin
Join Date: May 2005
Location: United States
Posts: 247
Rep Power: 4
![]() |
Re: Streaming Audio over network
I have made some progress in my program. I have created a UDP receive class to handle all received data. It now receives audio and adds it to a queue, but it doesn't seem to be capturing input from the microphone like it is supposed to, or sending data, for that matter. I am posting the code. Could someone please point me in the right direction. I am using Borland C++ BuilderX on Windows XP. Thanks in Advance.
Brent And here is the output of the program: no free buffers no free buffers no free buffers no free buffers no free buffers no free buffers no free buffers no free buffers no free buffers udp: 1330210 free: 0 play: 0 In: 0 Out: 0 |
|
|
|
|
|
#27 |
|
Hobbyist Programmer
Join Date: May 2006
Location: West Jordan, Utah, United States
Posts: 176
Rep Power: 3
![]() |
Re: Streaming Audio over network
Are you sending uncompressed wave files? At 192KB/s , that could be choppy. You would need to buffer quite a bit.
|
|
|
|
|
|
#28 |
|
Highly Adaptive Penguin
Join Date: May 2005
Location: United States
Posts: 247
Rep Power: 4
![]() |
Re: Streaming Audio over network
The program streams uncompressed voice(Wave PCM) over a network (LAN or internet). At the moment, I am only testing this on my local machine and over my LAN, so there shouldn't be any latency.
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Network Simulator design | renato | Software Design and Algorithms | 2 | Dec 11th, 2007 10:54 PM |
| An Audio and Video class for ruby | Master | Ruby | 3 | Mar 24th, 2006 5:49 AM |
| Streaming audio songs? | java_roshan | Coder's Corner Lounge | 1 | Oct 27th, 2005 1:35 PM |
| Code Request - Onboard Audio | Meecher | Other Programming Languages | 7 | Sep 20th, 2005 1:53 AM |
| Checking source codes of image, audio and video files | on_auc | C++ | 3 | Feb 21st, 2005 8:36 PM |