Skip to content

Latest commit

 

History

History
192 lines (157 loc) · 7.51 KB

File metadata and controls

192 lines (157 loc) · 7.51 KB
title description
Quickstart
Generate your first AI voice with FineVoice

Overview

This guide will walk you through generating your first text-to-speech audio with FineVoice. By the end, you’ll have converted text into natural-sounding speech using our API.

Quick Get your API Key

**1. Visit the FineVoice Website**
[**Open FineVoice**](https://finevoice.ai/) on your browser, and you can find the “Sign up” / “Sign in” button in the top right corner.

**2. Choose a Sign-up or Sign-in Method**

<Steps>
  <Step title="Method 1: Register/Login with a Google Account">
    Click “Sign up” or “Sign in” and choose “Continue with Google”. Then, select your Google account. If you are not logged in, enter your password, click “Continue”, and you will successfully log in to FineVoice.
  </Step>
  <Step title="Method 2: Register/Login with an Apple Account">
    On the “Sign up” or “Sign in” page, click “Continue with Apple”. Enter your email address or phone number and click “Continue”. Then, enter your password and click “Sign In”.
  </Step>
  <Step title="Method 3: Register/Login with Email">
    On the “Sign up” or “Sign in” page, click “Continue with Email”. Then, enter your email address and password and click “Sign up” or “Sign in”. You will receive a verification email in your mailbox. Find the mail and click the verification link to complete registration.
  </Step>
</Steps>
**3. Log in to your account and navigate to the usercenter**
1.  Go to https://finevoice.ai/usercenter 1.  Navigate to the API Tokens 1.  Generate Secret Key
<Tip>
  Keep your API key secret! Never commit it to version control or share it publicly.
</Tip>

Your First TTS Request

Let’s create your first audio file from text.

Store your API key as an environment variable (recommended approach):
    ```shellscript
    export FINEVOICE_API_KEY="replace_me"
    ```
  </Step>
  <Step title="Make the TTS request">
    > The following example uses the default voice. To use a different voice, change the `voice` parameter and provide the model name from FineVoice. You can retrieve detailed information about available voices using the methods below. [**[View Voice API]**](https://fvdocs.fineshare.com/api-reference/endpoint/getvoicedetail)

    Run this **cURL** command to generate your first voice:

    ```shellscript
    curl -X POST https://converter.fineshare.net/api/fsmstexttospeech \
      -H "Authorization: Bearer $FINEVOICE_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{
      "Engine": "v7",
      "AppId": "107",
      "FeatureId": "22",
      "speech": "[happy] Hi, welcome to today’s video! In this episode, [breathe] I’ll show you some practical voice generation tips that can make your audio projects a lot easier and more creative. [clear_throat] Stick around, and let’s jump right in!",
      "voice": "james",
      "platform": "web",
      "Parameter": {
        "Speed": 1.0,
        "LanguageCode": "en-US",
        "Pitch": 0.0
      }
    }'\
    ```

    Windows Command Prompt:

    ```shellscript
    curl -X POST https://converter.fineshare.net/api/fsmstexttospeech -H "Authorization: Bearer %FINEVOICE_API_KEY%" -H "Content-Type: application/json" -d "{\"Engine\":\"v7\",\"AppId\":\"107\",\"FeatureId\":\"22\",\"speech\":\"[happy] Hi, welcome to today’s video! In this episode, [breathe] I’ll show you some practical voice generation tips that can make your audio projects a lot easier and more creative. [clear_throat] Stick around, and let’s jump right in!\",\"voice\":\"james\",\"platform\":\"web\",\"Parameter\":{\"Speed\":1.0,\"LanguageCode\":\"en-US\",\"Pitch\":0.0}}"
    ```
  </Step>
  <Step title="Get the Audio Download URL">
    The response returns a unique `uuid` that identifies the generated audio task.\
    Use this `uuid` in the subsequent request to retrieve the audio download URL.

    ```shellscript
    {
      "uuid": "6d2fec0a-0983-4b3f-b3f8-6038d12187ce",
      "available_count": 298825,
      "wordBoundaries": [],
      "error": {
        "code": "0001",
        "message": null
      }
    }
    ```

    Use the following request to check the file generation status and retrieve the audio download URL:

    ```shellscript
    curl -X GET https://voiceai.fineshare.net/api/checkfilechangestatus/{uuid}
    ```

    Replace `{uuid}` with the `uuid` returned from the text-to-speech request.\
    When the audio file is ready, the response will include the audio download URL.

    **Response Example:**

    ```json
    {
        "uuid": "6d2fec0a-0983-4b3f-b3f8-6038d12187ce",
        "client": null,
        "status": 3,
        "url": "https://dlaudio.fineshare.net/ovc/6d2fec0a-0983-4b3f-b3f8-6038d12187ce.mp3",
        "coverUrl": null,
        "duration": 16,
        "title": "welcome to today’s video",
        "error": {
            "code": "0001",
            "message": null
        }
    }
    ```
  </Step>
  <Step title="Download the Audio File">
    Run the following cURL command to download the audio file:

    ```shellscript
    curl -L -o output.mp3 https://dlaudio.fineshare.net/ovc/6d2fec0a-0983-4b3f-b3f8-6038d12187ce.mp3
    ```
  </Step>
  <Step title="Play the Downloaded Audio">
    The audio has been saved as **output.mp3.** You can play it by:

    - Double-clicking the file or opening it in any media player
    - Or using the command line:

    ```shellscript
    # On macOS
    afplay output.mp3
    
    # On Linux
    mpg123 output.mp3
    
    # On Windows
    start output.mp3
    ```
  </Step>
</Steps>

List AI Voices

Explore all AI voices you can use for text-to-speech generation.

Store your API key as an environment variable (recommended approach):
    ```shellscript
    export FINEVOICE_API_KEY="replace_me"
    ```
  </Step>
  <Step title="List Available Voice Models">
    Retrieve a paginated list of available AI voice models with filters for gender, language, page number, and page size. This API helps you browse and select voices for text-to-speech or voice conversion tasks. [**Check out the API reference here**](https://fvdocs.fineshare.com/api-reference/introduction).

    ```shellscript
    curl -X GET "https://converter.fineshare.net/api/pagevoices?v=v2&gender=all&language=en-US&page=1&limit=10" \
      -H "Authorization: Bearer $FINEVOICE_API_KEY" \
      -o "pagevoices.json"
    ```
  </Step>
</Steps>

Support

Need help? Check out these resources: