ভয়েস ডিজাইন আপনাকে জেমিনি এপিআই ভয়েসেস এন্ডপয়েন্ট ( POST /v1beta/voices ) ব্যবহার করে স্বাভাবিক ভাষার বর্ণনার ভিত্তিতে একটি সম্পূর্ণ নতুন ও স্থায়ী ভোকাল পার্সোনা তৈরি করার সুযোগ দেয়। আগে থেকে তৈরি ভয়েস বা রেফারেন্স অডিও রেকর্ড করার মধ্যে সীমাবদ্ধ না থেকে, আপনি একটি চরিত্রের বয়স, কণ্ঠস্বরের বৈশিষ্ট্য, উচ্চারণভঙ্গি এবং স্বাভাবিক বাচনভঙ্গি বর্ণনা করতে পারেন এবং আপনার প্রোজেক্টে সংরক্ষিত একটি পুনঃব্যবহারযোগ্য voice_... ID পেতে পারেন।
কাস্টম ভয়েস ডিজাইন, অডিশন এবং উন্নত করার সবচেয়ে দ্রুত উপায় হলো গুগল এআই স্টুডিও- এর ইন্টারেক্টিভ ভয়েস ডিজাইন স্টুডিও ব্যবহার করা। আপনি টেক্সট প্রম্পট থেকে কাস্টম পারসোনা তৈরি করতে পারেন, স্যাম্পল স্ক্রিপ্ট দিয়ে সেগুলো পরীক্ষা করতে পারেন এবং প্রাপ্ত voice_... ID সরাসরি আপনার অ্যাপ্লিকেশন কোডে কপি করতে পারেন।
Gemini 3.8 Flash TTS ( gemini-3.8-flash-tts ) এবং Gemini 3.8 Flash-Lite TTS ( gemini-3.8-flash-lite-tts ) উভয়ই ভয়েস ডিজাইন সমর্থন করে।
একটি পরিকল্পিত কণ্ঠস্বর তৈরি করুন
টেক্সট বিবরণ থেকে একটি কাস্টম ভয়েস তৈরি করতে Google GenAI SDK ( google-genai 2.25.0+ / @google/genai 2.24.0+) অথবা REST API ব্যবহার করুন। "prompted" ভয়েসের জন্য, voices.create ( CreateVoice ) এবং voices.get ( GetVoice ) উভয়ই একটি আউটপুট-অনলি sample_audio ফিল্ড ( mime_type: "audio/wav" , base64-এনকোডেড data ) রিটার্ন করে, যাতে আপনি তৈরি করা ভয়েসটি সাথে সাথে অডিশন করতে পারেন:
পাইথন
import base64
from google import genai
client = genai.Client()
# 1. Design a custom voice persona from natural language
created_voice = client.voices.create(
store=True,
voice={
"model": "gemini-3.8-flash-tts",
"type": "prompted",
"display_name": "Warm British Astronomer",
"gender": "male",
"language_code": "en-GB",
"prompted": {
"input": (
"A warm, thoughtful astronomer in his late 60s with a gentle"
" British accent, speaking with quiet wonder."
)
},
},
)
print(f"Created voice ID: {created_voice.id}")
# Save the generated sample_audio preview (audio/wav) returned by CreateVoice
if created_voice.sample_audio and created_voice.sample_audio.data:
with open("voice_preview.wav", "wb") as f:
f.write(base64.b64decode(created_voice.sample_audio.data))
জাভাস্ক্রিপ্ট
import * as fs from "node:fs";
import { GoogleGenAI } from "@google/genai";
const ai = new GoogleGenAI();
// 1. Design a custom voice persona from natural language
const createdVoice = await ai.voices.create({
store: true,
voice: {
model: "gemini-3.8-flash-tts",
type: "prompted",
display_name: "Warm British Astronomer",
gender: "male",
language_code: "en-GB",
prompted: {
input:
"A warm, thoughtful astronomer in his late 60s with a gentle British accent, speaking with quiet wonder.",
},
},
});
console.log(`Created voice ID: ${createdVoice.id}`);
// Save the generated sample_audio preview (audio/wav) returned by CreateVoice
if (createdVoice.sample_audio?.data) {
fs.writeFileSync(
"voice_preview.wav",
Buffer.from(createdVoice.sample_audio.data, "base64")
);
}
বিশ্রাম
curl "https://generativelanguage.googleapis.com/v1beta/voices" \
-H "x-goog-api-key: $GEMINI_API_KEY" \
-H "Content-Type: application/json" \
-X POST \
-d '{
"store": true,
"voice": {
"model": "gemini-3.8-flash-tts",
"type": "prompted",
"display_name": "Warm British Astronomer",
"gender": "male",
"language_code": "en-GB",
"prompted": {
"input": "A warm, thoughtful astronomer in his late 60s with a gentle British accent, speaking with quiet wonder."
}
}
}' | tee created_voice.json | jq -r '.sample_audio.data' | base64 --decode > voice_preview.wav
ভয়েস ডিজাইন কীভাবে কাজ করে
- একটি প্রম্পটেড ভয়েস তৈরি করুন:
voices.create(POST /v1beta/voices) কল করুন, যেখানেtype="prompted"এবংstore=Trueথাকবে। - একটি স্থায়ী
voice_idএবংsample_audioপ্রিভিউ গ্রহণ করুন: API-টি ভোকাল আইডেন্টিটি তৈরি করে, আপনার প্রোজেক্টে তা সংরক্ষণ করে এবং একটি স্থায়ী ID (উদাহরণস্বরূপ,voice_abc123...) ফেরত দেয়। এর সাথেsample_audio(mime_type: "audio/wav", base64-এনকোডেডdata) প্রদান করা হয়, যাতে সেই ভয়েসের জন্য তৈরি করা প্রিভিউ অডিও থাকে। - স্পিচ সিন্থেসাইজ করুন: আপনার সিন্থেসিস অনুরোধে যেখানে ভয়েসের নাম গ্রহণ করা হয়, সেখানে
voice_idপাস করুন।
আপনার ডিজাইন করা ভয়েস দিয়ে কথা সংশ্লেষণ করুন
একবার ভয়েস তৈরি করে ফেললে, স্পিচ জেনারেট করার জন্য এর id ( voice_... ) ইন্টারঅ্যাকশনস এপিআই-তে পাস করুন:
পাইথন
import base64
from google import genai
client = genai.Client()
interaction = client.interactions.create(
model="gemini-3.8-flash-tts",
input=[{
"type": "user_input",
"content": [{
"type": "text",
"text": (
"Look out past the rings of Saturn. Those faint photons left"
" their source millions of years ago."
),
"annotations": [{
"type": "speech_metadata",
"style": "reflective and awe-inspired",
}],
}],
}],
response_format={"type": "audio"},
generation_config={
"speech_config": [
{"voice": created_voice.id},
]
},
)
with open("designed_voice.wav", "wb") as f:
f.write(base64.b64decode(interaction.output_audio.data))
জাভাস্ক্রিপ্ট
import * as fs from "node:fs";
import { GoogleGenAI } from "@google/genai";
const ai = new GoogleGenAI();
const interaction = await ai.interactions.create({
model: "gemini-3.8-flash-tts",
input: [{
type: "user_input",
content: [{
type: "text",
text: "Look out past the rings of Saturn. Those faint photons left their source millions of years ago.",
annotations: [{
type: "speech_metadata",
style: "reflective and awe-inspired",
}],
}],
}],
response_format: { type: "audio" },
generation_config: {
speech_config: [
{ voice: createdVoice.id },
],
},
});
fs.writeFileSync("designed_voice.wav", Buffer.from(interaction.output_audio.data, "base64"));
বিশ্রাম
curl "https://generativelanguage.googleapis.com/v1beta/interactions" \
-H "x-goog-api-key: $GEMINI_API_KEY" \
-H "Content-Type: application/json" \
-X POST \
-d '{
"model": "gemini-3.8-flash-tts",
"input": [{
"type": "user_input",
"content": [{
"type": "text",
"text": "Look out past the rings of Saturn. Those faint photons left their source millions of years ago.",
"annotations": [{
"type": "speech_metadata",
"style": "reflective and awe-inspired"
}]
}]
}],
"response_format": {"type": "audio"},
"generation_config": {
"speech_config": [
{"voice": "voice_YOUR_DESIGNED_VOICE_ID"}
]
}
}'
আপনার কণ্ঠস্বর পরিচালনা করুন
আপনি ভয়েসেস এপিআই (Voices API) ব্যবহার করে যেকোনো সময় আপনার সংরক্ষিত ভয়েসগুলো তালিকাভুক্ত করতে, ফিল্টার করতে, পরিদর্শন করতে এবং মুছে ফেলতে পারেন (সমস্ত ফিল্টার প্যারামিটারের জন্য এক্সটেন্ডেড ভয়েস লাইব্রেরি এবং ফিল্টারিং দেখুন)।
- স্টোরেজ সীমা এবং টিটিএল: স্টেটফুল ভয়েস (
store=True, যা প্রম্পটেড এবং রেপ্লিকেটেড ভয়েস জুড়ে শেয়ার করা হয়) এর ক্ষেত্রে প্রতি প্রজেক্টে ২০০টি ভয়েসের সীমা এবং ১ বছরের টিটিএল (টাইম-টু-লিভ) রয়েছে। sample_audioপ্রাপ্যতা:voices.create()(CreateVoice) এবংvoices.get()(GetVoice)"prompted"ভয়েসগুলির জন্যsample_audio(mime_type: "audio/wav", base64-এনকোডেডdata) পূরণ করে। তালিকাটিকে সংক্ষিপ্ত রাখতে,voices.list()(ListVoices)sample_audioবাদ দেয় (এবং"replicated"ও"prebuilt"ভয়েসগুলির জন্যsample_audioসেট করা থাকে না)।
পাইথন
from google import genai
client = genai.Client()
# List stored prompted voices in your project filtered by language
response = client.voices.list(
type_=["prompted"],
language_code=["en-US", "en-GB"],
)
for voice in response.voices or []:
print(voice.id, voice.display_name, voice.type)
# Retrieve a specific voice by ID
voice_details = client.voices.get(id=created_voice.id)
# Delete a stored custom voice
client.voices.delete(id=created_voice.id)
জাভাস্ক্রিপ্ট
import { GoogleGenAI } from "@google/genai";
const ai = new GoogleGenAI();
// List stored prompted voices in your project filtered by language
const response = await ai.voices.list({
type: ["prompted"],
language_code: ["en-US", "en-GB"],
});
for (const voice of response.voices ?? []) {
console.log(voice.id, voice.display_name, voice.type);
}
// Retrieve a specific voice by ID
const voiceDetails = await ai.voices.get(createdVoice.id);
// Delete a stored custom voice
await ai.voices.delete(createdVoice.id);
বিশ্রাম
# List stored prompted voices filtered by language
curl -G "https://generativelanguage.googleapis.com/v1beta/voices" \
-H "x-goog-api-key: $GEMINI_API_KEY" \
--data-urlencode "type=prompted" \
--data-urlencode "language_code=en-US" \
--data-urlencode "language_code=en-GB"
# Retrieve a specific voice by ID
curl "https://generativelanguage.googleapis.com/v1beta/voices/voice_YOUR_DESIGNED_VOICE_ID" \
-H "x-goog-api-key: $GEMINI_API_KEY"
# Delete a stored custom voice
curl -X DELETE "https://generativelanguage.googleapis.com/v1beta/voices/voice_YOUR_DESIGNED_VOICE_ID" \
-H "x-goog-api-key: $GEMINI_API_KEY"
ভয়েস ডিজাইনের জন্য সর্বোত্তম অনুশীলন সম্পর্কে জানানো
- ভয়েস
styleনয়, ভয়েস ডিজাইনে স্থায়ী কণ্ঠস্বরের বৈশিষ্ট্য যোগ করুন:voices.createএ ভয়েস তৈরি করার সময় বয়স, লিঙ্গ, টিম্বার, ভোকাল টেক্সচার এবং আঞ্চলিক উচ্চারণের মতো অপরিবর্তনীয় বৈশিষ্ট্যগুলো নির্ধারণ করুন। - পরিস্থিতিগত আবেগের জন্য
speech_metadata.styleসংরক্ষিত রাখুন: একবার আপনার নিজস্ব কণ্ঠস্বর তৈরি হয়ে গেলে, বক্তার মূল পরিচয় পরিবর্তন না করে পালাক্রমে অভিনয়কে পরিচালনা করার জন্য সংক্ষিপ্তstyleপ্রম্পট (উদাহরণস্বরূপ,"whispered urgently"বা"cheerful and energetic") ব্যবহার করুন। - সুনির্দিষ্ট এবং সংক্ষিপ্ত হোন: পরস্পরবিরোধী বা অতিরিক্ত দীর্ঘ অনুচ্ছেদের চেয়ে ১-২ বাক্যের একটি স্পষ্ট বর্ণনা (যেমন , "ত্রিশের কোঠায় থাকা একজন প্রাণবন্ত ও উচ্ছল ক্রীড়া ঘোষিকা, যাঁর কথায় হালকা মিডওয়েস্টার্ন টান রয়েছে" ) অধিকতর পরিচ্ছন্ন ও সামঞ্জস্যপূর্ণ ফলাফল দেয়।
এরপর কী?
- ভয়েস রেপ্লিকেশন- এর মাধ্যমে বিদ্যমান কোনো বক্তার কণ্ঠস্বর কীভাবে অনুকরণ করতে হয়, তা জানুন।
- টেক্সট-টু-স্পিচ গাইডে টার্ন-লেভেল স্টাইলিং, ইনলাইন ট্যাগ এবং একাধিক বক্তার সংলাপ সম্পর্কে জানুন।