]> git.ipfire.org Git - thirdparty/asterisk.git/commit
app_mp3: Use correct buffer size and the same sample rate as the channel 41/3741/3
authorMichael Kuron <m.kuron@gmx.de>
Wed, 31 Aug 2016 17:23:09 +0000 (19:23 +0200)
committerMichael Kuron <m.kuron@gmx.de>
Thu, 1 Sep 2016 11:16:19 +0000 (13:16 +0200)
commitdd408708c9b165444caf72e2ce7ab2a104a903b6
treeaeee3a96e9a01f5d7ca9a8fad78b186bbeb7c080
parenta220f40cfe2ece8a1bbf3244d40378f1dd6343d7
app_mp3: Use correct buffer size and the same sample rate as the channel

Previously, the buffer used for MP3 streamed from HTTP servers had a size of
1 MB. For 8 kHz mono audio at 16 bit resolution, such a buffer covers about 1
minute. Only when the buffer is full does audio start to play.
For MP3 files streamed from a server, that is usually not a big deal as long as
the connection to the server is fast enough to supply that much data within a
second or two. For MP3 live streams however, it takes 1 minute to download 1
minute of audio, so without this change, app_mp3 wasn't really usable for MP3
live streams.
This commit changes the buffer size so that it covers 6 seconds of an MP3 file
streamed from a server and 0.5 seconds of an MP3 live stream. The latter is
identified by the use of a .m3u file extension.

app_mp3 so far only supported 8 kHz audio.
Now it always runs at the sample rate of the channel.

ASTERISK-26085 #close

Change-Id: Id1ee274733cd804a0edecf7450329b72f1235af0
apps/app_mp3.c