Audio signal processing method and device and electronic equipment

By encoding and decoding the N-channel audio signal, the target speaker is determined, which solves the problem that the speaker device cannot play different audio simultaneously, and realizes the simultaneous playback of different audio signals, meeting the needs of multiple audio signals.

CN119181368APending Publication Date: 2024-12-24BEIJING XIAOMI MOBILE SOFTWARE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310748228.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-06-21
Publication Date
2024-12-24

AI Technical Summary

Technical Problem

Existing speaker devices only support homologous sound sharing and cannot support heterologous audio sharing, resulting in the inability to play different audio signals at the same time. For example, smartphones cannot play music and parent-child educational audio through headphones at the same time.

Method used

By encoding N-channel audio signals, the target speaker associated with each audio signal is determined, and audio encoded data is sent to the target speaker for decoding and playing, achieving simultaneous playback of heterologous audio. The specific steps include obtaining the target application identifier carried by the audio signal, querying the mapping relationship between the application identifier and the speaker identifier, determining the target speaker associated with the audio signal, and encoding and playing according to the encoding parameters and sound output format supported by the speaker.

Benefits of technology

It realizes simultaneous playback of multiple audio signals sent by the same device, meets the needs of different users, reduces redundancy in the audio signal, and retains the main audio information.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119181368A_ABST
    Figure CN119181368A_ABST
Patent Text Reader

Abstract

The invention provides an audio signal processing method and device and electronic equipment, and relates to the technical field of audio processing. The audio signal processing method comprises the steps that N paths of audio signals are coded to obtain respective audio coded data, and the value of N is an integer larger than or equal to 2; determining a target loudspeaker associated with each path of audio signal; and for each path of audio signal, sending the audio coding data of the audio signal to the target loudspeaker associated with the audio signal for decoding and playing. According to the embodiment of the invention, multiple paths of audio signals in the equipment can be played at the same time, and the problem that the existing audio cannot be played from different sources is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of audio processing technology, and in particular to an audio signal processing method, device and electronic device. Background Art

[0002] Current speaker devices only support the same-source sound sharing function, and cannot support heterogeneous audio sharing. Heterogeneous audio can be understood as different audio. For example, a smartphone cannot support two headphones playing different audio, such as playing music and parent-child education audio respectively. Summary of the invention

[0003] Embodiments of the present application provide an audio signal processing method, device, and electronic device.

[0004] The first embodiment of the present application provides an audio signal processing method, including:

[0005] Encode N audio signals to obtain respective audio encoding data, where the value of N is an integer greater than or equal to 2;

[0006] Determine the target speaker associated with each audio signal;

[0007] For each audio signal, the audio encoding data of the audio signal is sent to a target speaker associated with the audio signal for decoding and playback.

[0008] In one embodiment of the present application, determining the target speaker associated with each audio signal includes:

[0009] Obtaining a target application identifier carried by the audio signal;

[0010] The mapping relationship between the application identifier and the speaker identifier is queried to obtain a speaker that has a mapping relationship with the target application identifier as the target speaker associated with the audio signal.

[0011] In one embodiment of the present application, when each audio signal corresponds to an encoder, encoding the N audio signals to obtain respective audio encoding data includes:

[0012] Each audio signal is input into a corresponding encoder for encoding, and the encoder obtains the respective audio encoding data from the input audio signal.

[0013] In one embodiment of the present application, when M audio signals among the N audio signals use one encoder, M is an integer greater than or equal to 2, and M≤N, wherein encoding the N audio signals to obtain respective audio encoding data includes:

[0014] Buffering the M channels of audio signals into a first buffer area;

[0015] Input the M channels of audio signals in the first buffer area into the multiplexed encoder one by one according to the first-in-first-out principle, and the encoder encodes the input audio signals to obtain the respective audio encoding data;

[0016] The remaining (NM) audio signals of the unmultiplexed encoders are input into the corresponding encoders, and the encoders encode the input audio signals to obtain the respective audio encoding data.

[0017] In one embodiment of the present application, the step of buffering the M audio signals into a first buffer area includes:

[0018] Generate a packet header mark for each audio signal in the M audio signals, and add the packet header mark to the header of the audio signal, wherein the packet header mark is used to distinguish the audio signals in the M audio signals;

[0019] Each audio signal carrying the packet header mark in the M audio signals is cached in the first cache area.

[0020] In one embodiment of the present application, encoding N channels of audio signals to obtain respective audio encoding data includes:

[0021] For each audio signal, determining encoding parameters supported by a target speaker associated with the audio signal;

[0022] The encoder encodes the input audio signal according to the encoding parameters supported by the target speaker to obtain the audio encoding data.

[0023] In one embodiment of the present application, encoding the input audio signal by the encoder to obtain the audio encoding data includes:

[0024] Determining a sound output format corresponding to the audio signal;

[0025] Each audio signal is input into a corresponding encoder, and the encoder encodes the audio signal according to the encoding parameters and outputs corresponding audio encoding data according to the sound output format.

[0026] In one embodiment of the present application, in a scenario where L audio signals among the N audio signals are shared to two or more speakers, L is an integer greater than or equal to 2, and L≤N, wherein the N audio signals are encoded to obtain respective audio encoding data, including:

[0027] Input each shared audio signal in the L audio signals into a corresponding encoder for encoding, so as to obtain shared audio encoding data corresponding to the shared audio signal;

[0028] The sending the audio encoding data of the audio signal to the target speaker associated with the audio signal for decoding and playing includes:

[0029] Determine the number of speakers to which the shared audio signal is shared;

[0030] The shared audio encoding data is copied according to the number of the speakers, and the audio encoding data is sent to each shared speaker.

[0031] In one embodiment of the present application, encoding N channels of audio signals to obtain respective audio encoding data includes:

[0032] Determine the playback channel to which the target speaker associated with each audio signal belongs;

[0033] For each audio signal, the audio signal is input into a corresponding encoder, and the encoder encodes the input audio signal according to the encoding parameters corresponding to the playback channel to obtain the corresponding audio encoding data.

[0034] In one embodiment of the present application, when K of the N audio signals share the same communication component, K is an integer greater than or equal to 2, and K≤N, wherein the sending of the audio coded data of the audio signal to the target speaker associated with the audio signal for decoding and playback includes:

[0035] Cache the audio coding data corresponding to each audio signal in the K audio signals in the second buffer area of ​​the shared communication component;

[0036] Sending the K-channel audio encoding data in the second buffer area to the target speakers associated with the K-channel audio signals respectively through the common communication component according to the first-in-first-out principle, and the target speakers associated with the K-channel audio signals respectively are connected to the terminal device through the common communication component;

[0037] The audio encoding data of the remaining (NK) audio signals that do not share the same communication component are sent to the target speakers associated with the (NK) audio signals through their respective corresponding communication components, and the target speakers associated with the (NK) audio signals are connected to the terminal device through their respective communication components.

[0038] In one embodiment of the present application, when each of the N audio signals corresponds to a different communication component, sending the audio encoding data of the audio signal to a target speaker associated with the audio signal for decoding and playing includes:

[0039] Each of the N audio signals is sent to the target speakers associated with each of the N audio signals through the corresponding communication components.

[0040] The second aspect of the present application provides an audio signal processing device, including:

[0041] An encoding module, used for encoding N audio signals to obtain respective audio encoding data, where the value of N is an integer greater than or equal to 2;

[0042] A speaker acquisition module is used to determine the target speaker associated with each audio signal;

[0043] The playing module is used to send the audio encoding data of each audio signal to the target speaker associated with the audio signal for decoding and playing.

[0044] In one embodiment of the present application, the speaker acquisition module includes:

[0045] Obtaining a target application identifier carried by the audio signal;

[0046] The mapping relationship between the application identifier and the speaker identifier is queried to obtain a speaker that has a mapping relationship with the target application identifier as the target speaker associated with the audio signal.

[0047] In one embodiment of the present application, when each audio signal corresponds to an encoder, the encoding module includes:

[0048] Each audio signal is input into a corresponding encoder for encoding, and the encoder obtains the respective audio encoding data from the input audio signal.

[0049] In one embodiment of the present application, when M audio signals among the N audio signals multiplex one encoder, M is an integer greater than or equal to 2, and M≤N, wherein the encoding module includes:

[0050] Buffering the M channels of audio signals into a first buffer area;

[0051] Input the M channels of audio signals in the first buffer area into the multiplexed encoder one by one according to the first-in-first-out principle, and the encoder encodes the input audio signals to obtain the respective audio encoding data;

[0052] The remaining (NM) audio signals of the unmultiplexed encoders are input into the corresponding encoders, and the encoders encode the input audio signals to obtain the respective audio encoding data.

[0053] In one embodiment of the present application, the encoding module includes:

[0054] Generate a packet header mark for each audio signal in the M audio signals, and add the packet header mark to the header of the audio signal, wherein the packet header mark is used to distinguish the audio signals in the M audio signals;

[0055] Each audio signal carrying the packet header mark in the M audio signals is cached in the first cache area.

