Streaming Over 3G faster than WiFi?
I'm writing an iOS client for a The Text-to-Speech software product who requires the audio to be sent in PCM format, 44100hz sample rate, 16 bit , mono, so I'm recording using LPCM. It is required that users can hit play to hear their own voice aft wards, so the server sends the audio just as it was recorded.
Now, when playing back I'm using AudioStreamer : https://github.com/mattgallagher/AudioStreamer, and I've been playing a lot with buffer size and the like. As of now I'm using 64kbytes buffers and start playing when at least three buffers are fulfilled ,while the total amount is 16 buffers to avoid running out of free buffers.
And here's the thing : when playing under WiFi it takes more time to fill the buffers than when using 3G or 4G.. crazy ! This is a log that I added to see how buffers are filled , you can see that the packets are no bigger than a few kilobytes. I wonder if this is normal. With 3G they come much more smoothly than WIFI …
2013-09-16 23:50:35.997 < AudioStreamer.m:(1855)> Handle incoming data, 1382 bytes , with bytesFilled 19340 2013-09-16 23:50:36.017 < AudioStreamer.m:(1415)> AudioFile Stream Parse Bytes 2013-09-16 23:50:36.018 < AudioStreamer.m:(1855)> Handle incoming data, 5528 bytes , with bytesFilled 20722 2013-09-16 23:50:36.020 < AudioStreamer.m:(1415)> AudioFile Stream Parse Bytes 2013-09-16 23:50:36.021 < AudioStreamer.m:(1855)> Handle incoming data, 1382 bytes , with bytesFilled 26250 2013-09-16 23:50:36.031 < AudioStreamer.m:(1415)> AudioFile Stream Parse Bytes 2013-09-16 23:50:36.032 < AudioStreamer.m:(1855)> Handle incoming data, 1382 bytes , with bytesFilled 27632 2013-09-16 23:50:36.034 < AudioStreamer.m:(1415)> AudioFile Stream Parse Bytes
Which makes the buffers to take a few more seconds under Wifi.
64 kbytes - 3 buffers. No Gaps, WIFI
2013-09-17 19:29:48:553 AudioStreamer Waiting for data
2013-09-17 19:29:52:094 Begin playing audio queue with buffers used 3
64 kbytes - 3 buffers. No Gaps, and on 3G :
2013-09-17 19:27:33:680 AudioStreamer Waiting for data
2013-09-17 19:27:35:954 Begin playing audio queue with buffers used 3
As you can see, 3G seems to be twice as fast .. any clues?
链接地址: http://www.djcxy.com/p/67028.html上一篇: 音频输出单元的输入回调中允许采取哪些操作
下一篇: 3G流式传输比WiFi流式传输更快?