[[["เข้าใจง่าย","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-08-22 UTC"],[],[],null,["# Support voice actions\n\nIntegrate voice actions into your media app to enhance driver safety and\nconvenience by minimizing distractions. When Android Auto or Android Automotive\nOS (AAOS) detects and interprets a voice action, they deliver the action to your\napp through the `onPlayFromSearch` callback.\n\nUpon receiving the callback, your app finds content that matches the query\nstring and then starts playback. Your app must account for various query\ncategories, such as genre, artist, album, song name, radio station, or playlist.\nAdditionally, your app must handle an empty query string, which indicates a\ngeneral request for music.\n\nIf your app is playing one media item, the user can say \"Play \\[song title\\]\"\nto tell your app to play a different song without looking at or touching the\ncar's display. Users can initiate queries by clicking the appropriate buttons\non their steering wheel or speaking the hotwords \"OK Google.\"\n| **Design guidelines:** To learn more, see [Create apps](/cars/design/create-apps).\n\nWhen Android Auto or AAOS detects and interprets a voice action, Android Auto or\nAAOS delivers that voice action to the app through [`onPlayFromSearch`](/reference/android/support/v4/media/session/MediaSessionCompat.Callback#onPlayFromSearch(java.lang.String,%20android.os.Bundle)). Upon\nreceiving this callback, the app finds content to match the `query` string and\nthen starts playback.\n\nUsers can specify different categories of terms in their query: genre, artist,\nalbum, song name, radio station, or playlist, among others. When building\nsupport for search, account for all the categories that make sense for your app.\nIf Android Auto or AAOS detects that a given query fits into a specific\ncategory, extras are appended in the `extras` parameter. You can send these\nextras:\n\n- [`EXTRA_MEDIA_ALBUM`](/reference/android/provider/MediaStore#EXTRA_MEDIA_ALBUM)\n- [`EXTRA_MEDIA_ARTIST`](/reference/android/provider/MediaStore#EXTRA_MEDIA_ARTIST)\n- [`EXTRA_MEDIA_GENRE`](/reference/android/provider/MediaStore#EXTRA_MEDIA_GENRE)\n- [`EXTRA_MEDIA_PLAYLIST`](/reference/android/provider/MediaStore#EXTRA_MEDIA_PLAYLIST)\n- [`EXTRA_MEDIA_TITLE`](/reference/android/provider/MediaStore#EXTRA_MEDIA_TITLE)\n\nAccount for an empty `query` string, which can be sent by Android Auto or AAOS\nif the user doesn't specify search terms. For example, if the user says\n\"Play some music.\" In this case, your app can start a recently played or new\ntrack.\n\nIf your app can't process a search quickly, don't block in `onPlayFromSearch`.\nInstead, set the playback state to [`STATE_CONNECTING`](/reference/android/support/v4/media/session/PlaybackStateCompat#STATE_CONNECTING()) and perform the\nsearch on an async thread.\n\nWhen playback starts, consider populating the media session's queue with\nrelated content. For example, if the user requests an album to be played, your\napp could fill the queue with the album's tracklist.\n\nIn addition to \"Play\" queries, Android Auto and AAOS recognize voice queries to\ncontrol playback like \"pause music\" and \"next song\" and match these commands to\nthe appropriate media session callbacks, such as `onPause` and `onSkipToNext`.\n\nTo learn more about implementing voice-enabled playback actions, see\n[Google Assistant and media apps](/media/implement/assistant)."]]