Tutorial Tutorial Tutorial Developer Platform Developer Platform Developer Platform ~32 phút ~32 min ~32 នាទី Đồng bộ 2026-06-10 Synced 2026-06-10 ធ្វើសមកាល 2026-06-10

Whisper-large-v3-turbo với Cloudflare Workers AI Whisper-large-v3-turbo with Cloudflare Workers AI ហ្វេសប៊ូតុង-v3-turbo ជាមួយ Cloudflare Workers AI

Hướng dẫn chi tiết đồng bộ từ docs Cloudflare — mỗi section có backlink tới đúng vị trí trên trang gốc. Detailed guide synced from Cloudflare docs — each section links to the matching anchor on the official page. មគ្គុទ្ទេសក៍លម្អិតធ្វើសមកាលពី docs Cloudflare — ផ្នែកនីមួយៗមានតំណទៅទីតាំងត្រូវគ្នានៅទំព័រផ្លូវការ។

← Danh mục ← Catalog ← បញ្ជី

Giải thích nhanh Quick context បរិបទរហ័ស

Thuộc Developer Platform — thực hành triển khai code, API và dữ liệu trên edge/serverless. Tutorial «Whisper-large-v3-turbo với Cloudflare Workers AI» giúp bạn làm quen luồng triển khai thật — phù hợp đọc trước khi mở tài liệu gốc tiếng Anh. Docs gốc chia khoảng 4 bước chính; bản tóm tắt dưới đây giúp bạn nắm khung trước khi làm theo từng lệnh.

Learn how to transcribe large audio files using Workers AI.

តើធ្វើដូចម្តេចដើម្បីធ្វើតេស្តឯកសារអូឌីយ៉ូធំដោយប្រើ Workers AI?

Lưu ý Note ចំណាំ

Lưu ý trước khi làm Notes before you start ចំណាំមុនពេលចាប់ផ្តើម

  • Đây là bản tóm tắt trên Orange Cloud Learning Hub — không thay thế tài liệu chính thức.
  • Luôn mở liên kết «Tài liệu gốc» bên dưới khi cần lệnh CLI, snippet code và ảnh minh họa đầy đủ.
  • Cần tài khoản Cloudflare, Wrangler CLI và (thường) hoàn thành hướng dẫn Get started của Workers/Pages.
  • Docs Cloudflare cập nhật thường xuyên — đối chiếu ngày «Rà soát lần cuối» trên trang gốc khi triển khai production.
  • This is a summary on Orange Cloud Learning Hub — it does not replace the official documentation.
  • Open the Official docs link below for CLI commands, code snippets, and full screenshots.
  • Requires a Cloudflare account, Wrangler CLI, and (typically) completing the Workers/Pages Get started guide.
  • Cloudflare docs change frequently — verify the Last reviewed date on the official page before production use.
  • នេះគឺជាការបញ្ជាក់អំពី Orange Cloud Learning Hub — វាគឺជាការផ្លាស់ប្តូរនៃឯកសារផ្លូវការ។
  • ចុចតំណភ្ជាប់ Docs Official នៅខាងក្រោមសម្រាប់ការបញ្ជា CLI, សៀវភៅកូដនិងរូបថតពេញលេញ។
  • តម្រូវឱ្យមានគណនី Cloudflare, Wrangler CLI និង (ប្រហែលជា) ការបញ្ចប់គណនី Workers/Pages Get started ។
  • Cloudflare បានផ្លាស់ប្តូរជាធម្មតានៅពេលវេលានៅពេលវេលានៅពេលវេលានៅពេលវេលានៅពេលវេលានៅពេលវេលានៅពេលវេលានៅពេលវេលានៅពេលវេលានៅពេលវេលានៅពេលវេលានៅពេលវេលានៅពេលវេលានៅពេលវេលានៅពេលវេលានៅពេលវេលានៅពេលវេលានៅពេលវេលានៅពេលវេលានៅពេលវេលានៅពេលវេលានៅពេលវេលានៅពេលវេលានៅពេលវេលានៅពេលវេលានៅពេលវេលានៅពេលវេលានៅ។