[0056] In one embodiment of the present application, the encoding module includes:

[0057] For each audio signal, determining encoding parameters supported by a target speaker associated with the audio signal;

[0058] The encoder encodes the input audio signal according to the encoding parameters supported by the target speaker to obtain the audio encoding data.

[0059] In one embodiment of the present application, the encoding module includes:

[0060] Determining a sound output format corresponding to the audio signal;

[0061] Each audio signal is input into a corresponding encoder, and the encoder encodes the audio signal according to the encoding parameters and outputs corresponding audio encoding data according to the sound output format.

[0062] In one embodiment of the present application, in a scenario where L audio signals among the N audio signals are shared to two or more speakers, L is an integer greater than or equal to 2, and L≤N, wherein the encoding module includes:

[0063] Input each shared audio signal in the L audio signals into a corresponding encoder for encoding, so as to obtain shared audio encoding data corresponding to the shared audio signal;

[0064] The sending the audio encoding data of the audio signal to the target speaker associated with the audio signal for decoding and playing includes:

[0065] Determine the number of speakers to which the shared audio signal is shared;

[0066] The shared audio encoding data is copied according to the number of the speakers, and the audio encoding data is sent to each shared speaker.

[0067] In one embodiment of the present application, the encoding module includes:

[0068] Determine the playback channel to which the target speaker associated with each audio signal belongs;

[0069] For each audio signal, the audio signal is input into a corresponding encoder, and the encoder encodes the input audio signal according to the encoding parameters corresponding to the playback channel to obtain the corresponding audio encoding data.

[0070] In one embodiment of the present application, when K of the N audio signals share the same communication component, K is an integer greater than or equal to 2, and K≤N, wherein the playback module includes:

[0071] Cache the audio coding data corresponding to each audio signal in the K audio signals in the second buffer area of ​​the shared communication component;

[0072] Sending the K-channel audio encoding data in the second buffer area to the target speakers associated with the K-channel audio signals respectively through the common communication component according to the first-in-first-out principle, and the target speakers associated with the K-channel audio signals respectively are connected to the terminal device through the common communication component;

[0073] The audio encoding data of the remaining (NK) audio signals that do not share the same communication component are sent to the target speakers associated with the (NK) audio signals through their respective corresponding communication components, and the target speakers associated with the (NK) audio signals are connected to the terminal device through their respective communication components.

[0074] In one embodiment of the present application, when each of the N audio signals corresponds to a different communication component, the playing module includes:

[0075] Each of the N audio signals is sent to the target speakers associated with each of the N audio signals through the corresponding communication components.

[0076] The third aspect of the present application provides an electronic device, including: the audio signal processing device provided in the second aspect of the present application.

[0077] The fourth aspect embodiment of the present application proposes an electronic device, comprising: a processor; a memory for storing instructions executable by the processor; wherein the processor is configured to execute the instructions to implement the audio signal processing method proposed in the first aspect embodiment of the present application.

[0078] The fifth aspect embodiment of the present application proposes a non-temporary computer-readable storage medium. When the instructions in the storage medium are executed by the processor of an electronic device, the electronic device can execute the method proposed in the first aspect embodiment of the present application.

[0079] The sixth aspect embodiment of the present application proposes a computer program product, including a computer program, which implements the method proposed in the first aspect embodiment of the present application when executed by a processor in a communication device.

[0080] The technical solution provided by the embodiments of the present application brings at least the following beneficial effects:

[0081] The embodiment of the present application encodes multiple audio signals separately to obtain audio coding data, reduces redundancy in the audio signals, and retains the main information of the audio; obtains the target speaker associated with each audio signal, and sends the audio coding data to the target speaker associated with each audio signal for decoding and playback, thereby achieving simultaneous playback of multiple audio signals emitted by the same device, realizing heterogeneous playback, and meeting the needs of different users at the same time.

[0082] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0083] The above and / or additional aspects and advantages of the present application will become apparent and easily understood from the following description of the embodiments in conjunction with the accompanying drawings, in which:

[0084] Figure 1 A flowchart of an audio signal processing method provided in an embodiment of the present application;

[0085] Figure 1a A schematic diagram of an audio signal provided in an embodiment of the present application being transmitted to a headset after being encoded and decoded;

[0086] Figure 1b A schematic diagram of the structure of the association of multiple execution devices provided in an embodiment of the present application;

[0087] Figure 2 A schematic diagram of another audio signal processing method provided in an embodiment of the present application;

[0088] Figure 3A schematic diagram of another audio signal processing method provided in an embodiment of the present application;

[0089] Figure 3a A schematic diagram of an audio signal processing method under different communication components provided in an embodiment of the present application;

[0090] Figure 3b A schematic diagram of an audio signal processing method under a multiplexed communication component provided in an embodiment of the present application;

[0091] Figure 4 A schematic diagram of another audio signal processing method provided in an embodiment of the present application;

[0092] Figure 4a A schematic diagram of an audio signal processing method in an EDR mode provided in an embodiment of the present application;

[0093] Figure 4b A schematic diagram of an audio signal processing method in LE mode provided in an embodiment of the present application;

[0094] Figure 4c A schematic diagram of an audio signal processing method in a mono format provided in an embodiment of the present application;

[0095] Figure 5 A schematic diagram of another audio signal processing method provided in an embodiment of the present application;

[0096] Figure 5a A schematic diagram of another audio signal processing method in the EDR mode provided in an embodiment of the present application;

[0097] Figure 5b A schematic diagram of another method for processing an audio signal in LE mode provided in an embodiment of the present application;

[0098] Figure 6 A schematic diagram of another audio signal processing method provided in an embodiment of the present application;

[0099] Figure 6a A schematic diagram of another audio signal processing method in the EDR mode provided in an embodiment of the present application;

[0100] Figure 6b A schematic diagram of another method for processing an audio signal in LE mode provided in an embodiment of the present application;

[0101] Figure 7 A schematic diagram of another audio signal processing method provided in an embodiment of the present application;

[0102] Figure 7a A schematic diagram of another method for processing an audio signal in LE mode provided in an embodiment of the present application;

[0103] Figure 8 A schematic diagram of another method for processing an audio signal in LE mode provided in an embodiment of the present application;

[0104] Fig. 9 A schematic diagram of the structure of an audio signal processing device provided in an embodiment of the present application;

[0105] Fig.10 A schematic diagram of the structure of an electronic device provided according to an embodiment of the present application;

[0106] Fig.11 A schematic diagram of the structure of an electronic device provided according to an embodiment of the present application;

[0107] Fig.12 The present invention is a schematic diagram of the structure of an electronic device provided according to an embodiment of the present application. DETAILED DESCRIPTION

[0108] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the embodiments of the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the embodiments of the present application as detailed in the appended claims.

[0109] The terms used in the embodiments of the present application are only for the purpose of describing specific embodiments, and are not intended to limit the embodiments of the present application. The singular forms of "a" and "the" used in the embodiments of the present application and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used herein refers to and includes any or all possible combinations of one or more associated listed items.

[0110] It should be understood that, although the terms first, second, third, etc. may be used to describe various information in the embodiments of the present application, these information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of the embodiments of the present application, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the words "if" and "if" as used herein may be interpreted as "at..." or "when..." or "in response to determination".

[0111] The embodiments of the present application are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present application, and should not be construed as limiting the present application.

[0112] It should be noted that the audio signal processing method provided in any embodiment of the present application can be executed alone, or can be executed together with possible implementation methods in other embodiments, or can be executed together with any technical solution in the related technology.

[0113] The following describes the audio signal processing method, device and electronic device of the present application with reference to the accompanying drawings. The present application embodiment can be applied to a speaker device such as headphones or speakers, and is used to enable the speaker device to emit audio signals from different sources.

[0114] Figure 1 A flowchart of an audio signal processing method provided in an embodiment of the present application is shown in FIG. Figure 1 As shown, the method includes but is not limited to the following steps:

[0115] S101, encode N channels of audio signals to obtain respective audio encoding data, where the value of N is an integer greater than or equal to 2.

[0116] Optionally, the N-channel audio signals may be respectively sourced from different electronic devices such as a mobile device, a laptop or a television, a cloud or a vehicle-mounted device. Optionally, the N-channel audio signals may be sourced from different applications on the same electronic device.

[0117] It can be understood that N-channel audio signals means that there are multiple audio signals from different sources. For example, for a smart phone, you can play parent-child audio through the speaker, and you can also listen to music or watch videos on the phone; then the audio signals emitted by the parent-child audio and the music or video are audio signals from different sources.

[0118] In some implementations, encoding an audio signal can reduce redundancy in the audio, retain main information of the audio, and reduce distortion of the audio signal.

[0119] Optionally, the encoding can be divided into hardware encoding and software encoding. The hardware encoding is usually completed in a digital signal processing (DSP) unit on the chip side; the software encoding is usually completed in an application processing (AP) side.

[0120] S102: Determine a target speaker associated with each audio signal.

