Sound area switching method and device, electronic equipment and storage medium

By identifying audio zone switching events in in-vehicle multi-screen interaction scenarios, obtaining application and audio zone identifiers, filtering target audio tracks, and controlling audio stream playback, the problem of abnormal audio playback was solved, ensuring stable output of the audio stream in different audio zones and improving the user experience.

CN122018846APending Publication Date: 2026-05-12BEIJING PHOENIX AUTO INTELLIGENCE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
BEIJING PHOENIX AUTO INTELLIGENCE CO LTD
Filing Date
2025-12-25
Publication Date
2026-05-12

AI Technical Summary

Technical Problem

In in-vehicle multi-screen interaction scenarios, audio playback status applications are prone to abnormal issues such as playback pauses and interruptions during device pairing and connection or cross-screen content migration, affecting the user's driving experience and interaction satisfaction.

Method used

By identifying the audio zone switching event, obtaining the application and audio zone identifiers, filtering the target audio track, and using the target audio track to control the playback of the audio stream, the system ensures the directional switching and continuity of the audio stream in different audio zones, and uses fade-in and fade-out methods to reduce playback anomalies.

Benefits of technology

It enables precise switching between different audio ranges in audio applications, avoids playback abnormalities, and improves the accuracy of audio playback and user experience in multi-range interactive scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122018846A_ABST
    Figure CN122018846A_ABST
Patent Text Reader

Abstract

The invention relates to a sound area switching method and device, electronic equipment and a storage medium, and the method comprises the steps: determining whether a sound area switching event is detected, and the sound area switching event is used for switching an audio stream of a first application from a first sound area to a second sound area; if a sound area switching event is detected, obtaining a first application identifier of the first application and a first sound area identifier of the second sound area; determining a target audio track according to the first sound area identifier and the first application identifier; and controlling an audio stream from the first application to be played by using the target audio track. According to the embodiment of the invention, it can be ensured that only the target audio track corresponding to the first application mark and the first audio area identifier plays the audio stream of the first application, and the playing of the audio streams of other audio tracks is not affected, so that the playing abnormity such as playing pause and interruption of the other audio tracks is avoided, and the playing continuity of the audio streams of the other audio tracks is ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of audio processing technology in multi-screen interaction scenarios in vehicles, and particularly to a method, device, electronic device and storage medium for switching audio zones. Background Technology

[0002] With the accelerated development of automotive intelligence and connectivity, in-vehicle interior functions are continuously upgraded, and the adoption and popularity of multi-screen devices have increased significantly, leading to increasingly diverse multi-screen collaborative interaction scenarios. As a core application mode of multi-screen linkage, screen-flying technology, with its features such as gesture control and seamless information flow, has become a key configuration for improving the convenience of in-vehicle interaction and driving safety, and is widely used in cross-screen migration scenarios for navigation, entertainment, and other content.

[0003] However, in actual use, the screen-flying technology still has room for improvement. Especially during device pairing or cross-screen content migration, applications in audio playback mode are prone to abnormal issues, such as playback pauses or interruptions. These problems directly disrupt the continuity of the audio experience and seriously affect the user's driving experience and interaction satisfaction. Summary of the Invention

[0004] In order to solve the above-mentioned technical problems, or at least partially solve the above-mentioned technical problems, this application provides a method, apparatus, electronic device and storage medium for switching audio zones.

[0005] Firstly, this application provides a method for switching audio zones, including: Determine whether a zone switching event is detected, the zone switching event being used to switch the audio stream of the first application from the first zone to the second zone; If a zone switching event is detected, obtain the first application identifier of the first application and the first zone identifier of the second zone; The target audio track is determined based on the first audio region identifier and the first application identifier; The target audio track is used to control the playback of the audio stream from the first application.

[0006] Optionally, determining the target audio track based on the first audio region identifier and the first application identifier includes: Identify multiple candidate audio tracks corresponding to the first audio region identifier; The candidate audio track corresponding to the first application identifier among the multiple candidate audio tracks is determined as the target audio track.

[0007] Optionally, controlling the playback of an audio stream from the first application using the target audio track includes: Trigger the target audio track to perform an audio stream refresh operation corresponding to the first application identifier; The target audio track is used to control the playback device in the second audio region to play the audio stream corresponding to the first application identifier.

[0008] Optionally, the method further includes: Determine if a third audio region exists that is playing an audio stream from a second application; If there is a third audio region that is playing an audio stream from the second application, obtain the second audio region identifier of the third audio region and the second application identifier of the second application; Determine the first audio track corresponding to the second audio region identifier and the second application identifier; While triggering the target audio track to perform an audio stream refresh operation corresponding to the first application identifier, the first audio track is not triggered to perform an audio stream refresh operation corresponding to the first application identifier, so that the first audio track continues to play the audio stream from the second application without interruption. Optionally, the target audio track is used to control the playback device in the second audio region to play the audio stream corresponding to the first application identifier, including: The target audio track is used to control the playback device in the second audio region, and the audio stream from the first application is played in a preset fade-in manner.

[0009] Optionally, before playing the audio stream of the first application using the target audio track, the method further includes: Determine the second audio track corresponding to the first audio region identifier of the first audio region; The system notifies the second audio track in the playback device of the first audio zone to end the playback of the audio stream from the first application according to a preset fade-out method.

[0010] Optionally, determine whether a zone switching event is detected, including: Determine whether a screen-flying operation is received to switch the audio stream of the first application from the first audio region to the second audio region; If the screen-flying operation is received, the audio zone switching event is triggered. The audio zone switching event is used to switch the audio stream of the first application from the first audio zone to the second audio zone.

[0011] Secondly, this application provides a frequency zone switching device, comprising: The first determining module is used to determine whether a zone switching event is detected, wherein the zone switching event is used to switch the audio stream of the first application from the first zone to the second zone; The acquisition module is used to acquire the first application identifier of the first application and the first audio zone identifier of the second audio zone if an audio zone switching event is detected. The second determining module is used to determine the target audio track based on the first audio region identifier and the first application identifier; A control module is used to control the playback of an audio stream from the first application using the target audio track.

[0012] Thirdly, this application provides an electronic device, including a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus; Memory, used to store computer programs; When a processor executes a program stored in memory, it implements the audio zone switching method described in any of the first aspects.

[0013] Fourthly, this application provides a computer-readable storage medium storing a program for a register switching method, wherein when the program for the register switching method is executed by a processor, it implements the steps of the register switching method described in any of the first aspects.

[0014] The beneficial effects of this invention are as follows: This embodiment determines the target audio track based on the first application identifier of the switched application and the first audio zone identifier to which it is switched. Furthermore, it controls the playback of the first application's audio stream using the target audio track, ensuring that only the target audio track corresponding to the first application identifier and the first audio zone identifier plays the first application's audio stream. The playback of other audio tracks is not affected, preventing playback anomalies such as pauses or interruptions on other audio tracks and ensuring the continuity of audio stream playback on other tracks. Moreover, it enables directional switching of audio applications across different audio zones, ensuring accurate audio output in the target audio zone, avoiding audio stream playback anomalies, and improving audio playback accuracy and user experience in multi-zone interactive scenarios. Attached Figure Description

[0015] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.

[0016] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0017] Figure 1 A flowchart illustrating a voice zone switching method provided in an embodiment of this application; Figure 2 for Figure 1 Flowchart of step S103; Figure 3 for Figure 1 Flowchart of step S104; Figure 4 Another flowchart of a voice zone switching method provided in an embodiment of this application; Figure 5 Another flowchart of a voice zone switching method provided in an embodiment of this application; Figure 6 A diagram illustrating a zone switching routing framework provided in this application embodiment; Figure 7 Flowchart for obtaining the unique UID of the playback device Figure 8 A flowchart for triggering the decision to change the corresponding audio zone of the AudioPolicyServie UID; Figure 9 This is a flowchart of AudioFLinger's UID determination process; Figure 10 Flowchart for fade-out processing Figure 11 Flowchart for fade-in processing; Figure 12 A structural diagram of a volume switching device provided in an embodiment of this application; Figure 13 This is a structural diagram of an electronic device provided in an embodiment of this application. Detailed Implementation

[0018] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0019] In practical use, the experience of screen-switching technology still has room for improvement. Especially during device pairing or cross-screen content migration, applications in audio playback mode are prone to issues such as playback pauses and interruptions. These problems directly disrupt the continuity of the audio experience, severely impacting user comfort and interaction satisfaction. Therefore, this application provides a method, apparatus, electronic device, and storage medium for switching audio zones.

[0020] This application provides a method for switching audio zones, which can be applied to in-vehicle infotainment systems, such as... Figure 1 As shown, the audio zone switching method includes: Step S101: Determine whether a zone switching event has been detected; In this embodiment of the application, the audio zone switching event refers to the triggering event when the playback audio zone of the audio application changes. The audio zone switching event is used to switch the audio stream of the first application from the first audio zone to the second audio zone. The first application is the audio playback application that initiates the audio zone switching, the audio stream is the audio data that is being played or to be played generated by the first application, the first audio zone is the audio zone that the first application initially plays, and the second audio zone is the audio zone that the first application will play after switching.

[0021] In this step, it can be determined whether there are any events that trigger a certain audio application's audio playback to switch from the initial audio region to another target audio region.

[0022] For example: Define the driver's screen as the first audio zone, the passenger's screen as the second audio zone, and the first application as Kugou Music. Determine whether the relevant event of Kugou Music's audio stream switching from the first audio zone corresponding to the driver's screen to the second audio zone corresponding to the passenger's screen is detected.

[0023] In one embodiment of this application, step S101, determining whether a zone switching event is detected, includes: determining whether a screen-flying operation is received to switch the audio stream of the first application from the first zone to the second zone; if the screen-flying operation is received, triggering the zone switching event, wherein the zone switching event is used to switch the audio stream of the first application from the first zone to the second zone.

[0024] Screen-to-screen operation refers to the user's interaction with an audio application by swiping or using gestures to move the screen corresponding to one audio zone to another. This implementation clearly defines the trigger source of the audio zone switching event as the user's screen-to-screen operation, ensuring that the system can accurately respond to the user's interaction needs, achieve precise switching of the audio application between different audio zones, and improve the user interaction experience in multi-screen, multi-audio-zone scenarios.

