[Asterisk-code-review] app mp3: use correct buffer size for streams (asterisk[master])

Michael Kuron asteriskteam at digium.com
Mon Aug 29 15:34:27 CDT 2016


Michael Kuron has posted comments on this change.

Change subject: app_mp3: use correct buffer size for streams
......................................................................


Patch Set 1:

The man page suggests a buffer size of 1024 KB and says that corresponds to 6 seconds. That makes sense if you consider uncompressed stereo audio at 44.1 kHz.
For mono audio at a sampling rate of 8 kHz however, the buffer should then only have approximately 100 KB to cover 6 seconds. A 6-second buffer is fine for audio files that are played from disk or streamed from a web server (URL starting with http and ending in .mp3). For a live stream (URL starting with http and ending with m3u), even a 6-second buffer is much too large because audio will not be played before the buffer is full, which will obviously be after 6s. Even a 1-second buffer is probably larger than what can sensibly be used.

So how about if I change the buffer size for file-based playback to 96 KB (corresponding to 6s) and for live streams to 8KB (corresponding to 0.5s)? An optional buffer size parameter could be added, but I don't think it's necessary.

I will modify the commit message as requested.

-- 
To view, visit https://gerrit.asterisk.org/3738
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Id1ee274733cd804a0edecf7450329b72f1235af0
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Owner: Michael Kuron <m.kuron at gmx.de>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: Kevin Harwell <kharwell at digium.com>
Gerrit-Reviewer: Michael Kuron <m.kuron at gmx.de>
Gerrit-HasComments: No



More information about the asterisk-code-review mailing list