Skip to content

Commit 78d6822

Browse files
authored
fix(grpc): forward word-level timestamps in AudioTranscription wrapper (#10402)
The gRPC server wrapper in pkg/grpc/server.go reconstructs TranscriptSegment messages when relaying AudioTranscription results from backends. The Words field was not being copied, causing all word-level timestamps to be silently dropped regardless of backend support. This was introduced when PR #9621 added the TranscriptWord proto message and transcriptResultFromProto (server-side), but did not update the server-side gRPC relay to forward the new field. Fixes #9306 Signed-off-by: fqscfqj <fqscfqj@outlook.com>
1 parent 29dbba7 commit 78d6822

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

pkg/grpc/server.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,14 @@ func (s *server) AudioTranscription(ctx context.Context, in *pb.TranscriptReques
243243
for _, t := range s.Tokens {
244244
tks = append(tks, int32(t))
245245
}
246+
words := make([]*pb.TranscriptWord, 0, len(s.Words))
247+
for _, w := range s.Words {
248+
words = append(words, &pb.TranscriptWord{
249+
Start: int64(w.Start),
250+
End: int64(w.End),
251+
Text: w.Text,
252+
})
253+
}
246254
tresult.Segments = append(tresult.Segments,
247255
&pb.TranscriptSegment{
248256
Text: s.Text,
@@ -251,6 +259,7 @@ func (s *server) AudioTranscription(ctx context.Context, in *pb.TranscriptReques
251259
End: int64(s.End),
252260
Tokens: tks,
253261
Speaker: s.Speaker,
262+
Words: words,
254263
})
255264
}
256265

0 commit comments

Comments
 (0)