hls-test/HLS/rewrite-mp3.php
2023-04-04 09:57:12 -07:00

20 lines
511 B
PHP

<?php
require( __DIR__ . '/StreamReader.php' );
require( __DIR__ . '/OwningStreamReader.php' );
require( __DIR__ . '/Segmenter.php' );
require( __DIR__ . '/MP3Segmenter.php' );
use MediaWiki\TimedMediaHandler\HLS\MP3Segmenter;
$argv = $_SERVER['argv'];
$self = array_shift( $argv );
$filename = array_shift( $argv );
$target = 10;
$segmenter = new MP3Segmenter( $filename );
$segmenter->consolidate( $target );
$segmenter->rewrite();
$m3u8 = $segmenter->playlist( $target, $filename );
print $m3u8 . "\n";