音声合成API

TTS APIでテキストを自然な音声に変換。300以上のAI音声、無制限の音声クローン、リアルな音声生成
300以上のAIボイス
ボイス・クローニング
REST API
TTS Editor Interface
50万人以上のユーザーに信頼されている

強力なTTS API機能

プロフェッショナルな音声合成をアプリケーションに統合するために必要なすべてが揃っています。
ニューラルTTS
300以上のAIボイス英語、ポルトガル語、スペイン語、フランス語、ドイツ語、中国語、日本語など、33以上の言語のプレミアム神経音声にアクセスできます。
無制限
ボイス・クローニング無制限のボイスクローニングで、オーディオサンプルからカスタムボイスを作成。パーソナライズされたコンテンツやブランドボイスに最適です。
グローバル
33以上の言語英語、ポルトガル語、スペイン語、フランス語、ドイツ語、中国語、日本語など、33以上の言語をサポート。

TTS APIワークフロー

簡単なAPIコールでテキストを音声に変換
01

TTSプロジェクトの作成

テキストの内容と音声設定を使って、新しい音声合成プロジェクトを作成します。
API Request
curl -X POST "https://dubsmart.ai/api/v1/projects/tts" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "My TTS Project",
    "segments": [
      {
        "text": "Hello, this is a test message",
        "voice": "anna_en_v2",
        "language": "en"
      }
    ]
  }'
02

モニター処理

テキストを自然な音声に処理するTTSプロジェクトの進捗状況を追跡できます。
API Request
curl -X GET "https://dubsmart.ai/api/v1/projects/tts/{projectId}" \
  -H "Authorization: Bearer YOUR_API_KEY"

# Response:
{
  "id": "project_id",
  "status": "processing",
  "progress": 75,
  "segments": [
    {
      "id": "segment_id",
      "status": "completed",
      "audioUrl": "https://..."
    }
  ]
}
03

ダウンロード

処理完了後、高音質オーディオファイルをダウンロード。22kHz品質のMP3フォーマットを入手。
API Request
curl -X GET "https://dubsmart.ai/api/v1/projects/tts/{projectId}" \
  -H "Authorization: Bearer YOUR_API_KEY"

# When status is "completed":
{
  "id": "project_id",
  "status": "completed",
  "audioUrl": "https://storage.dubsmart.ai/audio.mp3",
  "segments": [
    {
      "id": "segment_id",
      "audioUrl": "https://storage.dubsmart.ai/segment.mp3"
    }
  ]
}

TTS APIエンドポイント

音声合成機能の完全なAPIリファレンス
POST
/projects/tts

TTSプロジェクトの作成

テキストセグメントと音声設定を使って、新しい音声合成プロジェクトを作成する。
Request
JSON
{
  "title": "My TTS Project",
  "segments": [
    {
      "text": "Hello world! This is a test message.",
      "voice": "anna_en_v2",
      "language": "en",
      "speed": 1.0,
      "pitch": 1.0
    }
  ]
}
Response
JSON
{
  "id": "64f8a2b1c3d4e5f6a7b8c9d0",
  "title": "My TTS Project",
  "status": "pending",
  "progress": 0,
  "createdAt": "2023-09-06T10:30:00Z",
  "segments": [
    {
      "id": "segment_1",
      "text": "Hello world! This is a test message.",
      "status": "pending"
    }
  ]
}
GET
/projects/tts

TTSプロジェクト

TTSプロジェクトのリストを、ページ分割とフィルタリングのオプション付きで取得します。
Request
JSON
Query Parameters:
- limit: number (default: 20, max: 100)
- cursor: string (for pagination)
- status: "pending" | "processing" | "completed" | "failed"
Response
JSON
{
  "items": [
    {
      "id": "64f8a2b1c3d4e5f6a7b8c9d0",
      "title": "My TTS Project",
      "status": "completed",
      "progress": 100,
      "createdAt": "2023-09-06T10:30:00Z",
      "audioUrl": "https://storage.dubsmart.ai/audio.mp3"
    }
  ],
  "nextCursor": "next_cursor_value"
}
GET
/projects/tts/{projectId}

