Qt Audio Stream / Download
-
Hi,
I would like to write some example applications to demonstrate how push and pull models in server client communication work and I thought streaming or downloading audio would be a cool example since you can spot the differences quite well.
But sadly, networking is not my strengh so I would like to ask you, to help me come up with the general approach. ;)So I want to write 4 applications, one client server pair for audio streaming, one client server pair for "downloadin".
The pull (download) apps should be easy when it comes to the concept:
A client requests a .wav-file. The servers sends a chunk of the file and the client writes the chunk in a local copy and requests a new chunk. this repeats until the end of the file is reached.
The reason I want to use this method is that the client also should start playing the samples after buffering for a while.
Which protocol would you use and could you give me a sketch of what Qt classes I should use? I would like to let the s/c communication run on a higher level so I don't have to think about loosing samples and so on. ;)When it comes to the push / streaming example, I don't have any idea how to solve this. Which classes / protocols should I use and is it even possible to stream audio from a pc? (Lets say 10 clients are more than enough to demonstrate the concept. :) )
I am sorry that I post such an generall queston here but I am new to Qt and don't have much experience with networking either. :( I hope you can help me!
Thanks in advance!
-
Hi,
The QtNetwork modules comes to mind and the related examples/demos you have in Qt's documentation should help you get started. As for the protocol, Tcp for the pull and Udp for the push. You have QTcpSocket and QUdpSocket that you can look at.
Hope it helps
-
Yes I already looked at the examples. (at least at some tcp ones)
[quote author="SGaist" date="1399925707"]Hi,
As for the protocol, Tcp for the pull and Udp for the push. You have QTcpSocket and QUdpSocket that you can look at.[/quote]It's not often that you get such a clear answer. Thanks. ;)
Regarding UDP, do I have to manage lost packets or does Qt help me there already? I don't know if it is ok to just ignore lost packages and so on in an audio stream.But I still need to figure out, how the layout of the push exmaple should look like. ;)