Closed raulgonzalezdev closed 1 year ago
hey @gqcryptoraul, thank you for reaching out. from the information provided(aws-exports and app.js) I understand that you are trying to convert text to speech.
async function transcribe(bytes) { await Predictions.convert({ transcription: { source: { bytes, }, language: 'en-US', }, }) .then(({transcription: {fullText}}) => console.log({fullText})) .catch((err) => console.log({err})); }
The API call being used here would need to be the example as follows.
Predictions.convert({
textToSpeech: {
source: {
text: textToGenerateSpeech,
language: "es-MX" // default configured in aws-exports.js
},
voiceId: "Mia"
}
}).then(result => {
setAudioStream(result.speech.url);
setResponse(`Generation completed, press play`);
})
.catch(err => setResponse(JSON.stringify(err, null, 2)))
Please refer to https://docs.amplify.aws/lib/predictions/text-speech/q/platform/js/#working-with-the-api providing this information. For testing purposes I utilized the Texttospeech
function example provided here: https://aws.amazon.com/blogs/mobile/announcing-the-new-predictions-category-in-amplify-framework/
In my tests i observed the error "region not configured for transcription
occurs when we use a different api from the category configured.
Please do let us know if this aligns with your use case.
@ykethan Thanks for your input, but what I need to do is to Transcribe text from audio. using (speechGenerator) So I am also using a library that recognizes the voice and stores it in the buffer and then with the Amplify framework I can write the interpreted text in the temporary voice recording.
As you have a lot of experience I would like if you could send me a link to be used in React-Native.
This is the prediction that I want to use and that I have configured in my local project.
"predictions": { "convert": { "speechGenerator": { "region": "us-east-2", "proxy": { "proxy": false, "defaults": { "voiceId": "joey", "languageCode": "en-US" } } } }
hey, I will be transferring the issue to amplify js for better assistance on your use case using react native.
additionally, amplify does allow us to convert text from audio when we provide the following options.
amplify add predictions
? Please select from one of the categories below: Convert
? What would you like to convert?
Translate text into a different language
Generate speech audio from text
> Transcribe text from audio
observed the aws-exports file with the following.
"predictions": {
"convert": {
"transcription": {
"region": "us-east-1",
"proxy": false,
"defaults": {
"language": "en-GB"
}
}
}
}
Hello @raulgonzalezdev ,
From the comments above, it looks like your app was configured with speechGenerator
and needs to be configured for transcription
before it will work without the error you're seeing. Have you made this update to your application as @ykethan recommended? Did that resolve the error?
If not, what are you seeing and what does your configuration look like now that this transcription is configured?
Thanks, Aaron
Hello, Good Amplify community, it's a pleasure to be on this channel, I am new in the management of Amplify services I am testing the service with Predictions speechGenerator, but when I test the App generated in React-Native in the console I get an Error {"err": "region not configured for transcription"}, I have checked the microphone buffer and certainly generates data, I am testing only with the phrase "Hello Word", I have used the Basic configuration automatically generated by AWS Amplify.
I will leave the fragments of my code, to see if it is a problem with the region where I created the Backend or something in my code that in theory is very simple.
My Code in React-Native