Tài liệu gốc — rà soát lần cuối: about 1 year ago Official docs — last reviewed: about 1 year ago ឯកសារផ្លូវការ — ពិនិត្យចុងក្រោយ: about 1 year ago

Overview Overview Overview

Phần «Tổng quan» — đọc hướng dẫn bên dưới, dùng liên kết docs gốc để xem ảnh minh họa và tab cấu hình đầy đủ.

Read the "Overview" section below — open the official docs link for full screenshots and configuration tabs.

អានផ្នែក «Overview» ខាងក្រោម — បើកតំណ docs ផ្លូវការសម្រាប់រូបភាព និង tab កំណត់។

Mở section docs gốc ↗ Open source section ↗ បើកផ្នែក docs ផ្លូវការ ↗
Trong hướng dẫn này, bạn sẽ học cách:
In this tutorial you will learn how to:
នៅក្នុង tutorial នេះអ្នកនឹងដឹងពីរបៀបដើម្បី:
  • Transcribe large audio files: Sử dụng mô hình Whisper-large-v3-turbo từ Cloudflare Workers AI để thực hiện nhận dạng giọng nói tự động (ASR) hoặc dịch.
  • Handle large files: Chia tệp âm thanh lớn thành các mảnh nhỏ hơn để xử lý, giúp vượt qua hạn chế về bộ nhớ và thời gian thực hiện.
  • Deploy using Cloudflare Workers: Tạo một đường ống biên dịch có thể mở rộng, chậm trễ thấp trong môi trường không có máy chủ.
  • Transcribe large audio files: Use the Whisper-large-v3-turbo model from Cloudflare Workers AI to perform automatic speech recognition (ASR) or translation.
  • Handle large files: Split large audio files into smaller chunks for processing, which helps overcome memory and execution time limitations.
  • Deploy using Cloudflare Workers: Create a scalable, low‑latency transcription pipeline in a serverless environment.
  • Transcribe large audio files: ប្រើម៉ូដែល Whisper-large-v3-turbo ពី Cloudflare Workers AI ដើម្បីធ្វើការអនុម័តការសរសេរដោយស្វ័យប្រវត្តិ (ASR) ឬការបម្លែង។
  • Handle large files: ការផ្លាស់ប្តូរឯកសារអូឌីយ៉ូធំទូលំទូលាយទៅក្នុងផ្លាស់ប្តូរទំហំទូលំទូលំទូលំទូលំទូលំទូលំទូលំទូលំទូលំទូលំទូលំទូលំទូលំទូលំទូលំទូលំទូលំទូលំទូលំទូលាយ។
  • Deploy using Cloudflare Workers: បានបង្កើត pipeline transcription ដែលអាចកាត់បន្ថយទំហំទូលាយនៅក្នុងបរិស្ថានដែលមិនមានសេវាកម្ម។

Liên kết liên quan (docs Cloudflare) Related links (Cloudflare docs) តំណពាក់ព័ន្ធ (docs Cloudflare)

1: Tạo một dự án mới Cloudflare Worker 1: Create a new Cloudflare Worker project 1: បង្កើតគម្រោងការងារថ្មី Cloudflare

Phần «1: Create mới Cloudflare Worker dự án» — đọc hướng dẫn bên dưới, dùng liên kết docs gốc để xem ảnh minh họa và tab cấu hình đầy đủ.

Read the "1: Create a new Cloudflare Worker project" section below — open the official docs link for full screenshots and configuration tabs.

អានផ្នែក «1: បង្កើតគម្រោងការងារថ្មី Cloudflare» ខាងក្រោម — បើកតំណ docs ផ្លូវការសម្រាប់រូបភាព និង tab កំណត់។

Mở section docs gốc ↗ Open source section ↗ បើកផ្នែក docs ផ្លូវការ ↗
  1. Đăng ký cho một Cloudflare account ↗.
  2. Cài đặt Node.js ↗
  1. Sign up for a Cloudflare account ↗.
  2. Install Node.js ↗.
  1. សូមចុះឈ្មោះសម្រាប់ Cloudflare account ↗ ។
  2. ទាញយក Node.js ↗ ។
Node.js Trình quản lý phiên bản
Node.js version manager
Node.js អ្នកគ្រប់គ្រងកំណែ
Sử dụng trình quản lý phiên bản nút như Volta ↗ hoặc nvm ↗ để tránh các vấn đề quyền và thay đổi các phiên bản Node.js. Wrangler, được thảo luận sau trong hướng dẫn này, yêu cầu một phiên bản nút của 16.17.0 hoặc mới hơn.
Use a Node version manager like Volta ↗ or nvm ↗ to avoid permission issues and change Node.js versions. Wrangler, discussed later in this guide, requires a Node version of 16.17.0 or later.
ប្រើកម្មវិធីគ្រប់គ្រងកំណែ Node ដូចជា Volta ↗ ឬ nvm ↗ ដើម្បីជួសជុលបញ្ហាការអនុញ្ញាតនិងផ្លាស់ប្តូរកំណែ Node.js ។ Wrangler ដែលត្រូវបានពិភាក្សាបន្ទាប់មកនៅក្នុងវគ្គសិក្សានេះត្រូវការកំណែ Node នៃ 16.17.0 ឬបន្ទាប់មក។
Bạn sẽ tạo một dự án Công nhân mới bằng cách sử dụng create-cloudflare CLI (C3). C3 ↗ là một công cụ dòng lệnh được thiết kế để giúp bạn thiết lập và triển khai các ứng dụng mới để Cloudflare.
You will create a new Worker project using the create-cloudflare CLI (C3). C3 ↗ is a command-line tool designed to help you set up and deploy new applications to Cloudflare.
អ្នកនឹងបង្កើតគម្រោងការងារថ្មីដោយប្រើ create-cloudflare CLI (C3) ។ C3 ↗ គឺជាឧបករណ៍បន្ទាត់គោលបំណងដែលត្រូវបានរចនាឡើងដើម្បីជួយអ្នកបង្កើតនិងដំឡើងកម្មវិធីថ្មីទៅ Cloudflare ។
Tạo một dự án mới có tên whisper-tutorial bằng cách chạy:
Create a new project named whisper-tutorial by running:
បានបង្កើតគម្រោងថ្មីដែលមានឈ្មោះ whisper-tutorial ដោយធ្វើការ:
Mã sản phẩm: npm yarn pnpm
npm yarn pnpm
លក្ខណៈពិសេស NPM
text
npm create cloudflare@latest -- whisper-tutorial
text
yarn create cloudflare whisper-tutorial
text
pnpm create cloudflare@latest whisper-tutorial
Chạy npm create cloudflare@latest sẽ nhắc bạn cài đặt create-cloudflare package ↗, và dẫn bạn qua thiết lập. C3 cũng sẽ cài đặt Wrangler, nền tảng phát triển Cloudflare CLI.
Running npm create cloudflare@latest will prompt you to install the create-cloudflare package ↗, and lead you through setup. C3 will also install Wrangler, the Cloudflare Developer Platform CLI.
ការដំឡើង npm create cloudflare@latest នឹងបង្វិលអ្នកដើម្បីដំឡើង create-cloudflare package ↗ និងនាំអ្នកតាមរយៈការដំឡើង។ C3 នឹងដំឡើង Wrangler, Cloudflare ប្លាស្ទិចអ្នកអភិវឌ្ឍន៍ CLI ។
Để cài đặt, hãy chọn các tùy chọn sau:
For setup, select the following options:
សម្រាប់ការដំឡើងអ្នកជ្រើសរើសជម្រើសខាងក្រោម:
  • Đối với Bạn muốn bắt đầu với gì?, chọn Hello World example.
  • Đối với bạn muốn sử dụng mẫu nào?, chọn Worker only.
  • Đối với Ngôn ngữ nào bạn muốn sử dụng?, chọn TypeScript.
  • Đối với Do you want to use git for version control?, chọn Yes.
  • Đối với Bạn muốn triển khai ứng dụng của mình?, chọn No (chúng tôi sẽ thực hiện một số thay đổi trước khi triển khai).
  • For What would you like to start with?, choose Hello World example.
  • For Which template would you like to use?, choose Worker only.
  • For Which language do you want to use?, choose TypeScript.
  • For Do you want to use git for version control?, choose Yes.
  • For Do you want to deploy your application?, choose No (we will be making some changes before deploying).
  • សម្រាប់ តើអ្នកចង់ចាប់ផ្តើមជាមួយអ្វី?, ជ្រើស Hello World example ។
  • សម្រាប់គំរូ តើអ្នកចង់ប្រើគំរូណាមួយ?, ជ្រើស Worker only ។
  • សម្រាប់ តើអ្នកចង់ប្រើភាសាណាមួយ?, ជ្រើស TypeScript ។
  • សម្រាប់ តើអ្នកចង់ប្រើ git សម្រាប់ការគ្រប់គ្រងកំណែ?, ជ្រើស Yes ។
  • សម្រាប់ តើអ្នកចង់ដំឡើងកម្មវិធីរបស់អ្នក?, ជ្រើស No (យើងនឹងធ្វើការផ្លាស់ប្តូរមួយចំនួនមុនពេលដំឡើង) ។
