미디어 앱에 음성 작업을 통합하여 주의를 분산하는 요소를 최소화함으로써 운전자 안전과 편의성을 개선하세요. Android Auto 또는 Android Automotive OS (AAOS)에서 음성 작업을 감지하여 해석하면 onPlayFromSearch 콜백을 통해 앱에 작업을 전달합니다.
콜백을 수신하면 앱은 쿼리 문자열과 일치하는 콘텐츠를 찾아 재생을 시작합니다. 앱은 장르, 아티스트, 앨범, 노래 제목, 라디오 채널, 재생목록 등 다양한 쿼리 카테고리를 고려해야 합니다.
또한 앱은 음악에 대한 일반적인 요청을 나타내는 빈 쿼리 문자열을 처리해야 합니다.
앱에서 하나의 미디어 항목을 재생하고 있다면 사용자는 "[노래 제목] 재생"이라고 말하여 자동차 디스플레이를 보거나 터치하지 않고도 다른 노래를 재생하라고 앱에 알려줄 수 있습니다. 사용자는 핸들에 있는 적절한 버튼을 클릭하거나 "Hey Google"이라는 핫워드를 말하여 쿼리를 시작할 수 있습니다.
Android Auto 또는 AAOS에서 음성 작업을 감지하여 해석하면 Android Auto 또는 AAOS는 onPlayFromSearch를 통해 앱에 음성 작업을 전달합니다. 이 콜백을 수신하면 앱은 query 문자열과 일치하는 콘텐츠를 찾아 재생을 시작합니다.
사용자는 특히 장르나 아티스트, 앨범, 노래 제목, 라디오 채널, 재생목록 등 다양한 검색어 카테고리를 쿼리에 지정할 수 있습니다. 검색 지원 기능을 구축할 때는 앱에 적합한 모든 카테고리를 고려하세요. Android Auto 또는 AAOS에서는 지정된 쿼리가 특정 카테고리에 적합하다고 감지하면 extras 매개변수에 추가 항목을 더합니다. 다음과 같은 추가 데이터를 전송할 수 있습니다.
이 페이지에 나와 있는 콘텐츠와 코드 샘플에는 콘텐츠 라이선스에서 설명하는 라이선스가 적용됩니다. 자바 및 OpenJDK는 Oracle 및 Oracle 계열사의 상표 또는 등록 상표입니다.
최종 업데이트: 2025-08-22(UTC)
[null,null,["최종 업데이트: 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)."]]