Score:0

Icecast sound lagging

bd flag

I have a quality problem trying to stream in local icecast server from my application.

Here is the mp3 record just before sending to icecast server

and here is the recorded mp3 from vlc media player.

As you can hear there is a sound trembling between chunks.

What may cause this problem?

The chunk period i have choose is 744 msec The sampling frequency is 44.1KHz

I use python-shout module to send audio data to icecasts servers.

The icecast config file is:

<icecast>
    <hostname>localhost</hostname>


    <limits>
        <clients>100</clients>
        <sources>2</sources>
        <threadpool>8</threadpool>
        <queue-size>102400</queue-size>
        <client-timeout>30</client-timeout>
        <header-timeout>15</header-timeout>
        <source-timeout>10</source-timeout>
        <burst-on-connect>0</burst-on-connect>
        <burst-size>65536</burst-size>
    </limits>

    <authentication>

        <source-password>hackme</source-password>

        <relay-password>hackme</relay-password>


        <admin-user>admin</admin-user>
        <admin-password>hackme</admin-password>
    </authentication>




    <http-headers>
        <header name="Access-Control-Allow-Origin" value="*" />
    </http-headers>




    
    <mount type="normal">
        <mount-name>/test.mp3</mount-name>

        <username>username1</username>
        <password>password1</password>

        <max-listeners>100</max-listeners>
        <dump-file>/tmp/dump-example1.mp3</dump-file>
        <burst-size>25536</burst-size>
        <fallback-mount>/test2.mp3</fallback-mount>
        <fallback-override>0</fallback-override>
        <fallback-when-full>0</fallback-when-full>
        <!--<intro>111.mp3</intro>-->
        <hidden>0</hidden>
        <public>1</public>
        <http-headers>
                <header name="Access-Control-Allow-Origin" value="http://webplayer.example.org" />
                <header name="baz" value="quux" />
        </http-headers>
    </mount>
   


    <fileserve>1</fileserve>

    <paths>
        <logdir>./log</logdir>
        <webroot>./web</webroot>
        <adminroot>./admin</adminroot>

        <alias source="/" destination="/status.xsl"/>
    </paths>

    <logging>
        <accesslog>access.log</accesslog>
        <errorlog>error.log</errorlog>

        <loglevel>3</loglevel> <!-- 4 Debug, 3 Info, 2 Warn, 1 Error -->
        <logsize>10000</logsize> <!-- Max size of a logfile -->
        <!-- <logarchive>1</logarchive> -->
    </logging>
</icecast>

and the python modules to mixx the mp3 sound are pyaudio and pydub.

Edit: The bit rate that i connect the application to the icecast server is 128Kbps but i don't think the encoded mp3 data are 128Kbps. Anyway the record before transmitions sound good, so what may cause the quality problem?

Edit: If i try to just retransmit a radio station, then there is no problem:

        with requests.get("https://impradio.bytemasters.gr/8002/LIVE", stream=True) as peradio:
            for chunk in peradio.iter_content(chunk_size=4096):
                for connection in self.connections:
                    if connection["status"]=="connected":
                        connection["connection"].send(chunk)
                        connection["connection"].sync()

so i think there is no icecast error but something goes wrong with my application.

Any help would be much appreciated.

Edit: In ogg format the quality is almost excellent.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.