[0121] Optionally, the speaker may include but is not limited to headphones, speakers, smart wearable devices, or car-mounted screens and other devices that can play.

[0122] Determine the target speaker associated with the audio signal, that is, determine which speaker the audio is played by. For example, if the current game audio is played by speaker A, then speaker A is the target speaker associated with the current game audio.

[0123] Optionally, the audio signal may carry a feature tag, and the target speaker associated with the audio signal is determined by matching the feature tag with the speaker.

[0124] The audio signal sending device can be adapted to the speaker in a variety of ways. For example, assuming that for a smartphone, it sends out 3 audio signals corresponding to 3 Bluetooth headsets, then the adaptation combination of a smartphone adapting to 3 Bluetooth headsets will include: smartphone + 3 Wi-Fi headsets, smartphone + 3 Bluetooth headsets, smartphone + 3 UWB headsets, smartphone + 1 Bluetooth headset + 2 Wi-Fi headsets, smartphone + 1 UWB headset + 2 Wi-Fi headsets, smartphone + 2 UWB headsets + 1 Wi-Fi headset, smartphone + 2 UWB headsets + 1 Bluetooth headset, smartphone + 2 Bluetooth headsets + 1 Wi-Fi headset, smartphone + 2 Bluetooth headsets + 1 UWB headset, and smartphone + 1 Bluetooth headset + 1 Wi-Fi headset + 1 UWB headset, a total of 10 adaptation combinations.

[0125] S103: For each audio signal, send the audio encoding data of the audio signal to a target speaker associated with the audio signal for decoding and playback.

[0126] Since there are N audio signals, each audio signal corresponds to an associated target speaker; the audio encoding data of the audio signal is sent to the target speaker associated with the audio signal; the audio encoding data is decoded and played. In other words, each target speaker plays its corresponding audio signal, and each target speaker plays different audio, so as to achieve heterogeneous playback of N audio signals emitted by the same device.

[0127] Optionally, when the audio signal is transmitted to the headset after encoding and decoding, it can be transmitted using classic Bluetooth, Enhanced Data Rate (EDR), Wireless Fidelity (Wi-Fi), Low Energy Bluetooth (LE) and Ultra Wide Band (UWB).

[0128] For example, Figure 1a, which shows a flowchart of three audio signals being transmitted to the earphone after encoding and decoding, namely method A (audio signal A is encoded and decoded to transmit the audio encoded data to TWS earphone A), method B (audio signal B is encoded and decoded to transmit the audio encoded data to TWS earphone B), method C (audio signal C is encoded and decoded to transmit the audio encoded data to TWS earphone C) and method D (audio signal A and audio signal B are respectively encoded and decoded to transmit the audio encoded data to the left channel and the right channel of the TWS earphone respectively), wherein the audio signal A is encoded by encoding method A and sent to the corresponding TWS earphone A or the left channel of the TWS earphone, the audio signal B is encoded by encoding method B and sent to the corresponding TWS earphone B or the right channel of the TWS earphone, and the corresponding audio signal C is encoded by encoding method C and sent to the corresponding TWS earphone C.

[0129] based on Figure 1a The combination of method A+method B or method B+method C can achieve the following goals: a smartphone plays parent-child audio through a speaker and listens to music or watches videos on the phone; or a smartphone plays game audio through a Bluetooth headset and plays music on the phone for sharing. Figure 1a Method D in the middle achieves the purpose of: a smartphone plays games through a Bluetooth headset and answers voice or phone calls on a social platform on the smartphone. That is, the left channel of the Bluetooth headset can play the game audio, and the right channel of the Bluetooth headset can play the phone audio, so that the game audio sound is not interrupted when answering the phone. Figure 1a Method A + Method B + Method C in the method can achieve the following purpose: a smart phone plays parent-child audio through speakers, plays reading audio or financial audio through Bluetooth headphones, and listens to music or watches videos on the phone.

[0130] like Figure 1b As shown, the smartphone can obtain audio signals from different sources from the cloud, onboard computer, and wearable devices. The smartphone can be connected to multiple TWS headsets, and the smartphone and TWS headsets can communicate through a variety of wireless communication methods, such as Bluetooth, WiFi, UWB, etc. The smartphone can obtain various audio signals from the cloud, onboard computer, and wearable devices, encode each audio signal to obtain corresponding audio encoding data, and send it to the corresponding TWS headset through one or more communication methods. In the communication between the smartphone and the TWS headset, network support is provided by the router.

[0131] In an embodiment of the present application, multiple audio signals are respectively encoded to obtain audio encoding data, thereby reducing redundancy in the audio signals and retaining the main information of the audio; the target speaker associated with each audio signal is obtained, and the audio encoding data is sent to the target speaker associated with each audio signal for decoding and playback, thereby achieving simultaneous playback of multiple audio signals emitted by the same device, realizing heterogeneous playback, and meeting the needs of different users at the same time.

[0132] Figure 2 A flowchart of another audio signal processing method provided in an embodiment of the present application. Figure 2 As shown, the method includes but is not limited to the following steps:

[0133] S201, encode N channels of audio signals to obtain respective audio encoding data, where the value of N is an integer greater than or equal to 2.

[0134] Optionally, each audio signal may correspond to the same encoder or may correspond to different encoders.

[0135] In the case where each audio signal corresponds to a respective encoder, each audio signal is input into the respective corresponding encoder for encoding, and the encoder encodes the input audio signal to obtain the respective corresponding audio encoding data.

[0136] In the case where M audio signals among N audio signals use one encoder, the M audio signals are cached in a first buffer area; the M audio signals in the first buffer area are input into the multiplexed encoder one by one according to the first-in-first-out principle, and the encoder encodes the input audio signals to obtain corresponding audio encoding data; wherein M is a positive integer greater than or equal to 2 and not greater than N. That is to say, when there are multiple audio signals that use one encoder, the audio signals are input into the multiplexed encoder one by one, and the audio signals are encoded according to the first-in-first-out principle to obtain audio encoding data corresponding to each audio signal.

[0137] It should be noted that, when M of the N audio signals multiplex one encoder, for the remaining NM audio signals that do not multiplex the encoders, the remaining NM audio signals are input into their respective encoders, and the corresponding encoders encode the audio signals to obtain their respective audio encoding data.

[0138] In the embodiment of the present application, the implementation method of step S201 can be implemented by any of the methods in the embodiments of the present disclosure, which is not limited here and will not be repeated.

[0139] S202: Obtain a target application identifier carried by the audio signal.

[0140] Optionally, the target application may be a common application, such as A music app, B novel app, C video app, and the like.

[0141] Optionally, the target application identifier may be determined by numbers, letters, or keywords of the target application, such as using the number "1" to represent A music app, the number "2" to represent B novel app, and the number "3" to represent C video app; it may also be determined by keywords, such as "A music" to represent A music app, "B novel" to represent B novel app, and "C video" to represent C video app.

[0142] In some implementations, the audio signal may be audio emitted by a corresponding target application, and thus the target application identifier carried by the audio signal may be determined based on the audio signal.

[0143] S203, querying the mapping relationship between the application identifier and the speaker identifier, obtaining a speaker that has a mapping relationship with the target application identifier as the target speaker associated with the audio signal.

[0144] In some implementations, a mapping relationship between the application identifier and the speaker identifier is established in advance to facilitate determining the corresponding speaker according to the application identifier.

[0145] After acquiring the target application identifier carried in the audio signal, the mapping relationship between the target application identifier and the speaker identifier is queried to obtain a speaker having a mapping relationship with the target application identifier. The speaker is the target speaker associated with the audio signal.

[0146] S204: For each audio signal, send the audio encoding data of the audio signal to a target speaker associated with the audio signal for decoding and playback.

[0147] Optionally, an audio signal can be sent to a target speaker associated with the audio signal based on a communication component; the communication component can be classic Bluetooth, Wireless Fidelity (Wi-Fi) or Ultra WideBand (UWB), etc., that is, the target speaker can receive an audio signal sent by a terminal device, such as an audio signal sent by a mobile phone or a computer, through the communication component. Among them, when the communication component is classic Bluetooth, it can be divided into Enhanced Data Rate (EDR) mode and Low Energy (LE) mode.

[0148] It can be understood that when the communication component is classic Bluetooth, whether in the EDR modulation mode or LE modulation mode of classic Bluetooth, the audio signals may each correspond to an encoder, or multiple audio signals may multiplex one encoder. If multiple audio signals multiplex one encoder, the method in step S201 is used to encode the audio signal.

[0149] In the embodiment of the present application, the implementation method of step S204 can be implemented by any of the methods in the embodiments of the present disclosure, which is not limited here and will not be repeated.

