Lines Matching refs:focus

3 …his is where audio focus comes into play. For applications that provide audio services, it is impo…
5 …utlines the system's audio focus strategy, detailing how applications can request and release audi…
7 …ism, which allows applications to customize the focus strategy for its audio streams. During audio…
11 The system has a default [audio focus strategy](#audio-focus-strategy) that manages all playback an…
13focus](#requesting-audio-focus) before starting playback or recording and [release it](#releasing-…
15 To ensure a superior audio focus experience for users, applications should:
19 - During playback or recording, [listen for audio focus events](#handling-audio-focus-changes) and …
21 - To actively manage audio focus, call the APIs related to [AudioSession](#managing-audio-focus-wit…
25 When an application starts to play or record audio, the system automatically requests audio focus f…
27 …udio.md#start8) of AudioRenderer, the system automatically requests audio focus for the applicatio…
29 If the audio focus request is successful, the audio stream starts normally; otherwise, the audio st…
31 …ten for audio focus events](#handling-audio-focus-changes). If the audio focus request is rejected…
35 …Movie**, or **AudioBook**, the concurrent mode is used by default for the focus request, without a…
37 …o avoid affecting other audio during the mute phase, and then seeks audio focus with a standard st…
47 When an application stops playing or recording audio, the system automatically releases audio focus
49 …it/js-apis-audio.md#release8) of AudioRenderer, the system releases audio focus for the applicatio…
51 After the audio focus is released, other audio streams (for example, streams with reduced volume or…
53 …t to release audio focus immediately when the audio stream stops, it can call the APIs related to …
57 …s or releases audio focus, the system manages focus for all audio streams (including playback and …
59 The system's default audio focus strategy is determined based on the audio stream type ([StreamUsag…
61 To prevent unexpected focus changes, applications must correctly set **StreamUsage** or **SourceTyp…
63 Common audio focus scenarios are as follows:
71focus strategy fails to meet specific scenario requirements, applications can use [AudioSession](#…
75 Applications can set the focus mode (specified by [InterruptMode](../../reference/apis-audio-kit/js…
77 The system provides two predefined focus modes:
79focus. The concurrency rules between these audio streams are determined by the application, withou…
81 …DE**: Each audio stream from the application has its own audio focus, and the audio focus strategy…
83 Applications can select the appropriate focus mode based on their needs. By default, the system use…
85 You can set the audio focus mode in one of the following ways:
87 …../../reference/apis-media-kit/js-apis-media.md#avplayer9) of AVPlayer to set the audio focus mode.
89 …rence/apis-media-kit/_a_v_player.md#oh_avplayer_setaudiointerruptmode) to set the audio focus mode.
91 …ce/apis-audio-kit/js-apis-audio.md#setinterruptmode9) of AudioRenderer to set the audio focus mode.
93 …udio-kit/_o_h_audio.md#oh_audiostreambuilder_setrendererinterruptmode) to set the audio focus mode.
97focus when an application is playing or recording audio, the system handles this situation based o…
99focus events (specified by [InterruptEvent](../../reference/apis-audio-kit/js-apis-audio.md#interr…
101 The manners for listening for audio focus events vary according to the development modes:
103 …ce/apis-media-kit/js-apis-media.md#onaudiointerrupt9) to listen for audio focus events (specified …
105 …dia-kit/_a_v_player.md#oh_avplayer_setoninfocallback) to listen for audio focus events (specified …
107 …ce/apis-audio-kit/js-apis-audio.md#onaudiointerrupt9) to listen for audio focus events (specified …
109 …h_audio.md#oh_audiostreambuilder_setrenderercallback) to listen for audio focus events (specified …
111 …e/apis-audio-kit/js-apis-audio.md#onaudiointerrupt10) to listen for audio focus events (specified …
113 …h_audio.md#oh_audiostreambuilder_setcapturercallback) to listen for audio focus events (specified …
115 When receiving an audio focus event (specified by [InterruptEvent](../../reference/apis-audio-kit/j…
117 In an audio focus event, applications should pay attention to two key pieces of information: **Inte…
121 This parameter specifies whether the focus change is forcibly performed by the system.
141 …ERRUPT_HINT_PAUSE**: The audio stream is paused and audio focus is lost temporarily. When focus is…
142 - **INTERRUPT_HINT_STOP**: The audio stream stops and audio focus is lost.
146 The following provides an example of audio focus processing.
163 …// When audio focus changes, the AudioRenderer receives the interruptEvent callback and performs p…
165 …// Note: In the default focus strategy, INTERRUPT_HINT_RESUME maps to the force type INTERRUPT_SHA…
171 …// The system has paused the audio stream (focus is temporarily lost). To ensure state consistency…
172 …// Temporarily losing focus: After other audio streams release focus, the current audio stream wil…
176 …// The system has stopped the audio stream (focus is permanently lost). To ensure state consistenc…
177 …// Permanently losing focus: No audio focus event will be received. The user must manually trigger…
220 … may use AudioSession APIs to customize a focus strategy for its audio streams. When the system pe…
224 …gy), all audio streams of the application preferentially use this strategy during focus management.
228focus is not released immediately. The system retains focus until the audio session is deactivated…
230 …ion plays multiple audio clips sequentially, it desires to maintain audio focus continuity through…
248 …preferentially used during focus management of the audio stream of the application (for example, r…
249 …eated activation, the saved strategy is updated, and the latest policy is used in focus management.
253focus is not released immediately. Instead, it is maintained in the silent wait state until the au…
255 …audio focus when the audio stream starts. All audio streams of the application prioritize the stra…
257 4. Deactivate the audio session after the audio service ends. The system releases audio focus when …
261focus in maintained in the silent wait state), audio focus is released immediately. If the applica…
273 - **CONCURRENCY_DEFAULT**): default [audio focus strategy](#audio-focus-strategy) of the system.
279 …NCY_PAUSE_OTHERS**: pausing other audio streams and notifying them to resume after releasing focus.
283 …preceding modes through an audio session, the system will try to meet the focus strategy, but it m…
285 > For example, in **CONCURRENCY_PAUSE_OTHERS** mode, if a Movie stream requests audio focus while a…
295 …s of the application are interrupted by other audio streams. As a result, focus is lost and the au…
305 The following lists typical adaptation scenarios for audio focus, where application A plays audio s…
309 … Application B plays the music normally.| Application A listens for audio focus events. When it re…
310 … the music volume is restored to normal.| Application A listens for audio focus events. When it re…
311 …nds, the video playback resumes. | Application A listens for audio focus events. When it re…
312 … then ended, the music playback resumes.| Application A listens for audio focus events. When it re…
313 …e call ends, the music playback resumes.| Application A listens for audio focus events. When it re…