[0025] Step S102: If a zone switching event is detected, obtain the first application identifier of the first application and the first zone identifier of the second zone; In this embodiment of the application, the first application identifier is information used to uniquely identify the first application, and the first audio region identifier is information used to uniquely identify the second audio region.

[0026] In this step, after confirming that a zone switching event has been detected, the first application identifier that can uniquely identify the switching application and the first zone identifier of the second zone can be extracted from the zone switching event.

[0027] For example, after detecting the event that KuGou Music switches from the first audio zone corresponding to the driver's screen to the second audio zone corresponding to the passenger's screen, the first application identifier of KuGou Music and the first audio zone identifier of the second audio zone corresponding to the passenger's screen can be obtained.

[0028] Step S103: Determine the target audio track based on the first audio region identifier and the first application identifier; In this embodiment of the application, the target audio track is an audio playback control unit that is bound to the first application identifier and adapted to the audio zone corresponding to the first audio zone identifier.

[0029] In this step, the target audio track responsible for processing the application's playback in the target audio zone can be selected by combining the first audio zone identifier and the first application identifier.

[0030] For example, based on the first application identifier of KuGou Music and the first audio zone identifier corresponding to the passenger screen, the audio track that belongs only to KuGou Music and is compatible with the passenger screen audio zone is selected from multiple audio tracks in the system as the target audio track.

[0031] Step S104: Use the target audio track to control the playback of the audio stream from the first application.

[0032] In this step, the selected target audio track can be used to control the audio data of the first application to play normally in the target audio region. For example, by using the selected target audio track, the audio stream of KuGou Music can be controlled to play in the second audio region corresponding to the passenger screen.

[0033] This application embodiment determines the target audio track based on the first application identifier of the switched application and the first audio zone identifier of the switched area. Furthermore, it uses the target audio track to control the playback of the first application's audio stream, ensuring that only the target audio track corresponding to the first application identifier and the first audio zone identifier plays the first application's audio stream. The playback of audio streams on other tracks will not be affected, avoiding playback anomalies such as pauses or interruptions on other tracks and ensuring the continuity of audio stream playback on other tracks. Moreover, it can realize directional switching of audio applications in different audio zones, ensuring that audio can be accurately output in the target audio zone, avoiding audio stream playback anomalies, and improving the accuracy of audio playback and user experience in multi-audio zone interaction scenarios.

[0034] In yet another embodiment of this application, as Figure 2 As shown, step S103, which determines the target audio track based on the first audio region identifier and the first application identifier, includes: Step S201: Determine multiple candidate audio tracks corresponding to the first audio region identifier; In this embodiment of the application, the candidate audio track refers to all audio playback control units that are adapted to the corresponding audio zone of the first audio zone identifier, i.e., candidate audio tracks. These audio tracks all have the ability to play audio in that audio zone.

[0035] This step can filter out all audio control units that can play audio in the target audio zone. For example, the first audio zone is identified as the passenger screen audio zone. All audio tracks that are adapted to the passenger screen audio zone and can play audio in that zone are identified as multiple candidate audio tracks. These candidate audio tracks may correspond to different audio applications.

[0036] Step S202: Among the multiple candidate audio tracks, the candidate audio track corresponding to the first application identifier is determined as the target audio track.

[0037] In this step, a dedicated audio control unit that matches the unique identifier of the application that initiated the switch, i.e., the first application identifier, can be selected from all audio control units that are compatible with the target audio region.

[0038] For example, multiple candidate audio tracks correspond to different applications such as NetEase Cloud Music and Kugou Music. The first application identifier is the unique user identifier of Kugou Music. The audio track that corresponds to the first application identifier among the candidate audio tracks is determined as the target audio track.

[0039] This application embodiment improves the accuracy of target audio track determination by first screening candidate audio tracks that are compatible with the target audio region and then accurately locating the target audio track based on the application identifier. This avoids playback abnormalities caused by the mismatch between the audio track and the application or audio region, and ensures that the audio stream can be stably played in the target audio region through the dedicated audio track.

[0040] In yet another embodiment of this application, as Figure 3 As shown, step S104 uses the target audio track to control the playback of the audio stream from the first application, including: Step S301: Trigger the target audio track to perform an audio stream refresh operation corresponding to the first application identifier; In this embodiment of the application, the audio stream refresh operation refers to the operation of updating the audio stream transmission path, playback configuration and other related parameters corresponding to the target audio track, so that the audio track is adapted to the new playback environment.

[0041] In this step, after the target audio track is determined, the target audio track can be triggered to perform an audio stream refresh operation for the audio stream from the first application, so that the target audio track can update the playback parameters related to the audio stream of the first application being switched, in order to adapt to the playback requirements of the target audio region.

[0042] For example, triggering the target audio track corresponding to KuGou Music updates the transmission path, playback format, and other parameters of the KuGou Music audio stream in that track, making it compatible with the playback device in the passenger side screen audio zone.

[0043] Step S302: Use the target audio track to control the playback device of the second audio zone to play the audio stream corresponding to the first application identifier.

[0044] In this embodiment of the application, the playback device for the second audio zone refers to a dedicated hardware device for outputting audio, such as a speaker, for the second audio zone.