[0150] In an embodiment of the present application, when encoding an audio signal, encoding is performed in different ways based on whether each audio signal corresponds to the same encoder. When the audio signal reuses the same encoder, the audio signal of the multiplexed encoder is cached in a first buffer area, and the audio signals in the first buffer area are input into the encoder one by one for encoding according to the first-in-first-out principle to obtain audio encoding data, thereby avoiding confusion between audio signals; further, the target application identifier carried by the audio signal is obtained, and the target speaker of the audio signal is accurately identified according to the mapping relationship between the application identifier and the speaker, and the audio signal is played, thereby improving the accuracy of the target speaker in playing the audio signal.

[0151] Figure 3 A flowchart of another audio signal processing method provided in an embodiment of the present application. Figure 3 As shown, the method includes but is not limited to the following steps:

[0152] S301, encode N channels of audio signals to obtain respective audio encoding data.

[0153] The value of N is an integer greater than or equal to 2.

[0154] In the embodiment of the present application, the implementation method of step S301 can be implemented by any of the methods in the embodiments of the present disclosure, which is not limited here and will not be repeated.

[0155] S302: Determine a target speaker associated with each audio signal.

[0156] In the embodiment of the present application, the implementation method of step S302 can be implemented by any of the methods in the embodiments of the present disclosure, which is not limited here and will not be repeated.

[0157] S303: Send each of the N audio signals to a target speaker associated with each of the N audio signals through a corresponding communication component.

[0158] In some implementations, each audio signal may correspond to a different communication component, such as Figure 3a As shown, each audio signal is sent to its associated target speaker through its corresponding communication component, and the communication components are Bluetooth (classic Bluetooth or low-power Bluetooth), Wi-Fi and UWB.

[0159] In some other implementations, there may be a situation where K audio signals out of N audio signals multiplex the same communication component, where K is an integer greater than or equal to 2, and K≤N; Figure 3b As shown, there are 3 audio signals in total, 2 of which use the same communication component, and the remaining 1 audio signal uses another communication component.

[0160] Optionally, when K audio signals share a communication component, the audio encoding data corresponding to each audio signal in the K audio signals is cached in a second cache area of ​​the shared communication component to facilitate communication transmission by the communication component.

[0161] Optionally, when K audio signals are sent through the shared communication component, they are sent to the associated target speakers in sequence according to a first-in-first-out order.

[0162] It can be understood that the target speakers associated with the K audio signals are connected to the terminal device through a common communication component; the terminal device can be a mobile phone, computer or TV and other devices, and the terminal device sends the audio signal to the target speaker through the communication component, for example, the mobile phone sends audio to the headset through Bluetooth communication.

[0163] Furthermore, for the remaining (NK) audio signals, the target speakers associated with each audio signal are connected to the terminal device through their respective communication components. Each audio signal uses a different communication component, and the audio encoding data corresponding to the audio signal is sent to the associated target speaker for decoding and playback through the communication component corresponding to each audio signal in the (NK) audio signals.

[0164] In the embodiment of the present application, in the embodiment of the present application, after determining the target speaker corresponding to the audio signal, different sending methods can be adopted according to whether the audio signal uses the same communication component; when there are K-way audio signals sharing the same communication component, the audio data encodings of the K-way audio signals are sequentially cached in the second buffer area of ​​the communication component, so that the communication component can communicate and send; further, according to the first-in-first-out principle, the audio data encodings are sequentially sent to the associated target speakers for decoding and playback; for the remaining (NK)-way audio signals that do not share the same communication component, according to their respective communication components, the audio encoding data corresponding to the audio signal is sent to the associated target speakers for decoding and playback. When N-way audio signals correspond to different communication components, according to the communication components corresponding to each audio signal, the audio encoding data is sent to the respective associated target speakers for decoding and playback, so as to ensure that the signal transmission between different communication components will not interfere with each other, and when multiple audio signals share the same communication component, the transmission of the audio encoding data will not cause confusion, so as to ensure the accuracy of the audio encoding data received by the target speaker, and realize the simultaneous playback of multiple audio signals on the same terminal device, thereby improving the user experience.

[0165] Based on the above embodiment, when each of the N signals corresponds to an encoder, Figure 4 A flowchart of another audio signal processing method provided in an embodiment of the present application. Figure 4 As shown, the method includes but is not limited to the following steps:

[0166] S401, input each audio signal into a corresponding encoder for encoding, and the encoder encodes the input audio signal to obtain corresponding audio encoding data.

[0167] Optionally, each audio signal corresponds to an encoder, and each audio signal is input into the corresponding encoder for encoding to obtain audio encoding data.

[0168] In the embodiment of the present application, the implementation method of step S401 can be implemented by any of the methods in the embodiments of the present disclosure, which is not limited here and will not be repeated.

[0169] S402: Determine a target speaker associated with each audio signal.

[0170] In the embodiment of the present application, the implementation method of step S402 can be implemented by any of the methods in the embodiments of the present disclosure, which is not limited here and will not be repeated.

[0171] S403: Send the audio encoding data of the audio signal to the target speaker associated with the audio signal for decoding and playback.

[0172] Optionally, when sending the audio signal to the target speaker associated with the audio signal, it is necessary to use the communication component corresponding to the audio signal. Figure 3a As shown, when each audio signal corresponds to a different communication component, the audio encoding data is transmitted to the target speaker for decoding and playback through the respective communication components of the audio data, such as Figure 3b As shown in the formula, in the case where multiple audio signals multiplex the same communication component, the audio signals multiplexed with the same communication component are cached in the second cache area of ​​the communication component, and are sent to the corresponding target speakers one by one in a first-in-first-out order for decoding and playback. For the remaining audio signals that are not multiplexed with the same communication component, they are sent to the target speakers for decoding and playback according to their respective corresponding communication components.

[0173] For example, assuming that the communication component is classic Bluetooth, classic Bluetooth can be divided into EDR mode and LE mode. If it is in EDR mode, such as Figure 4a As shown, the corresponding audio encoding data is sent to the target speaker associated with each audio signal through the EDR Radio radio frequency of Bluetooth, and decoded and played. That is, the audio signals of "Music App A", "Listening to Book App B" and "Online Class App C" are encoded respectively through Sub Band Codec (SBC) / Advanced Audio Coding (AAC) / Audio Processing Technology-X (APTX) series / Low-Latency Hi-Definition Audio Codec (LHDC) series / Low Delay Audio Codec (LDAC) and the like to obtain their respective audio encoding data. For example, the audio signal of "Music APP A" is encoded through SBC / AAC / APTX series / LHDC series / LDAC to obtain audio coded data A; the audio signal of "Audiobook APP B" is encoded through SBC / AAC / APTX series / LHDC series / LDAC to obtain audio coded data B, and the audio signal of "Online Class APP C" is encoded through SBC / AAC / APTX series / LHDC series / LDAC to obtain audio coded data C. Figure 4aAs shown, the audio encoding data is sent through the EDR mode, cached in the Bluetooth EDR Radio frequency, and sent to the associated earphones A, B, and C respectively according to the first-in-first-out principle. For example, the audio encoding data A of "Music APP A" is sent to earphone A, the audio encoding data B of "Listening to Book APP B" is sent to earphone B, and the audio encoding data C of "Online Class APP C" is sent to earphone C.

[0174] If it is LE mode at this time, such as Figure 4b As shown, the corresponding audio coding data is sent to the target speaker associated with each audio signal through the Bluetooth LE Radio frequency, and decoded and played. That is, the audio signals of "Music App A", "Listening to Book App B" and "Online Class App C" are respectively encoded through the Low Complexity Communication Codec (LC3) unique to the LE mode to obtain their own audio coding data. For example, the audio signal of "Music APP A" is encoded through LC3 to obtain audio coding data A; the audio signal of "Listening to Book APP B" is encoded through LC3 to obtain audio coding data B; the audio signal of "Online Class APP C" is encoded through LC3 to obtain audio coding data C. Figure 4b As shown, the audio coding data is sent through the LE mode, cached in the Bluetooth LE Radio frequency, and sent to the associated earphones A, B and C respectively according to the first-in-first-out principle. For example, the audio coding data A of "Music APPA" is sent to earphone A, the audio coding data B of "Listening to Book APP B" is sent to earphone B, and the audio coding data of "Online Class APPC" is sent to earphone C.

[0175] On the basis of the above embodiment, when encoding N audio signals in the embodiment of the present application, the target speaker associated with the audio signal can be obtained for each audio signal, and the encoding parameters supported by the target speaker associated with the audio signal can be determined. The sound output format corresponding to the audio signal is further determined, and the encoder encodes the audio signal according to the encoding parameters, and outputs the corresponding audio encoding data according to the sound output format.

[0176] In some implementations, encoding parameters are used to determine the manner in which the audio signal is encoded.

[0177] Optionally, the target speaker can be a device such as a headset or a speaker, or a speaker in a device such as a headset or a speaker; and the coding parameters supported by the headset and the speaker will vary depending on the communication components. For example, when using the EDR mode of classic Bluetooth, you can use codecs such as SBC / AAC / APTX series / LHDC series / LDAC. When using the LE mode of classic Bluetooth, you can use the low-complexity audio decoder LC3 codec unique to the LE mode. Therefore, when encoding, it is necessary to base it on the coding parameters supported by the target speaker.

