Gemini API สามารถเปลี่ยนอินพุตข้อความเป็นเสียงของลำโพงเดี่ยวหรือหลายลำโพง โดยใช้ความสามารถในการสร้างข้อความเป็นเสียง (TTS) ของ Gemini การสร้างการอ่านออกเสียงข้อความ (TTS) เป็นแบบควบคุมได้ ซึ่งหมายความว่าคุณสามารถใช้ภาษาธรรมชาติเพื่อจัดโครงสร้างการโต้ตอบและกำหนดสไตล์ สำเนียง จังหวะ และโทนของเสียง
ความสามารถของ TTS แตกต่างจากการสร้างคำพูดที่ให้บริการผ่าน Live API ซึ่งออกแบบมาสำหรับเสียงแบบโต้ตอบที่ไม่มีโครงสร้าง รวมถึงอินพุตและเอาต์พุตแบบมัลติโมดัล แม้ว่า Live API จะโดดเด่น ในบริบทการสนทนาแบบไดนามิก แต่ TTS ผ่าน Gemini API ได้รับการปรับแต่งสำหรับสถานการณ์ที่ต้องมีการอ่านข้อความที่แน่นอนพร้อมการควบคุม สไตล์และเสียงอย่างละเอียด เช่น การสร้างพอดแคสต์หรือหนังสือเสียง
คู่มือนี้จะแสดงวิธีสร้างเสียงแบบมีผู้พูดคนเดียวและแบบมีผู้พูดหลายคนจากข้อความ
ก่อนเริ่มต้น
ตรวจสอบว่าคุณใช้โมเดล Gemini 2.5 ที่มีฟีเจอร์ข้อความเป็นเสียง (TTS) ของ Gemini ตามที่ระบุไว้ในส่วนโมเดลที่รองรับ โปรดพิจารณาว่าโมเดลใดเหมาะกับ Use Case เฉพาะของคุณมากที่สุดเพื่อให้ได้ผลลัพธ์ที่ดีที่สุด
คุณอาจเห็นว่าการทดสอบโมเดล TTS ของ Gemini 2.5 ใน AI Studio มีประโยชน์ก่อนที่จะเริ่มสร้าง
TTS แบบผู้พูดคนเดียว
หากต้องการแปลงข้อความเป็นเสียงแบบลำโพงเดียว ให้ตั้งค่ารูปแบบการตอบกลับเป็น "เสียง"
และส่งออบเจ็กต์ SpeechConfig ที่มีVoiceConfig ตั้งค่าไว้
คุณจะต้องเลือกชื่อเสียงจากเสียงเอาต์พุตที่สร้างไว้ล่วงหน้า
ตัวอย่างนี้จะบันทึกเสียงเอาต์พุตจากโมเดลในไฟล์ Wave
Python
from google import genai
from google.genai import types
import wave
# Set up the wave file to save the output:
def wave_file(filename, pcm, channels=1, rate=24000, sample_width=2):
with wave.open(filename, "wb") as wf:
wf.setnchannels(channels)
wf.setsampwidth(sample_width)
wf.setframerate(rate)
wf.writeframes(pcm)
client = genai.Client()
response = client.models.generate_content(
model="gemini-2.5-flash-preview-tts",
contents="Say cheerfully: Have a wonderful day!",
config=types.GenerateContentConfig(
response_modalities=["AUDIO"],
speech_config=types.SpeechConfig(
voice_config=types.VoiceConfig(
prebuilt_voice_config=types.PrebuiltVoiceConfig(
voice_name='Kore',
)
)
),
)
)
data = response.candidates[0].content.parts[0].inline_data.data
file_name='out.wav'
wave_file(file_name, data) # Saves the file to current directory
JavaScript
import {GoogleGenAI} from '@google/genai';
import wav from 'wav';
async function saveWaveFile(
filename,
pcmData,
channels = 1,
rate = 24000,
sampleWidth = 2,
) {
return new Promise((resolve, reject) => {
const writer = new wav.FileWriter(filename, {
channels,
sampleRate: rate,
bitDepth: sampleWidth * 8,
});
writer.on('finish', resolve);
writer.on('error', reject);
writer.write(pcmData);
writer.end();
});
}
async function main() {
const ai = new GoogleGenAI({});
const response = await ai.models.generateContent({
model: "gemini-2.5-flash-preview-tts",
contents: [{ parts: [{ text: 'Say cheerfully: Have a wonderful day!' }] }],
config: {
responseModalities: ['AUDIO'],
speechConfig: {
voiceConfig: {
prebuiltVoiceConfig: { voiceName: 'Kore' },
},
},
},
});
const data = response.candidates?.[0]?.content?.parts?.[0]?.inlineData?.data;
const audioBuffer = Buffer.from(data, 'base64');
const fileName = 'out.wav';
await saveWaveFile(fileName, audioBuffer);
}
await main();
REST
curl "https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash-preview-tts:generateContent" \
-H "x-goog-api-key: $GEMINI_API_KEY" \
-X POST \
-H "Content-Type: application/json" \
-d '{
"contents": [{
"parts":[{
"text": "Say cheerfully: Have a wonderful day!"
}]
}],
"generationConfig": {
"responseModalities": ["AUDIO"],
"speechConfig": {
"voiceConfig": {
"prebuiltVoiceConfig": {
"voiceName": "Kore"
}
}
}
},
"model": "gemini-2.5-flash-preview-tts",
}' | jq -r '.candidates[0].content.parts[0].inlineData.data' | \
base64 --decode >out.pcm
# You may need to install ffmpeg.
ffmpeg -f s16le -ar 24000 -ac 1 -i out.pcm out.wav
TTS แบบหลายเสียง
สำหรับเสียงแบบหลายลำโพง คุณจะต้องมีออบเจ็กต์ MultiSpeakerVoiceConfig ที่กำหนดค่าลำโพงแต่ละตัว (สูงสุด 2 ตัว) เป็น SpeakerVoiceConfig
คุณจะต้องกําหนด speaker แต่ละรายการด้วยชื่อเดียวกันกับที่ใช้ในพรอมต์
Python
from google import genai
from google.genai import types
import wave
# Set up the wave file to save the output:
def wave_file(filename, pcm, channels=1, rate=24000, sample_width=2):
with wave.open(filename, "wb") as wf:
wf.setnchannels(channels)
wf.setsampwidth(sample_width)
wf.setframerate(rate)
wf.writeframes(pcm)
client = genai.Client()
prompt = """TTS the following conversation between Joe and Jane:
Joe: How's it going today Jane?
Jane: Not too bad, how about you?"""
response = client.models.generate_content(
model="gemini-2.5-flash-preview-tts",
contents=prompt,
config=types.GenerateContentConfig(
response_modalities=["AUDIO"],
speech_config=types.SpeechConfig(
multi_speaker_voice_config=types.MultiSpeakerVoiceConfig(
speaker_voice_configs=[
types.SpeakerVoiceConfig(
speaker='Joe',
voice_config=types.VoiceConfig(
prebuilt_voice_config=types.PrebuiltVoiceConfig(
voice_name='Kore',
)
)
),
types.SpeakerVoiceConfig(
speaker='Jane',
voice_config=types.VoiceConfig(
prebuilt_voice_config=types.PrebuiltVoiceConfig(
voice_name='Puck',
)
)
),
]
)
)
)
)
data = response.candidates[0].content.parts[0].inline_data.data
file_name='out.wav'
wave_file(file_name, data) # Saves the file to current directory
JavaScript
import {GoogleGenAI} from '@google/genai';
import wav from 'wav';
async function saveWaveFile(
filename,
pcmData,
channels = 1,
rate = 24000,
sampleWidth = 2,
) {
return new Promise((resolve, reject) => {
const writer = new wav.FileWriter(filename, {
channels,
sampleRate: rate,
bitDepth: sampleWidth * 8,
});
writer.on('finish', resolve);
writer.on('error', reject);
writer.write(pcmData);
writer.end();
});
}
async function main() {
const ai = new GoogleGenAI({});
const prompt = `TTS the following conversation between Joe and Jane:
Joe: How's it going today Jane?
Jane: Not too bad, how about you?`;
const response = await ai.models.generateContent({
model: "gemini-2.5-flash-preview-tts",
contents: [{ parts: [{ text: prompt }] }],
config: {
responseModalities: ['AUDIO'],
speechConfig: {
multiSpeakerVoiceConfig: {
speakerVoiceConfigs: [
{
speaker: 'Joe',
voiceConfig: {
prebuiltVoiceConfig: { voiceName: 'Kore' }
}
},
{
speaker: 'Jane',
voiceConfig: {
prebuiltVoiceConfig: { voiceName: 'Puck' }
}
}
]
}
}
}
});
const data = response.candidates?.[0]?.content?.parts?.[0]?.inlineData?.data;
const audioBuffer = Buffer.from(data, 'base64');
const fileName = 'out.wav';
await saveWaveFile(fileName, audioBuffer);
}
await main();
REST
curl "https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash-preview-tts:generateContent" \
-H "x-goog-api-key: $GEMINI_API_KEY" \
-X POST \
-H "Content-Type: application/json" \
-d '{
"contents": [{
"parts":[{
"text": "TTS the following conversation between Joe and Jane:
Joe: Hows it going today Jane?
Jane: Not too bad, how about you?"
}]
}],
"generationConfig": {
"responseModalities": ["AUDIO"],
"speechConfig": {
"multiSpeakerVoiceConfig": {
"speakerVoiceConfigs": [{
"speaker": "Joe",
"voiceConfig": {
"prebuiltVoiceConfig": {
"voiceName": "Kore"
}
}
}, {
"speaker": "Jane",
"voiceConfig": {
"prebuiltVoiceConfig": {
"voiceName": "Puck"
}
}
}]
}
}
},
"model": "gemini-2.5-flash-preview-tts",
}' | jq -r '.candidates[0].content.parts[0].inlineData.data' | \
base64 --decode > out.pcm
# You may need to install ffmpeg.
ffmpeg -f s16le -ar 24000 -ac 1 -i out.pcm out.wav
การควบคุมรูปแบบคำพูดด้วยพรอมต์
คุณควบคุมสไตล์ น้ำเสียง สำเนียง และจังหวะได้โดยใช้พรอมต์ภาษาธรรมชาติ สำหรับการอ่านออกเสียงข้อความแบบเสียงเดียวและหลายเสียง ตัวอย่างเช่น ในพรอมต์ที่มีผู้พูดคนเดียว คุณอาจพูดว่า
Say in an spooky whisper:
"By the pricking of my thumbs...
Something wicked this way comes"
ในพรอมต์ที่มีผู้พูดหลายคน ให้ระบุชื่อของผู้พูดแต่ละคนและ ข้อความถอดเสียงที่เกี่ยวข้อง นอกจากนี้ คุณยังให้คำแนะนำแก่ผู้พูดแต่ละคน ได้ด้วยตนเองโดยทำดังนี้
Make Speaker1 sound tired and bored, and Speaker2 sound excited and happy:
Speaker1: So... what's on the agenda today?
Speaker2: You're never going to guess!
ลองใช้ตัวเลือกเสียงที่สอดคล้องกับสไตล์หรืออารมณ์ที่คุณต้องการสื่อ เพื่อเน้นย้ำให้มากขึ้น เช่น ในพรอมต์ก่อนหน้า เสียงลมของ Enceladus อาจเน้นคำว่า "เหนื่อย" และ "เบื่อ" ในขณะที่โทนเสียงที่ร่าเริงของ Puck อาจเสริมคำว่า "ตื่นเต้น" และ "มีความสุข"
กำลังสร้างพรอมต์เพื่อแปลงเป็นเสียง
โมเดล TTS จะแสดงผลเฉพาะเสียง แต่คุณสามารถใช้โมเดลอื่นๆ เพื่อสร้างการถอดเสียงก่อน จากนั้นส่งการถอดเสียงนั้นไปยังโมเดล TTS เพื่ออ่านออกเสียง
Python
from google import genai
from google.genai import types
client = genai.Client()
transcript = client.models.generate_content(
model="gemini-2.5-flash",
contents="""Generate a short transcript around 100 words that reads
like it was clipped from a podcast by excited herpetologists.
The hosts names are Dr. Anya and Liam.""").text
response = client.models.generate_content(
model="gemini-2.5-flash-preview-tts",
contents=transcript,
config=types.GenerateContentConfig(
response_modalities=["AUDIO"],
speech_config=types.SpeechConfig(
multi_speaker_voice_config=types.MultiSpeakerVoiceConfig(
speaker_voice_configs=[
types.SpeakerVoiceConfig(
speaker='Dr. Anya',
voice_config=types.VoiceConfig(
prebuilt_voice_config=types.PrebuiltVoiceConfig(
voice_name='Kore',
)
)
),
types.SpeakerVoiceConfig(
speaker='Liam',
voice_config=types.VoiceConfig(
prebuilt_voice_config=types.PrebuiltVoiceConfig(
voice_name='Puck',
)
)
),
]
)
)
)
)
# ...Code to stream or save the output
JavaScript
import { GoogleGenAI } from "@google/genai";
const ai = new GoogleGenAI({});
async function main() {
const transcript = await ai.models.generateContent({
model: "gemini-2.5-flash",
contents: "Generate a short transcript around 100 words that reads like it was clipped from a podcast by excited herpetologists. The hosts names are Dr. Anya and Liam.",
})
const response = await ai.models.generateContent({
model: "gemini-2.5-flash-preview-tts",
contents: transcript,
config: {
responseModalities: ['AUDIO'],
speechConfig: {
multiSpeakerVoiceConfig: {
speakerVoiceConfigs: [
{
speaker: "Dr. Anya",
voiceConfig: {
prebuiltVoiceConfig: {voiceName: "Kore"},
}
},
{
speaker: "Liam",
voiceConfig: {
prebuiltVoiceConfig: {voiceName: "Puck"},
}
}
]
}
}
}
});
}
// ..JavaScript code for exporting .wav file for output audio
await main();
ตัวเลือกเสียง
โมเดล TTS รองรับตัวเลือกเสียง 30 แบบต่อไปนี้ในฟิลด์ voice_name
| Zephyr -- Bright | Puck -- Upbeat | Charon - ให้ข้อมูล |
| เกาหลี -- หนักแน่น | Fenrir -- ตื่นเต้นง่าย | Leda -- วัยรุ่น |
| Orus -- Firm | Aoede -- Breezy | Callirrhoe -- สบายๆ |
| Autonoe -- Bright | Enceladus -- Breathy | Iapetus -- Clear |
| Umbriel - สบายๆ | Algieba -- ราบรื่น | Despina -- Smooth |
| Erinome -- ล้าง | Algenib -- Gravelly | Rasalgethi -- ให้ข้อมูล |
| Laomedeia -- Upbeat | Achernar -- Soft | Alnilam -- Firm |
| Schedar -- Even | Gacrux -- ผู้ใหญ่ | Pulcherrima -- Forward |
| Achird -- เป็นมิตร | Zubenelgenubi -- สบายๆ | Vindemiatrix -- อ่อนโยน |
| Sadachbia -- Lively | Sadaltager -- มีความรู้ | Sulafat -- Warm |
คุณฟังตัวเลือกเสียงทั้งหมดได้ใน AI Studio
ภาษาที่รองรับ
โมเดล TTS จะตรวจหาภาษาที่ป้อนโดยอัตโนมัติ โดยรองรับภาษาต่อไปนี้ 24 ภาษา
| ภาษา | รหัส BCP-47 | ภาษา | รหัส BCP-47 |
|---|---|---|---|
| อาหรับ (อียิปต์) | ar-EG |
เยอรมัน (เยอรมนี) | de-DE |
| อังกฤษ (อเมริกัน) | en-US |
สเปน (สหรัฐอเมริกา) | es-US |
| ฝรั่งเศส (ฝรั่งเศส) | fr-FR |
ฮินดี (อินเดีย) | hi-IN |
| อินโดนีเซีย (อินโดนีเซีย) | id-ID |
อิตาลี (อิตาลี) | it-IT |
| ญี่ปุ่น (ญี่ปุ่น) | ja-JP |
เกาหลี (เกาหลี) | ko-KR |
| โปรตุเกส (บราซิล) | pt-BR |
รัสเซีย (รัสเซีย) | ru-RU |
| ดัตช์ (เนเธอร์แลนด์) | nl-NL |
โปแลนด์ (โปแลนด์) | pl-PL |
| ไทย (ประเทศไทย) | th-TH |
ตุรกี (ตุรกี) | tr-TR |
| เวียดนาม (เวียดนาม) | vi-VN |
โรมาเนีย (โรมาเนีย) | ro-RO |
| ยูเครน (ยูเครน) | uk-UA |
เบงกาลี (บังกลาเทศ) | bn-BD |
| อังกฤษ (อินเดีย) | แพ็กเกจ en-IN และ hi-IN |
มราฐี (อินเดีย) | mr-IN |
| ทมิฬ (อินเดีย) | ta-IN |
เตลูกู (อินเดีย) | te-IN |
รุ่นที่รองรับ
| รุ่น | ผู้พูดคนเดียว | Multispeaker |
|---|---|---|
| TTS ของ Gemini 2.5 Flash (เวอร์ชันตัวอย่าง) | ✔️ | ✔️ |
| TTS ของ Gemini 2.5 Pro เวอร์ชันตัวอย่าง | ✔️ | ✔️ |
ข้อจำกัด
- โมเดล TTS รับได้เฉพาะข้อความที่ป้อนและสร้างเอาต์พุตเสียงเท่านั้น
- เซสชัน TTS มีขีดจำกัดหน้าต่างบริบทอยู่ที่ 32,000 โทเค็น
- ดูส่วนภาษาเพื่อดูการรองรับภาษา
คำแนะนำในการเขียนพรอมต์
โมเดลการอ่านออกเสียงข้อความ (TTS) ของ Gemini Native Audio Generation แตกต่างจากโมเดล TTS แบบเดิมตรงที่ใช้โมเดลภาษาขนาดใหญ่ที่ไม่เพียงรู้ว่าจะพูดอะไร แต่ยังรู้วิธีพูดด้วย
หากต้องการปลดล็อกความสามารถนี้ ผู้ใช้สามารถคิดว่าตนเองเป็นผู้กำกับที่กำลังจัด ฉากให้นักพากย์เสมือนจริงแสดง เราขอแนะนำให้คุณพิจารณาส่วนประกอบต่อไปนี้เพื่อสร้างพรอมต์ โปรไฟล์เสียงที่กำหนดลักษณะตัวตนและต้นแบบหลักของตัวละคร คำอธิบายฉากที่สร้างสภาพแวดล้อมทางกายภาพและ"กลิ่นอาย" ทางอารมณ์ และหมายเหตุของผู้กำกับที่ให้คำแนะนำด้านการแสดงที่แม่นยำยิ่งขึ้นเกี่ยวกับสไตล์ สำเนียง และการควบคุมจังหวะ
การให้คำสั่งที่ละเอียด เช่น สำเนียงเฉพาะภูมิภาค ลักษณะเฉพาะ ทางภาษา (เช่น เสียงลม) หรือจังหวะ จะช่วยให้ผู้ใช้ใช้ประโยชน์จากความสามารถของโมเดลในการรับรู้บริบทเพื่อสร้าง เสียงที่มีความไดนามิก เป็นธรรมชาติ และสื่ออารมณ์ได้อย่างดี เราขอแนะนำให้ข้อความถอดเสียงและพรอมต์ของผู้กำกับสอดคล้องกันเพื่อให้ "ใครเป็นคนพูด" ตรงกับ "สิ่งที่พูด" และ "วิธีการพูด" เพื่อให้ได้ประสิทธิภาพสูงสุด
จุดประสงค์ของคู่มือนี้คือการให้แนวทางพื้นฐานและจุดประกายไอเดียเมื่อ พัฒนาประสบการณ์ด้านเสียงโดยใช้การสร้างเสียง TTS ของ Gemini เราตื่นเต้น ที่จะได้เห็นผลงานของคุณ
โครงสร้างพรอมต์
พรอมต์ที่มีประสิทธิภาพควรมีองค์ประกอบต่อไปนี้ซึ่งทำงานร่วมกันเพื่อ สร้างประสิทธิภาพที่ยอดเยี่ยม
- โปรไฟล์เสียง - สร้างตัวตนสำหรับเสียง โดยกำหนดตัวตนของตัวละคร ต้นแบบ และลักษณะอื่นๆ เช่น อายุ พื้นหลัง ฯลฯ
- ฉาก - เตรียมความพร้อม อธิบายทั้งสภาพแวดล้อมทางกายภาพและ"บรรยากาศ"
- หมายเหตุของผู้กำกับ - คำแนะนำด้านประสิทธิภาพที่คุณสามารถแจกแจงคำสั่งที่สำคัญสำหรับพรสวรรค์เสมือนให้จดบันทึกได้ ตัวอย่างเช่น สไตล์การพูด การหายใจ การเว้นจังหวะ การออกเสียง และสำเนียง
- บริบทตัวอย่าง - ให้จุดเริ่มต้นตามบริบทแก่โมเดล เพื่อให้ตัวละครเสมือน เข้าสู่ฉากที่คุณตั้งค่าไว้อย่างเป็นธรรมชาติ
- ข้อความถอดเสียง - ข้อความที่โมเดลจะพูด โปรดทราบว่าหัวข้อของข้อความถอดเสียงและรูปแบบการเขียนควรสอดคล้องกับ คำสั่งที่คุณให้เพื่อประสิทธิภาพที่ดีที่สุด
ตัวอย่างพรอมต์แบบเต็ม
# AUDIO PROFILE: Jaz R.
## "The Morning Hype"
## THE SCENE: The London Studio
It is 10:00 PM in a glass-walled studio overlooking the moonlit London skyline,
but inside, it is blindingly bright. The red "ON AIR" tally light is blazing.
Jaz is standing up, not sitting, bouncing on the balls of their heels to the
rhythm of a thumping backing track. Their hands fly across the faders on a
massive mixing desk. It is a chaotic, caffeine-fueled cockpit designed to wake
up an entire nation.
### DIRECTOR'S NOTES
Style:
* The "Vocal Smile": You must hear the grin in the audio. The soft palate is
always raised to keep the tone bright, sunny, and explicitly inviting.
* Dynamics: High projection without shouting. Punchy consonants and elongated
vowels on excitement words (e.g., "Beauuutiful morning").
Pace: Speaks at an energetic pace, keeping up with the fast music. Speaks
with A "bouncing" cadence. High-speed delivery with fluid transitions — no dead
air, no gaps.
Accent: Jaz is from Brixton, London
### SAMPLE CONTEXT
Jaz is the industry standard for Top 40 radio, high-octane event promos, or any
script that requires a charismatic Estuary accent and 11/10 infectious energy.
#### TRANSCRIPT
Yes, massive vibes in the studio! You are locked in and it is absolutely
popping off in London right now. If you're stuck on the tube, or just sat
there pretending to work... stop it. Seriously, I see you. Turn this up!
We've got the project roadmap landing in three, two... let's go!
กลยุทธ์การแจ้งโดยละเอียด
มาดูรายละเอียดของแต่ละองค์ประกอบในพรอมต์กัน
โปรไฟล์เสียง
อธิบายตัวตนของตัวละครโดยย่อ
- ชื่อ การตั้งชื่อตัวละครจะช่วยให้โมเดลและ การแสดงผสานรวมกันได้อย่างแนบเนียน โปรดอ้างอิงถึงตัวละครด้วยชื่อเมื่อตั้งค่าฉากและ บริบท
- บทบาท ตัวตนหลักและต้นแบบของตัวละครที่กำลังแสดงในฉาก เช่น ดีเจวิทยุ ผู้จัดพอดแคสต์ ผู้สื่อข่าว และอื่นๆ
ตัวอย่าง
# AUDIO PROFILE: Jaz R.
## "The Morning Hype"
# AUDIO PROFILE: Monica A.
## "The Beauty Influencer"
บรรยากาศ
กำหนดบริบทของฉาก รวมถึงสถานที่ อารมณ์ และรายละเอียดด้านสิ่งแวดล้อม ที่กำหนดโทนและบรรยากาศ อธิบายสิ่งที่เกิดขึ้นรอบตัว ตัวละครและผลกระทบที่มีต่อตัวละคร ฉากจะให้บริบทด้านสภาพแวดล้อม สำหรับการโต้ตอบทั้งหมดและเป็นแนวทางในการแสดง อย่างเป็นธรรมชาติ
ตัวอย่าง
## THE SCENE: The London Studio
It is 10:00 PM in a glass-walled studio overlooking the moonlit London skyline,
but inside, it is blindingly bright. The red "ON AIR" tally light is blazing.
Jaz is standing up, not sitting, bouncing on the balls of their heels to the
rhythm of a thumping backing track. Their hands fly across the faders on a
massive mixing desk. It is a chaotic, caffeine-fueled cockpit designed to
wake up an entire nation.
## THE SCENE: Homegrown Studio
A meticulously sound-treated bedroom in a suburban home. The space is
deadened by plush velvet curtains and a heavy rug, but there is a
distinct "proximity effect."
หมายเหตุของผู้กำกับ
ส่วนสำคัญนี้มีคำแนะนำด้านประสิทธิภาพที่เฉพาะเจาะจง คุณข้ามองค์ประกอบอื่นๆ ทั้งหมดได้ แต่เราขอแนะนำให้รวมองค์ประกอบนี้ไว้
กำหนดเฉพาะสิ่งที่สำคัญต่อประสิทธิภาพ โดยระมัดระวังไม่ให้ ระบุมากเกินไป กฎที่เข้มงวดมากเกินไปจะจำกัดความคิดสร้างสรรค์ของโมเดลและอาจ ส่งผลให้ประสิทธิภาพแย่ลง ปรับสมดุลคำอธิบายบทบาทและฉากด้วย กฎการแสดงเฉพาะ
คำสั่งที่พบบ่อยที่สุดคือสไตล์ การเว้นวรรค และสำเนียง แต่โมเดลไม่ได้จำกัดอยู่เพียงคำสั่งเหล่านี้ และไม่จำเป็นต้องใช้คำสั่งเหล่านี้ คุณสามารถใส่คำสั่งที่กำหนดเองเพื่อระบุรายละเอียดเพิ่มเติมที่สำคัญต่อประสิทธิภาพ และ ระบุรายละเอียดมากหรือน้อยตามที่จำเป็น
เช่น
### DIRECTOR'S NOTES
Style: Enthusiastic and Sassy GenZ beauty YouTuber
Pacing: Speaks at an energetic pace, keeping up with the extremely fast, rapid
delivery influencers use in short form videos.
Accent: Southern california valley girl from Laguna Beach |
รูปแบบ:
กำหนดโทนและสไตล์ของคำพูดที่สร้างขึ้น ระบุอารมณ์ เช่น สดใส กระตือรือร้น ผ่อนคลาย เบื่อ ฯลฯ เพื่อเป็นแนวทางในการแสดง อธิบายและ ให้รายละเอียดมากที่สุดเท่าที่จำเป็น: "ความกระตือรือร้นที่แพร่หลาย ผู้ฟัง ควรรู้สึกเหมือนเป็นส่วนหนึ่งของกิจกรรมชุมชนที่ยิ่งใหญ่และน่าตื่นเต้น" ได้ผลดีกว่าการพูดว่า"กระตือรือร้นและกระฉับกระเฉง" เพียงอย่างเดียว
หรือจะลองใช้คำที่ได้รับความนิยมในอุตสาหกรรมเสียงบรรยาย เช่น "เสียง ยิ้ม" ก็ได้ คุณซ้อนลักษณะสไตล์ได้มากเท่าที่ต้องการ
ตัวอย่าง
Simple Emotion
DIRECTORS NOTES
...
Style: Frustrated and angry developer who can't get the build to run.
...
ความลึกมากขึ้น
DIRECTORS NOTES
...
Style: Sassy GenZ beauty YouTuber, who mostly creates content for YouTube Shorts.
...
ซับซ้อน
DIRECTORS NOTES
Style:
* The "Vocal Smile": You must hear the grin in the audio. The soft palate is
always raised to keep the tone bright, sunny, and explicitly inviting.
*Dynamics: High projection without shouting. Punchy consonants and
elongated vowels on excitement words (e.g., "Beauuutiful morning").
เครื่องหมายแสดงการเน้นเสียง:
อธิบายสำเนียงที่ต้องการ ยิ่งระบุรายละเอียดมากเท่าไหร่ ผลลัพธ์ก็จะยิ่งดีขึ้นเท่านั้น เช่น ใช้ "สำเนียงภาษาอังกฤษแบบอังกฤษที่ได้ยินในครอยดอน ประเทศอังกฤษ" เทียบกับ "สำเนียงอังกฤษ"
ตัวอย่าง
### DIRECTORS NOTES
...
Accent: Southern california valley girl from Laguna Beach
...
### DIRECTORS NOTES
...
Accent: Jaz is a from Brixton, London
...
การกำหนดอัตราการแสดงโฆษณา:
การกำหนดจังหวะโดยรวมและความผันแปรของจังหวะตลอดทั้งชิ้นงาน
ตัวอย่าง
เรียบง่าย
### DIRECTORS NOTES
...
Pacing: Speak as fast as possible
...
ข้อมูลเพิ่มเติม
### DIRECTORS NOTES
...
Pacing: Speaks at a faster, energetic pace, keeping up with fast paced music.
...
ซับซ้อน
### DIRECTORS NOTES
...
Pacing: The "Drift": The tempo is incredibly slow and liquid. Words bleed into each other. There is zero urgency.
...
ลองใช้เลย
ลองใช้ตัวอย่างเหล่านี้ด้วยตัวคุณเองใน AI Studio เล่นกับ แอป TTS ของเรา แล้วให้ Gemini พาคุณไปนั่งเก้าอี้ผู้กำกับ อย่าลืมคำนึงถึงเคล็ดลับต่อไปนี้เพื่อสร้างการแสดงเสียงร้องที่ยอดเยี่ยม
- อย่าลืมทำให้พรอมต์ทั้งหมดสอดคล้องกัน โดยสคริปต์และคำสั่งจะทำงานร่วมกันในการสร้างการแสดงที่ยอดเยี่ยม
- คุณไม่จำเป็นต้องอธิบายทุกอย่าง บางครั้งการเว้นช่องว่างให้โมเดลเติมเต็มจะช่วยให้เป็นธรรมชาติมากขึ้น (เหมือนนักแสดงมากความสามารถ)
- หากคุณรู้สึกว่าตัน ให้ Gemini ช่วยคุณร่างสคริปต์หรือการแสดง
ขั้นตอนถัดไป
- ลองใช้สูตรการสร้างเสียง
- Live API ของ Gemini มีตัวเลือกการสร้างเสียงแบบอินเทอร์แอกทีฟ ที่คุณสามารถสอดแทรกกับรูปแบบอื่นๆ ได้
- หากต้องการทำงานกับอินพุตเสียง โปรดไปที่คู่มือการทำความเข้าใจเสียง