Điều này sẽ tạo ra một thư mục whisper-tutorial mới. Thư mục whisper-tutorial sẽ bao gồm:
This will create a new whisper-tutorial directory. Your new whisper-tutorial directory will include:
នេះនឹងបង្កើតអាសយដ្ឋាន whisper-tutorial ថ្មី។ សៀវភៅថ្មីរបស់អ្នក whisper-tutorial នឹងមាន:
  • ការ "Hello World" Worker នៅ src/index.ts ។
  • ទាញយកឯកសារ wrangler.jsonc ។
Đi đến thư mục ứng dụng của bạn:
Go to your application directory:
សូមចូលទៅក្នុងកម្មវិធីកម្មវិធីរបស់អ្នក:
Cửa sổ Terminal
Terminal window
បង្វិល Terminal
text
cd whisper-tutorial

Liên kết liên quan (docs Cloudflare) Related links (Cloudflare docs) តំណពាក់ព័ន្ធ (docs Cloudflare)

2.Đối với Kết nối nhân viên của bạn với Workers AI 2. Connect your Worker to Workers AI 2 ។ ទូរស័ព្ទដៃរបស់អ្នកទៅ Workers AI

Phần «Kết nối your Worker to Workers AI» — đọc hướng dẫn bên dưới, dùng liên kết docs gốc để xem ảnh minh họa và tab cấu hình đầy đủ.

Read the "2. Connect your Worker to Workers AI" section below — open the official docs link for full screenshots and configuration tabs.

អានផ្នែក «2 ។ ទូរស័ព្ទដៃរបស់អ្នកទៅ Workers AI» ខាងក្រោម — បើកតំណ docs ផ្លូវការសម្រាប់រូបភាព និង tab កំណត់។

Mở section docs gốc ↗ Open source section ↗ បើកផ្នែក docs ផ្លូវការ ↗
Bạn phải tạo một liên kết AI cho Người lao động của bạn để kết nối với Workers AI. Bindings cho phép Workers của bạn tương tác với các tài nguyên, chẳng hạn như Workers AI, trên nền tảng Nhà phát triển Cloudflare.
You must create an AI binding for your Worker to connect to Workers AI. Bindings allow your Workers to interact with resources, like Workers AI, on the Cloudflare Developer Platform.
អ្នកត្រូវបង្កើតការបណ្តុះបណ្តាល AI សម្រាប់បុគ្គលិករបស់អ្នកដើម្បីភ្ជាប់ទៅ Workers AI ។ Bindings អនុញ្ញាតឱ្យ Workers របស់អ្នកដើម្បីចូលរួមជាមួយសម្ភារៈដូចជា Workers AI នៅលើបណ្តាញអភិវឌ្ឍន៍ Cloudflare ។
Để gắn Workers AI với Worker của bạn, hãy thêm những điều sau đây vào cuối tệp cấu hình Wrangler của bạn:
To bind Workers AI to your Worker, add the following to the end of your Wrangler configuration file:
ដើម្បីបំពាក់ Workers AI ទៅលើ Worker របស់អ្នក, បន្ថែមដូចខាងក្រោមនៅចុងនៃឯកសារកំណត់ Wrangler របស់អ្នក:
JSONC
JSONC
JSONC
text
{

  "ai": {

    "binding": "AI"

  }

}
TOML
TOML
TOML
text
[ai]

binding = "AI"
Kết nối của bạn là available in your Worker code trên env.AI.
ការភ្ជាប់របស់អ្នកគឺ available in your Worker code នៅលើ env.AI ។

Liên kết liên quan (docs Cloudflare) Related links (Cloudflare docs) តំណពាក់ព័ន្ធ (docs Cloudflare)

3 Cái Cấu hình Wrangler 3. Configure Wrangler 3 ។ ការកំណត់ Wrangler

Phần «Cấu hình Wrangler» — đọc hướng dẫn bên dưới, dùng liên kết docs gốc để xem ảnh minh họa và tab cấu hình đầy đủ.

Read the "3. Configure Wrangler" section below — open the official docs link for full screenshots and configuration tabs.

អានផ្នែក «3 ។ ការកំណត់ Wrangler» ខាងក្រោម — បើកតំណ docs ផ្លូវការសម្រាប់រូបភាព និង tab កំណត់។

Mở section docs gốc ↗ Open source section ↗ បើកផ្នែក docs ផ្លូវការ ↗
Trong tệp wrangler của bạn, hãy thêm hoặc cập nhật các cài đặt sau để bật API và polyfills Node.js (với ngày tương thích 2024‐09‐23 trở lên):
In your wrangler file, add or update the following settings to enable Node.js APIs and polyfills (with a compatibility date of 2024‑09‑23 or later):
ក្នុងឯកសារ wrangler របស់អ្នក, បន្ថែមឬបច្ចុប្បន្នភាពកំណត់ដូចខាងក្រោមដើម្បីអនុញ្ញាតឱ្យ Node.js API និង polyfills (ជាមួយនឹងថ្ងៃសុពលភាពនៃ 2024‐09‐23 ឬបន្ទាប់):
JSONC
JSONC
JSONC
text
{

  "compatibility_flags": [

    "nodejs_compat"

  ],

  // Set this to today's date

  "compatibility_date": "2026-06-10"

}
TOML
TOML
TOML
text
compatibility_flags = [ "nodejs_compat" ]

# Set this to today's date

compatibility_date = "2026-06-10"

Bốn Xử lý các tập tin âm thanh lớn với chunking 4. Handle large audio files with chunking 4 ។ ការដោះស្រាយឯកសារអូឌីយ៉ូធំជាមួយ Chunking

Phần «Xử lý large audio files với chunking» — đọc hướng dẫn bên dưới, dùng liên kết docs gốc để xem ảnh minh họa và tab cấu hình đầy đủ.

Read the "4. Handle large audio files with chunking" section below — open the official docs link for full screenshots and configuration tabs.

