fralik/package

There is no license information available for the latest version (v0.2.0) of this package.

Load and parse VTT files.

v0.2.0 2023-01-11 17:46 UTC

This package is auto-updated.

Last update: 2025-06-11 23:44:19 UTC


README

This small PHP package assists in the loading and parsing of VTT files.

Usage

use Fralik\Package\Transcription;

$transcription = Transcription::load('path/to/file.vtt');

foreach ($transcription->lines() as $line) {
    // $line->body
    // $line->toHtml()
    
    // $line->timestamp->begin()
    // $line->timestamp->beginSeconds()
    // $line->timestamp->end()
    // $line->timestamp->endSeconds()
    
    // json_encode($line);
}

// Group lines into full sentences.
// $transcription->lines()->groupBySentence();

License

This package is open-sourced software licensed under the MIT license.