Fine-tune Qwen-Audio-TTS models

Updated at:

Fine-tune Qwen-Audio-3.0-TTS-Flash with supervised fine-tuning (SFT) via the Alibaba Cloud Model Studio API using recordings and matching transcripts from a single speaker to build a custom voice synthesis model.

Use cases

To reproduce a particular speaker’s voice, first try voice cloning with a short reference recording and listen to the result. Consider fine-tuning if you need a closer match or more consistent long-form narration and can provide multiple transcribed recordings of the speaker.

  • Brands and virtual characters: Use recordings of the target speaker to create a recognizable voice across productions.
  • Audiobooks and other long-form narration: Train on recordings of one narrator reading aloud to keep the tone and pacing consistent across chapters.

NoteIf you have only a written description of the voice, use voice design. If you already have a suitable voice and want to change its pace or emotion, use instruction control in the synthesis request.

Prerequisites

NoteFine-tuning Qwen-Audio-3.0-TTS-Flash is currently available by invitation. To request access, contact your account manager.

  • Supported model: Qwen-Audio-3.0-TTS-Flash (model ID: qwen-audio-3.0-tts-flash).
  • Training method: Submit supervised fine-tuning jobs through the HTTP API with training_type set to sft.
  • Supported region: China (Beijing) only.
  • Account and API key: Contact your account manager to enable fine-tuning for your account, then obtain an API key and set the environment variable DASHSCOPE_API_KEY. If you use a RAM user, grant the required model invocation and training permissions first.

Prepare data

Training data

Each job supports one speaker. Prepare WAV recordings of that speaker and a transcript for each recording. The total recording time must exceed 30 minutes.

  • Recording specifications and dataset size: Use a sample rate of 16 kHz or higher for best results. Split recordings at sentence boundaries. Aim for clips of 2–30 seconds and avoid fragments shorter than 1 second. A recommended starting point is 1–10 hours across at least 150 clips. Cover the vocabulary, sentence types, and intonation your application needs.
  • Recording quality and style: Record in a quiet environment and select clips with the pace, emotion, and pauses you want to reproduce. For an audiobook voice, for example, choose clips of the speaker reading aloud. Exclude background music, other speakers, mispronunciations, and unwanted sounds such as coughs or long pauses.
  • Language and transcripts: Choose languages supported by the base model. In text, transcribe what the speaker actually says, including words in both languages if the speaker switches languages within a clip. Omit unspoken symbols and put style instructions in tts_instruction.

Directory structure

Organize your training dataset in the following directory structure:

user_data/
├── data.jsonl           # Training sample manifest (required)
├── speakers.jsonl       # Speaker configuration (optional; can be omitted for single speaker)
├── speaker/             # Reference audio directory (required if speakers.jsonl is provided)
│   ├── ref_audio_1.wav
│   └── ref_audio_2.wav
└── train/               # Training audio directory (all training WAV files)
    ├── train_001.wav
    └── train_002.wav

Because Qwen-Audio-3.0-TTS-Flash allows only one speaker, you can omit speakers.jsonl and speaker/ (keeping only data.jsonl and train/). Include them only if you need to specify reference audio clips and a default speaker language explicitly.

data.jsonl

Required file. Each line is a JSON object describing one training recording and its transcript.

  • When using speakers.jsonl, specify the same speaker on every line:

    {"wav_fn": "train/train_001.wav", "text": "This is a test sentence.", "speaker": "Paimon1", "tts_instruction": "happy", "language": "english"}
    {"wav_fn": "train/train_002.wav", "text": "Another sample recording.", "speaker": "Paimon1", "language": "english"}
    
  • When omitting speakers.jsonl (default single speaker), omit speaker on every line:

    {"wav_fn": "train/train_001.wav", "text": "Please leave a message after the tone.", "language": "english"}
    {"wav_fn": "train/train_002.wav", "text": "Your message has been saved.", "language": "english"}
    
FieldRequiredTypeDescription
wav_fnYesstringPath to the training WAV file relative to the directory containing data.jsonl (for example, train/train_001.wav).
textYesstringSpoken transcript matching the audio recording.
speakerNostringSpeaker name. Must be provided on every record (matching speakers.jsonl) or omitted on every record (treated as one default speaker).
tts_instructionNostringStyle or emotion instruction for the recording (for example, happy).
languageNostringRecording language (for example, chinese or english). Defaults to chinese if omitted; overrides language in speakers.jsonl when both are set.