[0045] In this step, the target audio track after the audio stream refresh operation can be used to control the playback device corresponding to the second audio zone to play the audio stream of the first audio.

[0046] For example, the updated target audio track can be used to control the speakers in the passenger side screen audio zone to play the corresponding audio stream from KuGou Music.

[0047] This application embodiment refreshes the audio stream parameters of the target audio track first, and then controls the playback device of the target audio zone to play the audio. This ensures that the audio stream can quickly adapt to the new playback environment after switching audio zones, achieves stable output, and reduces possible playback interruptions or abnormalities during audio zone switching.

[0048] In yet another embodiment of this application, as Figure 4 As shown, the method further includes: Step S401: Determine if there is a third audio region that is playing an audio stream from the second application; In this embodiment of the application, the second application is an audio playback application other than the first application, and the third audio zone is the audio zone that is playing audio other than the first and second audio zones.

[0049] In this step, it can be determined whether other audio applications in the system are playing audio in a sound zone not involved in the switching.

[0050] For example, if the first application is Kugou Music, the first audio zone is the driver's side screen audio zone, and the second audio zone is the passenger side screen audio zone, determine whether there is an audio stream from NetEase Cloud Music (the second application) playing in the third audio zone corresponding to the rear screen.

[0051] Step S402: If there is a third audio region that is playing an audio stream from the second application, obtain the second audio region identifier of the third audio region and the second application identifier of the second application. In this embodiment of the application, the second voice zone identifier is information used to uniquely identify the third voice zone, and the second application identifier is information used to uniquely identify the second application.

[0052] In this step, after confirming the existence of another third audio zone playing from the second application, the unique identification information of the third audio zone and the application can be collected.

[0053] For example: after confirming that the third audio zone corresponding to the rear screen is playing NetEase Cloud Music, obtain the identifier of the rear screen audio zone as the second audio zone identifier, and obtain the unique user identifier of NetEase Cloud Music as the second application identifier.

[0054] Step S403: Determine the first audio track corresponding to the second audio region identifier and the second application identifier; In this embodiment, the first audio track is an audio playback control unit that is bound to the second application identifier and adapted to the third audio zone corresponding to the second audio zone identifier. It is a dedicated carrier for the second application audio stream to be played in the third audio zone.

[0055] In this step, the dedicated audio playback control unit can be determined based on the identifiers of other playback applications and the corresponding audio regions.

[0056] For example, based on the second audio zone identifier of the rear screen audio zone and the second application identifier of NetEase Cloud Music, the corresponding dedicated audio playback control unit is determined as the first audio track.

[0057] Step S404: While triggering the target audio track to perform an audio stream refresh operation corresponding to the first application identifier, the first audio track is not triggered to perform an audio stream refresh operation corresponding to the first application identifier, so that the first audio track continues to play the audio stream from the second application without interruption.

[0058] In this step, when refreshing the dedicated audio track of the switching application in step S301, no related refresh operation is performed on the dedicated audio tracks of other applications that are playing, so as to ensure that the audio playback of other applications is not affected.

[0059] For example, when the target audio track of Kugou Music is triggered to perform an audio stream refresh operation, the first audio track of NetEase Cloud Music is not triggered to perform the refresh operation, so that the playback of NetEase Cloud Music in the back screen audio zone remains uninterrupted.

[0060] This application's embodiments identify other currently playing audio applications and audio zones, determine their dedicated audio tracks, and prevent these tracks from being interfered with by irrelevant refresh operations. This solves the problem of non-target application playback interruption and stuttering caused by all audio tracks being triggered to refresh during traditional audio zone switching. It enables parallel playback of multiple audio zones and multiple applications without interference, greatly improving the user's driving audio experience. In practical use, the experience of screen-flying technology still has room for improvement. Especially during device pairing or cross-screen content migration, applications in audio playback mode are prone to abnormal issues, such as popping sounds and background noise. These problems directly disrupt the continuity of the audio experience, severely impacting the user's driving experience and interaction satisfaction. Therefore, in another embodiment of this application, the target audio track is used to control the playback device in the second audio zone to play the audio stream corresponding to the first application identifier, including: The target audio track is used to control the playback device in the second audio region, and the audio stream from the first application is played in a preset fade-in manner.

[0061] In this embodiment of the application, the fade-in mode refers to the playback mode in which the audio volume gradually increases from the initial volume to the normal playback volume. The preset fade-in mode is a pre-set fade-in duration and volume increase rhythm.

[0062] In this step, the playback device of the target audio zone can be controlled through the target audio track to start the playback of the switching application audio stream in a pre-set gradual manner.

[0063] For example, by using the target audio track of KuGou Music, the speaker in the passenger side screen can be controlled to play the audio stream of KuGou Music in a fade-in manner, which gradually increases from 0 to the original volume in 100 steps according to the preset total duration of 300ms.

[0064] This application embodiment uses a fade-in method to play the audio stream, avoiding auditory discomfort such as popping sounds and noises caused by sudden increases in the target audio range, making the audio playback startup process smoother and improving the user's auditory experience.

[0065] In yet another embodiment of this application, as Figure 5 As shown, before step S104, which uses the target audio track to play the audio stream of the first application, the method further includes: Step S501: Determine the second audio track corresponding to the first audio zone identifier of the first audio zone; In this embodiment of the application, the second audio track is an audio playback control unit that is bound to the first application identifier and adapted to the first audio zone identifier corresponding to the first audio zone, that is, the exclusive audio track of the first application when playing in the initial audio zone.

