> ## Documentation Index
> Fetch the complete documentation index at: https://cndoc-langchain.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Open AI Whisper 音频集成

> 使用 LangChain JavaScript 与 Open AI Whisper 音频文档加载器集成。

<Tip>
  **兼容性**

  仅在 Node.js 上可用。
</Tip>

本文介绍如何使用 [Open AI Whisper](https://platform.openai.com/docs/guides/speech-to-text) API 从音频文件加载文档对象。

## 设置

要运行此加载器，您需要在 Open AI 上创建一个账户，并从 [https://platform.openai.com/account](https://platform.openai.com/account) 页面获取认证密钥。

## 用法

配置好认证密钥后，您可以使用加载器创建转录，然后将其转换为文档。

```typescript theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
import { OpenAIWhisperAudio } from "@langchain/community/document_loaders/fs/openai_whisper_audio";

const filePath = "./src/document_loaders/example_data/test.mp3";

const loader = new OpenAIWhisperAudio(filePath, {
  transcriptionCreateParams: {
    language: "en",
  },
});

const docs = await loader.load();

console.log(docs);
```

***

<div className="source-links">
  <Callout icon="terminal-2">
    [连接这些文档](/use-these-docs) 到 Claude、VSCode 等，通过 MCP 获取实时答案。
  </Callout>

  <Callout icon="edit">
    [在 GitHub 上编辑此页面](https://github.com/langchain-ai/docs/edit/main/src/oss/javascript/integrations/document_loaders/file_loaders/openai_whisper_audio.mdx) 或 [提交问题](https://github.com/langchain-ai/docs/issues/new/choose)。
  </Callout>
</div>
