Skip to content

laracasts/transcriptions

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

VTT Transcriptions

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

Usage

use Laracasts\Transcriptions\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.