メインコンテンツまでスキップ

Audio transcription and generation

音声書き起こしと生成

Transcribe spoken language from audio files and create spoken audio using AI-generated speech

音声ファイルから話し言葉を文字起こしし、AI生成音声を使用して音声を作成します

Use cases

ユースケース

  • Automatically trigger transcription when new audio files are uploaded. 新しいオーディオファイルがアップロードされた際に、自動的に書き起こしをトリガーします。
  • Save and summarize transcriptions using a Squid AI Agent. Squid AI Agent を使用して、書き起こしを保存および要約します。
  • Create an audible persona for your AI agent. AIエージェント用のオーディオペルソナを作成します。

Run transcription

書き起こしの実行

To transcribe a file, use the Squid Client SDK. ファイルを書き起こすには、Squid Client SDK を使用します。

注意

The Squid AI Audio client requires admin access to your Squid resources. It should only be used in a secure environment where you can safely provide your Squid API key, such as the Squid backend. Squid AI Audio クライアントは、あなたの Squid リソースへの管理者アクセスを必要とします。これは、Squid backend のように、Squid API キーを安全に提供できるセキュアな環境でのみ使用するべきです。

To transcribe a file, use Squid AI Audio's transcribe() method, passing the audio Blob and file name as an object: ファイルを書き起こすには、Squid AI Audio の transcribe() メソッドを使用し、audio Blob とファイル名をオブジェクトとして渡します。

Backend code
const fileName = 'myAudioFile.mp3';

const audioBlobAndFilename = {
audioBlob, // provide your audio as a Blob
fileName,
};
const transcription = await squid.ai().audio().transcribe(audioBlobAndFilename);

The transcribe() method also accepts an optional options parameter for customizing your transcription. More information can be found in the reference documentation. transcribe() メソッドは、書き起こしをカスタマイズするためのオプションの options パラメータも受け取ります。詳しくは reference documentation をご覧ください。

Create audio files

オーディオファイルの作成

To create AI-generated audio files, use Squid AI Audio's createSpeech() method. This method takes an input string and an options parameter, which is used to customize the audio file. The method returns a promise that resolves to the generated audio file. AI生成オーディオファイルを作成するには、Squid AI Audio の createSpeech() メソッドを使用します。このメソッドは、input 文字列と、オーディオファイルをカスタマイズするための options パラメータを取ります。メソッドは生成されたオーディオファイルを返す Promise を返します。

Backend code
const audioFile = await squid
.ai()
.audio()
.createSpeech('Say hello to all users like a pirate would say hello.', {
modelName: 'tts-1',
});