1094332d3Sopenharmony_ci/* 2094332d3Sopenharmony_ci * Copyright (c) 2020-2021 Huawei Device Co., Ltd. 3094332d3Sopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License"); 4094332d3Sopenharmony_ci * you may not use this file except in compliance with the License. 5094332d3Sopenharmony_ci * You may obtain a copy of the License at 6094332d3Sopenharmony_ci * 7094332d3Sopenharmony_ci * http://www.apache.org/licenses/LICENSE-2.0 8094332d3Sopenharmony_ci * 9094332d3Sopenharmony_ci * Unless required by applicable law or agreed to in writing, software 10094332d3Sopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS, 11094332d3Sopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12094332d3Sopenharmony_ci * See the License for the specific language governing permissions and 13094332d3Sopenharmony_ci * limitations under the License. 14094332d3Sopenharmony_ci */ 15094332d3Sopenharmony_ci 16094332d3Sopenharmony_ci/** 17094332d3Sopenharmony_ci * @addtogroup Audio 18094332d3Sopenharmony_ci * @{ 19094332d3Sopenharmony_ci * 20094332d3Sopenharmony_ci * @brief Defines audio-related APIs, including custom data types and functions for loading drivers, 21094332d3Sopenharmony_ci * accessing a driver adapter, and rendering and capturing audios. 22094332d3Sopenharmony_ci * 23094332d3Sopenharmony_ci * @since 1.0 24094332d3Sopenharmony_ci * @version 1.0 25094332d3Sopenharmony_ci */ 26094332d3Sopenharmony_ci 27094332d3Sopenharmony_ci/** 28094332d3Sopenharmony_ci * @file audio_scene.h 29094332d3Sopenharmony_ci * 30094332d3Sopenharmony_ci * @brief Declares APIs for audio scenes. 31094332d3Sopenharmony_ci * 32094332d3Sopenharmony_ci * @since 1.0 33094332d3Sopenharmony_ci * @version 1.0 34094332d3Sopenharmony_ci */ 35094332d3Sopenharmony_ci 36094332d3Sopenharmony_ci#ifndef AUDIO_SCENE_H 37094332d3Sopenharmony_ci#define AUDIO_SCENE_H 38094332d3Sopenharmony_ci 39094332d3Sopenharmony_ci#include "audio_types.h" 40094332d3Sopenharmony_cinamespace OHOS::HDI::Audio_Bluetooth { 41094332d3Sopenharmony_ci/** 42094332d3Sopenharmony_ci * @brief Provides scene-related APIs for audio rendering or capturing, including functions to 43094332d3Sopenharmony_ci * select an audio scene and check whether the configuration of an audio scene is supported. 44094332d3Sopenharmony_ci * 45094332d3Sopenharmony_ci * @since 1.0 46094332d3Sopenharmony_ci * @version 1.0 47094332d3Sopenharmony_ci */ 48094332d3Sopenharmony_cistruct AudioScene { 49094332d3Sopenharmony_ci /** 50094332d3Sopenharmony_ci * @brief Checks whether the configuration of an audio scene is supported. 51094332d3Sopenharmony_ci * 52094332d3Sopenharmony_ci * @param handle Indicates the audio handle. 53094332d3Sopenharmony_ci * @param scene Indicates the pointer to the descriptor of the audio scene. 54094332d3Sopenharmony_ci * @param supported Indicates the pointer to the variable specifying whether the configuration is supported. 55094332d3Sopenharmony_ci * Value <b>true</b> means that the configuration is supported, and <b>false</b> means the opposite. 56094332d3Sopenharmony_ci * @return Returns <b>0</b> if the result is obtained; returns a negative value otherwise. 57094332d3Sopenharmony_ci * @see SelectScene 58094332d3Sopenharmony_ci */ 59094332d3Sopenharmony_ci int32_t (*CheckSceneCapability)(AudioHandle handle, const struct AudioSceneDescriptor *scene, bool *supported); 60094332d3Sopenharmony_ci 61094332d3Sopenharmony_ci /** 62094332d3Sopenharmony_ci * @brief Selects an audio scene. 63094332d3Sopenharmony_ci * 64094332d3Sopenharmony_ci * <ul> 65094332d3Sopenharmony_ci * <li>To select a specific audio scene, you need to specify both the application scenario and output device. 66094332d3Sopenharmony_ci * For example, to select a scene using a smartphone speaker as the output device, set <b>scene</b> according 67094332d3Sopenharmony_ci * to the scenarios where the speaker is used. For example:</li> 68094332d3Sopenharmony_ci * <ul> 69094332d3Sopenharmony_ci * <li>For media playback, set the value to <b>media_speaker</b>.</li> 70094332d3Sopenharmony_ci * <li>For a voice call, set the value to <b>voice_speaker</b>.</li> 71094332d3Sopenharmony_ci * </ul> 72094332d3Sopenharmony_ci * <li>To select only the application scenario, such as media playback, movie, or gaming, you can set 73094332d3Sopenharmony_ci * <b>scene</b> to <b>media</b>, <b>movie</b>, or <b>game</b>, respectively.</li> 74094332d3Sopenharmony_ci * <li>To select only the output device, such as media receiver, speaker, or headset, you can set 75094332d3Sopenharmony_ci * <b>scene</b> to <b>receiver</b>, <b>speaker</b>, or <b>headset</b>, respectively.</li> 76094332d3Sopenharmony_ci * </ul> 77094332d3Sopenharmony_ci * @param handle Indicates the audio handle. 78094332d3Sopenharmony_ci * @param scene Indicates the pointer to the descriptor of the audio scene to select. 79094332d3Sopenharmony_ci * @return Returns <b>0</b> if the scene is selected successfully; returns a negative value otherwise. 80094332d3Sopenharmony_ci * @see CheckSceneCapability 81094332d3Sopenharmony_ci */ 82094332d3Sopenharmony_ci int32_t (*SelectScene)(AudioHandle handle, const struct AudioSceneDescriptor *scene); 83094332d3Sopenharmony_ci}; 84094332d3Sopenharmony_ci} 85094332d3Sopenharmony_ci#endif /* AUDIO_SCENE_H */ 86094332d3Sopenharmony_ci/** @} */ 87