HikaruOgata | 2023-02-06 04:35:41 UTC | #1
Is it possible to download the created voice prompt as an audio file?
charlie.conneely | 2023-02-07 12:44:49 UTC | #2
Hello
Yes, it is. Of course, you can click the download button manually in the Architect UI. You can also call out to GET /api/v2/architect/prompts/{promptId}, retrieve a mediaUri from the resources array, perform a basic http GET request to this media URI, and write the response to a file (I attached an example of this operation in Golang below).
resp, err := http.Get(mediaUri)
if err != nil {
log.Fatal(err)
}
defer resp.Body.Close()
out, err := os.Create("audioFile.wav")
if err != nil {
log.Fatal(err)
}
defer out.Close()
_, err = io.Copy(out, resp.Body)
if err != nil {
log.Fatal(err)
}
Hope this helps! Charlie
HikaruOgata | 2023-02-09 00:03:08 UTC | #3
Thank you for your reply!! I would like to know additionally, is there an API to get the promptId?
charlie.conneely | 2023-02-10 14:17:02 UTC | #4
Yes, you could use GET /api/v2/architect/prompts?name=nameofyour_prompt
HikaruOgata | 2023-02-10 07:57:36 UTC | #5
Thank you very much! All good, purpose achieved!
system | 2023-03-13 07:58:04 UTC | #6
This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.
This post was migrated from the old Developer Forum.
ref: 18281