speakers.jsonl

Optional file. Provide it only when explicitly configuring speaker reference audio (one line for a single speaker):

{"speaker": "Paimon1", "ref_audios": ["speaker/ref_audio_1.wav", "speaker/ref_audio_2.wav"], "language": "english"}
FieldRequiredTypeDescription
speakerYesstringSpeaker name, matching speaker in data.jsonl.
ref_audiosYesarray[string]List of reference audio paths relative to the directory containing data.jsonl (for example, speaker/ref_audio_1.wav).
languageNostringDefault language for the speaker. Defaults to chinese.

Packaging and upload

Prepare your files according to how you plan to load the dataset when creating a job:

  • Upload via File API: Run the following command from the parent directory of user_data/ so the ZIP archive retains the user_data/ folder (see Upload files for size and quota limits):

    zip -r train.zip user_data/
    
  • Mount from OSS: Upload the uncompressed user_data/ directory to an OSS bucket. Before mounting a dataset for the first time, go to Model Tuning in the Model Studio console, click Create Training Job, and select Mount Dataset under Data Configuration. Follow the authorization prompts and check that you can see the files in the target bucket.

NoteCurrently, you can mount OSS buckets only in China (Ulanqab). To mount a bucket in another region, contact your account manager.

Evaluation data

Model Studio runs built-in evaluations by default. When you mount training data from OSS, you can also specify a custom evaluation dataset in evaluation_datasets. The training logs report metrics separately for each built-in and custom dataset.

Write the evaluation samples to eval_data/data.jsonl, with one JSON object per line. Set text to the text to synthesize and language to its language. The following example contains two Chinese samples.

{"text": "您的包裹已送达,请在前台领取。", "language": "chinese"}
{"text": "今天下午三点,我们一起去图书馆。", "language": "chinese"}

An evaluation dataset supports up to 100 samples. Text longer than 500 characters is truncated. Upload the file to OSS and set mount_storage.file_path in evaluation_datasets to its object key.

Create a job

Choose either of the following methods based on dataset size and whether you need a custom evaluation dataset:

  • Method 1 (File API upload): Upload a ZIP archive and pass training_file_ids. Suitable for smaller training datasets.
  • Method 2 (OSS mount): Mount an uncompressed dataset directory directly from OSS. Suitable for large datasets or when passing custom evaluation_datasets.

Method 1: File API upload

  1. Upload train.zip and copy data.uploaded_files[0].file_id from the response:

    curl --request POST "https://dashscope.aliyuncs.com/api/v1/files" \
      --header "Authorization: Bearer ${DASHSCOPE_API_KEY}" \
      --form 'files=@"train.zip"' \
      --form 'purpose="fine-tune"' \
      --form 'descriptions="Qwen-Audio 3.0 TTS fine-tune dataset"'
    
  2. Replace <YOUR_FILE_ID> with the file ID returned above and submit the fine-tuning job:

    curl --location --request POST "https://dashscope.aliyuncs.com/api/v1/fine-tunes" \
      --header "Authorization: Bearer ${DASHSCOPE_API_KEY}" \
      --header "Content-Type: application/json" \
      --data '{
        "model": "qwen-audio-3.0-tts-flash",
        "training_type": "sft",
        "training_file_ids": [
          "<YOUR_FILE_ID>"
        ],
        "hyper_parameters": {}
      }'
    

Method 2: OSS mount

Ensure you have authorized Mount Dataset in the console and uploaded the uncompressed training directory (and optional evaluation directory) to your OSS bucket. Replace the placeholders with your bucket name and data.jsonl path; omit evaluation_datasets if you do not need a custom evaluation set.

curl --location --request POST "https://dashscope.aliyuncs.com/api/v1/fine-tunes" \
  --header "Authorization: Bearer ${DASHSCOPE_API_KEY}" \
  --header "Content-Type: application/json" \
  --data '{
    "model": "qwen-audio-3.0-tts-flash",
    "training_type": "sft",
    "training_file_ids": [],
    "training_datasets": [
      {
        "data_source_type": "oss_mount",
        "mount_storage": {
          "region": "cn-wulanchabu",
          "bucket": "<YOUR_BUCKET_NAME>",
          "file_path": "user_data/data.jsonl"
        }
      }
    ],
    "evaluation_datasets": [
      {
        "data_source_type": "oss_mount",
        "mount_storage": {
          "region": "cn-wulanchabu",
          "bucket": "<YOUR_BUCKET_NAME>",
          "file_path": "eval_data/data.jsonl"
        }
      }
    ],
    "hyper_parameters": {"lm_epoch": 6}
  }'

