sdsfsdf (aeons_back) wrote,

AAC/AACplus/AACplusV2 streaming on Linux/Windows: hz Icecast/Shoutcast source client for Linux/Win32

hz - AAC/AAC+/AAC+V2 & MP1/MP2/MP3 Icecast/Shoutcast source client for Linux/Win32

What's the point?
hz is a small, portable and fast MPEG1/2/2.5 LayerI/II/III and
AAC/AACplus/AACplusV2 Icecast/Shoutcast source client. It is written
to be nice and easy to use. It is also scriptable in some way, so
you can script your playlist handling with Lua scripting language.

What does "hz" mean?
hz stands for "a h.. ego znaet". If you can understand this, I probably
shouldn't explain more. hz is also very antisocial.

Yes, it doesn't like you by default. Neither your mom and girlfriend.
The only thing it likes to do is to hang out together with its rubber

What is supported?
AAC/AACplus/AACplusV2 and MPEG1/MPEG2/MPEG2.5 LayerI/II/III files
can be streamed to a Icecast or Shoutcast server. All possible bitrates are
fully supported, even VBR, but gosh, VBR seems not to be a grand idea for
an internet radio, I suggest that you use CBR. But whatever...

Tell me more.
Well, here are some key features:

 - AACx and MPx files support. All possible bitrates and their variations, including VBR.
 - Pretty precise timing. You shouldn't get any client buffering ever.
 - Icecast and Shoutcast servers are fully supported.
 - Metadata updating supported. The metadata is read from ID3v1 and ID3v2 tags.
   It can also be read from cuesheets (.cue file with the same name as audio file).
 - You can write your own script routine to get the next file name to stream.
 - You can write your own script routine to format metadata.

What about MP4, MP4A files support? And Ogg Vorbis?
MP4 is a container, not a compression format. If your MP4 file
contains AAC compressed sound that you want to stream, you
have to extract it from MP4 first. You can do it with MPEG4IP
(, for example.
Ogg Vorbis is not (yet) supported.

Is there to be a live source support, for example /dev/dsp?
Never. hz has been written to be small and fast, so you can run it even on
an old Pentium-166 and stream say perfect quality AACplusV2 without
any significant performance impact.

What platforms are supported?
Linux and Win32 at the moment. Want more? Then, err.. port it.

How do I compile it?

How do I configure it?
Read conf/hz.ini.dist. Tune it for your needs.
Prepare your static playlist or write your dynamic playlist handling
function in Lua scripting language. Do not ever mix files that have
different format (MPx/AACx) or different samplerate in one playlist. No,
hz will successfully survive this as well as Icecast, but your player
definitely won't. You've been warned.

How do I run it?
hz <hz ini.file>, i.e.:
./hz /etc/hz/rock.ini

Can it be run as daemon on Linux?

As service on Windows?
No. You'll need to use one of that 3rd party software to hide the
hz console window or to install it as service if you have to.

I've found a bug!
Yes, there should be some. Report them, if you care. Oh, and be descriptive
as possible. More details increase the chances for it to be fixed.
Provide no details and your message won't be answered.


v0.6 - Oct 5 2007

- MPEG1/2/2.5 Layer I/II/III files now supported!
- Daemon mode added, works on Linux.
- Some really nasty bugs fixed.

v0.5 - Jan 2007

- Extended Lua scripting. Essential hz configuration parameters are now available to Lua scripts. Added hz_onmetadata script function to override metadata, hz_formatmetadata to format metadata.
- Cuesheet support added. If hz finds a .cue file with the same name as currently playing .aac file, then tags are read from that .cue file. It makes it possible to stream .aac files that were captured by StreamRipper with correct metadata!
- New ConnectionAttempts ini parameter. If server is down, hz will try to reconnect up to ConnectionAttempts times before giving up.
- Rewrote net functions, and now hostnames can also be specified in the host ini parameter.
- Some net error checking added, now hz will tell you if it is being rejected by a server.
- Some minor improvements.

v0.4 - Autumn 2006

- Added Lua scripting. Now playlist handling can be done via cool and convenient Lua scripts. Why not Python and Perl then? Well, I don't like Perl, I like Lua. And Python... Hmm, maybe in next version :)
- Shoutcast server is now supported too. With metadata!
- Added logging to an external file.
- Proper CTRL-C handling.
- Nice and groovy Makefile :)
- Some minor bugs are fixed.
- Cleaned up code a bit.

v0.3 - Autumn 2006

- Metadata updating added. Supported tags are ID3v1 and ID3v2. If a file contains both ID3v1 and ID3v2, then ID3v1 has the priority. Unicode tags in ID3v2 are not supported yet. In fact, my entire ID3v2 implementation is a quick and dirty hack, so watch out, there may be problems. Yes, I'm evil. Bugoga.
- Send-ahead buffer is now configurable. Default is 3 seconds.
- If AAC file check fails, it causes hz to skip the erroneous file instead of bailing out.
- Playlist is now checked for non-existing files.
- Even more precise timing. Tested on a wide range of AAC files, appears to work with all tested CBR and VBR files, with bitrates from 24 to 320kbps.
- Handling of broken AAC files improved. Now hz tries to resync accurately to the next valid AAC frame if an error in AAC file is encountered.
- No more pause between tracks, as this parameter didn't make much sense but could break the timing.
- Some other bugfixes.

v0.2 - Summer 2006

- Now compiles on Linux and Win32
- Practically balls-on accurate timing. No more listener disconnects even after a long period of time. (Still needs some testing).
- Playlist file gets reloaded with each track change. Allows to change playlist dynamically without stopping the client.
- Random play mode is added
- Pause between tracks is now configurable

v0.1 - Summer 2006

First version. Sucked too much.


some mirror

hz is written in FreePascal (I prefer not to code in C), so you'll probably need the compiler. Get it from

aacPlus v2 encoder for Linux (courtesy of Matteo Croce) :

  • Post a new comment


    default userpic

    Your IP address will be recorded 

    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.
← Ctrl ← Alt
Ctrl → Alt →
← Ctrl ← Alt
Ctrl → Alt →