[0066] In this step, the dedicated audio playback control unit corresponding to the initial playback zone of the first application can be located.

[0067] For example, if the first application is Kugou Music, the first audio zone is the driver's side screen audio zone, and the dedicated audio playback control unit corresponding to Kugou Music when playing in the driver's side screen audio zone is determined as the second audio track.

[0068] Step S502: Instruct the second audio track to stop playing the audio stream from the first application in the playback device of the first audio zone according to a preset fade-out method.

[0069] In this embodiment of the application, the fade-out mode refers to the playback mode in which the audio volume gradually decreases from normal playback volume to stop. The preset fade-out mode is a pre-set fade-out duration and volume decrease rhythm.

[0070] In this step, the first application can be notified to terminate the audio playback in the initial audio zone using a pre-set fading method on its dedicated audio track.

[0071] For example: Notify the second audio track corresponding to KuGou Music to play the audio stream of KuGou Music in the speaker of the driver's side screen in a fade-out manner that gradually decreases from the original volume to 0 in 100 steps with a preset total duration of 300ms.

[0072] This application embodiment uses a fade-out method to end the audio playback of the initial audio zone before switching audio playback zones, avoiding auditory discomfort caused by sudden interruption of audio in the initial audio zone, making the transition of audio zone switching more natural and smooth, and further improving the user experience.

[0073] For ease of understanding, this application provides a complete flowchart of an audio switching method in practical application, as follows: The in-vehicle environment is set up with three independent audio zones and corresponding screens: the driver's screen is the first audio zone (initial playback audio zone), the passenger's screen is the second audio zone (target switching audio zone), and the rear screen is the third audio zone (currently playing audio from other applications); the first application is Kugou Music (initially playing in the first audio zone), and the second application is NetEase Cloud Music (continuously playing in the third audio zone); the screen-flying operation allows the user to move Kugou Music from the driver's screen to the passenger's screen by swiping their hand, triggering an audio zone switching event.

[0074] 1. Determine if a zone switching event is detected: The system first determines whether a screen-flying operation has been received to switch the audio stream of the first application from the first zone to the second zone. A zone switching event is a trigger event that causes an audio application to change its playback zone. The first application is the audio playback application that initiates the switch, the audio stream is the audio data it generates to be played, the first zone is the initial playback zone, and the second zone is the target playback zone. The core of this step is to identify the user-initiated audio application cross-zone migration interaction command. When the system receives a screen-flying operation from the first zone on the driver's screen to the second zone on the passenger's screen using KuGou Music, a zone switching event is triggered, clarifying the switching target and zone range.

[0075] 1. Determine if a zone switching event is detected: The system first determines whether a screen-flying operation has been received to switch the audio stream of the first application from the first zone to the second zone. A zone switching event is a trigger event that causes an audio application to change its playback zone. The first application is the audio playback application that initiates the switch, the audio stream is the audio data it generates to be played, the first zone is the initial playback zone, and the second zone is the target playback zone. The core of this step is to identify the user-initiated audio application cross-zone migration interaction command. When the system receives a screen-flying operation from the first zone on the driver's screen to the second zone on the passenger's screen using KuGou Music, a zone switching event is triggered, clarifying the switching target and zone range.

