PHPackages                             oleh-exe/mp3-stream-title - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. oleh-exe/mp3-stream-title

ActiveLibrary

oleh-exe/mp3-stream-title
=========================

Fetch and parse current track metadata from Icecast and Shoutcast MP3 streams.

v1.0.0(1mo ago)82↓75%1Apache-2.0PHPPHP ^8.2

Since Jul 17Pushed 1mo ago2 watchersCompare

[ Source](https://github.com/oleh-exe/mp3-stream-title)[ Packagist](https://packagist.org/packages/oleh-exe/mp3-stream-title)[ Docs](https://github.com/oleh-exe/mp3-stream-title)[ RSS](/packages/oleh-exe-mp3-stream-title/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (2)Dependencies (2)Versions (2)Used By (0)

🎵 MP3 Stream Title
==================

[](#-mp3-stream-title)

[![PHP Version](https://camo.githubusercontent.com/4afea8ebc529326b47ecdd7dfc0a901bfdacbb0cb9ea9f20b7d75d75735d8175/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253345253344382e322d3737376262332e7376673f6c6f676f3d706870266c6f676f436f6c6f723d7768697465)](https://camo.githubusercontent.com/4afea8ebc529326b47ecdd7dfc0a901bfdacbb0cb9ea9f20b7d75d75735d8175/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253345253344382e322d3737376262332e7376673f6c6f676f3d706870266c6f676f436f6c6f723d7768697465)[![License](https://camo.githubusercontent.com/48c3918479c6ea40d65216332adbf6c7a89400e32b69faf50a750b905d214b76/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d417061636865253230322e302d677265656e2e737667)](https://camo.githubusercontent.com/48c3918479c6ea40d65216332adbf6c7a89400e32b69faf50a750b905d214b76/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d417061636865253230322e302d677265656e2e737667)[![Packagist Version](https://camo.githubusercontent.com/e1dc059840c5e578d268266623768bb43440b900323f68828f790e30feaf4052/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6f6c65682d6578652f6d70332d73747265616d2d7469746c652e737667)](https://packagist.org/packages/oleh-exe/mp3-stream-title)[![Total Downloads](https://camo.githubusercontent.com/d473bbcad006d4cb0d724d6a113e03962e7f71f0f236f4cddf45fe12c4759557/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6f6c65682d6578652f6d70332d73747265616d2d7469746c652e737667)](https://packagist.org/packages/oleh-exe/mp3-stream-title)

[![Stand with Ukraine](https://raw.githubusercontent.com/vshymanskyy/StandWithUkraine/main/badges/StandWithUkraine.svg)](https://stand-with-ukraine.pp.ua)[![Made in Ukraine](https://camo.githubusercontent.com/80937f1273ed9263d28ff963a657c01857c8825e176a96a70822881590ffc1be/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6d6164655f696e2d556b7261696e652d6666643730302e7376673f6c6162656c436f6c6f723d303035376237)](https://stand-with-ukraine.pp.ua)

MP3 Stream Title is a small PHP library for reading the current `StreamTitle`metadata from Icecast and Shoutcast MP3 radio streams.

It sends an ICY metadata request, reads only the part of the stream needed to reach the metadata block, and returns the current `StreamTitle` metadata as a string.

Features
--------

[](#features)

- Fetches current track metadata from online MP3 radio streams.
- Supports cURL, PHP streams, and socket-based transports.
- Uses typed PHP 8.2 APIs, strict validation, and exceptions.
- Parses ICY metadata through focused request, response, and metadata helpers.
- Includes helpers for UTF-8 fallback conversion and HTML entity decoding.
- Provides `MetadataWatcher` for polling a stream and yielding title changes.
- Ships with Composer PSR-4 autoloading.

Requirements
------------

[](#requirements)

- PHP 8.2 or newer.
- PHP cURL extension.
- Composer.

`composer.json` declares `ext-curl`, and the default transport is `StreamTransport::CURL`. Although stream and socket transports are available, the package currently requires the PHP cURL extension.

Installation
------------

[](#installation)

```
composer require oleh-exe/mp3-stream-title
```

For development from a checkout, install dependencies first:

```
composer install
```

All examples below assume Composer autoloading is available through `vendor/autoload.php`.

Usage
-----

[](#usage)

```
