ตั้งแต่วันที่ 27 มีนาคม 2025 เป็นต้นไป เราขอแนะนำให้ใช้ android-latest-release
แทน aosp-main
เพื่อสร้างและมีส่วนร่วมใน AOSP โปรดดูข้อมูลเพิ่มเติมที่หัวข้อการเปลี่ยนแปลงใน AOSP
เกี่ยวกับการโต้ตอบด้วยเสียง
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
Voice Interaction Service API แสดงภาพรวมของแอปต่างๆ ที่อาจใช้การควบคุมด้วยเสียงได้ การติดตั้งใช้งานสามารถพัฒนาตามหลักเกณฑ์ที่อธิบายไว้ในการพัฒนาแอป
เนื้อหาในคู่มือการผสานรวมนี้จะอธิบายวิธีผสานรวมแอปเหล่านี้ลงในภาพระบบ Android Automotive OS (AAOS) ที่เฉพาะเจาะจง
คำศัพท์
คําศัพท์ที่ใช้ในคู่มือนี้
- ข้อมูลแอสซิสต์ เมื่อเริ่มเซสชันการโต้ตอบด้วยเสียง ระบบจะจับภาพมุมมองและภาพหน้าจอ และส่งข้อมูลนี้ไปยังเซสชันได้ แอปสามารถแสดงข้อมูลเพิ่มเติมได้โดยใช้
Activity#onProvideAssistData()
และ Activity#onProvideAssistContent()
- Push-to-talk (PTT) ปุ่มควบคุมด้วยเสียงจริง โดยปกติจะอยู่ที่พวงมาลัย
- RecognitionService (RS) บริการจดจำเสียงที่แอปใช้ผ่าน
SpeechRecognizer
API VIA ต้องมีทั้ง VoiceInteractionService
และ RecognitionService
- ฟีเจอร์แตะเพื่อพูด (TTT) ปุ่มควบคุมด้วยเสียงของซอฟต์แวร์ ซึ่งมักจะรวมอยู่ใน UI ของระบบ) ใน Android เรียกวิธีนี้ว่าท่าทางควบคุม
VoiceInteractionService
บริการระบบแบบเบาที่นักพัฒนา VIA ติดตั้งใช้งาน บริการที่เลือกจะเชื่อมโยงจากบริการของระบบเมื่อเปิดเครื่อง และทำงานอยู่เสมอ
- VoiceInteractionSession (VIS) คลาสนี้จะรวมตรรกะทางธุรกิจของการโต้ตอบกับผู้ใช้ โดยมีหน้าที่แสดงสถานะของการโต้ตอบด้วยเสียงแก่ผู้ใช้ จัดการคําขอ VoiceInteractor และรับข้อมูลความช่วยเหลือและภาพหน้าจอ
- VoiceInteractionSessionService (VSS) บริการที่เป็นส่วนหนึ่งของ VIA ซึ่งมีหน้าที่จัดการเซสชันการโต้ตอบด้วยเสียง บริการนี้เชื่อมโยงจากบริการระบบของ Android ระหว่างการโต้ตอบด้วยเสียงกับผู้ใช้ ตรรกะทางธุรกิจทั้งหมดของเซสชันนี้ติดตั้งใช้งานในคลาส
VoiceSession
บริการนี้รับประกันว่าจะใช้งานได้ในระหว่างเซสชันเสียงของผู้ใช้รายเดียวเท่านั้น
- แอปการโต้ตอบด้วยเสียง (VIA) แอป Android ที่ออกแบบมาเพื่อใช้เป็นการควบคุมด้วยเสียง (เรียกว่าผู้ช่วย) แอปเหล่านี้จะระบุได้ด้วยการเพิ่ม
VoiceInteractionService
ในไฟล์ Manifest
ระบบจะเลือกแอปเหล่านี้เป็นค่าเริ่มต้นได้เพียงแอปเดียวในแต่ละครั้ง
ระบบจะคงไว้เฉพาะแอปเริ่มต้น (เชื่อมโยงจากบริการของระบบ) และแอปดังกล่าวจะเป็นตัวรับเหตุการณ์ Push-To-Talk (PTT) หรือ Tap-To-Talk (TTT)
หน้าที่รับผิดชอบ
ตารางนี้อธิบายความรับผิดชอบของคู่สัญญาแต่ละฝ่าย
ผู้ผลิตรถยนต์ (OEM) |
AOSP |
นักพัฒนาแอป |
- สร้างระบบสาระบันเทิงที่เข้ากันได้กับ AAOS
- ใช้อินพุตและเอาต์พุตเสียง โดยอาจรวมการรองรับการตรวจหาคําสั่งให้ดำเนินการ (Hotword) ของ DSP ไว้ด้วย
- ให้สิทธิ์ที่มีสิทธิ์ระดับระบบสำหรับบริการโต้ตอบด้วยเสียง
- ปฏิบัติตามข้อกำหนดของ
VoiceInteractionService เกี่ยวกับการเข้าถึงหน้าจอการตั้งค่าของแอป
|
- กำหนดและพัฒนา
VoiceInteractionService และ API ที่เกี่ยวข้อง
- มอบเอกสารประกอบ API, โค้ดตัวอย่าง และเนื้อหาสนับสนุนอื่นๆ ให้แก่นักพัฒนาซอฟต์แวร์ VIA
- ให้คําแนะนําเกี่ยวกับ UX พร้อมข้อกําหนดและคําแนะนํา
|
- ใช้
VoiceInteractionService API, RecognitionService API และ NotificationListenerService API (ดูคำอธิบายโดยละเอียดที่การพัฒนาแอป)
- มี UI ที่ปรับแต่งได้ซึ่ง OEM สามารถปรับให้เข้ากับระบบการออกแบบรถยนต์แต่ละระบบ
|
ข้อกำหนด UX
OEM มีหน้าที่รับผิดชอบสูงสุดในการจัดหาประสบการณ์การใช้งานที่ดีให้แก่ลูกค้า
OEM ต้องตรวจสอบว่าบริการโต้ตอบด้วยเสียงที่ติดตั้งไว้ล่วงหน้าทั้งหมดเป็นไปตามข้อกำหนดที่อธิบายไว้ในผู้ช่วยที่โหลดไว้ล่วงหน้า: หลักเกณฑ์ UX
ประสบการณ์การใช้งาน Assistant หลัก
แอปพลิเคชันการโต้ตอบด้วยเสียง (VIA) ยานยนต์จะดำเนินการต่อไปนี้
- [ต้อง] ตอบสนองต่อทริกเกอร์การโต้ตอบด้วยเสียงที่ระบบจัดการ (PTT, TTT)
- [ต้อง] แสดงภาพความคืบหน้าของคำสั่งซื้อ (เช่น กำลังฟัง กำลังประมวลผล และกำลังดำเนินการตามคำสั่งซื้อ)
- [ต้อง] ใช้เสียงเพื่อบ่งบอกความเข้าใจและการดำเนินการตามคำขอของผู้ใช้จนเสร็จสมบูรณ์
- [ต้อง] ทำหน้าที่เป็นตัวจดจำคำพูดสำหรับแอปอื่นๆ (ดู SpeechRecognizer
API)
- [ควร] ตอบสนองต่อทริกเกอร์คำสั่งให้ดำเนินการ
- [MAY] แสดงกิจกรรมการตั้งค่าที่ผู้ใช้สามารถกําหนดค่า VIA นี้ได้ (เช่น สิทธิ์ การกําหนดค่าคําสั่งให้ดำเนินการ และการลงชื่อเข้าใช้)
- [MAY] Handle assist data (
Intent#ACTION_ASSIST
)
- [MAY] รองรับการโต้ตอบด้วยเสียงจาก Keyguard (หน้าจอล็อก)
คอมโพเนนต์
ในระดับสูง แอปโต้ตอบด้วยเสียงจะโต้ตอบกับองค์ประกอบต่อไปนี้

