Saying your first words.

Let’s say you want to use the Vocal Avatar API to generate Hello World with your voice!

Before you start, please go and create your own artificial voice in our website. You will need to do that before you are able to follow this tutorial.

This tutorial is a very short introduction to our API that will allow you to say your first words in your artificial voice. For more details about our API, please read the documentation.

Note: Our voice avatar API is not public yet. Therefore, if you were not invited by one of our team members, that means you can’t use this yet. If you stumbled onto this document by chance and you would like to try it, please send us an email to support@lyrebird.ai and we will give you API access.

Create a Lyrebird application.

To create a lyrebird application, you need to sign up to your lyrebird account and then go here.

Fill all the fields and save the changes. For this tutorial, we used http://localhost as our REDIRECT URL. After you save the changes, you will have created your first app! You can find all your apps here.

Then, click on the name of the new application that you created. There, you will see your CLIENT_ID. You will need it for the next step.

Authorize your new application to use your voice.

On your browser, go to this site:

https://beta.myvoice.lyrebird.ai/authorize?response_type=token&client_id=CLIENT_ID&redirect_uri=http%3A%2F%2Flocalhost&state=SECRET_STATE&scope=voice

Note: Don’t forget to replace CLIENT_ID for the string that you obtained in the previous state. You can use any string to replace SECRET_STATE. Remember that redirect_uri needs to be the encoded version of the URL that you defined when creating your application. To encode your URL, you can use a URL encoder like this one.

After you authorize (as a user) access to your voice, you will be redirected to the following address: http://localhost/?state=SECRET_STATE#acces_token=ACCESS_TOKEN. ACCESS_TOKEN is the last thing you need to say your first words.

Say your first words.

We’re almost there. Take the ACCESS_TOKEN that you obtained in the last step and make the following cURL request:

curl -X POST   https://avatar.lyrebird.ai/api/v0/generate \
-H 'Authorization: Bearer ACCESS_TOKEN' \
-H 'Cache-Control: no-cache' \
-H 'Content-Type: application/json' \
-d '{"text":"hello world"}' > audio.wav

This will save your first words in the audio.wav file. Congratulations! If you have followed this tutorial, you should have used your artificial voice for the first time!

The next step!

We're really excited to see the apps that you will build using our vocal avatar API. Please read the documentation where we will explain with more detail how to use our API. We have also developed a few applications that can help you get started:

results matching ""

    No results matching ""