Skip to content

Commit e8c1a9e

Browse files
authored
Merge pull request #782 from GoogleCloudPlatform/speech-fixwordtimeoffset
Fixes seconds reported in word time offsets and enables maven checks
2 parents 5d3c484 + da0fc94 commit e8c1a9e

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

speech/cloud-client/pom.xml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,9 @@
2121

2222
<!-- Parent defines config for testing & linting. -->
2323
<parent>
24-
<artifactId>doc-samples</artifactId>
25-
<groupId>com.google.cloud</groupId>
26-
<version>1.0.0</version>
27-
<relativePath>../..</relativePath>
24+
<groupId>com.google.cloud.samples</groupId>
25+
<artifactId>shared-configuration</artifactId>
26+
<version>1.0.5</version>
2827
</parent>
2928

3029
<properties>

speech/cloud-client/src/main/java/com/example/speech/Recognize.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,8 +229,11 @@ public static void asyncRecognizeGcs(String gcsUri) throws Exception, IOExceptio
229229
System.out.printf("Transcription: %s\n",alternative.getTranscript());
230230
for (WordInfo wordInfo: alternative.getWordsList()) {
231231
System.out.println(wordInfo.getWord());
232-
System.out.printf("\t%s ns - %s ns\n",
233-
wordInfo.getStartTime().getNanos(), wordInfo.getEndTime().getNanos());
232+
System.out.printf("\t%s.%s sec - %s.%s sec\n",
233+
wordInfo.getStartTime().getSeconds(),
234+
wordInfo.getStartTime().getNanos() / 100000000,
235+
wordInfo.getEndTime().getSeconds(),
236+
wordInfo.getEndTime().getNanos() / 100000000);
234237
}
235238
}
236239
}

0 commit comments

Comments
 (0)