1

Once a month the mp3 streams messes up and the only way to tell it has messed up is by listening to it as it streams. Is there a script or program or tool I can use to monitor the live streams at a given url and send some kind of flag when it corrupts?

What happens is normally it plays a song for example or some music but once a month, every month, randomly, the stream corrupts and starts random chimpmunk like trash audio. Any ideas on this? I am just getting started at this with no idea at all.

Bulvak
  • 1,794
  • 8
  • 31
  • 63

1 Answers1

1

Typically, this will happen when you play a track of the wrong sample rate.

Most (all that I've seen) SHOUTcast/Icecast encoders (going straight from files) will compress for MP3 just fine, but assume a fixed sample rate of whatever they are configured for. Typically this will be 44.1kHz. If you drop in a 48kHz track, or a 22.05kHz track, they will play at different speeds while causing all sorts of random issues with the stream.

The problem is easy enough to verify. Simply create a file of a different sample rate and test it. I suspect you will reproduce the problem. If that is the case, to my knowledge there is no way to detect it, since your stream isn't actually corrupt... it just sounds incorrect. You will have to scan all of your files for sample rate. FFMPEG in a script should be able to help you with that.


Now, if the problem actually is a corrupt MP3 stream, then you have problems on your encoding side. I suspect simply swapping out whatever DLL or module you're using with a recent stable version of LAME will help.

To detect a corrupt MP3 stream, your encoder must be using CRC. If you enable it, you should be able to read through the headers of each frame to find the CRC, and then run it on the audio data. In the event you get an error (or several frames with errors), you can then trigger a warning.

You can find information on the MP3 stream header here:

http://www.mp3-tech.org/programmer/frame_header.html

Brad
  • 159,648
  • 54
  • 349
  • 530
  • thank you sooooo much brad!!!! I would like to discuss this a little more to get a better idea of this. I am a coop student and never worked on this and have been given very little documentation. Ive been told they have some encoder and such working and the problem where this is occuring is when the feeds or the stream gets transcoded to get played on a cell. "Randomly once a month the records start playing jibberish and to fix this we reset our connection and this fixes the problem" One of the technicians said to me to look into ffmpeg as well. Thank you SOOO MUCH! – Bulvak Nov 22 '11 at 14:31
  • 1
    @Nadal, Feel free to contact me at brad@musatcha.com if you need any help with streaming. If you have questions specifically related to programming, post them on Stack Overflow (and send me a link) so that everyone can provide input and learn. – Brad Nov 22 '11 at 14:41
  • Thank you! I am trying to download FFMPEG but I have never worked with streams before so I am not sure how to get started on this. You can remove your email so you dont get spammed, I have written it down. – Bulvak Nov 22 '11 at 14:47
  • That doesnt seem to be the problem. All the live streams coming in are the same frequency. Thinking of looking into FMPEG and bitrate – Bulvak Nov 22 '11 at 20:00
  • 1
    @Nadal, bitrate has nothing to do with this. Sample rate will appear the same on the client side, but possibly not in the source material. I will discuss this with you over e-mail, as this is not a programming issue. – Brad Nov 22 '11 at 20:11
  • thanks for all the help, it has to be a corrupt MP3 stream in this case. Just so it is clear the stream keeps streaming even with the garbage sounds it makes the only way they have been able to tell so far is by listening to it – Bulvak Nov 23 '11 at 18:07