Skip to content

Commit

Permalink
Merge pull request #198 from dvonthenen/fix-stream-speak
Browse files Browse the repository at this point in the history
Fix speak.ToStream() Creating Distorted Sound
  • Loading branch information
davidvonthenen authored Mar 26, 2024
2 parents 60f860a + 8b420bf commit 4504306
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down
File renamed without changes.
File renamed without changes.
3 changes: 2 additions & 1 deletion pkg/client/speak/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit 4504306

Please sign in to comment.