Replies: 16 comments 8 replies
-
Here is an example of a successful call to the OpenAI API: Request URL: https://api.openai.com/v1/audio/speech Headers: I tried a couple things with Custom TTS in the app, but I get a message that the auth header is not being sent, even though I've got it in the Http Request header field. |
Beta Was this translation helpful? Give feedback.
-
Custom TTS has been deprecated. Use plugin instead. // EDIT: let apiKey = ttsrv.userVars["key"]
let apiKey = ttsrv.userVars["apiKey"]
let PluginJS = {
'name': 'ChatGPT',
'id': 'speech.openai.com',
'author': 'TTS Server',
'description': '',
'version': 1,
"vars": {
apiKey: {label: "API-KEY", hint: "OpenAI API-KEY"},
},
'getAudio': function (text, locale, voice, speed, volume, pitch) {
let reqHeaders = {
'Content-Type': 'application/json',
'Authorization': 'Bearer ' + apiKey
}
let body = {"model":"tts-1", "input":text, "voice":voice, "response_format":"opus"}
let str = JSON.stringify(body)
let resp = ttsrv.httpPost('https://api.openai.com/v1/audio/speech', str, reqHeaders)
if (resp.isSuccessful()) {
return resp.body().byteStream()
} else {
throw "FAILED: status=" + resp.code()
}
}
}
let EditorJS = {
'getAudioSampleRate': function (locale, voice) {
let audio = PluginJS.getAudio('test', locale, voice, 50, 50, 50)
return ttsrv.getAudioSampleRate(audio)
// return 22050
},
'onLoadData': function () {
},
'getLocales': function () {
return ['en-US']
},
'getVoices': function (locale) {
return {
'nova': 'Nova',
}
},
'onLoadUI': function (ctx, linearLayout) {
}
} |
Beta Was this translation helpful? Give feedback.
-
Use devlopment version from Github actions |
Beta Was this translation helpful? Give feedback.
-
Thank you for your reply!
Unfortunately, I received the following errors:
com.script.ScriptException: org.mozilla.javascript.JavaScriptException:
FAILED: status=401 (<Unknown source>#27) in <Unknown source> at line number
27
at
com.script.javascript.RhinoScriptEngine.invoke(RhinoScriptEngine.java:107)
at
com.script.javascript.RhinoScriptEngine.invokeMethod(RhinoScriptEngine.java:3)
at ra.c.d(TtsPluginUiEngine.kt:35)
at u9.y0$a$c.invokeSuspend(PluginTtsUI.kt:34)
at ff.a.resumeWith(ContinuationImpl.kt:9)
at eg.p0.run(DispatchedTask.kt:111)
at jg.j$a.run(LimitedDispatcher.kt:4)
at lg.j.run(Tasks.kt:3)
at lg.a$a.run(CoroutineScheduler.kt:96)
Caused by: org.mozilla.javascript.JavaScriptException: FAILED: status=401
(<Unknown source>#27)
at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:77)
at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:57)
at
org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:21)
at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:1)
at
com.script.javascript.RhinoScriptEngine$1.superDoTopCall(RhinoScriptEngine.java:1)
at
com.script.javascript.RhinoScriptEngine$1.doTopCall(RhinoScriptEngine.java:40)
at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:8)
at
org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:16)
at
com.script.javascript.RhinoScriptEngine.invoke(RhinoScriptEngine.java:60)
... 8 more
https://bin.kv2.dev/~65b7b2205de7ed6bfdbca56f
…On Mon, Jan 29, 2024, 8:53 AM Jing ***@***.***> wrote:
Use devlopment version from Github actions
—
Reply to this email directly, view it on GitHub
<#143 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABZA6S4X7KCWL4BSXLUQHLYQ6SUXAVCNFSM6AAAAABCI65PC6VHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM4DEOBTGE2DC>
.
You are receiving this because you authored the thread.Message ID:
***@***.***
com>
|
Beta Was this translation helpful? Give feedback.
-
If you need a ChatGPT key for testing, please provide a private way to contact you, and I will send one. |
Beta Was this translation helpful? Give feedback.
-
401 unauthorized
Have you set up the plugin variables?
…---Original---
From: ***@***.***>
Date: Mon, Jan 29, 2024 22:12 PM
To: ***@***.***>;
Cc: ***@***.******@***.***>;
Subject: Re: [jing332/tts-server-android] ChatGPT Voices (Discussion #143)
Thank you for your reply!
Unfortunately, I received the following errors:
com.script.ScriptException: org.mozilla.javascript.JavaScriptException:
FAILED: status=401 (<Unknown source>#27) in <Unknown source> at line number
27
at
com.script.javascript.RhinoScriptEngine.invoke(RhinoScriptEngine.java:107)
at
com.script.javascript.RhinoScriptEngine.invokeMethod(RhinoScriptEngine.java:3)
at ra.c.d(TtsPluginUiEngine.kt:35)
at u9.y0$a$c.invokeSuspend(PluginTtsUI.kt:34)
at ff.a.resumeWith(ContinuationImpl.kt:9)
at eg.p0.run(DispatchedTask.kt:111)
at jg.j$a.run(LimitedDispatcher.kt:4)
at lg.j.run(Tasks.kt:3)
at lg.a$a.run(CoroutineScheduler.kt:96)
Caused by: org.mozilla.javascript.JavaScriptException: FAILED: status=401
(<Unknown source>#27)
at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:77)
at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:57)
at
org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:21)
at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:1)
at
com.script.javascript.RhinoScriptEngine$1.superDoTopCall(RhinoScriptEngine.java:1)
at
com.script.javascript.RhinoScriptEngine$1.doTopCall(RhinoScriptEngine.java:40)
at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:8)
at
org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:16)
at
com.script.javascript.RhinoScriptEngine.invoke(RhinoScriptEngine.java:60)
... 8 more
https://bin.kv2.dev/~65b7b2205de7ed6bfdbca56f
Dan Frist
Founder
Sttark.com|864-906-0300 (SMS)
2 TASK INDUSTRIAL CT | GREENVILLE SC 29607
On Mon, Jan 29, 2024, 8:53 AM Jing ***@***.***> wrote:
> Use devlopment version from Github actions
>
> —
> Reply to this email directly, view it on GitHub
> <#143 (comment)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AABZA6S4X7KCWL4BSXLUQHLYQ6SUXAVCNFSM6AAAAABCI65PC6VHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM4DEOBTGE2DC>
> .
> You are receiving this because you authored the thread.Message ID:
> ***@***.***
> com>
>
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you commented.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Yes. I also tested the connection with https://reqbin.com/ and found that the voice name needs to be nova not Nova so I made that change in your app, but it still does not work. |
Beta Was this translation helpful? Give feedback.
-
Sorry, the problem is from me, let apiKey = ttsrv.userVars["apiKey"] |
Beta Was this translation helpful? Give feedback.
-
Okay. We have made progress. I can now use the audition button and it works properly. However, I have selected TTS server as my preferred speech engine in my phone settings. But when I select text to speak, I hear nothing. Eventually I get a system message that TTS server continues to stop. (I think I had this trouble before, but I don't remember how I resolved it then, since it was some time ago.) Any more help would be much appreciated. If you have already made comments in another discussion on how to resolve this I apologize, I cannot read other languages. |
Beta Was this translation helpful? Give feedback.
-
I just used the latest stable release and it's working! Thank you. |
Beta Was this translation helpful? Give feedback.
-
Unfortunately, the sample rate is not changing for the return from this plugin. Can you help? |
Beta Was this translation helpful? Give feedback.
-
'getAudioSampleRate': function (locale, voice) {
return 24000
}, The sample rate will be changed the next time you save the TTS configuration. |
Beta Was this translation helpful? Give feedback.
-
Hi, I'm a bit of an amateur and I'd love to get the ChatGPT voice working. If you have time to give me step by step instructions, that would be greatly appreciated. 🙏🏼 I've added my OpenAI API key, but I get this error when previewing the voice: (Thank you @jing332 for this amazing app! I've been using the Microsoft Neural voice to read out notifications with MacroDroid) |
Beta Was this translation helpful? Give feedback.
-
https://github.com/jing332/tts-server-android?tab=readme-ov-file#actions-mirror |
Beta Was this translation helpful? Give feedback.
-
I found that if I start the system tts forwarder I don't get any errors |
Beta Was this translation helpful? Give feedback.
-
I am also facing this same error 429 com.script.ScriptException: org.mozilla.javascript.JavaScriptException: FAILED: status=429 (#14) in at line number 14 |
Beta Was this translation helpful? Give feedback.
-
I love this app, and I use it every day. I am not visually impaired, either. I just use it for productivity and reading retention.
Question: Would it be possible to add ChatGPT voices?
Beta Was this translation helpful? Give feedback.
All reactions