IDでTTSプロジェクトを取得

特定のTTSプロジェクトに関する詳細情報の取得
Request
JSON
Path Parameters:
- projectId: string (required)
Response
JSON
{
  "id": "64f8a2b1c3d4e5f6a7b8c9d0",
  "title": "My TTS Project",
  "status": "completed",
  "progress": 100,
  "createdAt": "2023-09-06T10:30:00Z",
  "audioUrl": "https://storage.dubsmart.ai/audio.mp3",
  "segments": [
    {
      "id": "segment_1",
      "text": "Hello world! This is a test message.",
      "status": "completed",
      "audioUrl": "https://storage.dubsmart.ai/segment_1.mp3"
    }
  ]
}

TTS APIコード例

複数のプログラミング言語ですぐに使えるコード例
JavaScript Example
// JavaScript/Node.js Example
const axios = require('axios');

const API_KEY = 'your_api_key_here';
const BASE_URL = 'https://dubsmart.ai/api/v1';

async function createTTSProject() {
  try {
    // Create TTS project
    const projectResponse = await axios.post(`${BASE_URL}/projects/tts`, {
      title: 'My TTS Project',
      segments: [
        {
          text: 'Hello! This is a sample text for text-to-speech conversion.',
          voice: 'anna_en_v2',
          language: 'en',
          speed: 1.0,
          pitch: 1.0
        },
        {
          text: 'This is the second segment with a different voice.',
          voice: 'john_en_v2',
          language: 'en',
          speed: 1.1,
          pitch: 0.9
        }
      ]
    }, {
      headers: { 'Authorization': `Bearer ${API_KEY}` }
    });

    console.log('Project created:', projectResponse.data);
    
    // Monitor project status
    const projectId = projectResponse.data.id;
    await monitorProjectStatus(projectId);
    
    return projectResponse.data;
  } catch (error) {
    console.error('Error:', error.response?.data || error.message);
  }
}

// Monitor project status
async function monitorProjectStatus(projectId) {
  let status = 'pending';
  
  while (status !== 'completed' && status !== 'failed') {
    await new Promise(resolve => setTimeout(resolve, 5000)); // Wait 5 seconds
    
    const response = await axios.get(`${BASE_URL}/projects/tts/${projectId}`, {
      headers: { 'Authorization': `Bearer ${API_KEY}` }
    });
    
    status = response.data.status;
    console.log(`Project status: ${status}, Progress: ${response.data.progress}%`);
    
    if (status === 'completed') {
      console.log('Audio URL:', response.data.audioUrl);
      console.log('Segments:', response.data.segments);
    }
  }
}

// Usage
createTTSProject();

よくあるご質問

TTS APIとは何ですか?当社のTTS APIは、高度なAI技術を使用してテキストを自然な音声に変換するRESTfulサービスです。テキストの内容と音声の設定をPOSTリクエストで送信するだけで、高品質の音声ファイルが返信されます。
音声と言語はいくつありますか?私たちのTTS APIは、33以上の言語と方言にわたる300以上のプレミアムAIボイスへのアクセスを提供します。これには、英語、スペイン語、フランス語、ドイツ語、中国語、日本語などの一般的な言語が含まれます。
APIで音声クローンを使用できますか?はい!私たちのAPIは、無制限のカスタムボイスクローニングをサポートしています。音声サンプルを提供することでパーソナライズされた音声を作成し、TTSプロジェクトでこれらのカスタム音声を使用することができます。
APIはどのようなオーディオフォーマットと音質をサポートしていますか?TTS APIは高品質の音声をMP3形式で生成します。
TTSリクエストの処理にはどのくらい時間がかかりますか?処理時間はテキストの長さと複雑さによって異なります。一般的なセグメント(1~2文)は10~30秒で処理されます。