អានផ្នែក «4 ។ ការដោះស្រាយឯកសារអូឌីយ៉ូធំជាមួយ Chunking» ខាងក្រោម — បើកតំណ docs ផ្លូវការសម្រាប់រូបភាព និង tab កំណត់។

Mở section docs gốc ↗ Open source section ↗ បើកផ្នែក docs ផ្លូវការ ↗
Thay thế nội dung của tệp src/index.ts của bạn bằng mã tích hợp sau. Mẫu này cho thấy cách:
Replace the contents of your src/index.ts file with the following integrated code. This sample demonstrates how to:
ការផ្លាស់ប្តូរសម្ភារៈនៃឯកសារ src/index.ts របស់អ្នកជាមួយនឹងកូដរួមបញ្ចូលដូចខាងក្រោម។ ការគំរូនេះបង្ហាញពីរបៀបដើម្បី:
(1) Trích xuất một URL tệp âm thanh từ các thông số truy vấn.
(1) Extract an audio file URL from the query parameters.
(1) ការបញ្ចេញ URL នៃឯកសារអូឌីយ៉ូពីទំហំសំណួរ។
(2) Khôi phục tập tin âm thanh trong khi theo dõi rõ ràng các chuyển hướng.
(2) Fetch the audio file while explicitly following redirects.
(2) ទាញយកឯកសារអូឌីយ៉ូនៅពេលដែលតាមរយៈការបណ្តុះបណ្តាល។
(3) Chia tệp âm thanh thành các mảnh nhỏ hơn (ví dụ, 1 MB mảnh).
(3) Split the audio file into smaller chunks (such as, 1 MB chunks).
(3) ការផ្លាស់ប្តូរឯកសារអូឌីយ៉ូទៅក្នុងការផ្លាស់ប្តូរតូចជាងមុន (ដូចជាផ្លាស់ប្តូរ 1 MB) ។
(4) Trancribe mỗi phần bằng cách sử dụng mô hình Whisper-large-v3-turbo thông qua Cloudflare AI binding.
(4) Transcribe each chunk using the Whisper-large-v3-turbo model via the Cloudflare AI binding.
(4) ការផ្លាស់ប្តូរផ្នែកមួយដោយប្រើម៉ូដែល Whisper-large-v3-turbo ដោយប្រើ Cloudflare AI binding ។
(5) Trả lại bản sao tổng hợp dưới dạng văn bản đơn giản.
(5) Return the aggregated transcription as plain text.
(5) ទាញយកសៀវភៅសៀវភៅសៀវភៅសៀវភៅសៀវភៅសៀវភៅសៀវភៅសៀវភៅ
TypeScript Đánh giá
TypeScript
កុំព្យូទ័រ
text
import { Buffer } from "node:buffer";

import type { Ai } from "workers-ai";


export interface Env {

  AI: Ai;

  // If needed, add your KV namespace for storing transcripts.

  // MY_KV_NAMESPACE: KVNamespace;

}


/**

 * Fetches the audio file from the provided URL and splits it into chunks.

 * This function explicitly follows redirects.

 *

 * @param audioUrl - The URL of the audio file.

 * @returns An array of ArrayBuffers, each representing a chunk of the audio.

 */

async function getAudioChunks(audioUrl: string): Promise<ArrayBuffer[]> {

  const response = await fetch(audioUrl, { redirect: "follow" });

  if (!response.ok) {

    throw new Error(`Failed to fetch audio: ${response.status}`);

  }

  const arrayBuffer = await response.arrayBuffer();


  // Example: Split the audio into 1MB chunks.

  const chunkSize = 1024 * 1024; // 1MB

  const chunks: ArrayBuffer[] = [];

  for (let i = 0; i < arrayBuffer.byteLength; i += chunkSize) {

    const chunk = arrayBuffer.slice(i, i + chunkSize);

    chunks.push(chunk);

  }

  return chunks;

}


/**

 * Transcribes a single audio chunk using the Whisper‑large‑v3‑turbo model.

 * The function converts the audio chunk to a Base64-encoded string and

 * sends it to the model via the AI binding.

 *

 * @param chunkBuffer - The audio chunk as an ArrayBuffer.

 * @param env - The Cloudflare Worker environment, including the AI binding.

 * @returns The transcription text from the model.

 */

async function transcribeChunk(

  chunkBuffer: ArrayBuffer,

  env: Env,

): Promise<string> {

  const base64 = Buffer.from(chunkBuffer, "binary").toString("base64");

  const res = await env.AI.run("@cf/openai/whisper-large-v3-turbo", {

    audio: base64,

    // Optional parameters (uncomment and set if needed):

    // task: "transcribe",   // or "translate"

    // language: "en",

    // vad_filter: "false",

    // initial_prompt: "Provide context if needed.",

    // prefix: "Transcription:",

  });

  return res.text; // Assumes the transcription result includes a "text" property.

}


/**

 * The main fetch handler. It extracts the 'url' query parameter, fetches the audio,

 * processes it in chunks, and returns the full transcription.

 */

export default {

  async fetch(

    request: Request,

    env: Env,

    ctx: ExecutionContext,

  ): Promise<Response> {

    // Extract the audio URL from the query parameters.

    const { searchParams } = new URL(request.url);

    const audioUrl = searchParams.get("url");


    if (!audioUrl) {

      return new Response("Missing 'url' query parameter", { status: 400 });

    }


    // Get the audio chunks.

    const audioChunks: ArrayBuffer[] = await getAudioChunks(audioUrl);

    let fullTranscript = "";


    // Process each chunk and build the full transcript.

    for (const chunk of audioChunks) {

      try {

        const transcript = await transcribeChunk(chunk, env);

        fullTranscript += transcript + "\n";

      } catch (error) {

        fullTranscript += "[Error transcribing chunk]\n";

      }

    }


    return new Response(fullTranscript, {

      headers: { "Content-Type": "text/plain" },

    });

  },

} satisfies ExportedHandler<Env>;

5 triển khai công nhân của bạn 5. Deploy your Worker 5 ។ បញ្ចូលការងាររបស់អ្នក

Phần «Triển khai your Worker» — đọc hướng dẫn bên dưới, dùng liên kết docs gốc để xem ảnh minh họa và tab cấu hình đầy đủ.

Read the "5. Deploy your Worker" section below — open the official docs link for full screenshots and configuration tabs.

អានផ្នែក «5 ។ បញ្ចូលការងាររបស់អ្នក» ខាងក្រោម — បើកតំណ docs ផ្លូវការសម្រាប់រូបភាព និង tab កំណត់។

Mở section docs gốc ↗ Open source section ↗ បើកផ្នែក docs ផ្លូវការ ↗
  1. Run the Worker locally:
  1. Run the Worker locally:
  1. Run the Worker locally:
Sử dụng chế độ phát triển của wrangler để kiểm tra Worker của bạn tại địa phương:
Use wrangler's development mode to test your Worker locally:
ប្រើទូទាត់ការអភិវឌ្ឍន៍ wrangler ដើម្បីធ្វើតេស្ត Worker របស់អ្នកនៅទូទាំងពិភពលោក:
Cửa sổ Terminal
Terminal window
បង្វិល Terminal
text
npx wrangler dev
Mở trình duyệt của bạn và đi đến http://localhost:8787 ↗, hoặc sử dụng curl:
Open your browser and go to http://localhost:8787 ↗, or use curl:
ទាញយក http://localhost:8787 ↗ ឬប្រើ curl:
Cửa sổ Terminal
Terminal window
បង្វិល Terminal
text
curl "http://localhost:8787?url=https://raw.githubusercontent.com/your-username/your-repo/main/your-audio-file.mp3"
Thay thế tham số truy vấn URL bằng liên kết trực tiếp đến tệp âm thanh của bạn. (Đối với các tệp được lưu trữ GitHub, hãy đảm bảo rằng bạn sử dụng URL tệp thô.)
Replace the URL query parameter with the direct link to your audio file. (For GitHub-hosted files, ensure you use the raw file URL.)
ការផ្លាស់ប្តូរទម្រង់ URL ជាមួយនឹងតំណភ្ជាប់ផ្ទាល់ទៅនឹងឯកសារអូឌីយ៉ូរបស់អ្នក។ (សម្រាប់ឯកសារដែលត្រូវបានគេហទំព័រ GitHub សូមប្រាកដថាអ្នកប្រើ URL ដែលជាឯកសារធម្មតា។)
  1. Deploy the Worker:
  1. Deploy the Worker:
  1. Deploy the Worker:
Khi thử nghiệm hoàn tất, triển khai Nhân viên của bạn với:
Once testing is complete, deploy your Worker with:
បន្ទាប់ពីការធ្វើតេស្តបានបញ្ចប់, ការបម្រើបុគ្គលិករបស់អ្នកជាមួយ:
Cửa sổ Terminal
Terminal window
បង្វិល Terminal
text
npx wrangler deploy
  1. Test the deployed Worker:
  1. Test the deployed Worker:
  1. Test the deployed Worker:
Sau khi triển khai, kiểm tra Worker của bạn bằng cách thông qua URL âm thanh như là một tham số truy vấn:
After deployment, test your Worker by passing the audio URL as a query parameter:
បន្ទាប់ពីការដំឡើង, ការធ្វើតេស្ត Worker របស់អ្នកដោយផ្ញើ URL អូឌីយ៉ូជាទំហំសំណួរ:
Cửa sổ Terminal
Terminal window
បង្វិល Terminal
text
curl "https://<your-worker-subdomain>.workers.dev?url=https://raw.githubusercontent.com/your-username/your-repo/main/your-audio-file.mp3"
Hãy chắc chắn thay thế <your-worker-subdomain>, your-username, your-repo và your-audio-file.mp3 bằng các chi tiết thực tế của bạn.
Make sure to replace <your-worker-subdomain>, your-username, your-repo, and your-audio-file.mp3 with your actual details.
សូមផ្លាស់ប្តូរ <your-worker-subdomain>, your-username, your-repo និង your-audio-file.mp3 ជាមួយនឹងព័ត៌មានរបស់អ្នកពិតប្រាកដ។
Nếu thành công, Worker sẽ trả về một bản sao của tệp âm thanh:
If successful, the Worker will return a transcript of the audio file:
ប្រសិនបើវាបានជោគជ័យ, Worker នឹងបង្វិលបញ្ជីនៃឯកសារអូឌីយ៉ូ:
Cửa sổ Terminal
Terminal window
បង្វិល Terminal
text
This is the transcript of the audio...
json
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"item":{"@id":"/directory/","name":"Directory"}},{"@type":"ListItem","position":2,"item":{"@id":"/workers-ai/","name":"Workers AI"}},{"@type":"ListItem","position":3,"item":{"@id":"/workers-ai/guides/","name":"Guides"}},{"@type":"ListItem","position":4,"item":{"@id":"/workers-ai/guides/tutorials/","name":"Tutorials"}},{"@type":"ListItem","position":5,"item":{"@id":"/workers-ai/guides/tutorials/build-a-workers-ai-whisper-with-chunking/","name":"Whisper-large-v3-turbo with Cloudflare Workers AI"}}]}

Xem bản đầy đủ trên developers.cloudflare.com (ảnh, tab cấu hình). View the full guide on developers.cloudflare.com (images, config tabs). មើលមគ្គុទ្ទេសក៍ពេញលើ developers.cloudflare.com (រូបភាព, tab កំណត់)។

Tài liệu gốc ↗ Official docs ↗ ឯកសារផ្លូវការ ↗