[0178] Optionally, the sound output format may be a mono format or a stereo format, etc.

[0179] After the encoding parameters supported by the target speaker are determined, the encoder encodes the input audio signal according to the encoding parameters supported by the target speaker, and outputs corresponding audio encoding data according to the sound output format.

[0180] For example, Figure 4a The audio signal output format is stereo format. In the EDR mode of classic Bluetooth, the audio signal is encoded using codecs such as SBC / AAC / APTX series / LHDC series / LDAC. Figure 4b The sound output format of the audio signal is stereo format. In the LE mode of classic Bluetooth, the audio signal is encoded using the LC3 codec unique to the LE mode.

[0181] It is understandable that the sound output format of the audio signal can also be a mono format, such as Figure 4c As shown in the figure, when the sound output format of the audio signal is mono, the LC3 codec unique to the LE mode is used to encode the audio signal in the LE mode of classic Bluetooth. Correspondingly, if the sound output format of the audio signal is mono, the audio signal can also be encoded in the EDR mode of classic Bluetooth using codecs such as SBC / AAC / APTX series / LHDC series / LDAC.

[0182] In the embodiment of the present application, when each of the N audio signals corresponds to an encoder, the respective encoders are used to encode the audio signals to obtain audio encoding data, and the audio encoding data is input into the corresponding target speaker based on the corresponding communication component for decoding and playback, thereby solving the pain point that multiple audio signals cannot be played simultaneously. In addition, the audio encoding data of each audio signal can be output according to the encoding parameters corresponding to the current target speaker and the sound output format of the audio signal, so that the audio encoding data more comprehensively summarizes the information of the audio signal, so as to ensure the accuracy of the audio playback when the target speaker decodes and plays the audio encoding data.

[0183] Based on the above embodiment, when M audio signals among N audio signals use the same encoder, Figure 5 A flowchart of another audio signal processing method provided in an embodiment of the present application. Figure 5 As shown, the method includes but is not limited to the following steps:

[0184] S501 : Acquire N audio signals, generate a packet header marker for each of the M audio signals multiplexed with one encoder, and add the packet header marker to the header of the audio signal.

[0185] The packet header mark is used to distinguish the audio signals among the M-channel audio signals.

[0186] Optionally, the header mark may be a number, a letter or a special symbol; the special symbol may be “#”, “&” or “⊿”, etc.

[0187] In some implementations, a packet header marker may be added to the header of an audio signal to distinguish different audio signals so as to intuitively determine the sequence of the audio signals.

[0188] In some implementations, N audio signals may be multiplexed with one encoder; or, some of the N audio signals may be multiplexed with one encoder, and the remaining ones may be multiplexed with one encoder, or the remaining ones may each correspond to an encoder. Multiplexing an encoder for N audio signals may be implemented in a variety of ways, which are not limited herein.

[0189] S502: Buffer each audio signal carrying a packet header mark among the M audio signals into a first buffer area.

[0190] Furthermore, the audio signal carrying the packet header mark is cached in the first cache area.

[0191] The packet header mark of the audio signal is used to determine the cache order of the audio signal in the first cache area, so as to determine the encoding order of the audio signal according to the first-in-first-out principle.

[0192] S503: Input the M channels of audio signals in the first buffer area into the multiplexed encoder one by one according to the first-in-first-out principle, and the encoder encodes the input audio signals to obtain respective audio encoding data.

[0193] Optionally, M-channel audio signals can be cached in the first buffer area in sequence. Furthermore, according to the first-in-first-out principle, the audio signals in the first buffer area are input one by one into the multiplexed encoder for encoding to obtain audio encoding data. That is to say, the first audio signal cached in the first buffer area is the first input into the multiplexed encoder for encoding. In the embodiment of the present application, the M-channel audio signals can be distinguished by the packet header mark of the audio signal, thereby avoiding confusion when the M-channel audio signals are multiplexed and encoded using the same encoder.

[0194] S504: input the remaining (NM) audio signals of the unmultiplexed encoders into the corresponding encoders, and the encoders encode the input audio signals to obtain respective audio encoding data.

[0195] The remaining (NM) audio signals of the unmultiplexed encoder, that is, the (NM) audio signals correspond to different encoders respectively, and the (NM) audio signals are respectively input into the corresponding encoders for encoding to obtain respective audio encoding data.

[0196] S505: For each audio signal, send the audio encoding data of the audio signal to the target speaker associated with the audio signal for decoding and playback.

[0197] Optionally, when the audio signal is sent to a target speaker associated with the audio signal, it needs to be done through a communication component corresponding to the audio signal.

[0198] For example, assuming that the communication component is classic Bluetooth, classic Bluetooth can be divided into EDR mode and LE mode. If it is in EDR mode, such as Figure 5aAs shown, it shows a schematic diagram of 3 audio signals multiplexing the same encoder, that is, the smartphone can only support one set of audio signal transmission and storage architecture, and cannot separate multiple channels to transmit different audio signals separately, and at the same time only supports one set of Bluetooth encoding and decoding architecture. In order to distinguish each audio signal, a packet header mark can be added to each audio signal, and the audio signals carrying the packet header mark are cached one by one in the first buffer area. Further, according to the first-in-first-out principle, the audio signals in the first buffer area are input one by one into the multiplexed encoder for encoding, and the corresponding audio encoding data is sent to the target speaker associated with each audio signal through the Bluetooth EDR Radio radio frequency, and decoded and played. That is, packet header tags are added to the audio signals of "Music App A", "Listening to Book App B" and "Online Class App C" respectively, the audio signal of "Music App A" carrying the packet header tag is audio signal A, the audio signal of "Listening to Book App B" carrying the packet header tag is audio signal B, and the audio signal of "Online Class App C" carrying the packet header tag is audio signal C. The audio signal A, audio signal B and audio signal C are input into the first buffer area, and according to the first-in-first-out principle, the audio signals in the first buffer area are input into the multiplexed encoder one by one to obtain corresponding audio encoded data; for example, the order of inputting into the first buffer area is audio signal A, audio signal B and audio signal C, then the audio signals in the first buffer area are input into the multiplexed encoder one by one as audio signal A, audio signal B and audio signal C. Audio signal A is encoded by SBC / AAC / APTX series / LHDC series / LDAC to obtain audio encoded data A1, audio signal B is encoded by SBC / AAC / APTX series / LHDC series / LDAC to obtain audio encoded data B1, and audio signal C is encoded by SBC / AAC / APTX series / LHDC series / LDAC to obtain audio encoded data C1. Figure 5a As shown, the audio encoding data is sent through the EDR mode, cached in the Bluetooth EDR Radio frequency, and sent to the associated earphones A, B and C respectively according to the first-in-first-out principle. For example, the audio encoding data A1 of "Music APP A" is sent to earphone A, the audio encoding data B1 of "Listening to Book APP B" is sent to earphone B, and the audio encoding data C1 of "Online Class APP C" is sent to earphone C.

[0199] It is understandable that if it is LE mode at this time. Figure 5bAs shown in the figure, when the three audio signals use the same encoder, the smartphone can only support one set of audio signal transmission and storage architecture, and cannot separate multiple audio signals for independent transmission. In addition, it only supports one set of Bluetooth encoding and decoding architecture. In order to distinguish each audio signal, a packet header mark is added to the audio signal, that is, a packet header mark is added to the audio signals of music App A, listening to books App B, and online class App C.

[0200] The audio signal of "Music App A" carrying the header mark is audio signal A, the audio signal of "Listening to Book App B" carrying the header mark is audio signal B, and the audio signal of "Online Course App C" carrying the header mark is audio signal C. Audio signal A, audio signal B and audio signal C are input into the first buffer area, and according to the first-in-first-out principle, the audio signals in the first buffer area are input into the multiplexed encoder one by one to obtain corresponding audio encoding data; for example, the order of inputting into the first buffer area is audio signal A, audio signal B and audio signal C, then the audio signals in the first buffer area are input into the multiplexed encoder one by one as audio signal A, audio signal B and audio signal C. Audio signal A is encoded by LC3 to obtain audio encoding data A1, audio signal B is encoded by LC3 to obtain audio encoding data B1, and audio signal C is encoded by LC3 to obtain audio encoding data C1. Figure 5a As shown, the audio encoding data is sent through the LE mode, cached in the Bluetooth LE Radio frequency, and sent to the associated earphones A, B and C respectively according to the first-in-first-out principle. For example, the audio encoding data A1 of "Music APP A" is sent to earphone A, the audio encoding data B1 of "Listening to Book APP B" is sent to earphone B, and the audio encoding data C1 of "Online Class APP C" is sent to earphone C.

[0201] On the basis of the above embodiment, when encoding N audio signals in the embodiment of the present application, the target speaker associated with the audio signal can be obtained for each audio signal, and the encoding parameters supported by the target speaker associated with the audio signal can be determined. The sound output format corresponding to the audio signal is further determined, and the encoder encodes the audio signal according to the encoding parameters, and outputs the corresponding audio encoding data according to the sound output format.