[0076] 2. Obtaining Key Identification Information: After detecting a zone switching event, the system obtains the first application identifier of the first application and the first zone identifier of the second zone. The first application identifier uniquely identifies the first application (e.g., the unique user identifier of Kugou Music), and the first zone identifier uniquely identifies the second zone (e.g., the exclusive identifier of the passenger screen's zone). This step provides the core basis for subsequent accurate audio track positioning. Specifically, the system monitors application activity changes through the audio focus zone setting module, obtains the unique user identifier of Kugou Music as the first application identifier using the package manager, and simultaneously collects the exclusive identifier of the second zone of the passenger screen as the first zone identifier.

[0077] 3. Determine the second audio track corresponding to the initial audio zone: The system first locates the second audio track corresponding to the first audio zone identifier of the first audio zone. The second audio track is an audio playback control unit bound to the first application identifier and adapted to the first audio zone, i.e., the dedicated carrier for the first application when playing in the initial audio zone. This step prepares for the audio fade-out processing of the initial audio zone, specifically determining the dedicated audio control unit corresponding to KuGou Music when playing in the first audio zone of the main screen as the second audio track.

[0078] 4. Initial Audio Fade-out Processing: The second audio track is instructed to stop playback of the audio stream from the first application on the playback device in the first audio zone according to a preset fade-out method. The fade-out method is a gradual decrease in volume from normal to a stop, with the preset fade-out duration being 300ms, divided into 100 steps, gradually decreasing from the original volume to 0. This step avoids auditory discomfort caused by sudden interruptions in the initial audio zone. Specifically, the playback thread performs fade-out processing on the audio data of the second audio track in Thread.cpp, gradually decreasing the volume of KuGou Music from its original value to 0 within 300ms, 100 times, and then terminating its playback in the first audio zone of the main screen.

[0079] 5. Determine the target audio track based on the identifier: Combine the first audio zone identifier and the first application identifier to filter the target audio track. The target audio track is an audio playback control unit that is bound to the first application identifier and adapted to the second audio zone. It is the core carrier connecting the first application audio stream and the playback device in the second audio zone. This step first filters out all candidate audio tracks adapted to the second audio zone (i.e., all audio control units that can be played in the passenger screen audio zone), and then selects the audio track that matches the first application identifier of KuGou Music from the candidate audio tracks to determine it as the target audio track.

[0080] 6. Detect other currently playing audio zones and applications: The system determines whether there are any non-switching-related audio zones playing audio streams from other applications. The second application is any audio playback application other than the first application (such as NetEase Cloud Music), and the third audio zone is any audio zone playing audio other than the first and second audio zones (such as the rear screen audio zone). This step is used to prevent switching operations from interfering with the playback of other applications. Specifically, it was detected that the third audio zone of the rear screen was playing an audio stream from NetEase Cloud Music.

[0081] 7. Obtain identification information of other applications and audio zones: If there are other applications and audio zones that are playing, obtain the second audio zone identifier of the third audio zone (the exclusive identifier of the rear screen audio zone) and the second application identifier of the second application (the unique user identifier of NetEase Cloud Music) to provide a basis for determining its exclusive audio track.

[0082] 8. Determine the first audio track corresponding to other applications: Based on the second audio zone identifier and the second application identifier, determine the corresponding first audio track. The first audio track is an audio playback control unit that is bound to the second application identifier and adapted to the third audio zone, which is the exclusive carrier for NetEase Cloud Music to play in the third audio zone of the rear screen.

[0083] 9. Trigger the audio stream refresh operation of the target audio track: Trigger the target audio track to perform an audio stream refresh operation corresponding to the first application identifier. The audio stream refresh operation updates the transmission path, playback configuration, and other parameters of the target audio track to adapt to the playback requirements of the second audio zone. This step simultaneously ensures that the first audio track is not triggered to perform this refresh operation. Specifically, the multi-zone audio stream routing module triggers a stream status refresh method with the first application identifier parameter to update the transmission path, playback format, and other parameters of the target audio track in Kugou Music, while not performing any refresh operation on the first audio track corresponding to NetEase Cloud Music, so that its original playback state is maintained without interruption.

[0084] 10. Target Audio Zone Fade-In Playback: The target audio track controls the playback device in the second audio zone (the speaker in the passenger-side screen area), playing the audio stream from the first application according to a preset fade-in method. The fade-in method is a gradual increase in volume from 0 to normal. The preset fade-in method is a 300ms total duration, divided into 100 gradual increases from 0 to the original volume. This step avoids popping sounds caused by sudden increases in the target audio zone. Specifically, after the target audio track is bound to the passenger-side screen speaker, the playback thread performs fade-in processing on the audio data of the target audio track in Thread.cpp, increasing the volume of KuGou Music from 0 to the original volume 100 times within 300ms. After completion, the flag is reset to maintain normal playback.

[0085] Through the above process, a smooth switching of KuGou Music from the first audio zone of the driver's screen to the second audio zone of the passenger's screen was achieved, with no stuttering or popping sounds during the switching process; at the same time, NetEase Cloud Music in the third audio zone of the rear screen continued to play without any interference, completely solving the audio abnormality problem when switching between multiple audio zones and improving the audio playback experience in the multi-screen interaction scenario of the car.

[0086] Due to the native Android workflow, in a multi-zone design, any change in any zone will trigger other zones to reposition the audio stream indiscriminately. This can cause temporary loss of sound or stuttering in other playing zones. To address this issue, this application implements UID flag recognition for the entire audio system, ensuring that when multiple zones and tracks are played, only the playback of tracks with the same UID is affected, without affecting the playback of other zones and unrelated UID tracks.

[0087] Additionally, in multi-zone audio, when a track trigger selects a new playback device, the volume of each device will vary, which greatly increases the probability of momentary popping sounds, affecting the user experience. Therefore, when the track trigger device plays the audio, an audio stream fade-out algorithm is implemented to give the corresponding audio data a slow increase effect, avoiding momentary popping sounds.

[0088] Specifically, in practical applications, the implementation of this application's embodiments relies on the following three main modules: AudioFocusManagerService, AudioPolicyService, and AudioFlinger. (See...) Figure 6 The functions and roles of the three are described below: AudioFocusManagerService module: When an application's audio zone change is detected, it detects the application's corresponding UID and uses this UID as a dynamic parameter for subsequent verification, then passes it to the multi-zone audio stream routing module.

[0089] The multi-zone audio stream routing module, AudioPolicyManagerService, controls the system's audio policy switching, directing all audio streams from different speaker devices. Upon receiving a zone switching command, it triggers system-wide AudioTrack audio stream detection and passes the identifier object UID to AudioFlinger as a control parameter, selecting the correct speaker path for sound output.

[0090] AudioFlinger, the audio data stream processing module for audio zones: This module manages the playback, pause, and data stream input to different devices for all AudioTracks, ensuring normal sound output. The actual controller Track of the AudioTrack determines whether to re-identify the corresponding playback device based on the UID passed from AudioPolicyService, and controls pause and playback operations, selecting the correct path for speaker output.

[0091] For ease of understanding, this application also provides a method for switching audio zones in practical applications, as follows: 1. Application of focus zone switching control module Step 1: A playback application is present in the Za audio zone, but not in the Zb audio zone. Define screen A as audio zone Za and screen B as audio zone Zb. When MPa is playing in Za, swipe the MPa application to Zb. The AudioFocusManagerService module listens for the application's movement from Za to Zb and retrieves the application's UID using the PackageManager method `getPackageUid` based on the application's package name. Then, it binds the application's UID and audio zone device information using the AudioPolicy interface `setUidDeviceAffinity` and sends this information to the multi-zone audio stream routing module `AudioPolicyManagerService`. This process is not handled in the native design and may result in popping sounds; therefore, fade-out and fade-in logic based on the UID is required.

[0092] Step 2: An app is playing in the Za audio zone, an app is playing in the Zb audio zone, but no app is playing in the Zc audio zone. At this point, move the app playing in the Za audio zone to Zc. The subsequent steps are the same as in Step 1. During this process, as the Za app is moved to Zc, following the native process, the device currently playing in Zb will also experience a brief pause. Therefore, for this process, it is necessary to control the audio stream zone changes of the corresponding Track based on the UID, without affecting the Tracks currently playing in other audio zones, such as... Figure 7 .

[0093] 2. Multi-zone audio stream control policy process AudioPolicyManagerService.

[0094] Step 1: When AudioPolicyManagerService receives a change in audio region, it reroutes the corresponding audio stream based on the corresponding UID, triggering the checkForDeviceAndOutputChanges logic to detect which devices have changed. Then, based on the changed devices, it selects the corresponding profile to route the audio stream.

[0095] Step 2: Based on whether there has been a device change, the AudioFlinger's `invalidateStream` method is triggered. The original method has no parameters and only triggers all subsequent tracks to redirect device selection. To specifically trigger changes to specific tracks, a solution needs to be developed for this method. A parameterized `invalidateStream` method needs to be designed, passing in the corresponding UID as a parameter to perform corresponding recognition for subsequent tracks, thus specifically addressing audio stream routing changes. Figure 8 .

[0096] 3. AudioFlinger's handling of the actual AudioTrack operation object, Track. Step 1: After receiving the corresponding invalidateStream, AudioFlinger triggers the invalidateTracks method for all PlaybackThreads in the system stack. This method does not have a UID parameter by default, so the UID parameter needs to be added during the customization process. In other words, the native design does not include UID for design identification; it needs to be added during the customization process. Add a UID design to the triggering process corresponding to AudioPolicyManagerService-AudiFlinger-PlaybackThread.

[0097] Step 2: Before triggering `invalidateTracks`, `PlaybackThread` verifies the identity of all Tracks in the object stack. If the Track's UID matches the passed-in UID, it considers that Track to be the one requiring audio region changes. The remaining Tracks retain their previous playback devices and continue calling the `invalidate` method of the Track that changed its audio region. This method re-triggers the corresponding audio stream device, selecting the correct channel for sound output. This ensures that the Track implementing the corresponding audio region change outputs sound without interrupting other Tracks whose playback devices remain unchanged. This resolves the issue of Android's native audio region changes causing all Tracks to pause and then resume indiscriminately, resulting in brief pauses or stuttering. Figure 9 .

[0098] The above are solutions for addressing stuttering and pauses during multi-range audio transitions. The following measures, following the above steps, involve further processing audio plosives to resolve the issue of sudden volume drops or increases during range switching between devices, where volume levels differ.

[0099] Step 1: When `invalidateTracks` is triggered in `PlaybackThread`, within the `Thread.cpp` method of `PlaybackThread`, while iterating through the corresponding track data, the UID is checked, and a fade-out effect is applied to the track's data. The volume is set to change every 300ms, divided into 100 steps, gradually decreasing the volume from its initial value to 0 to achieve a smooth audio decrease and avoid discomfort caused by sudden sound loss. Then, the `invalidateTracks` method of `PlaybackThread` is triggered again to select the device and re-route, such as... Figure 10 .

[0100] Step 2: The above process resolves the discomfort caused by sudden sound disappearance. After device selection, the sound might suddenly appear, causing a sudden increase in volume. Therefore, we also operate within PlaybackThread. After adding the target track to the new audio playback device (speaker) using the addTrack operation, we set a flag to 1. In Thread.cpp, we operate on the Track and verify the corresponding UID. For the Track's data, we perform a gradual increase process, setting the volume change process to 300ms, divided into 100 steps, gradually increasing the volume from 0 to the original volume. At this point, we set the flag to 2, maintaining the original volume output for subsequent data in this process. This achieves a basic fade-in effect, preventing a sudden increase in volume caused by a sound suddenly coming from another device with different volumes. Figure 11 .

[0101] In yet another embodiment of this application, as Figure 12 As shown, a voice zone switching device is also provided, including: The first determining module 11 is used to determine whether a zone switching event is detected, wherein the zone switching event is used to switch the audio stream of the first application from the first zone to the second zone; The acquisition module 12 is used to acquire the first application identifier of the first application and the first audio zone identifier of the second audio zone if an audio zone switching event is detected. The second determining module 13 is used to determine the target audio track based on the first audio region identifier and the first application identifier; The control module 14 is used to control the playback of the audio stream from the first application using the target audio track.

[0102] In another embodiment of this application, an electronic device is also provided, including a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus. Memory, used to store computer programs; When a processor executes a program stored in memory, it implements the audio zone switching method described in any of the foregoing method embodiments.

[0103] The electronic device provided in this invention allows the processor to execute a program stored in a memory, determine the target audio track based on the first application identifier of the switched application and the first audio zone identifier, and control the playback of the audio stream of the first application using the target audio track. This ensures that only the target audio track corresponding to the first application identifier and the first audio zone identifier plays the audio stream of the first application, while the playback of audio streams of other tracks is not affected. This avoids playback anomalies such as pauses or interruptions in other audio tracks, ensuring the continuity of audio stream playback in other tracks. Furthermore, it enables directional switching of audio applications in different audio zones, ensuring that audio is accurately output in the target audio zone, avoiding audio stream playback anomalies, and improving the accuracy of audio playback and user experience in multi-zone interactive scenarios.

[0104] The communication bus 1140 mentioned in the above-mentioned electronic device can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. This communication bus 1140 can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 13 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.

[0105] The communication interface 1120 is used for communication between the above-mentioned electronic device and other devices.

[0106] The memory 1130 may include random access memory (RAM) or non-volatile memory, such as at least one disk storage device. Optionally, the memory may also be at least one storage device located remotely from the aforementioned processor.

[0107] The processor 1110 mentioned above can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.

[0108] In another embodiment of this application, a computer-readable storage medium is also provided, on which a program for a register switching method is stored, wherein when the program for the register switching method is executed by a processor, the program implements the steps of the register switching method described in any of the foregoing method embodiments.

[0109] It should be noted that, in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0110] The above description is merely a specific embodiment of the present invention, enabling those skilled in the art to understand or implement the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the present invention is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features claimed herein.

Claims

1. A method for switching audio registers, characterized in that, include: Determine whether a zone switching event is detected, the zone switching event being used to switch the audio stream of the first application from the first zone to the second zone; If a zone switching event is detected, obtain the first application identifier of the first application and the first zone identifier of the second zone; The target audio track is determined based on the first audio region identifier and the first application identifier; The target audio track is used to control the playback of the audio stream from the first application.

2. The audio zone switching method according to claim 1, characterized in that, Determining the target audio track based on the first register identifier and the first application identifier includes: Identify multiple candidate audio tracks corresponding to the first audio region identifier; The candidate audio track corresponding to the first application identifier among the multiple candidate audio tracks is determined as the target audio track.

3. The audio zone switching method according to claim 1, characterized in that, Controlling the playback of an audio stream from the first application using the target audio track includes: Trigger the target audio track to perform an audio stream refresh operation corresponding to the first application identifier; The target audio track is used to control the playback device in the second audio region to play the audio stream corresponding to the first application identifier.

4. The voice zone switching method according to claim 3, characterized in that, The method further includes: Determine if a third audio region exists that is playing an audio stream from a second application; If there is a third audio region that is playing an audio stream from the second application, obtain the second audio region identifier of the third audio region and the second application identifier of the second application; Determine the first audio track corresponding to the second audio region identifier and the second application identifier; While triggering the target audio track to perform an audio stream refresh operation corresponding to the first application identifier, the first audio track is not triggered to perform an audio stream refresh operation corresponding to the first application identifier, so that the first audio track continues to play the audio stream from the second application without interruption.

5. The voice zone switching method according to claim 3, characterized in that, Using the target audio track to control the playback device in the second audio region, playing the audio stream corresponding to the first application identifier, includes: The target audio track is used to control the playback device in the second audio region, and the audio stream from the first application is played in a preset fade-in manner.

6. The audio zone switching method according to claim 1, characterized in that, Before playing the audio stream of the first application using the target audio track, the method further includes: Determine the second audio track corresponding to the first audio region identifier of the first audio region; The system notifies the second audio track in the playback device of the first audio zone to end the playback of the audio stream from the first application according to a preset fade-out method.

7. The audio zone switching method according to claim 1, characterized in that, Determine whether a zone switching event was detected, including: Determine whether a screen-flying operation is received to switch the audio stream of the first application from the first audio region to the second audio region; If the screen-flying operation is received, the audio zone switching event is triggered. The audio zone switching event is used to switch the audio stream of the first application from the first audio zone to the second audio zone.

8. A frequency range switching device, characterized in that, include: The first determining module is used to determine whether a zone switching event is detected, wherein the zone switching event is used to switch the audio stream of the first application from the first zone to the second zone; The acquisition module is used to acquire the first application identifier of the first application and the first audio zone identifier of the second audio zone if an audio zone switching event is detected. The second determining module is used to determine the target audio track based on the first audio region identifier and the first application identifier; A control module is used to control the playback of an audio stream from the first application using the target audio track.

9. An electronic device, characterized in that, It includes a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus; Memory, used to store computer programs; A processor, when executing a program stored in memory, implements the audio zone switching method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a program for a register switching method, which, when executed by a processor, implements the steps of the register switching method according to any one of claims 1-7.