RPC Error while implementing Synthesize/SynthesizeSpeechRequest

Hello,

Trying to write a text-to-speech client in Go that calls the Jarvis TTS Synthesize method. When calling that method I’m returned with an nondescriptive "rpc error: code = Unimplemented desc = "

Steps taken so far:

I have the quickstart server running on localhost:50051, i have generated the bindings from the .proto files, and configured both a HealthClient and TextToSpeechClient.

I was able to connect to the health client and get a status:SERVING response.

Here is the failing code for the text to speech client:

package main

import (
	"context"
	"flag"
	"log"
	"time"

	pba "github.com/Xaqt/nvidia-jarvis-api/protos/nvidia.jarvis"
	pb "github.com/Xaqt/nvidia-jarvis-api/protos/nvidia.jarvis_speech"

	"google.golang.org/grpc"
)

func main() {

	serverFlag := flag.String("server", "0.0.0.0:50051", "Jarvis server to connect to")
	queryFlag := flag.String("query", "", "Text to be encoded into audio")
	voiceFlag := flag.String("voice", "ljspeech", "Voice name to use")
	languageFlag := flag.String("language", "en-US", "Language code to use")

	flag.Parse()

	if *queryFlag == "" {
		log.Fatal("-query must be set.")
	}

	// Set up a connection to the server.
	conn, err := grpc.Dial(*serverFlag, grpc.WithInsecure(), grpc.WithBlock(), grpc.WithTimeout(time.Second))
	if err != nil {
		log.Fatalf("Unable to connect to server: %v", err)
	}
	defer conn.Close()

	cc := pb.NewJarvisTTSClient(conn)
	hc := pb.NewHealthClient(conn)

	// Contact the server and print out its response.
	ctx, cancel := context.WithTimeout(context.Background(), time.Second)
	defer cancel()

	// This returns a healthy response
	h, err := hc.Check(ctx, &pb.HealthCheckRequest{
		Service: *serverFlag,
	}, grpc.EmptyCallOption{})

	if err != nil {
		log.Fatalf("Issue encountered with Jarvis Request: %v", err)
	}

	log.Println("Healthcheck response: ", h)

	r, err := cc.Synthesize(ctx, &pb.SynthesizeSpeechRequest{
		Text:         *queryFlag,
		LanguageCode: *languageFlag,
		Encoding:     pba.AudioEncoding_FLAC,
		SampleRateHz: int32(22050),
		VoiceName:    *voiceFlag,
	}, grpc.EmptyCallOption{})

	if err != nil {
		log.Fatalf("Issue encountered with Jarvis Request: %v", err)
	}

	log.Println("TTS Response in bytes: ", r)
}

Alias pb refers to nvidia_speech bindings: NLP, TTS, ASR, Health, NLP_Core
Alias pba refers to nvidia audio encoding bindings

Any help is appreciated

Mystery solved. In case anyone runs into this in the future:

My IDE was throwing import errors in the .proto files due to audio.proto and jarvis_tts.proto having different package names. I changed the package name in jarvis_tts.proto from nvidia.jarvis.tts to nvidia.jarvis.

Changing the package name back to nvidia.jarvis.tts and recompiling fixed the issue.

2 Likes

Thanks so much for sharing the problem - and also solving it by your self too, I am sure its going to help others.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.