[0202] In an embodiment of the present application, when multiple audio signals multiplex one encoder, a packet header mark is added to the header of the audio signal to distinguish the audio signal, and the audio signal carrying the packet header mark is cached in a first cache area to facilitate determining the order of the audio signals, accurately encode the audio signals according to the first-in-first-out principle, and improve the accuracy of audio signal encoding and transmission.

[0203] Based on the above embodiment, when L audio signals among N audio signals are shared to two or more speakers, Figure 6 A flowchart of another audio signal processing method provided in an embodiment of the present application.

[0204] like Figure 6 As shown, the method includes but is not limited to the following steps:

[0205] S601: Acquire N channels of audio signals.

[0206] Optionally, the N-channel audio signals may be respectively sourced from different electronic devices such as a mobile device, a laptop or a television, a cloud or a vehicle-mounted device. Optionally, the N-channel audio signals may be sourced from different applications on the same electronic device.

[0207] S602: Determine a target speaker associated with each audio signal.

[0208] In the embodiment of the present application, the implementation method of step S602 can be implemented by any of the methods in the embodiments of the present disclosure, which is not limited here and will not be repeated.

[0209] S603: Input each shared audio signal in the L audio signals into a corresponding encoder for encoding to obtain shared audio encoding data corresponding to the shared audio signal.

[0210] Wherein, the value of N is an integer greater than or equal to 2, L is an integer greater than or equal to 2, and L≤N.

[0211] It can be understood that the scenario in which L audio signals are shared to two or more speakers means that there is one audio signal corresponding to two or more speakers, and the two or more speakers play the same audio signal.

[0212] Optionally, each shared audio signal in the L audio signals is input into an encoder for encoding to obtain corresponding shared audio encoded data. The process of the encoder encoding the audio signal can be implemented in any of the embodiments of the present disclosure, which is not limited here and will not be repeated.

[0213] S604: Determine the number of speakers to which the shared audio signal is shared.

[0214] Since there are L shared audio signals among the N audio signals, and each shared audio signal corresponds to two or more speakers, each speaker needs to obtain the shared audio encoding data to ensure that the speaker can play the shared audio data.

[0215] Optionally, the number of speakers to which the shared audio signal is shared is determined to determine the number of shared audio encoding data that needs to be transmitted.

[0216] S605: Copy the shared audio encoding data according to the number of speakers, and send the audio encoding data to each shared speaker for decoding and playback.

[0217] Further, after the number of speakers is determined, the shared audio coding data is copied according to the number of speakers to obtain a plurality of shared audio coding data that is consistent with the number of speakers. For example, if the number of speakers is 3, the shared audio coding data needs to be copied twice to obtain a total of 3 identical shared audio coding data.

[0218] Each shared audio encoding data is sent to each shared speaker for decoding and playback.

[0219] It is understandable that sending each shared audio encoding data to each shared speaker needs to be done through a communication component corresponding to the audio signal.

[0220] For example, assuming that the communication component is classic Bluetooth, classic Bluetooth can be divided into EDR mode and LE mode. If it is in EDR mode, such as Figure 6a As shown in FIG. 1 , the audio signal of “Music App A” is shared to two speakers, so the audio encoding data of “Music App A” is copied to obtain two identical audio encoding data. Figure 6a As shown, the audio signal of "Music APP A" is encoded by SBC / AAC / APTX series / LHDC series / LDAC to obtain audio coded data A; the audio signal of "Online Class APP C" is encoded by SBC / AAC / APTX series / LHDC series / LDAC to obtain audio coded data C; the audio coded data A is copied to obtain two audio coded data A, and the audio coded data are sent through the EDR mode, cached in the EDR Radio frequency of Bluetooth, and sent to the associated earphones A, earphones B and earphones C respectively according to the first-in-first-out principle. For example, the audio coded data A of "Music APP A" is sent to earphone A, the audio coded data A of "Music APP A" is sent to earphone A and earphone B, and the audio coded data C of "Online Class APP C" is sent to earphone C.

[0221] Furthermore, if it is LE mode at this time, such as Figure 6b As shown in FIG. 1 , the audio signal of “Music App A” is shared to two speakers, so the audio encoding data of “Music App A” is copied to obtain two identical audio encoding data. Figure 6bAs shown, the audio signal of "Music APP A" is encoded by LC3 to obtain audio coded data A; the audio signal of "Online Class APP C" is encoded by LC3 to obtain audio coded data C; the audio coded data A is copied to obtain two audio coded data A, and the audio coded data are sent through LE mode, cached in the LE Radio frequency of Bluetooth, and sent to the associated earphones A, earphones B and earphones C respectively according to the first-in-first-out principle. For example, the audio coded data A of "Music APP A" is sent to earphone A, the audio coded data A of "Music APP A" is sent to earphone A and earphone B, and the audio coded data C of "Online Class APP C" is sent to earphone C.

[0222] On the basis of the above embodiment, when encoding N audio signals in the embodiment of the present application, the target speaker associated with the audio signal can be obtained for each audio signal, and the encoding parameters supported by the target speaker associated with the audio signal can be determined. The sound output format corresponding to the audio signal is further determined, and the encoder encodes the audio signal according to the encoding parameters, and outputs the corresponding audio encoding data according to the sound output format.

[0223] In an embodiment of the present application, when an audio signal is shared to two or more speakers, the number of shared audio coding data of the shared audio signal is determined by the number of speakers to which it is shared. That is, the audio signal is encoded only once, and the shared audio coding data is copied to obtain multiple shared audio coding data, which are sent to the shared speakers respectively, thereby avoiding repeated encoding, saving calculations and improving efficiency.

[0224] Figure 7 A flowchart of another audio signal processing method provided in an embodiment of the present application. Figure 7 As shown, the method includes but is not limited to the following steps:

[0225] S701: Acquire N channels of audio signals.

[0226] S702: Determine a target speaker associated with each audio signal.

[0227] In the embodiment of the present application, the implementation method of step S702 can be implemented by any of the methods in the embodiments of the present disclosure, which is not limited here and will not be repeated.

[0228] S703: Determine the playback channel to which the target speaker associated with each audio signal belongs.

[0229] It can be understood that for different target speakers, the corresponding playback channels are different, and the playback channels can be understood as the speakers of the target speakers; for example, headphones generally have two playback channels, left channel and right channel, that is, the left and right headphones each correspond to a speaker; and speakers generally have multiple speakers such as front speakers and rear speakers, and the front speakers and rear speakers may include speakers in different positions of left, center, and right, and each speaker corresponds to a playback channel.

[0230] Optionally, different playback channels of the target speaker may play different audio signals or the same audio signal, so it is necessary to determine the playback channel to which the target speaker associated with each audio signal belongs.

[0231] S704: For each audio signal, input the audio signal into a corresponding encoder, and the encoder encodes the input audio signal according to the encoding parameters corresponding to the playback channel to obtain corresponding audio encoding data.

[0232] Optionally, since the playback channel may be a speaker in a speaker device, the encoding parameters of the playback channel depend on the speaker device to which it belongs. For example, different encoding parameters correspond to headphones in EDR mode and LE mode, respectively.

[0233] For each audio signal, the audio signal is input into the encoder, and the encoder encodes it according to the encoding parameters of the playback channel to obtain audio encoding data of the audio signal. Optionally, according to the device playback channel position in the encoding parameters, playback channel data of different positions such as front left, front right, back middle, back left, etc. can be encoded respectively.

[0234] In some implementations, each audio signal may correspond to a respective encoder, and the audio signal may be encoded by the encoder corresponding to each audio signal to obtain audio encoding data.

[0235] In some other implementations, there may be a situation where multiple audio signals are multiplexed with one encoder among all the audio signals. When there are multiple audio signals multiplexing with one encoder, all the audio signals of the multiplexed encoder are cached in a cache area, and the audio signals in the cache area are input into the multiplexed encoder one by one according to the first-in-first-out principle, and the multiple audio signals are encoded one by one to obtain respective audio encoded data; for the remaining audio signals that are not multiplexed with the encoder, they are input into their respective corresponding encoders for encoding to obtain corresponding audio encoded data.

[0236] In some other implementations, there may be a situation where multiple speakers share the same audio signal, that is, one audio signal corresponds to two or more speakers; for the shared audio signal, the shared audio signal is input into the corresponding encoder for encoding to obtain corresponding shared audio encoding data. Since multiple speakers need to play the audio signal, the shared audio encoding data needs to be copied to obtain multiple shared audio encoding data consistent with the number of speakers. The number of speakers here is the number of speakers corresponding to the shared audio signal, so that each speaker can receive the shared audio encoding data.

[0237] S705 , for each audio signal, sending the audio encoding data of the audio signal to a target speaker associated with the audio signal for decoding and playing.