รูปที่ 1 ผู้พากย์เสียงสำหรับการโต้ตอบด้วยเสียง
รายละเอียด:
VoiceInteractionManagerService
บริการระบบนี้มีหน้าที่รับผิดชอบในการจัดการ VIA เริ่มต้น และแสดงฟังก์ชันการทำงานต่อระบบส่วนที่เหลือ
RecognitionService
บริการนี้จะแสดงความสามารถในการจดจำคำพูดแก่แอปอื่นๆ ในระบบ
SoundTrigger
. ใช้การจัดการคำสั่งให้ดำเนินการและพร้อมใช้งานสำหรับ VIA ผ่าน AlwaysOnHotwordDetector
MediaRecorder
ให้สิทธิ์เข้าถึงอินพุตเสียงสําหรับทั้งการตรวจหาคําสั่งให้ดำเนินการ (เมื่อใช้ CPU) และการจดจําคําพูด
PhoneWindowManager
/CarInputService
บริการเหล่านี้มีหน้าที่รับผิดชอบ (นอกเหนือจากเรื่องอื่นๆ) ในการจัดการเหตุการณ์สำคัญ การกำหนดเส้นทาง PTT ไปยัง VIA โดยใช้ VoiceInteractionManagerService
User
. ผู้ใช้โต้ตอบกับ VIA โดยใช้ทริกเกอร์ (PTT, TTT, คำสั่งให้ดำเนินการ) หรือ UI ของ Voice Plate
- CarService, Notifications, Media, Telephony, ContactsProvider และอื่นๆ
บริการและแอปที่ VoiceInteractionSession ใช้เพื่อดำเนินการตามคําสั่งของผู้ใช้
แนวคิดเฉพาะยานยนต์
AAOS แตกต่างจาก Android ในด้านต่อไปนี้
- นอกจากฟังก์ชันการทำงานปกติของ Assistant แล้ว AAOS VIA ยังควบคุมฟังก์ชันของยานพาหนะได้ด้วย (เช่น HVAC, เบาะ และไฟภายใน) ฟังก์ชันการทำงานเหล่านี้สามารถผสานรวมโดยใช้ CarPropertyManager API (ดูข้อมูลเพิ่มเติมได้ที่อ่านพร็อพเพอร์ตี้ของยานพาหนะ) ในกรณีที่ OEM กำหนดค่าการเข้าถึงอย่างถูกต้องตามที่อธิบายไว้ในรายการที่อนุญาตสิทธิ์ที่มีสิทธิ์
- การปรับแต่งและความสอดคล้องมีความเกี่ยวข้องในยานยนต์มากกว่ารูปแบบอื่นๆ ดูข้อมูลเพิ่มเติมเกี่ยวกับการใช้หลักเกณฑ์เหล่านี้ได้ที่ส่วนการปรับแต่ง
ตัวอย่างเนื้อหาและโค้ดในหน้าเว็บนี้ขึ้นอยู่กับใบอนุญาตที่อธิบายไว้ในใบอนุญาตการใช้เนื้อหา Java และ OpenJDK เป็นเครื่องหมายการค้าหรือเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-07-27 UTC
[[["เข้าใจง่าย","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 UTC"],[],[],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."]]