Audio output control method and related equipment

By establishing a correspondence between the audio playback device and the target audio source in the Android system, identifying and transmitting the audio track input, the problem of single audio output in the existing technology is solved, and independent audio transmission and processing in multi-device collaborative scenarios is realized.

CN120658985AActive Publication Date: 2025-09-16SHENZHEN FEASYCOM TECH CO LTD
View PDF 8 Cites 0 Cited by

Patent Information

Application Number
CN202511154887.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-08-18
Publication Date
2025-09-16
Estimated Expiration
2045-08-18

AI Technical Summary

Technical Problem

The existing Android system audio framework only supports single-channel audio output and cannot meet the complex in-vehicle audio transmission requirements in multi-device collaboration scenarios.

Method used

Construct an audio output control method that establishes a correspondence between audio playback devices and target audio sources, identifies audio track input, and transmits it to the corresponding device for output, supporting independent processing and transmission of multiple audio sources.

Benefits of technology

It realizes independent processing and transmission of multiple audio sources, avoids mixing interference between audio sources, and meets the audio transmission needs in multi-device collaboration scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120658985A_ABST
    Figure CN120658985A_ABST
Patent Text Reader

Abstract

The invention relates to an audio output control method and related equipment. The control method is applied to the terminal equipment, and comprises the following steps: establishing a corresponding relationship between first audio playing equipment and a first target sound source; obtaining audio track inputs corresponding to all sound sources in the terminal equipment, and identifying all the audio track inputs to obtain a first target audio track input corresponding to the first target sound source according to the corresponding relationship; and transmitting the first target audio track and inputting the first target audio track to the first audio playing device according to the corresponding relationship, so as to output audio data corresponding to the first target sound source through the first audio playing device. According to the invention, independent processing and transmission of audios corresponding to a plurality of sound sources can be realized, and sound mixing interference among the sound sources is avoided.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of audio transmission, and more particularly to an audio output control method and related equipment. Background Art

[0002] With the advancement of modern technology, audio transmission technology is playing an increasingly important role in in-car entertainment systems, wireless audio devices, and multi-device collaboration scenarios. Especially in driving environments, users have higher expectations for audio transmission quality, flexibility, and multi-device support. However, due to design limitations, the existing Android audio framework only supports a single audio output channel, which cannot meet the increasingly complex needs of in-car audio transmission. Summary of the Invention

[0003] The technical problem to be solved by the present invention is to provide an audio output control method and related equipment in response to some of the above technical defects in the prior art.

[0004] The technical solution adopted by the present invention to solve the technical problem is to construct an audio output control method, which is applied to a terminal device. The control method includes: Establishing a correspondence between a first audio playback device and a first target audio source; Acquire audio track inputs corresponding to all audio sources in the terminal device, identify all audio track inputs to acquire a first target audio track input corresponding to the first target audio source according to the corresponding relationship; The first target audio track is transmitted and input to the first audio playback device according to the corresponding relationship, so that the audio data corresponding to the first target audio source is output through the first audio playback device.

[0005] Preferably, in an embodiment of the audio output control method of the present invention, the control method further includes: Obtain the second target audio track input corresponding to the second target audio source from the audio track input corresponding to all audio sources, mix the second target audio track input based on AudioMixer, and input it to the second audio playback device, so as to output the audio data corresponding to the second target audio source through the second audio playback device.

[0006] Preferably, in an embodiment of the audio output control method of the present invention, the second target audio track input includes: One or more of the remaining track inputs after removing the first target track input from all track inputs; and / or At least one of said first target audio tracks is input.

[0007] Preferably, in an embodiment of the audio output control method described in the present invention, the number of the first audio playback devices is one or more, the number of the first target sound sources is one or more, and the corresponding relationship includes the corresponding relationship between one or more first audio playback devices and one or more first target sound sources.

[0008] Preferably, in an embodiment of the audio output control method of the present invention, the first audio playback device is a Bluetooth device; and the step of transmitting the first target audio track to the first audio playback device according to the corresponding relationship includes: The first target audio track is transmitted to the Bluetooth protocol stack via an IPC link corresponding to the Bluetooth device, so as to distribute the first target audio track to the Bluetooth device according to the corresponding relationship via the Bluetooth protocol stack.

[0009] Preferably, in an embodiment of the audio output control method of the present invention, establishing a correspondence between the first audio playback device and the first target sound source includes: When the first audio playback device is connected to the terminal device, a correspondence between the first audio playback device and the first target sound source is established according to the identification information of the first audio playback device and the APP corresponding to the first target sound source.

[0010] Preferably, in an embodiment of the audio output control method of the present invention, establishing a correspondence between the first audio playback device and the first target sound source includes: When the APP corresponding to the first target sound source is triggered, a correspondence between the first audio playback device and the first target sound source is set.

[0011] Preferably, in an embodiment of the audio output control method of the present invention, the step of identifying all audio track inputs to obtain a first target audio track input corresponding to the first target audio source according to the corresponding relationship comprises: Obtain the application UIDs corresponding to all audio track inputs to obtain the first target audio track input according to the application UIDs corresponding to the audio track inputs and the corresponding relationship, wherein the corresponding relationship includes the application UID corresponding to the first target audio source.

[0012] The present invention also constructs an electronic device, which includes a module for executing the method described above.

[0013] The present invention also constructs an electronic device, comprising a memory and a processor; The memory is used to store computer programs; The processor is configured to execute the computer program to implement the method described above.

[0014] The audio output control method and related equipment of the present invention have the following beneficial effects: independent processing and transmission of audio corresponding to multiple audio sources can be achieved, avoiding mixing interference between audio sources. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] The present invention will be further described below with reference to the accompanying drawings and embodiments, in which: Figure 1 This is a flowchart of an embodiment of an audio output control method of the present invention; Figure 2 is a flowchart of another embodiment of an audio output control method of the present invention; Figure 3 This is a signal flow diagram of an embodiment of an audio output control method of the present invention; Figure 4 It is a signal flow diagram of another embodiment of an audio output control method of the present invention. DETAILED DESCRIPTION

[0016] In order to have a clearer understanding of the technical features, purposes and effects of the present invention, specific embodiments of the present invention are now described in detail with reference to the accompanying drawings.

[0017] like Figure 1 As shown, an embodiment of an audio output control method of the present invention is shown. The method process is mainly used in terminal devices to achieve the relative independence of audio corresponding to multiple applications such as APPs in the terminal device during playback. Figure 1 In an embodiment of an audio output control method of the present invention shown, the method includes the following steps: S1. Establishing a correspondence between a first audio playback device and a first target sound source; S2. Obtaining audio track inputs corresponding to all sound sources in the terminal device, identifying all audio track inputs to obtain a first target audio track input corresponding to the first target sound source according to the correspondence; S3. Transmitting the first target audio track input to the first audio playback device according to the correspondence, so as to output the audio data corresponding to the first target sound source through the first audio playback device.

[0018] In step S1, the first audio playback device is used to play the specific audio in the terminal device, that is, the audio corresponding to the first target audio source, so that the first target audio source can be played directly through the first audio playback device without any mixing operation, thereby ensuring the independence of the first target audio source playback process. During the entire process, it is necessary to first set the correspondence between the first audio playback device and the first target audio source. It can be understood that the audio source in the terminal device generates corresponding audio data based on the use of the APP (hereinafter referred to as APP sound), that is, the audio source in the terminal device forms a one-to-one correspondence with the APP.

[0019] Based on step S1, in one embodiment, establishing a correspondence between the first audio playback device and the first target sound source includes: when the first audio playback device is connected to the terminal device, establishing a correspondence between the first audio playback device and the first target sound source based on the identification information of the first audio playback device and the app corresponding to the first target sound source. Based on this embodiment, when the first audio playback device establishes a communication connection with the terminal device, a correspondence between the first audio playback device and the app on the terminal device is established. Because the sound source corresponds to the app, a correspondence between the first audio playback device and the first target sound source can be obtained. For example, when the first audio playback device is a headset, when the headset is connected to the terminal device, a prompt message can be generated based on all apps installed on the terminal device, allowing the user to select the app sound that the headset can play. This can be used to obtain a correspondence between the first audio playback device and the selected app on the terminal device, which can be further understood as obtaining a correspondence between the first audio playback device and the first target sound source. This process can establish a relatively stable correspondence between a specific user and a specific app, thereby reducing the user's operation process. In one embodiment, the identification information of the first audio playback device can be the device information of the audio playback device. For example, when the first audio playback device is a Bluetooth device, the identification information may be the MAC address of the Bluetooth device.

[0020] In one embodiment, a correspondence between the first audio playback device and the first target sound source can also be established based on the location identification information of the first audio playback device. This allows for a correspondence between a user in a specific location and a specific app. For example, a correspondence can be established between a user in the driver's seat and a road navigation app, ensuring that the user in the driver's seat can hear the sound corresponding to the navigation app.

[0021] Based on step S1, in another embodiment, establishing a correspondence between the first audio playback device and the first target sound source includes: setting the correspondence between the first audio playback device and the first target sound source when the APP corresponding to the first target sound source is triggered. That is, when the APP in the terminal device is triggered and started, the user can manually set the correspondence between the APP and the first audio playback device. Because the sound source corresponds to the APP, the correspondence between the first audio playback device and the first target sound source can be obtained. In this example, a prompt message can be generated when the APP is triggered, and the user can determine whether the APP corresponds to the first target sound source, and establish the correspondence between the APP and the first audio playback device based on the first audio playback device connected to the terminal device, and then obtain the correspondence between the first audio playback device and the first target sound source. In a specific embodiment, when a certain APP is triggered for the first time, the correspondence between the APP and the earphone can be set according to the connection status between the terminal device and the earphone, that is, the user can decide whether the sound corresponding to the APP is output by the earphone or which earphone. Through this process, the process of establishing the correspondence between the first audio playback device and the first target sound source can be made more flexible.

[0022] In one embodiment, the correspondence between the first audio playback device and the first target sound source can also be obtained based on the historical settings. That is, after the correspondence between the first audio playback device and the first target sound source is set based on the above process, when the application on the first audio playback device and the terminal device has not changed, the latest correspondence between the first audio playback device and the first target sound source can be obtained based on the historically set correspondence between the first audio playback device and the first target sound source. In one embodiment, a prompt message can also be generated at an appropriate time to prompt the user whether the above historical settings need to be adopted, or when the APP on the first audio playback device or the terminal device changes, a prompt to update the above historical settings can be generated.

[0023] Based on step S2, in the terminal device, each APP can implement the application layer to send audio data to the audio system through the Audio track, that is, the audio data corresponding to each sound source forms a track input through the Audio track to be input into AudioFlinger. Before the AudioMixer in AudioFlinger performs mixing, the first target track input is identified. Because the first target sound source is equivalent to being known, the first target sound source and the track input are in a one-to-one correspondence. Therefore, the first target track input can be identified according to the set correspondence.

[0024] Based on step S3, after obtaining the first target audio track input, a data transmission relationship can be established between the first target audio track input and the first audio playback device according to the established correspondence between the first audio playback device and the first target sound source, and finally the audio data corresponding to the first target sound source can be output through the first audio playback device.

[0025] like Figure 2 As shown, in one embodiment of the audio output control method of the present invention, it also includes: S4, obtaining the second target audio track input corresponding to the second target audio source from the audio track input corresponding to all audio sources, mixing the second target audio track input based on AudioMixer and inputting it into the second audio playback device, so as to output the audio data corresponding to the second target audio source through the second audio playback device. Specifically, while the audio data of some audio sources are played separately through the first audio playback device, the audio data corresponding to all audio sources can also be judged, and the second target audio track input corresponding to the second target audio source can be identified. All the second target audio track inputs are mixed through AudioMixer, and finally the audio data of the audio source corresponding to the second target audio track input, i.e., the second target audio source, is played through the second audio playback device.

[0026] In which, there may also be a corresponding relationship between the second target sound source and the second audio playback device. This corresponding relationship can be established with reference to the process of establishing the corresponding relationship between the first audio playback device and the first target sound source. For example, in one embodiment, when the second audio playback device is connected to the terminal device, a corresponding relationship between the second audio playback device and the second target sound source is established based on the identification information of the second audio playback device and the APP corresponding to the second target sound source. That is, in this embodiment, when the second audio playback device establishes a communication connection with the terminal device, a corresponding relationship between the second audio playback device and the APP in the terminal device is established. Because the sound source corresponds to the APP, the corresponding relationship between the second audio playback device and the second target sound source can be obtained. In another embodiment, the corresponding relationship between the second audio playback device and the second target sound source is set when the APP corresponding to the second target sound source is triggered. That is, when the APP in the terminal device is triggered to start, the user can manually set the corresponding relationship between the APP and the second audio playback device. Because the sound source corresponds to the APP, the corresponding relationship between the second audio playback device and the second target sound source can be obtained. In a specific embodiment, a prompt message can be generated when the APP is triggered, and the user determines whether the APP corresponds to the second target sound source, and establishes a correspondence between the APP and the second audio playback device based on the second audio playback device connected to the terminal device, and then obtains the correspondence between the second audio playback device and the second target sound source. In another embodiment, the correspondence between the second audio playback device and the second target sound source can also be obtained based on historical settings. That is, after the correspondence between the second audio playback device and the second target sound source is set based on the above process, when the second audio playback device and the application on the terminal device have not changed, the latest correspondence between the second audio playback device and the second target sound source can be obtained based on the historically set correspondence between the second audio playback device and the second target sound source. In one embodiment, a prompt message can also be generated at an appropriate time to prompt the user whether the above historical settings need to be adopted, or when the APP on the second audio playback device or the terminal device changes, the above historical settings can be updated.

[0027] Optionally, in one embodiment of the audio output control method of the present invention, the second target audio track input includes: one or more of the remaining audio track inputs after the first target audio track input is eliminated from all audio track inputs; and / or at least one first target audio track input. Specifically, all audio sources can be played separately, that is, after the audio data corresponding to part of the audio sources, i.e., the audio data corresponding to the first target audio track input, are played through the first audio playback device, one or more of the audio data corresponding to the remaining audio sources can be mixed by AudioMixer and played through the second audio playback device. It is also possible that during the above-mentioned mixing process, part or all of the audio data corresponding to the first target audio track input can be mixed by AudioMixer and played through the second audio playback device.

[0028] In one embodiment, all audio track inputs are identified to obtain the first target audio track input corresponding to the first target audio source according to the corresponding relationship; including: obtaining the application UID corresponding to all audio track inputs to obtain the first target audio track input according to the application UID corresponding to the audio track input and the corresponding relationship, wherein the corresponding relationship includes the application UID corresponding to the first target audio source. That is, based on the above process, when establishing the corresponding relationship between the first audio playback device and the first target audio source, the application UID corresponding to the first target audio source is obtained according to the APP corresponding to the first target audio source, so as to establish the corresponding relationship between the first audio playback device and the first target audio source through the application UID corresponding to the first target audio source. In the process of obtaining the first target audio track input based on the audio track input corresponding to all audio sources, the first target audio track input can be selected from all audio track inputs according to the audio track input corresponding to the first target audio source, that is, the application UID of the first target audio track input.

[0029] In a specific embodiment, the number of the first audio playback devices is one or more, and the number of the first target sound sources is one or more; the correspondence between the first audio playback devices and the first target sound sources includes the correspondence between one or more first audio playback devices and one or more first target sound sources.

[0030] That is, the first audio playback device connected to the terminal device can be one or more, and the number of first target audio sources can be one or more. When there is one first audio playback device and one first target audio source, the first target audio source is directly selected for the first audio playback device, thereby obtaining a correspondence between the first audio playback device and the first target audio source. When there is one first audio playback device and multiple first target audio sources, the audio data corresponding to the multiple first target audio sources can be output simultaneously through the first audio playback device. When there is one first target audio source and multiple first audio playback devices, the audio data corresponding to the multiple first target audio sources can be output through one or more first audio playback devices. When there are multiple first target audio sources and multiple first audio playback devices, the audio data corresponding to one or more first target audio sources can be set to be output simultaneously through the same first audio playback device, that is, some of the first audio playback devices can be set to play the audio data corresponding to one or more first target audio sources simultaneously. For example, the number of apps installed on the terminal device can be multiple, and the sounds of some of the apps can be played through the same headset, that is, the sounds of multiple apps can be processed, such as through Bluetooth mixing, and then output to the headset. It is also possible to set the audio data corresponding to multiple first target sound sources to be played through different first audio playback devices respectively, that is, to set some first audio playback devices to play the audio data corresponding to different first target sound sources respectively. For example, there may be multiple APPs installed on the terminal device, and each APP sound can be played through different headphones, that is, multiple different headphones can play different APP sounds respectively. In a specific embodiment, multiple APP sounds can correspond to multiple headphones respectively, for example, one APP corresponds to headphone A, and another APP corresponds to headphone B.

[0031] In one embodiment, the first audio playback device is a Bluetooth device; transmitting the first target audio track input to the first audio playback device according to the corresponding relationship includes: transmitting the first target audio track input to the Bluetooth protocol stack through the IPC link corresponding to the Bluetooth device, so as to distribute the first target audio track input to the Bluetooth device according to the corresponding relationship through the Bluetooth protocol stack. Specifically, the first audio playback device is a Bluetooth device that establishes a communication connection with the terminal device, and the Bluetooth device can be a Bluetooth headset or a Bluetooth speaker, etc. The Bluetooth device can establish a corresponding relationship with the first target audio source according to its corresponding device identifier, such as a MAC address. After obtaining the first target audio track input, all the first target audio track inputs are transmitted to the Bluetooth protocol stack in the terminal device through the IPC link corresponding to the Bluetooth device in the terminal device in AudioFlinger, and the first target audio track input is distributed through the Bluetooth protocol stack according to the corresponding relationship between the first audio playback device and the first target audio source, so that the first audio playback device plays the audio data corresponding to the corresponding first target audio source.

[0032] like Figure 3 As shown, in one embodiment, some of the audio track inputs corresponding to the APP enter the Bluetooth protocol stack before mixing and are output through the Bluetooth protocol stack. After all the audio tracks are input into the AudioMixer for mixing, the mixed audio output is transmitted to the AudioPolicy. The AudioPolicyManager selects the appropriate output device according to the current audio policy (such as device connection status, audio type, user settings, etc.).

[0033] like Figure 4 As shown, in one embodiment, the audio track input entering the Bluetooth protocol stack is distributed to the corresponding Bluetooth device (different headphones) for output through the Bluetooth protocol stack.

[0034] In addition, an electronic device of the present invention has the function of implementing the corresponding steps performed in the above-mentioned method. Each function can be implemented by hardware, or by hardware executing corresponding software implementations. The corresponding hardware or software includes one or more modules corresponding to the above-mentioned functions. That is, the steps of the above-mentioned method are respectively performed by one or more modules. The specific coordination operations between the various modules can be referred to the specific process of the above-mentioned method and will not be repeated here.

[0035] In addition, an electronic device of the present invention may further include a memory and a processor; the memory is used to store a computer program; the processor is used to execute the computer program to implement the above method. Specifically, according to an embodiment of the present invention, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present invention includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed by an electronic device and, when executed, performs the above functions defined in the method of the embodiment of the present invention. The electronic device in the present invention may be a terminal such as a notebook, desktop, tablet computer, smart phone, or a server.

[0036] The electronic device may be an in-vehicle device. Based on the above embodiment, the in-vehicle device can achieve the following functions: separate driver and passenger audio, allowing the driver to receive navigation audio through a Bluetooth headset while the passenger enjoys high-quality music playback through the in-vehicle Bluetooth speaker. It can also support simultaneous connection to multiple Bluetooth devices, such as the driver's mobile phone, the passenger's tablet computer, and the in-vehicle speaker, to achieve independent transmission of multiple audio channels.

[0037] It is understandable that the above embodiments only express the preferred implementation modes of the present invention, and the description thereof is relatively specific and detailed, but it cannot be understood as limiting the patent scope of the present invention. It should be pointed out that for ordinary technicians in this field, without departing from the concept of the present invention, the above technical features can be freely combined, and several deformations and improvements can be made, all of which fall within the scope of protection of the present invention. Therefore, all equivalent changes and modifications made to the scope of the claims of the present invention should fall within the scope of coverage of the claims of the present invention.

Claims

1. An audio output control method, characterized in that: Applied to a terminal device, the control method includes: Establishing a correspondence between a first audio playback device and a first target audio source; Acquire audio track inputs corresponding to all audio sources in the terminal device, identify all audio track inputs to acquire a first target audio track input corresponding to the first target audio source according to the corresponding relationship; The first target audio track is transmitted and input to the first audio playback device according to the corresponding relationship, so that the audio data corresponding to the first target audio source is output through the first audio playback device.

2. The audio output control method according to claim 1, wherein: The control method further includes: Obtain the second target audio track input corresponding to the second target audio source from the audio track input corresponding to all audio sources, mix the second target audio track input based on AudioMixer, and input it to the second audio playback device, so as to output the audio data corresponding to the second target audio source through the second audio playback device.

3. The audio output control method according to claim 2, wherein: The second target audio track input includes: One or more of the remaining track inputs after removing the first target track input from all track inputs; and / or At least one of said first target audio tracks is input.

4. The audio output control method according to claim 1, wherein: The number of the first audio playback devices is one or more, and the number of the first target sound sources is one or more; The corresponding relationship includes a corresponding relationship between one or more first audio playback devices and one or more first target audio sources.

5. The audio output control method according to claim 1, wherein: The first audio playback device is a Bluetooth device; and the step of transmitting the first target audio track to the first audio playback device according to the corresponding relationship includes: The first target audio track is transmitted to the Bluetooth protocol stack via an IPC link corresponding to the Bluetooth device, so as to distribute the first target audio track to the Bluetooth device according to the corresponding relationship via the Bluetooth protocol stack.

6. The audio output control method according to claim 1, wherein: The establishing of a correspondence between the first audio playback device and the first target sound source includes: When the first audio playback device is connected to the terminal device, a correspondence between the first audio playback device and the first target sound source is established according to the identification information of the first audio playback device and the APP corresponding to the first target sound source.

7. The audio output control method according to claim 1, wherein: The establishing of a correspondence between the first audio playback device and the first target sound source includes: When the APP corresponding to the first target sound source is triggered, a correspondence between the first audio playback device and the first target sound source is set.

8. The audio output control method according to claim 6 or 7, characterized in that: The step of identifying all audio track inputs to obtain a first target audio track input corresponding to the first target audio source according to the corresponding relationship comprises: Obtain the application UIDs corresponding to all audio track inputs to obtain the first target audio track input according to the application UIDs corresponding to the audio track inputs and the corresponding relationship, wherein the corresponding relationship includes the application UID corresponding to the first target audio source.

9. An electronic device, characterized in that: The electronic device comprises: a module for executing the method according to any one of claims 1 to 8.

10. An electronic device, characterized in that: including memory and processor; The memory is used to store computer programs; The processor is configured to execute the computer program to implement the method according to any one of claims 1 to 8.

Citation Information

Patent Citations

  • Audio playing method, device and terminal

    CN102768846A

  • Song playing method and device

    CN103578514A

  • Audio processing method and device

    CN108140013A

  • Audio output method and electronic equipment

    CN112286481A

  • Audio playing method and device, terminal equipment and storage medium

    CN113821189A