[0238] For example, it is assumed that the communication component is in the LE mode of classic Bluetooth. Figure 7a As shown, it shows three channels of audio data of "Music App A", "Listening to Book App B" and "Online Class App C", and the three channels of audio data multiplex the same encoder, then a packet header mark is added to the audio signals of "Music App A", "Listening to Book App B" and "Online Class App C", the audio signal of "Music App A" carrying the packet header mark is audio signal A, the audio signal of "Listening to Book App B" carrying the packet header mark is audio signal B, and the audio signal of "Online Class App C" carrying the packet header mark is audio signal C, and the audio signal A, audio signal B and audio signal C are input into the first buffer area, and according to the first-in-first-out principle, the audio signals in the first buffer area are input into the multiplexed encoder one by one to obtain corresponding audio encoded data; for example, the order of inputting the first buffer area is audio signal A, audio signal B and audio signal C, then the audio signals in the first buffer area are input into the multiplexed encoder one by one as audio signal A, audio signal B and audio signal C. Audio signal A is encoded by LC3 to obtain audio encoding data A1, audio signal B is encoded by LC3 to obtain audio encoding data B1, and audio signal C is encoded by LC3 to obtain audio encoding data C1. At the same time, when encoding, channel position data is added, for example, audio encoding data A1, audio encoding data B1 and audio encoding data C1 include front left, front right and back middle respectively; Figure 7aAs shown, the audio encoding data is sent through the LE mode, cached in the LERadio radio frequency of Bluetooth, and sent to the associated speakers A, B and C respectively according to the first-in-first-out principle. For example, the audio encoding data A1 of "Music APP A" is sent to speaker A, the audio encoding data B1 of "Listening to Book APP B" is sent to speaker B, and the audio encoding data C1 of "Online Class APP C" is sent to speaker C.

[0239] It can be understood that the front left speaker of speaker A plays the audio of "Music App A", the front right speaker of speaker B plays the audio of "Audio Book App B", and the back middle speaker of speaker C plays the audio of "Online Class App C".

[0240] In the embodiment of the present application, the implementation method of step S704 can be implemented by any of the methods in the embodiments of the present disclosure, which is not limited here and will not be repeated.

[0241] In an embodiment of the present application, the playback channel corresponding to the target speaker is obtained and encoded according to the playback channel to obtain audio encoding data, so as to achieve the purpose of emitting different audio signals at different positions of the same target speaker, that is, the playback of multiple audio signals can be achieved through one target speaker, and the multiple audio signals can also use the same or different encoders, which is more flexible to use; heterogeneous playback can also be performed in scenarios where there are not multiple target speakers, and the application functions are more comprehensive.

[0242] On the basis of the above embodiments, the embodiments of the present application can also achieve the purpose of playing multiple audio signals simultaneously when the communication component is Wi-Fi, such as Figure 8 As shown, the audio signals of "Music App A", "Book Listening App B" and "Online Class App C" are respectively encoded by the encoder. For example, the audio signal of "Music App A" is encoded to obtain audio encoded data A; the audio signal of "Book Listening App B" is encoded to obtain audio encoded data B, and the audio signal of "Online Class App C" is encoded to obtain audio encoded data C. The audio encoded data is cached in the Wi-Fi Radio radio frequency, and the audio encoded data is sent to the associated earphones A, earphones B and earphones C respectively according to the first-in-first-out principle. For example, the audio encoded data A of "Music App A" is sent to earphone A, the audio encoded data B of "Book Listening App B" is sent to earphone B, and the audio encoded data of "Online Class App C" is sent to earphone C.

[0243] It is understandable that when the communication component is Wi-Fi, there may be a situation where multiple audio signals multiplex one encoder or each audio signal corresponds to an encoder. There may also be a situation where the audio signal is shared by two or more speakers. For such situations, any method in the embodiments of the present disclosure can be used to implement it. This is not limited to this and will not be elaborated on.

[0244] It can be understood that the embodiments of the present application can also achieve the purpose of simultaneous playback of multiple audio signals when the communication component is UWB. When the communication component is UWB, the simultaneous playback of multiple audio signals can be achieved by any method in the embodiments of the present disclosure. This is not limited to this and will not be repeated.

[0245] Fig. 9 FIG. 1 is a schematic diagram of the structure of the audio signal processing device according to an embodiment of the present application. Fig. 9 As shown, the audio signal processing device 900 includes:

[0246] The encoding module 901 is used to encode N audio signals to obtain respective audio encoding data, where the value of N is an integer greater than or equal to 2;

[0247] A speaker acquisition module 902 is used to determine a target speaker associated with each audio signal;

[0248] The playing module 903 is used to send the audio encoding data of each audio signal to the target speaker associated with the audio signal for decoding and playing.

[0249] In some implementations, the speaker acquisition module 902 includes:

[0250] Obtain the target application identifier carried by the audio signal;

[0251] The mapping relationship between the application identifier and the speaker identifier is queried to obtain a speaker that has a mapping relationship with the target application identifier as the target speaker associated with the audio signal.

[0252] In some implementations, when each audio signal corresponds to a respective encoder, the encoding module 901 includes:

[0253] Each audio signal is input into a corresponding encoder for encoding, and the encoder obtains respective audio encoding data from the input audio signal.

[0254] In some implementations, when M audio signals among N audio signals use one encoder, M is an integer greater than or equal to 2, and M≤N, wherein the encoding module 901 includes:

[0255] Buffering the M-channel audio signals into the first buffer area;

[0256] Input the M channels of audio signals in the first buffer area into the multiplexed encoder one by one according to the first-in-first-out principle, and the encoder encodes the input audio signals to obtain respective audio encoding data;

[0257] The remaining (NM) audio signals of the unmultiplexed encoders are input into the corresponding encoders, and the encoders encode the input audio signals to obtain respective audio encoding data.

[0258] In some implementations, the encoding module 901 includes:

[0259] Generate a packet header mark for each audio signal in the M-channel audio signals, and add the packet header mark to the header of the audio signal, wherein the packet header mark is used to distinguish the audio signals in the M-channel audio signals;

[0260] Each audio signal carrying a packet header mark among the M audio signals is cached in a first cache area.

[0261] In some implementations, the encoding module 901 includes:

[0262] For each audio signal, determine the encoding parameters supported by the target speaker associated with the audio signal;

[0263] The encoder encodes the input audio signal according to the encoding parameters supported by the target speaker to obtain audio encoding data.

[0264] In some implementations, the encoding module 901 includes:

[0265] Determine the sound output format corresponding to the audio signal;

[0266] Each audio signal is input into the corresponding encoder, which encodes the audio signal according to the encoding parameters and outputs the corresponding audio encoding data according to the sound output format.

[0267] In some implementations, in a scenario where L audio signals among N audio signals are shared to two or more speakers, L is an integer greater than or equal to 2, and L≤N, wherein the encoding module 901 includes:

[0268] Input each shared audio signal in the L audio signals into a corresponding encoder for encoding, to obtain shared audio encoding data corresponding to the shared audio signal;

[0269] Sending audio coded data of an audio signal to a target speaker associated with the audio signal for decoding and playing, including:

[0270] Determine the number of speakers to which the shared audio signal is shared;

[0271] The shared audio encoding data is copied according to the number of speakers, and the audio encoding data is sent to each shared speaker.

[0272] In some implementations, the encoding module 901 includes:

[0273] Determine the playback channel to which the target speaker associated with each audio signal belongs;

[0274] For each audio signal, the audio signal is input into the corresponding encoder, and the encoder encodes the input audio signal according to the encoding parameters corresponding to the playback channel to obtain corresponding audio encoding data.

[0275] In some implementations, when K of N audio signals share the same communication component, K is an integer greater than or equal to 2, and K≤N, wherein the playing module 903 includes:

[0276] Buffering the audio coding data corresponding to each audio signal in the K audio signals in a second buffer area of ​​the shared communication component;

[0277] The K-channel audio encoding data in the second buffer area are sent to the target speakers associated with the K-channel audio signals respectively through the common communication component according to the first-in-first-out principle, and the target speakers associated with the K-channel audio signals respectively are connected to the terminal device through the common communication component;

[0278] The audio encoding data of the remaining (NK) audio signals that do not share the same communication component are sent to the target speakers associated with the (NK) audio signals through their respective corresponding communication components. The target speakers associated with the (NK) audio signals are connected to the terminal devices through their respective communication components.

[0279] In some implementations, when each of the N audio signals corresponds to a different communication component, the playing module 903 includes:

[0280] Each of the N audio signals is sent to a target speaker associated with each of the N audio signals through a corresponding communication component.

[0281] In an embodiment of the present application, multiple audio signals are respectively encoded to obtain audio encoding data, thereby reducing redundancy in the audio signals and retaining the main information of the audio; the target speaker associated with each audio signal is obtained, and the audio encoding data is sent to the target speaker associated with each audio signal for decoding and playback, thereby achieving simultaneous playback of multiple audio signals emitted by the same device, realizing heterogeneous playback, and meeting the needs of different users at the same time.

[0282] Fig.10 FIG. 1 is a block diagram of an electronic device according to an exemplary embodiment. Fig.10 As shown, the electronic device 1000 includes an audio signal processing device 900. The electronic device may be a mobile electronic device or a non-mobile electronic device. For example, the mobile electronic device may be a mobile phone, a tablet computer, a laptop computer, a PDA, an in-vehicle electronic device, a wearable device, an ultra-mobile personal computer (UMPC), a netbook or a personal digital assistant (PDA), etc., and the non-mobile electronic device may be a network attached storage (NAS), a personal computer (PC), a television (TV), a teller machine or a self-service machine, etc., which is not specifically limited in the embodiments of the present application.

[0283] According to an embodiment of the present application, an electronic device is also provided, comprising: a processor; and a memory for storing instructions executable by the processor, wherein the processor is configured to execute the instructions to implement the audio signal processing method as described above.

[0284] In order to implement the above embodiments, the present application also proposes a storage medium.

[0285] When the instructions in the storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the audio signal processing method as described above.

[0286] In order to implement the above embodiments, the present application also provides a computer program product.

[0287] When the computer program product is executed by a processor of an electronic device, the electronic device is enabled to execute the method as described above.

[0288] Fig.11 The present invention is a block diagram of an electronic device according to an exemplary embodiment. Fig.11 The electronic device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0289] like Fig.11As shown, the electronic device 1100 includes a processor 1101, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 1102 or a program loaded from a memory 1106 to a random access memory (RAM) 1103. In the RAM 1103, various programs and data required for the operation of the electronic device 1100 are also stored. The processor 1101, the ROM 1102, and the RAM 1103 are connected to each other via a bus 1104. An input / output (I / O) interface 1105 is also connected to the bus 1104.

[0290] The following components are connected to the I / O interface 1105: a memory 1106 including a hard disk, etc.; and a communication part 1107 including a network interface card such as a LAN (Local Area Network) card, a modem, etc., and the communication part 1107 performs communication processing via a network such as the Internet; a drive 1108 is also connected to the I / O interface 1105 as needed.

[0291] In particular, according to an embodiment of the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 1107. When the computer program is executed by the processor 1101, the above-mentioned functions defined in the method of the present application are executed.

[0292] In an exemplary embodiment, a storage medium including instructions is also provided, such as a memory including instructions, and the instructions can be executed by the processor 1101 of the electronic device 1100 to complete the above method. Optionally, the storage medium can be a non-transitory computer-readable storage medium, for example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.

[0293] In the present application, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, apparatus, or device. In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in combination with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium may be transmitted using any suitable medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.

[0294] Fig.12 The present invention is a structural block diagram of an electronic device according to an exemplary embodiment. Fig.12 The electronic device shown is only an example and should not limit the functions and scope of use of the embodiments of the present application. Fig.12 As shown, the electronic device 1200 includes a processor 1201 and a memory 1202. The memory 1202 is used to store program codes, and the processor 1201 is connected to the memory 1202 to read the program codes from the memory 1202 to implement the audio signal processing method in the above embodiment.

[0295] Optionally, the number of processors 1201 may be one or more.

[0296] Optionally, the electronic device may further include an interface 1203, and the number of the interface 1203 may be multiple. The interface 1203 may be connected to an application program and may receive data from an external device such as a sensor.

[0297] Those skilled in the art will readily appreciate other embodiments of the present invention after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses or adaptations of the present invention that follow the general principles of the present invention and include common knowledge or customary techniques in the art that are not disclosed in this application. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present application are indicated by the following claims.

[0298] It should be understood that the present application is not limited to the precise structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.

Claims

1. An audio signal processing method, characterized in that: The method comprises: Encode N audio signals to obtain respective audio encoding data, where the value of N is an integer greater than or equal to 2; Determine the target speaker associated with each audio signal; For each audio signal, the audio encoding data of the audio signal is sent to a target speaker associated with the audio signal for decoding and playback.

2. The method according to claim 1, characterized in that The step of determining the target loudspeaker associated with each audio signal includes: Obtaining a target application identifier carried by the audio signal; The mapping relationship between the application identifier and the speaker identifier is queried to obtain a speaker that has a mapping relationship with the target application identifier as the target speaker associated with the audio signal.

3. The method according to claim 1, characterized in that In the case where each audio signal corresponds to an encoder, encoding the N audio signals to obtain respective audio encoding data includes: Each audio signal is input into a corresponding encoder for encoding, and the encoder obtains the respective audio encoding data from the input audio signal.

4. The method according to claim 1, characterized in that: In the case where M audio signals among the N audio signals use one encoder, M is an integer greater than or equal to 2, and M≤N, wherein encoding the N audio signals to obtain respective audio encoding data includes: Buffering the M channels of audio signals into a first buffer area; Input the M channels of audio signals in the first buffer area into the multiplexed encoder one by one according to the first-in-first-out principle, and the encoder encodes the input audio signals to obtain the respective audio encoding data; The remaining (NM) audio signals of the unmultiplexed encoders are input into the corresponding encoders, and the encoders encode the input audio signals to obtain the respective audio encoding data.

5. The method according to claim 4, characterized in that The step of caching the M audio signals into a first buffer area includes: generating a packet header mark for each audio signal in the M audio signals, and adding the packet header mark to the header of the audio signal, wherein the packet header mark is used to distinguish the audio signals in the M audio signals; Each audio signal carrying the packet header mark in the M audio signals is cached in the first cache area.

6. The method according to any one of claims 1 to 5, characterized in that The step of encoding N channels of audio signals to obtain respective audio encoding data includes: For each audio signal, determining encoding parameters supported by a target speaker associated with the audio signal; The encoder encodes the input audio signal according to the encoding parameters supported by the target speaker to obtain the audio encoding data.

7. The method according to claim 6, characterized in that The step of encoding the input audio signal by the encoder to obtain the audio encoding data comprises: Determining a sound output format corresponding to the audio signal; Each audio signal is input into a corresponding encoder, and the encoder encodes the audio signal according to the encoding parameters and outputs corresponding audio encoding data according to the sound output format.

8. The method according to claim 1, characterized in that: In a scenario where L audio signals among the N audio signals are shared by two or more speakers, L is an integer greater than or equal to 2, and L≤N, wherein the N audio signals are encoded to obtain respective audio encoding data, including: Input each shared audio signal in the L audio signals into a corresponding encoder for encoding, so as to obtain shared audio encoding data corresponding to the shared audio signal; The sending the audio encoding data of the audio signal to the target speaker associated with the audio signal for decoding and playing includes: Determine the number of speakers to which the shared audio signal is shared; The shared audio encoding data is copied according to the number of the speakers, and the audio encoding data is sent to each shared speaker.

9. The method according to claim 1, characterized in that: The step of encoding N channels of audio signals to obtain respective audio encoding data includes: Determine the playback channel to which the target speaker associated with each audio signal belongs; For each audio signal, the audio signal is input into a corresponding encoder, and the encoder encodes the input audio signal according to the encoding parameters corresponding to the playback channel to obtain the corresponding audio encoding data.

10. The method according to any one of claims 1 to 5 or 8 or 9, characterized in that: In the case where K of the N audio signals share the same communication component, K is an integer greater than or equal to 2, and K≤N, wherein the sending of the audio encoding data of the audio signal to the target speaker associated with the audio signal for decoding and playing includes: Cache the audio coding data corresponding to each audio signal in the K audio signals in the second buffer area of ​​the shared communication component; Sending the K-channel audio encoding data in the second buffer area to the target speakers associated with the K-channel audio signals respectively through the common communication component according to the first-in-first-out principle, and the target speakers associated with the K-channel audio signals respectively are connected to the terminal device through the common communication component; The audio encoding data of the remaining (NK) audio signals that do not share the same communication component are sent to the target speakers associated with the (NK) audio signals through their respective corresponding communication components, and the target speakers associated with the (NK) audio signals are connected to the terminal device through their respective communication components.

11. The method according to any one of claims 1 to 5 or 8 or 9, characterized in that: In a case where each of the N audio signals corresponds to a different communication component, sending the audio encoding data of the audio signal to a target speaker associated with the audio signal for decoding and playing includes: Each of the N audio signals is sent to the target speakers associated with each of the N audio signals through the corresponding communication components.

12. An audio signal processing device, characterized in that: include: An encoding module, used for encoding N audio signals to obtain respective audio encoding data, where the value of N is an integer greater than or equal to 2; A speaker acquisition module is used to determine the target speaker associated with each audio signal; The playing module is used to send the audio encoding data of each audio signal to the target speaker associated with the audio signal for decoding and playing.

13. An electronic device, characterized in that: include: processor; a memory for storing instructions executable by the processor; The processor is configured to execute the instructions to implement the method according to any one of claims 1 to 11.

14. A non-transitory computer-readable storage medium, characterized in that: When the instructions in the storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the method as claimed in any one of claims 1 to 11.

15. A computer program product, characterized in that The invention comprises a computer program, which implements the method according to any one of claims 1 to 11 when being executed by a processor.