fralik / package
Load and parse VTT files.
Installs: 6
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/fralik/package
Requires
- php: >=8.0
Requires (Dev)
- phpunit/phpunit: ^9.5
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.