@@ -34,7 +34,7 @@ function analyze_transcription($uri, array $options = [])
3434 $ features = [Feature::SPEECH_TRANSCRIPTION ];
3535 $ speechTranscriptionConfig = (new SpeechTranscriptionConfig ())
3636 ->setLanguageCode ('en-US ' )
37- ->setEnableAutomaticPunctuation (True );
37+ ->setEnableAutomaticPunctuation (true );
3838 $ videoContext = (new VideoContext ())
3939 ->setSpeechTranscriptionConfig ($ speechTranscriptionConfig );
4040
@@ -48,7 +48,7 @@ function analyze_transcription($uri, array $options = [])
4848 'videoContext ' => $ videoContext
4949 ]);
5050
51- print ('Processing video for speech transcription... ' );
51+ print ('Processing video for speech transcription... ' . PHP_EOL );
5252 # Wait for the request to complete.
5353 $ operation ->pollUntilComplete ($ options );
5454
@@ -66,7 +66,7 @@ function analyze_transcription($uri, array $options = [])
6666 # each alternative is a different possible transcription
6767 # and has its own confidence score.
6868 foreach ($ transcription ->getAlternatives () as $ alternative ) {
69- print ('Alternative level information ' );
69+ print ('Alternative level information ' . PHP_EOL );
7070
7171 printf ('Transcript: %s ' . PHP_EOL , $ alternative ->getTranscript ());
7272 printf ('Confidence: %s ' . PHP_EOL , $ alternative ->getConfidence ());
@@ -76,7 +76,7 @@ function analyze_transcription($uri, array $options = [])
7676 $ word = $ wordInfo ->getWord ();
7777 $ startTime = $ wordInfo ->getStartTime ();
7878 $ endTime = $ wordInfo ->getEndTime ();
79- printf ('%s s - %s s: %s ' . PHP_EOL , $ startTime , $ endTime , $ word );
79+ printf ('%s s - %s s: %s ' . PHP_EOL , $ startTime-> getSeconds () , $ endTime-> getSeconds () , $ word );
8080 }
8181 }
8282 }
0 commit comments