-
-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
real time. with out wait whole reply done, button actually appear. #46
Comments
@happyf-weallareeuropean currently the script just relies on the button (front-end method) so for your feature requires back-end method + API allows speak before completion but I never worked w/ this method before but I can look into it |
I just played with the API for awhile and it was too hardcore to implement from IDK what to do w/ the response. But this is where I got ( function speak() {
const synthEndpoint = 'https://chatgpt.com/backend-api/synthesize'
const msgID = '7fd31ce3-c6cc-4820-8166-4aed9f49f301'
const convoID = '67695cab-a0f0-800f-b79f-481c030a9f87'
const voice = 'cove'
chatgpt.getAccessToken().then(token => {
xhr({
method: 'GET', url: `${synthEndpoint}?message_id=${msgID}&conversation_id=${convoID}&voice=${voice}`,
headers: {
'Accept': '*/*', 'Accept-Encoding': 'gzip, deflate, br, zstd',
'Authorization': `Bearer ${token}`,
'Connection': 'keep-alive', 'DNT': '1',
'Host': 'chatgpt.com',
'OAI-Device-Id': 'b6e61267-b02e-42dc-837b-9e0d852af0e3', 'OAI-Language': 'en-US',
'Priority': 'u=4', 'Referer': 'https://chatgpt.com/c/67695cab-a0f0-800f-b79f-481c030a9f87',
'Sec-Fetch-Dest': 'empty', 'Sec-Fetch-Mode': 'cors', 'Sec-Fetch-Site': 'same-origin'
},
onload: resp => {
if (resp.status != 200) {
console.error('Response status', resp.status)
return console.info(resp)
}
console.log('Audio content received', resp)
const audioBlob = new Blob([resp.response], { type: 'audio/aac' }),
audioURL = URL.createObjectURL(audioBlob),
audio = new Audio(audioURL)
audio.play().then(() => console.log('Audio is playing'))
.catch(err => console.error('Error playing audio', err))
}
})
})
} The |
Actually upon reflection, I think the msg ID isn't generated until response completion but even if before, I think the msg thus audio file will not contain all the words yet so your feature is not possible |
thank your respond adamlui! i was though use siri. |
@happyf-weallareeuropean are you really good at JS/APIs though? Because advanced knowledge is required to play with the code I pasted |
nah, just start it swift 3 mo. from playgrounds switch to xcode as 2 week earlyer |
i will take care, any stock share with u also! |
what is this challenge of this feature?
The text was updated successfully, but these errors were encountered: