Skip to content

Commit c569124

Browse files
committed
chore(text-to-speech-v1): manual changes
1 parent 314c9a7 commit c569124

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

Scripts/Services/TextToSpeech/V1/TextToSpeechService.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
using Newtonsoft.Json.Linq;
3131
using System;
3232
using UnityEngine.Networking;
33+
using System.IO;
3334

3435
namespace IBM.Watson.TextToSpeech.V1
3536
{
@@ -1635,6 +1636,12 @@ public bool AddCustomPrompt(Callback<Prompt> callback, string customizationId, s
16351636
}
16361637

16371638
req.Forms = new Dictionary<string, RESTConnector.Form>();
1639+
1640+
if (metadata != null)
1641+
{
1642+
byte[] byteArray = Encoding.ASCII.GetBytes(JsonConvert.SerializeObject(metadata));
1643+
req.Forms["metadata"] = new RESTConnector.Form(new MemoryStream(byteArray), "" ,"application/json");
1644+
}
16381645
if (file != null)
16391646
{
16401647
req.Forms["file"] = new RESTConnector.Form(file, "filename", "audio/wav");

0 commit comments

Comments
 (0)