اعتبارًا من 27 آذار (مارس) 2025، ننصحك باستخدام android-latest-release
بدلاً من aosp-main
لإنشاء AOSP والمساهمة فيه. لمزيد من المعلومات، يُرجى الاطّلاع على التغييرات في AOSP.
لمحة عن التفاعل الصوتي
تنظيم صفحاتك في مجموعات
يمكنك حفظ المحتوى وتصنيفه حسب إعداداتك المفضّلة.
توفّر واجهة برمجة التطبيقات Voice Interaction Service API واجهة برمجة تطبيقات مجردة لمختلف
تطبيقات التحكّم الصوتي المحتملة. يمكن تطوير عمليات التنفيذ باتّباع الإرشادات описанة في تطوير التطبيقات.
يوضّح المحتوى في دليل الدمج هذا كيفية دمج هذه التطبيقات في
صورة نظام Android Automotive (AAOS) معيّنة.
المصطلحات
يتم استخدام هذه المصطلحات في هذا الدليل:
- بيانات المساهمة في الأهداف: عند بدء جلسة تفاعل صوتي،
يمكن للنظام تسجيل المشاهدات ولقطات الشاشة ونقلها
إلى الجلسة. يمكن للتطبيقات عرض معلومات إضافية من خلال تنفيذ
Activity#onProvideAssistData()
وActivity#onProvideAssistContent()
.
- الضغط للتحدث (PTT): زر التحكّم الصوتي المادي، والذي يقع عادةً
في عجلة القيادة
- RecognitionService (RS) خدمة التعرّف على الصوت التي تستخدمها التطبيقات من خلال واجهة برمجة التطبيقات
SpeechRecognizer
يجب أن تتضمّن عناوين URL لصفحات المنتج في نتائج البحث عن طريق مقارنة الأسعار كلاً من VoiceInteractionService
و
RecognitionService
.
- النقر للتحدث (TTT): زر التحكّم الصوتي بالبرامج، والذي يكون عادةً
مضمّنًا كجزء من واجهة مستخدم النظام في نظام التشغيل Android، يُشار إلى ذلك أيضًا باسم
إيماءة المساعدة.
-
VoiceInteractionService
: خدمة نظام خفيفة الوزن نفّذها مطوّر VIA. تكون الخدمة المحدّدة مرتبطة
بخدمة النظام عند التشغيل، وتكون قيد التشغيل دائمًا.
- VoiceInteractionSession (VIS) تُحاط هذه الفئة
بمنطق النشاط التجاري للتفاعل مع المستخدم. وهي مسؤولة عن إطلاع المستخدم على
حالة التفاعل الصوتي ومعالجة طلبات VoiceInteractor وتلقّي
بيانات المساعدة ولقطات الشاشة.
- VoiceInteractionSessionService (VSS) خدمة، وهي جزء من
VIA، مسؤولة عن معالجة جلسة تفاعل صوتي. يتم ربط هذه الخدمة
بخدمة نظام Android أثناء التفاعل الصوتي مع المستخدم. يتم تنفيذ كل
منطق الأعمال لهذه الجلسة في فئة
VoiceSession
.
لا يمكن ضمان استمرار هذه الخدمة إلا خلال جلسة صوتية واحدة للمستخدم.
- تطبيق التفاعل الصوتي (VIA) تطبيق Android مصمّم
ليكون بمثابة وحدة تحكّم صوتي (يُشار إليها باسم مساعد) يمكن تحديد هذه التطبيقات
من خلال تضمين
VoiceInteractionService
في بيانها.
يمكن اختيار تطبيق واحد فقط من هذه التطبيقات على أنّه تلقائي في كل مرة في النظام.
سيتم إبقاء التطبيق التلقائي فقط قيد التشغيل (مرتبطًا بخدمة نظام) وسيكون هو المستلِم لأحداث Push-To-Talk (PTT)
أو Tap-To-Talk (TTT).
المسؤوليات
يصف هذا الجدول مسؤوليات كل طرف.
الشركات المصنّعة للسيارات (OEM) |
مشروع مفتوح المصدر لنظام Android (AOSP) |
مطوّرو التطبيقات |
- أنشئ نظام ترفيه ومعلومات متوافقًا
باستخدام AAOS.
- تنفيذ إدخال وإخراج الصوت، بما في ذلك اختياريًا معالجة الإشارات الرقمية (DSP) لرصد الكلمات المفتاح
- منح أذونات امتيازات النظام لخدمات التفاعل الصوتي
- الالتزام بمتطلبات
VoiceInteractionService المتعلقة بالوصول إلى
شاشات إعدادات التطبيق
|
- تحديد
VoiceInteractionService وتطوير واجهات برمجة التطبيقات ذات الصلة
- تقديم مستندات واجهة برمجة التطبيقات ورمز نموذجي ومواد دعم أخرى لصنّاع تطبيقات VIA
- تقديم إرشادات حول تجربة المستخدم مع المتطلبات والاقتراحات
|
- تنفيذ واجهة برمجة التطبيقات
VoiceInteractionService وواجهة برمجة التطبيقات RecognitionService و
واجهة برمجة التطبيقات NotificationListenerService (اطّلِع على الوصف التفصيلي في
تطوير التطبيقات).
- توفير واجهة مستخدم قابلة للتخصيص يمكن لشركات المصنّعين الأصليّين للسيارات تعديلها لتتطابق مع كل نظام من أنظمة تصميم السيارات
|
متطلبات تجربة المستخدم
تتحمّل المصنّعين الأصليّين للأجهزة مسؤولية توفير تجربة مستخدم جيدة للعملاء.
على المصنّعين الأصليين للأجهزة التأكّد من أنّ جميع خدمات التفاعل الصوتي المثبَّتة مسبقًا تستوفي
المتطلبات الموضّحة في
مساعِدِي الصوت المثبَّتين مسبقًا: إرشادات حول تجربة المستخدم.
تجربة "مساعد Google" الأساسية
ينفِّذ تطبيق التفاعل الصوتي (VIA) في المركبات الإجراءات التالية:
- [يجب] الاستجابة لعوامل تشغيل التفاعل الصوتي التي يعالجها النظام (PTT وTTT).
- [يجب] عرض تمثيل مرئي لمستوى التقدّم (على سبيل المثال، الاستماع
والمعالجة والتنفيذ)
- [يجب] استخدام الصوت أو الأصوات للإشارة إلى فهم طلبات العميل
وإكمالها.
- [يجب] أن يعمل كأداة تعرّف على الكلام للتطبيقات الأخرى (راجِع واجهة برمجة التطبيقات SpeechRecognizer).
- [SHOULD] الاستجابة لعامل تشغيل كلمة مهمة
- [يجوز] عرض نشاط إعدادات يمكن للمستخدمين من خلاله ضبط هذه الميزة من خلال واجهة برمجة التطبيقات (مثل
الأذونات وإعداد الكلمات الرئيسية وتسجيل الدخول).
- [MAY] بيانات المساعدة في التعامل مع الطلبات (
Intent#ACTION_ASSIST
)
- [MAY] إتاحة التفاعل الصوتي من قفل الشاشة
المكوّنات
على مستوى عالٍ، يتفاعل تطبيق التفاعل الصوتي مع الجهات التالية:

الشكل 1: الجهات الفاعلة في التفاعل الصوتي
التفاصيل:
VoiceInteractionManagerService
. تتحمّل خدمة النظام هذه مسؤولية
إدارة واجهة برمجة التطبيقات التلقائية وعرض وظائفها على بقية النظام.
RecognitionService
: توفّر هذه الخدمة قدرات التعرّف على الكلام
للتطبيقات الأخرى في النظام.
SoundTrigger
. تنفيذ إدارة الكلمات الرئيسية القصيرة، وهي متوفرة لتطبيقات VIA من خلال AlwaysOnHotwordDetector
MediaRecorder
. يتيح الوصول إلى إدخال الصوت لكل من
رصد الكلمات الرئيسية (عند استخدام وحدة المعالجة المركزية) والتعرّف على الكلام.
-
PhoneWindowManager
/CarInputService
: تتحمّل هذه
الخدمات مسؤولية (من بين أمور أخرى) معالجة الأحداث الرئيسية وتوجيه
PTT إلى VIA باستخدام VoiceInteractionManagerService
.
User
. يتفاعل المستخدم مع جهاز VIA من خلال عوامل التفعيل
(PTT أو TTT أو عبارة التشغيل) أو واجهة مستخدم Voice Plate.
- CarService وNotifications وMedia وTelephony وContactsProvider وما إلى ذلك
الخدمات والتطبيقات التي تستخدمها VoiceInteractionSession ل
تنفيذ طلبات المستخدم
مفاهيم خاصة بالسيارات
يختلف نظام التشغيل AAOS عن Android في الجوانب التالية:
- بالإضافة إلى وظائف "مساعد Google" العادية، يمكن لتطبيقات VIA في AAOS التحكّم في وظائف
المركبة (مثل التدفئة والتهوية وتكييف الهواء والمقاعد والأضواء الداخلية). يمكن دمج هذه الوظائف
باستخدام واجهة برمجة التطبيقات CarPropertyManager API (اطّلِع على مزيد من المعلومات في مقالة قراءة
خاصية المركبة) شرط أن تضبط المصنّعين الأصليّين للسيارات إذن الوصول بشكل صحيح كما هو موضّح في مقالة قائمة الأذونات المميّزة المسموح بها.
- يُعدّ التخصيص واتساق التصميم أكثر ملاءمةً في الأجهزة المخصّصة للسيارات مقارنةً بأي شكل آخر للأجهزة. اطّلِع على التخصيص لقراءة المزيد من المعلومات عن تنفيذ هذه الإرشادات.
يخضع كل من المحتوى وعيّنات التعليمات البرمجية في هذه الصفحة للتراخيص الموضحّة في ترخيص استخدام المحتوى. إنّ Java وOpenJDK هما علامتان تجاريتان مسجَّلتان لشركة Oracle و/أو الشركات التابعة لها.
تاريخ التعديل الأخير: 2025-07-27 (حسب التوقيت العالمي المتفَّق عليه)
[[["يسهُل فهم المحتوى.","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"]],["تاريخ التعديل الأخير: 2025-07-27 (حسب التوقيت العالمي المتفَّق عليه)"],[],[],null,["# About voice interaction\n\nThe Voice Interaction Service API provides an abstraction over different\npotential voice control apps. Implementations can be developed following the guidelines\ndescribed in\n[App development](/docs/automotive/voice/voice_interaction_guide/app_development).\nThe content in this integration guide describes how to integrate these apps into\na specific Android Automotive OS (AAOS) system image.\n\nTerminology\n-----------\n\nThese terms are used through this guide:\n\n- **Assist data.** When a voice interaction session is started, the system is able to capture views and screenshots, and pass this information to the session. Apps can expose additional information by implementing [Activity#onProvideAssistData()](https://developer.android.com/reference/android/app/Activity#onProvideAssistData(android.os.Bundle)) and [Activity#onProvideAssistContent()](https://developer.android.com/reference/android/app/Activity#onProvideAssistContent(android.app.assist.AssistContent)).\n- **[Push-to-talk (PTT)](https://developer.android.com/reference/android/service/voice/VoiceInteractionSession#SHOW_SOURCE_PUSH_TO_TALK)**. Physical voice control button, usually located in the steering wheel.\n- **RecognitionService (RS).** Voice recognition service used by apps through the [SpeechRecognizer](https://developer.android.com/reference/android/speech/SpeechRecognizer)`\n ` API. VIAs must include both the `VoiceInteractionService` *and* the `RecognitionService`.\n- **[Tap-to-talk (TTT)](https://developer.android.com/reference/android/service/voice/VoiceInteractionSession#SHOW_SOURCE_ASSIST_GESTURE)** . Software voice control button, usually included as part of the system UI). In Android this is also referred to as *Assist Gesture*.\n- **[VoiceInteractionService](https://developer.android.com/reference/android/service/voice/VoiceInteractionService)**. Lightweight system service implemented by the VIA developer. The selected service is bound from system service on boot, and is always running.\n- **VoiceInteractionSession (VIS).** This class encapsulates the user interaction business logic. It is responsible for presenting the user with status of the voice interaction, handling VoiceInteractor requests and receiving assist and screenshot data.\n- **VoiceInteractionSessionService (VSS).** A service, part of a VIA, responsible for handling a voice interaction session. This service is bound from Android's system service during a voice interaction with a user. All business logic of this session is implemented in the `VoiceSession` class. This service is only guaranteed to stay alive during a single user voice session.\n- **Voice Interaction App (VIA).** Android app designed to serve as a voice control (referred to as *assistant* ). These apps can be identified by including a `VoiceInteractionService` in their manifest. Only one of these apps can be selected as *default* at a time in the system. Only the default app will be maintained alive (bound from a system service), and will be the receiver of [Push-To-Talk (PTT)](https://developer.android.com/reference/android/service/voice/VoiceInteractionSession#SHOW_SOURCE_PUSH_TO_TALK) or [Tap-To-Talk (TTT)](https://developer.android.com/reference/android/service/voice/VoiceInteractionSession#SHOW_SOURCE_ASSIST_GESTURE) events.\n\nResponsibilities\n----------------\n\nThis table describes the responsibilities of each party.\n\n| Car Manufacturers (OEMs) | AOSP | App Developers |\n|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| - Build a [compatible](/compatibility/android-cdd) infotainment system with AAOS. - Implement audio input and output, optionally including DSP hotword detection support. - Grant system-privileged permissions for the voice interaction services. - Respect `VoiceInteractionService` requirements regarding access to app's settings screens. | - Define and evolve `VoiceInteractionService` and related APIs. - Provide API documentation, sample code and other support material to VIA developers. - Provide UX guidance with requirements and recommendations. | - Implement `VoiceInteractionService` API, RecognitionService API and NotificationListenerService API (see detailed description at [App development](/docs/automotive/voice/voice_interaction_guide/app_development)). - Provide a customizable UI that can be adjusted by OEMs to match each car design system. |\n\nUX requirements\n---------------\n\nOEMs have the ultimate responsibility of providing a good user experience to customers.\nOEMs must ensure that the all pre-installed voice interaction services fulfill the\nrequirements described in\n[Preloaded Assistants: UX Guidance](/static/docs/automotive/voice/voice_interaction_guide/preloaded-assistants_UX-guidelines.pdf).\n\nCore assistant experience\n-------------------------\n\nAn automotive Voice Interaction Application (VIA) performs the following actions:\n\n- \\[MUST\\] Respond to system-handled voice interaction triggers (PTT, TTT).\n- \\[MUST\\] Display a visual representation of their progress (for example, listening, processing, and fulfilling).\n- \\[MUST\\] Use voice or sounds to indicate understanding and completion of user requests.\n- \\[MUST\\] Serve as a speech recognizer for other apps (see the [SpeechRecognizer\n API](https://developer.android.com/reference/android/speech/SpeechRecognizer)).\n- \\[SHOULD\\] Respond to a hotword trigger.\n- \\[MAY\\] Display a settings activity where users can configure this VIA (for example, permissions, hotword configuration, and sign-in).\n- \\[MAY\\] Handle assist data ([Intent#ACTION_ASSIST](https://developer.android.com/reference/android/content/Intent#ACTION_ASSIST))\n- \\[MAY\\] Support voice interaction from Keyguard (lock screen).\n\nComponents\n----------\n\nAt a high level, a voice interaction app interacts with these actors:\n\n**Figure 1.** Voice interaction actors\n\nDetails:\n\n- `VoiceInteractionManagerService`. This system service is responsible for managing the default VIA, and exposing its functionality to the rest of the system.\n- `RecognitionService`. This service exposes speech recognition capabilities to other apps in the system.\n- `SoundTrigger`. Implements hotword management and it's available to VIAs through the AlwaysOnHotwordDetector.\n- `MediaRecorder`. Provides access to audio input for both hotword detection (when using CPU) and speech recognition.\n- `PhoneWindowManager`/`CarInputService`. These services are responsible (among other things) for handling key events, routing PTT to the VIA, by means of the `VoiceInteractionManagerService`.\n- `User`. The user interacts with a VIA by means of Triggers (PTT, TTT, Hotword) or the Voice Plate UI.\n- **CarService, Notifications, Media, Telephony, ContactsProvider, and so on.** Services and apps used by the VoiceInteractionSession to fulfill the user's commands.\n\nAutomotive-specific concepts\n----------------------------\n\nAAOS diverges from Android in the following aspects:\n\n- Besides normal Assistant functionalities, AAOS VIAs can control vehicle functions (for example, HVAC, seats, and interior lights). These functionalities can be integrated using the CarPropertyManager API (see more at [Read a\n vehicle property](/docs/automotive/voice/voice_interaction_guide/fulfilling_commands#vehicle-property)) provided OEMs configure access correctly as described in [Privileged permission allowlisting](/docs/core/permissions/perms-allowlist).\n- Customization and consistency are more relevant in Automotive than in any other form factor. See [Customization](/docs/automotive/voice/voice_interaction_guide/integration_flows#customization) to read more about implementing these guidelines."]]