Skip to content

Commit

Permalink
Merge pull request #782 from GoogleCloudPlatform/speech-fixwordtimeof…
Browse files Browse the repository at this point in the history
…fset

Fixes seconds reported in word time offsets and enables maven checks
  • Loading branch information
gguuss authored Aug 2, 2017
2 parents 5d3c484 + da0fc94 commit e8c1a9e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
7 changes: 3 additions & 4 deletions speech/cloud-client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,9 @@

<!-- Parent defines config for testing & linting. -->
<parent>
<artifactId>doc-samples</artifactId>
<groupId>com.google.cloud</groupId>
<version>1.0.0</version>
<relativePath>../..</relativePath>
<groupId>com.google.cloud.samples</groupId>
<artifactId>shared-configuration</artifactId>
<version>1.0.5</version>
</parent>

<properties>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -229,8 +229,11 @@ public static void asyncRecognizeGcs(String gcsUri) throws Exception, IOExceptio
System.out.printf("Transcription: %s\n",alternative.getTranscript());
for (WordInfo wordInfo: alternative.getWordsList()) {
System.out.println(wordInfo.getWord());
System.out.printf("\t%s ns - %s ns\n",
wordInfo.getStartTime().getNanos(), wordInfo.getEndTime().getNanos());
System.out.printf("\t%s.%s sec - %s.%s sec\n",
wordInfo.getStartTime().getSeconds(),
wordInfo.getStartTime().getNanos() / 100000000,
wordInfo.getEndTime().getSeconds(),
wordInfo.getEndTime().getNanos() / 100000000);
}
}
}
Expand Down

0 comments on commit e8c1a9e

Please sign in to comment.