فهم الصوت  |  Gemini API  |  Google AI for Developers التخطّي إلى المحتوى الرئيسي / English Deutsch Español – América Latina Français Indonesia Italiano Polski Português – Brasil Shqip Tiếng Việt Türkçe Русский עברית العربيّة فارسی हिंदी বাংলা ภาษาไทย 中文 – 简体 中文 – 繁體 日本語 한국어 الحصول على مفتاح واجهة برمجة التطبيقات كتاب الطبخ منتدى تسجيل الدخول المستندات مرجع واجهة برمجة التطبيقات Gemini API المستندات مرجع واجهة برمجة التطبيقات الحصول على مفتاح واجهة برمجة التطبيقات كتاب الطبخ منتدى البدء نظرة عامة البدء مفاتيح واجهة برمجة التطبيقات المكتبات الأسعار واجهة برمجة التطبيقات Interactions API إعداد وكيل البرمجة الطرُز كل الطرز الحالي: Gemini 3.5 Nano Banana Veo Gemini Omni Flash ‫Lyria 3 Lyria RealTime Imagen نص إلى كلام الفيديوهات المباشرة الترجمة المباشرة التضمينات روبوتيات الإمكانات الأساسية نص صورة إنشاء الصور 🍌 فهم الصور فيديو نظرة عامة على الفيديو فهم الفيديو المستندات الكلام والصوت إنشاء الكلام فهم الصوت جارٍ التفكير جارٍ التفكير توقيعات الأفكار النتائج المنظَّمة استدعاء الدالة سياق طويل الوكلاء نظرة عامة التشغيل السريع Antigravity Agent إنشاء وكلاء مُدارين البيئات Deep Research Agent الأدوات نظرة عامة Google Search Google Maps تنفيذ الرمز البرمجي سياق عنوان URL استخدام الكمبيوتر البحث عن الملفات الجمع بين "الأدوات" و"استدعاء الدالة" واجهة برمجة التطبيقات للبث المباشر نظرة عامة البدء بدء استخدام حزمة تطوير البرامج (SDK) للذكاء الاصطناعي التوليدي بدء استخدام WebSockets غير المعالجة الإمكانات الترجمة المباشرة استخدام الأداة إدارة الجلسة الرموز المميّزة المؤقتة أفضل الممارسات التحسين نظرة عامة Batch API الردّ التلقائي على الويب الاستنتاج المرن الاستدلال حسب الأولوية التخزين المؤقت للسياق الأدلة بث التنفيذ في الخلفية إدخال الملف أساليب الإدخال واجهة برمجة تطبيقات الملفات التوافق مع OpenAI درجة دقة الوسائط احتساب الرموز المميّزة هندسة الطلبات السجلّات ومجموعات البيانات بدء استخدام السجلات تسجيل البيانات ومشاركتها دفاع إعدادات الأمن الشخصي إرشادات السلامة الأطر LangChain وLangGraph CrewAI LlamaIndex Vercel AI SDK زماني الموارد ملاحظات حول الإصدار الميزات التي سيتم إيقافها نهائيًا النقل نقل البيانات إلى حزمة تطوير برامج الذكاء الاصطناعي التوليدي نقل البيانات إلى Interactions API التغييرات غير المتوافقة في التفاعلات (مايو 2026) حدود المعدل معلومات الفوترة تحديد المشاكل في واجهة برمجة التطبيقات وحلّها الحالة عمليات الدمج مع الشركاء والمكتبات Google AI Studio التشغيل السريع البرمجة الوصفية في "وضع الإنشاء" تطوير تطبيقات الحزمة الكاملة إنشاء تطبيقات Android نشر تطبيقك الوكلاء في مساحة تجربة الذكاء الاصطناعي في Studio تجربة LearnLM تحديد المشاكل وحلّها إمكانية الوصول لمستخدمي Workspace Google Cloud Platform Gemini Enterprise Agent Platform Gemini API مصادقة OAuth السياسات بنود الخدمة المناطق المتاحة رصد إساءة الاستخدام الملاحظات في "تعليقات Google" أصبحت Interactions API متاحة الآن للجميع. ننصحك باستخدام واجهة برمجة التطبيقات هذه للوصول إلى جميع أحدث الميزات والنماذج. Google uses AI technology to translate content into your preferred language. AI translations can contain errors. الصفحة الرئيسية Gemini API المستندات إرسال ملاحظات فهم الصوت ملاحظة: يغطي هذا الإصدار من الصفحة واجهة برمجة التطبيقات Interactions API. يمكنك استخدام زر التبديل في هذه الصفحة للانتقال إلى إصدار صفحة generateContent API. يمكن لـ Gemini تحليل الإدخال الصوتي وإنشاء ردود نصية. Python from google import genai import base64 client = genai.Client() uploaded_file = client.files.upload(file="path/to/sample.mp3") interaction = client.interactions.create( model="gemini-3.5-flash", input=[ {"type": "text", "text": "Describe this audio clip"}, { "type": "audio", "uri": uploaded_file.uri, "mime_type": uploaded_file.mime_type } ] ) print(interaction.output_text) JavaScript import { GoogleGenAI } from "@google/genai"; const client = new GoogleGenAI({}); const uploadedFile = await client.files.upload({ file: "path/to/sample.mp3", config: { mime_type: "audio/mp3" } }); const interaction = await client.interactions.create({ model: "gemini-3.5-flash", input: [ {type: "text", text: "Describe this audio clip"}, { type: "audio", uri: uploadedFile.uri, mime_type: uploadedFile.mimeType } ] }); console.log(interaction.output_text); REST # First upload the file, then use the URI: curl -X POST "https://generativelanguage.googleapis.com/v1beta/interactions" \ -H "x-goog-api-key: $GEMINI_API_KEY" \ -H 'Content-Type: application/json' \ -d '{ "model": "gemini-3.5-flash", "input": [ {"type": "text", "text": "Describe this audio clip"}, { "type": "audio", "uri": "YOUR_FILE_URI", "mime_type": "audio/mp3" } ] }' نظرة عامة يمكن لـ Gemini تحليل وفهم الإدخال الصوتي وإنشاء ردود نصية، ما يتيح حالات استخدام مثل: وصف المحتوى الصوتي أو تلخيصه أو الإجابة عن أسئلة بشأنه تحويل الصوت إلى نص وترجمته تمييز أصوات المتحدّثِين (تحديد هوية المتحدّثِين المختلفين) رصد المشاعر في الكلام والموسيقى تحليل شرائح محدّدة باستخدام الطوابع الزمنية للتفاعلات الصوتية والمرئية في الوقت الفعلي، يمكنك الاطّلاع على Live API. بالنسبة إلى نماذج تحويل الكلام إلى نص المخصّصة التي تتيح تحويل الكلام إلى نص في الوقت الفعلي، استخدِم Google Cloud Speech-to-Text API. تحويل الكلام إلى نص يوضّح هذا المثال كيفية تحويل الكلام إلى نص وترجمته وتلخيصه مع الطوابع الزمنية وتحديد المتحدثين ورصد المشاعر باستخدام النتائج المنظَّمة. Python from google import genai client = genai.Client() YOUTUBE_URL = "https://www.youtube.com/watch?v=ku-N-eS1lgM" prompt = """ Process the audio file and generate a detailed transcription. Requirements: 1. Identify distinct speakers (e.g., Speaker 1, Speaker 2). 2. Provide accurate timestamps for each segment (Format: MM:SS). 3. Detect the primary language of each segment. 4. If not English, provide the English translation. 5. Identify the primary emotion: Happy, Sad, Angry, or Neutral. 6. Provide a brief summary at the beginning. """ response_schema = { "type": "object", "properties": { "summary": {"type": "string"}, "segments": { "type": "array", "items": { "type": "object", "properties": { "speaker": {"type": "string"}, "timestamp": {"type": "string"}, "content": {"type": "string"}, "language": {"type": "string"}, "emotion": { "type": "string", "enum": ["happy", "sad", "angry", "neutral"] } }, "required": ["speaker", "timestamp", "content", "emotion"] } } }, "required": ["summary", "segments"] } interaction = client.interactions.create( model="gemini-3.5-flash", input=[ {"type": "video", "uri": YOUTUBE_URL, "mime_type": "video/mp4"}, {"type": "text", "text": prompt} ], response_format=response_schema, ) print(interaction.output_text) JavaScript import { GoogleGenAI } from "@google/genai"; const client = new GoogleGenAI({}); const YOUTUBE_URL = "https://www.youtube.com/watch?v=ku-N-eS1lgM"; const prompt = ` Process the audio file and generate a detailed transcription. Requirements: 1. Identify distinct speakers (e.g., Speaker 1, Speaker 2). 2. Provide accurate timestamps for each segment (Format: MM:SS). 3. Detect the primary language of each segment. 4. If not English, provide the English translation. 5. Identify the primary emotion: Happy, Sad, Angry, or Neutral. 6. Provide a brief summary at the beginning. `; const responseSchema = { type: "object", properties: { summary: { type: "string" }, segments: { type: "array", items: { type: "object", properties: { speaker: { type: "string" }, timestamp: { type: "string" }, content: { type: "string" }, language: { type: "string" }, emotion: { type: "string", enum: ["happy", "sad", "angry", "neutral"] } }, required: ["speaker", "timestamp", "content", "emotion"] } } }, required: ["summary", "segments"] }; const interaction = await client.interactions.create({ model: "gemini-3.5-flash", input: [ { type: "video", uri: YOUTUBE_URL, mime_type: "video/mp4" }, { type: "text", text: prompt } ], response_format: responseSchema, }); console.log(JSON.parse(interaction.output_text)); REST curl -X POST "https://generativelanguage.googleapis.com/v1beta/interactions" \ -H "x-goog-api-key: $GEMINI_API_KEY" \ -H 'Content-Type: application/json' \ -d '{ "model": "gemini-3.5-flash", "input": [ { "type": "video", "uri": "https://www.youtube.com/watch?v=ku-N-eS1lgM", "mime_type": "video/mp4" }, { "type": "text", "text": "Transcribe with speaker diarization and emotion detection." } ], "response_format": { "type": "object", "properties": { "summary": {"type": "string"}, "segments": { "type": "array", "items": { "type": "object", "properties": { "speaker": {"type": "string"}, "timestamp": {"type": "string"}, "content": {"type": "string"}, "emotion": {"type": "string", "enum": ["happy", "sad", "angry", "neutral"]} } } } } } }' إدخال الصوت يمكنك تقديم بيانات صوتية بالطرق التالية: حمِّل ملفًا صوتيًا قبل تقديم طلب. مرِّر بيانات الصوت المضمّنة مع الطلب. تحميل ملف صوتي استخدِم Files API للملفات التي يزيد حجمها عن 20 ميغابايت. Python from google import genai client = genai.Client() uploaded_file = client.files.upload(file="path/to/sample.mp3") interaction = client.interactions.create( model="gemini-3.5-flash", input=[ {"type": "text", "text": "Describe this audio clip"}, { "type": "audio", "uri": uploaded_file.uri, "mime_type": uploaded_file.mime_type } ] ) print(interaction.output_text) JavaScript import { GoogleGenAI } from "@google/genai"; const client = new GoogleGenAI({}); const uploadedFile = await client.files.upload({ file: "path/to/sample.mp3", config: { mimeType: "audio/mp3" } }); const interaction = await client.interactions.create({ model: "gemini-3.5-flash", input: [ {type: "text", text: "Describe this audio clip"}, { type: "audio", uri: uploadedFile.uri, mime_type: uploadedFile.mimeType } ] }); console.log(interaction.output_text); REST # First upload the file using the Files API, then use the URI: curl -X POST "https://generativelanguage.googleapis.com/v1beta/interactions" \ -H "x-goog-api-key: $GEMINI_API_KEY" \ -H 'Content-Type: application/json' \ -d '{ "model": "gemini-3.5-flash", "input": [ {"type": "text", "text": "Describe this audio clip"}, { "type": "audio", "uri": "YOUR_FILE_URI", "mime_type": "audio/mp3" } ] }' تمرير بيانات الصوت مضمّنة بالنسبة إلى ملفات الصوت الصغيرة التي يقلّ حجم الطلب الإجمالي فيها عن 20 ميغابايت: Python from google import genai import base64 client = genai.Client() with open('path/to/small-sample.mp3', 'rb') as f: audio_bytes = f.read() interaction = client.interactions.create( model="gemini-3.5-flash", input=[ {"type": "text", "text": "Describe this audio clip"}, { "type": "audio", "data": base64.b64encode(audio_bytes).decode('utf-8'), "mime_type": "audio/mp3" } ] ) print(interaction.output_text) JavaScript import { GoogleGenAI } from "@google/genai"; import * as fs from "node:fs"; const client = new GoogleGenAI({}); const audioData = fs.readFileSync("path/to/small-sample.mp3", { encoding: "base64" }); const interaction = await client.interactions.create({ model: "gemini-3.5-flash", input: [ {type: "text", text: "Describe this audio clip"}, { type: "audio", data: audioData, mime_type: "audio/mp3" } ] }); console.log(interaction.output_text); REST AUDIO_PATH="path/to/sample.mp3" if [[ "$(base64 --version 2>&1)" = *"FreeBSD"* ]]; then B64FLAGS="--input" else B64FLAGS="-w0" fi curl -X POST "https://generativelanguage.googleapis.com/v1beta/interactions" \ -H "x-goog-api-key: $GEMINI_API_KEY" \ -H 'Content-Type: application/json' \ -d '{ "model": "gemini-3.5-flash", "input": [ {"type": "text", "text": "Describe this audio clip"}, { "type": "audio", "data": "'$(base64 $B64FLAGS $AUDIO_PATH)'", "mime_type": "audio/mp3" } ] }' ملاحظات حول بيانات الصوت المضمّنة: * الحدّ الأقصى لحجم الطلب هو 20 ميغابايت إجمالاً (بما في ذلك الطلبات وكل الملفات) * لإعادة الاستخدام، يُرجى تحميل الملف بدلاً من ذلك الحصول على نص للحصول على نص، اطلب ذلك في الطلب: Python interaction = client.interactions.create( model="gemini-3.5-flash", input=[ {"type": "text", "text": "Generate a transcript of the speech."}, { "type": "audio", "uri": uploaded_file.uri, "mime_type": uploaded_file.mime_type } ] ) print(interaction.output_text) JavaScript const interaction = await client.interactions.create({ model: "gemini-3.5-flash", input: [ { type: "text", text: "Generate a transcript of the speech." }, { type: "audio", uri: uploadedFile.uri, mime_type: uploadedFile.mimeType } ] }); console.log(interaction.output_text); الرجوع إلى الطوابع الزمنية استخدِم التنسيق MM:SS للإشارة إلى أقسام معيّنة: Python interaction = client.interactions.create( model="gemini-3.5-flash", input=[ {"type": "text", "text": "Provide a transcript from 02:30 to 03:29."}, { "type": "audio", "uri": uploaded_file.uri, "mime_type": uploaded_file.mime_type } ] ) JavaScript const interaction = await client.interactions.create({ model: "gemini-3.5-flash", input: [ { type: "text", text: "Provide a transcript from 02:30 to 03:29." }, { type: "audio", uri: uploadedFile.uri, mime_type: "audio/mp3" } ] }); عدد الرموز المميّزة حساب عدد الرموز المميزة في ملف صوتي: Python response = client.models.count_tokens( model="gemini-3.5-flash", contents=[uploaded_file] ) print(response) JavaScript const response = await client.models.countTokens({ model: "gemini-3.5-flash", contents: [ { fileData: { fileUri: uploadedFile.uri, mimeType: uploadedFile.mimeType } } ] }); console.log(response.totalTokens); تنسيقات الصوت المتوافقة WAV - audio/wav MP3 - audio/mp3 AIFF - audio/aiff AAC - audio/aac OGG Vorbis - audio/ogg FLAC - audio/flac التفاصيل الفنية حول الصوت الرموز المميزة: 32 رمزًا مميزًا لكل ثانية من الصوت (دقيقة واحدة = 1,920 رمزًا مميزًا) الأصوات غير الكلامية: يفهم Gemini الأصوات غير الكلامية (مثل زقزقة العصافير وأصوات سيارات الإسعاف وغيرها). الحدّ الأقصى للطول: 9.5 ساعات من الصوت لكل طلب درجة الدقة: تم تخفيضها إلى 16 كيلوبت في الثانية القنوات: مقاطع صوتية متعددة القنوات مدمجة في قناة واحدة الخطوات التالية Files API: تحميل الملفات الصوتية وإدارتها تعليمات النظام: تخصيص سلوك النموذج الناتج المنظَّم: يمكنك الحصول على نتائج تحويل الصوت إلى نص بتنسيق JSON إرسال ملاحظات إنّ محتوى هذه الصفحة مرخّص بموجب ترخيص Creative Commons Attribution 4.0‏ ما لم يُنصّ على خلاف ذلك، ونماذج الرموز مرخّصة بموجب ترخيص Apache 2.0‏. للاطّلاع على التفاصيل، يُرجى مراجعة سياسات موقع Google Developers‏. إنّ Java هي علامة تجارية مسجَّلة لشركة Oracle و/أو شركائها التابعين. تاريخ التعديل الأخير: 2026-07-06 (حسب التوقيت العالمي المتفَّق عليه) هل تريد مشاركة ملاحظاتك معنا؟ [[["يسهُل فهم المحتوى.","easyToUnderstand","thumb-up"],["ساعَدني المحتوى في حلّ مشكلتي.","solvedMyProblem","thumb-up"],["غير ذلك","otherUp","thumb-up"]],[["لا يحتوي على المعلومات التي أحتاج إليها.","missingTheInformationINeed","thumb-down"],["الخطوات معقدة للغاية / كثيرة جدًا.","tooComplicatedTooManySteps","thumb-down"],["المحتوى قديم.","outOfDate","thumb-down"],["ثمة مشكلة في الترجمة.","translationIssue","thumb-down"],["مشكلة في العيّنات / التعليمات البرمجية","samplesCodeIssue","thumb-down"],["غير ذلك","otherDown","thumb-down"]],["تاريخ التعديل الأخير: 2026-07-06 (حسب التوقيت العالمي المتفَّق عليه)"],[],[]] البنود الخصوصية Manage cookies English Deutsch Español – América Latina Français Indonesia Italiano Polski Português – Brasil Shqip Tiếng Việt Türkçe Русский עברית العربيّة فارسی हिंदी বাংলা ภาษาไทย 中文 – 简体 中文 – 繁體 日本語 한국어