After the job is created, save output.job_id (job ID) and output.finetuned_output (fine-tuned model ID) from the response.

Request parameters

ParameterRequiredDescription
modelYesBase model ID. Must be qwen-audio-3.0-tts-flash.
training_typeYesTraining method. Set this parameter to sft.
training_file_idsConditionalFor Method 1. List of uploaded training file IDs; only one file ID is supported. Pass [] or omit when using Method 2.
training_datasetsConditionalFor Method 2. List of OSS-mounted training datasets; only one training dataset path is supported. Set data_source_type to oss_mount, and configure mount_storage with the bucket region (region), bucket name (bucket), and object key of data.jsonl (file_path).
evaluation_datasetsNoFor Method 2 only. List of OSS-mounted evaluation datasets with the same structure as training_datasets; only one evaluation dataset path is supported.
hyper_parametersYesHyperparameter object. Set lm_epoch to an integer from 5 through 15 to specify the number of language model training epochs. The default is 5. Pass {} to use the default. fm_epoch is currently fixed at 50.

Check results

Job status

Replace <YOUR_JOB_ID> with output.job_id from job creation to check progress:

curl "https://dashscope.aliyuncs.com/api/v1/fine-tunes/<YOUR_JOB_ID>" \
  --header "Authorization: Bearer ${DASHSCOPE_API_KEY}"
  • output.status tracks the job lifecycle: PENDING → QUEUING → RUNNING → SUCCEEDED (or FAILED / CANCELED). See Query fine-tuning job status for full response fields.
  • When output.status is SUCCEEDED, output.finetuned_output contains the fine-tuned model ID and output.usage reports total training tokens consumed.
  • You can also call List checkpoints (GET /api/v1/fine-tunes/{job_id}/checkpoints) to inspect generated checkpoint artifacts.

Logs and metrics

Use the logs API to track step progress, view automatic evaluation metrics, and diagnose failures:

curl "https://dashscope.aliyuncs.com/api/v1/fine-tunes/<YOUR_JOB_ID>/logs?offset=0&line=100" \
  --header "Authorization: Bearer ${DASHSCOPE_API_KEY}"

Use offset and line for pagination; see Query fine-tuning job logs for full API details. After training completes, the logs report the following evaluation metrics:

MetricDescription
WER (Word Error Rate)Transcribes synthesized audio with an ASR model and compares it against the reference text; lower values indicate higher pronunciation accuracy.
Speaker similarityComputes similarity between the target speaker audio embedding and the synthesized audio embedding; values closer to 1 indicate higher voice fidelity.
MOS (Mean Opinion Score)Evaluates perceptual naturalness and audio quality using a speech quality model (P.808 MOS); higher scores indicate better perceived quality.

Deploy the model

To deploy Qwen-Audio-3.0-TTS-Flash after fine-tuning, contact your account manager.

Billing

Training Qwen-Audio-3.0-TTS-Flash costs CNY 0.1 per 1,000 tokens. The job creation API does not return a cost estimate. To budget for a job, use the total duration of your training recordings and the number of training epochs.

  • Estimated training tokens = (lm_epoch + fm_epoch) × 25 × total training audio duration in seconds
  • Estimated training cost in CNY = estimated training tokens ÷ 1,000 × 0.1

For example, with 1 hour (3,600 seconds) of training audio, the default lm_epoch of 5, and the fixed fm_epoch of 50, the estimated usage is (5 + 50) × 25 × 3,600 = 4,950,000 tokens. The estimated training cost is CNY 495.

After the job completes, check output.usage for actual token consumption and your bill for the final charge.

FAQ

Job creation fails with 403 AccessDenied (Feature unavailable)

The account or workspace does not have invitation access enabled for Qwen-Audio-3.0-TTS-Flash fine-tuning. Contact your account manager to request access, and verify that the API key belongs to the authorized account.

Job creation fails with 400 InvalidParameter (unsupported model)

Check the model ID and training method in your request. Set model to qwen-audio-3.0-tts-flash and training_type to sft.

Training job fails with speaker_audio_duration_below_0_5h in logs

The combined WAV duration for the speaker is less than 0.5 hours (30 minutes). Add more WAV recordings from the same speaker so total duration exceeds 30 minutes, repackage and re-upload (or update OSS), and submit a new job.