diff --git a/README.md b/README.md index b0875dfc..a752079c 100644 --- a/README.md +++ b/README.md @@ -151,7 +151,7 @@ These examples provide: - Save audio to a Path - [examples/speak/save](https://github.com/deepgram/deepgram-go-sdk/blob/main/examples/speak/save/main.go) - Save audio to a user-defined Writer - [examples/speak/file](https://github.com/deepgram/deepgram-go-sdk/blob/main/examples/speak/file/main.go) - - Save audio to a Buffer - [examples/speak/buffer](https://github.com/deepgram/deepgram-go-sdk/blob/main/examples/speak/buffer/main.go) + - Save audio to a Stream/Buffer - [examples/speak/stream](https://github.com/deepgram/deepgram-go-sdk/blob/main/examples/speak/stream/main.go) - Management API exercise the full [CRUD](https://en.wikipedia.org/wiki/Create,_read,_update_and_delete) operations for: diff --git a/examples/speak/buffer/hello-world/main.go b/examples/speak/stream/hello-world/main.go similarity index 100% rename from examples/speak/buffer/hello-world/main.go rename to examples/speak/stream/hello-world/main.go diff --git a/examples/speak/buffer/woodchuck/main.go b/examples/speak/stream/woodchuck/main.go similarity index 100% rename from examples/speak/buffer/woodchuck/main.go rename to examples/speak/stream/woodchuck/main.go diff --git a/pkg/client/speak/client.go b/pkg/client/speak/client.go index c11b06b0..644092b0 100644 --- a/pkg/client/speak/client.go +++ b/pkg/client/speak/client.go @@ -173,7 +173,8 @@ func (c *Client) DoText(ctx context.Context, text string, options interfaces.Spe case *interfaces.RawResponse: klog.V(3).Infof("RawResponse\n") klog.V(6).Infof("speak.DoText() LEAVE\n") - return res.Write(b) + _, err := io.Copy(b, res.Body) + return err case io.Writer: klog.V(3).Infof("io.Writer\n") klog.V(6).Infof("speak.DoText() LEAVE\n")