refactor
/ build (push) Successful in 44s

This commit is contained in:
2025-12-19 07:33:54 -08:00
parent a28d00a1fe
commit 0a244be9bb
10 changed files with 2067 additions and 2621 deletions
+2
View File
@@ -0,0 +1,2 @@
/*
access-control-allow-origin: *
@@ -56,7 +56,7 @@ export function DescribeVoices(
Engine='standard',
LanguageCode='',
IncludeAdditionalLanguageCodes=true){
const url=new URL('/v1/voices',import.meta.url)
const url=new URL('/v1/voices',origin)
url.search=new URLSearchParams({
Engine:Engine,
LanguageCode:LanguageCode,
@@ -160,7 +160,7 @@ export function SynthesizeSpeech(
Text+='</speak>'
}
}
const url=new URL('/v1/speech',import.meta.url)
const url=new URL('/v1/speech',origin)
url.search=new URLSearchParams({
Text:Text,
VoiceId:VoiceId,
@@ -184,8 +184,9 @@ export class Polly {
*
* @param {import('@twurple/auth').AuthProvider} auth_provider
*/
constructor(auth_provider) {
constructor(auth_provider,proxyOrigin=import.meta.url) {
this.#auth_provider = auth_provider
setProxyOrigin(proxyOrigin)
}
async #GetAuthHeaders() {
@@ -219,4 +220,10 @@ export class Polly {
SampleRate
)
}
}
let origin = import.meta.url
export function setProxyOrigin(proxyOrigin) {
origin=proxyOrigin
}