Audio playback method, system, electronic device and computer-readable storage medium

By generating and sending appropriate audio signals in the electronic device, the hearing aid and other audio devices can play audio simultaneously, and the problem of being unable to play audio simultaneously in the prior art is solved, and the audio sharing function is realized.

CN119743715APending Publication Date: 2025-04-01HONOR DEVICE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311239841.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-09-22
Publication Date
2025-04-01

AI Technical Summary

Technical Problem

In the prior art, hearing aids and other audio devices cannot play audio simultaneously and cannot meet the actual scene needs.

Method used

By generating the first audio signal and the second audio signal in the electronic device and sending it to the hearing aid and the first audio device, the hearing aid and the first audio device can simultaneously play the sound corresponding to the audio data.

Benefits of technology

It realizes audio sharing between hearing aids and other audio devices, meeting the audio sharing needs of hearing-impaired people.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119743715A_ABST
    Figure CN119743715A_ABST
Patent Text Reader

Abstract

The present application provides an audio playback method, system, electronic device and computer-readable storage medium. The audio playback method includes: when the electronic device is communicatively connected with a hearing aid and a first audio device, determining the sound output mode of the hearing aid; when it is determined that the sound output mode of the hearing aid is a first mode, generating a first audio signal and a second audio signal according to audio data of the electronic device; sending the first audio signal to the hearing aid, and sending the second audio signal to the first audio device to instruct the hearing aid and the first audio device to simultaneously play the sound corresponding to the audio data, thereby realizing audio sharing between the hearing aid and the first audio device.
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, and in particular to an audio playback method, system, electronic device and computer-readable storage medium. Background Art

[0002] By connecting hearing aids to electronic devices such as mobile phones, hearing-impaired people can listen to the audio played by electronic devices through hearing aids. In the prior art, when an electronic device is connected to a hearing aid, the sound output channel is in the hearing aid, that is, the audio is only played through the hearing aid. If the electronic device is connected to other audio devices (such as speakers, TVs, or headphones), the electronic device will set the sound output channel to other audio devices, and the hearing aid cannot play audio. That is, the hearing aid and other audio devices cannot play audio at the same time, which cannot meet the needs of actual scenarios. Summary of the invention

[0003] The present application provides an audio playback method, system, electronic device and computer-readable storage medium, which solve the problem in the prior art that hearing aids and other audio devices cannot play audio at the same time.

[0004] In order to achieve the above objectives, this application adopts the following technical solutions:

[0005] In a first aspect, an audio playback method is provided, in which, when an electronic device is in communication connection with a hearing aid and a first audio device, the sound output mode of the hearing aid is determined, and when the sound output mode of the hearing aid is determined to be the first mode, it is determined that the hearing aid has turned on a mode of always outputting sound, and the electronic device generates a first audio signal and a second audio signal according to audio data, sends the first audio signal to the hearing aid, and sends the second audio signal to the first audio device, so as to instruct the hearing aid and the first audio device to simultaneously play the sound corresponding to the audio data. Therefore, the hearing-impaired user can hear the sound played by the electronic device through the hearing aid, and other users can hear the sound played by the electronic device through the first audio device.

[0006] In one embodiment, generating a first audio signal and a second audio signal according to audio data of an electronic device includes:

[0007] Generate a digital signal to be sent according to the audio data of the electronic device, copy the digital signal to be sent to obtain a first digital signal and a second digital signal, encode the first digital signal according to a first transmission protocol to obtain a first audio signal, and encode the second digital signal according to a second transmission protocol to obtain a second audio signal. The first transmission protocol is determined by the hearing aid, and the second transmission protocol is determined by the first audio device. Sending the first audio signal to the hearing aid and sending the second audio signal to the first audio device can enable the hearing aid and the first audio device to decode the first audio signal and the second audio signal respectively according to the corresponding transmission protocols, and then can simultaneously play the sound corresponding to the audio data of the electronic device.

[0008] In one embodiment, when the first transmission protocol and the second transmission protocol are the same, generating the first audio signal and the second audio signal according to the audio data of the electronic device includes: generating a digital signal to be sent according to the audio data of the electronic device, encoding the digital signal to be sent to obtain the audio signal to be sent, and copying the audio signal to be sent to obtain the same first audio signal and the second audio signal. The electronic device can set the first transmission protocol and the second transmission protocol to be the same transmission protocol when the hearing aid and the first audio device are connected.

[0009] In one embodiment, the electronic device is connected to the hearing aid and the first audio device via Bluetooth. The electronic device can perform an operation of copying the digital signal to be sent in the Bluetooth protocol stack to achieve audio signal diversion and obtain the first audio signal and the second audio signal.

[0010] In one embodiment, when the electronic device instructs the hearing aid to play the sound corresponding to the audio data, if it is detected that the first audio device is connected to the electronic device, the electronic device can output a prompt message for setting the sound mode of the hearing aid, and then obtain the user's first input information, and determine the sound mode of the hearing aid based on the first input information.

[0011] In one embodiment, the electronic device sets a rule for giving priority to the sound of the hearing aid. When the electronic device instructs the first audio device to play the sound corresponding to the audio data, if it is detected that the hearing aid is connected to the electronic device, the sound mode is determined to be the first mode, thereby controlling the hearing aid and the first audio device to play the sound corresponding to the audio data at the same time.

[0012] In one embodiment, after sending the first audio signal to the hearing aid and sending the second audio signal to the first audio device, the method further includes: when receiving a first control instruction to set the hearing aid to silent mode, encoding the audio data and sending it to the first audio device.

[0013] In one embodiment, after sending the first audio signal to the hearing aid and sending the second audio signal to the first audio device, the method further includes: if it is detected that the first audio device is disconnected from the electronic device, encoding the audio data and sending it to the hearing aid.

[0014] In one embodiment, after sending the first audio signal to the hearing aid and sending the second audio signal to the first audio device, the method further includes: when a first volume adjustment instruction is detected, adjusting the volume of the hearing aid according to the first volume adjustment instruction, and / or, when a second volume adjustment instruction is detected, adjusting the volume of the first audio device according to the second volume adjustment instruction.

[0015] In a second aspect, an audio playback device is provided, comprising a communication module and a processing module.

[0016] The communication module is used to determine the sound output mode of the hearing aid when the electronic device is in communication connection with the hearing aid and the first audio device;

[0017] The processing module is used to generate a first audio signal and a second audio signal according to the audio data of the electronic device when it is determined that the sound output mode of the hearing aid is the first mode;

[0018] The communication module is further used to send the first audio signal to the hearing aid and send the second audio signal to the first audio device, so as to instruct the hearing aid and the first audio device to simultaneously play the sound corresponding to the audio data.

[0019] In one embodiment, the processing module is specifically used for:

[0020] Generate a digital signal to be sent according to the audio data of the electronic device;

[0021] Copying the digital signal to be sent to obtain a first digital signal and a second digital signal;

[0022] Encoding the first digital signal according to a first transmission protocol to obtain the first audio signal;

[0023] The second digital signal is encoded according to a second transmission protocol to obtain the second audio signal.

[0024] In one embodiment, the processing module is specifically used for:

[0025] Generate a digital signal to be sent according to the audio data of the electronic device;

[0026] Encoding the digital signal to be sent to obtain an audio signal to be sent;

[0027] The to-be-sent audio signal is copied to obtain the first audio signal and the second audio signal.

[0028] In one embodiment, the electronic device is connected to the hearing aid and the first audio device via Bluetooth.

[0029] In one embodiment, the processing module is further configured to:

[0030] In the case where the electronic device instructs the hearing aid to play the sound corresponding to the audio data, if it is detected that the first audio device is connected to the electronic device, first input information is obtained; and the sound output mode is determined according to the first input information.

[0031] In one embodiment, the processing module is further configured to:

[0032] In the case where the electronic device instructs the first audio device to play the sound corresponding to the audio data, if it is detected that the hearing aid is connected to the electronic device, the sound output mode is determined to be the first mode.

[0033] In one embodiment, the communication module is further used for:

[0034] When a first control instruction is received, the audio data is encoded and sent to the first audio device, and the first control instruction is used to instruct the hearing aid to be set to a silent mode.

[0035] In one embodiment, the communication module is further used for:

[0036] If it is detected that the first audio device is disconnected from the electronic device, the audio data is encoded and sent to the hearing aid.

[0037] In one embodiment, the communication module is further used for:

[0038] When a first volume adjustment instruction is detected, adjusting the volume of the hearing aid according to the first volume adjustment instruction, and / or,

[0039] When a second volume adjustment instruction is detected, the volume of the first audio device is adjusted according to the second volume adjustment instruction.

[0040] In a third aspect, an electronic device is provided, comprising a processor, wherein the processor is used to execute a computer program stored in a memory to implement the audio playback method as described in the first aspect above.

[0041] In a fourth aspect, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the audio playback method as described in the first aspect is implemented.

[0042] In a fifth aspect, an audio playback system is provided, comprising a hearing aid, a first audio device, and the electronic device as described in the third aspect above, wherein the electronic device is communicatively connected to the hearing aid, and the electronic device is communicatively connected to the first audio device.

[0043] In a sixth aspect, a chip is provided, the chip comprising a processor, the processor being coupled to a memory, the processor executing a computer program or instruction stored in the memory to implement the audio playback method as described in the first aspect above.

[0044] In a seventh aspect, a computer program product is provided. When the computer program product is run on an electronic device, the electronic device executes the audio playback method described in the first aspect.

[0045] It can be understood that the beneficial effects of the second to seventh aspects mentioned above can be found in the relevant description of the first aspect mentioned above, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0046] Figure 1 A schematic diagram of an audio playback system provided in one embodiment of the present application;

[0047] Figure 2 A flowchart of an audio playback method provided in one embodiment of the present application;

[0048] Figure 3 A schematic diagram of a setting interface of a hearing aid on an electronic device provided in an embodiment of the present application;

[0049] Figure 4 A schematic diagram of an audio switching interface on an electronic device provided by an embodiment of the present application;

[0050] Figure 5 A schematic diagram of an audio switching interface on an electronic device provided by another embodiment of the present application;

[0051] Figure 6 A schematic diagram of a volume adjustment page on an electronic device provided by an embodiment of the present application;

[0052] Figure 7 A schematic diagram of a volume setting page on an electronic device provided in an embodiment of the present application;

[0053] Figure 8 A flowchart of generating a first audio signal and a second audio signal from audio data provided by an embodiment of the present application;

[0054] Fig. 9 A schematic diagram of a process of an electronic device controlling a hearing aid and a first audio device to play a sound corresponding to audio data provided by an embodiment of the present application;

[0055] Fig.10 Another embodiment of the present application provides a flowchart of generating a first audio signal and a second audio signal from audio data;

[0056] Fig.11 A flowchart of implementing audio playback by a hearing aid and a first audio device provided in an embodiment of the present application;

[0057] Fig.12 A software architecture diagram of an electronic device provided in one embodiment of the present application;

[0058] Fig.13 A schematic diagram of the structure of an electronic device provided in one embodiment of the present application. DETAILED DESCRIPTION

[0059] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.

[0060] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, wholes, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or combinations thereof.

[0061] It should also be understood that the term “and / or” used in the specification and appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.

[0062] As used in the specification and appended claims of this application, the term "if" can be interpreted as "when" or "uponce" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is detected" can be interpreted as meaning "uponce it is determined" or "in response to determining" or "uponce [described condition or event] is detected" or "in response to detecting [described condition or event]", depending on the context.

[0063] In addition, in the description of the present application, the terms "first", "second", etc. are only used to distinguish the description and cannot be understood as indicating or implying relative importance.

[0064] References to "one embodiment" or "some embodiments" etc. described in the specification of this application mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.

[0065] In the prior art, when a mobile phone is connected to a hearing aid, the hearing aid can play the audio of the mobile phone. At this time, if other audio devices are connected to the mobile phone, the other audio devices play the audio of the mobile phone, and the hearing aid cannot play the audio of the mobile phone, and the user cannot hear the original audio played by the mobile phone through the hearing aid. If the user selects the hearing aid as the sound device, other audio devices will not be able to play the audio of the mobile phone. Therefore, it is impossible to realize audio sharing between hearing aids and other audio devices, and the audio sharing needs of the hearing-impaired cannot be met.

[0066] To this end, the present application provides an audio playback method, which generates a first audio signal and a second audio signal from audio data of an electronic device, and sends the first audio signal and the second audio signal to a hearing aid and a first audio device respectively, thereby achieving audio sharing between the hearing aid and the first audio device.

[0067] The audio playback method provided by this application is introduced in detail below.

[0068] The audio playback method provided in the embodiment of the present application is executed in an electronic device.

[0069] For example, the electronic device described in the embodiments of the present application may be a mobile phone, a tablet computer, a handheld computer, a personal digital assistant (PDA), an augmented reality (AR) / virtual reality (VR) device, a media player, a wearable device, or other device that can be held / operated with one hand. The embodiments of the present application do not impose any special restrictions on the specific form / type of the electronic device. The above-mentioned electronic devices include but are not limited to devices equipped with Devices running Harmony OS or other operating systems.

[0070] The audio playback method provided in the embodiment of the present application is applied to an audio playback system. Figure 1 Schematic diagram of an audio playback system provided in an embodiment of the present application. Figure 1 As shown, the electronic device 100 can establish a communication connection with the hearing aid 200 and the first audio device 300 according to the connection instruction input by the user, and then generate a first audio signal and a second audio signal according to the audio data of the electronic device 100, and send the first audio signal and the second audio signal to the hearing aid 200 and the first audio device 300 respectively. The electronic device 100 can also disconnect the communication connection with the hearing aid 200 or the first audio device 300 according to the user's instruction, so as to only send the audio signal generated according to the audio data to the hearing aid 200 or the first audio device 300.

[0071] The first audio device 300 may be a terminal device such as a speaker, a headset, or a television. The first audio device 300 may be one terminal device or may include multiple terminal devices.

[0072] Combine the following Figure 1 The application scenario shown introduces the process of the audio playback method provided in the embodiment of the present application.

[0073] like Figure 2 As shown, the audio playback method provided by an embodiment of the present application includes:

[0074] S201: When the electronic device is in communication connection with the hearing aid and the first audio device, determine the sound output mode of the hearing aid.

[0075] The communication connection between the electronic device and the hearing aid and the first audio device may be a wired connection or a wireless connection. The wireless connection may be a Bluetooth connection, a WIFI connection, a 4G connection, a 5G connection, etc. The electronic device may be wiredly connected to the hearing aid and the first audio device, or wirelessly connected to the hearing aid and the first audio device, or wiredly connected to one of the hearing aid and the first audio device and wirelessly connected to the other device.

[0076] The electronic device may determine the sound output mode of the hearing aid according to the setting information of the sound output mode sent by the hearing aid, or may determine the sound output mode of the hearing aid according to the operation information of the user on the electronic device.

[0077] For example, the hearing aid is provided with three sound mode options: a continuous sound mode, a separate sound mode, and a silent mode. The hearing aid determines the sound mode selected by the user according to the user operation and sends the information of the sound mode selected by the user to the electronic device.

[0078] For another example, the electronic device is a mobile phone, and the hearing aid is connected to the electronic device via Bluetooth. In the Bluetooth setting interface of the electronic device, the setting page of the hearing aid can be opened. Figure 3As shown in (a) of FIG. 1 , the setting page of the hearing aid includes options for renaming, automatic Bluetooth connection, synchronization of Bluetooth device volume with mobile phone, and voice mode. When the electronic device detects that the user clicks on the voice mode option, the setting page of the hearing aid opens as shown in FIG. Figure 3 The sound mode setting page shown in (b) displays three sound mode options: always-on mode, separate sound mode, and silent mode. The electronic device determines the sound mode of the hearing aid based on the user's selection information, and controls the hearing aid to play or stop playing audio based on the sound mode of the hearing aid.

[0079] Among them, the always-sound mode means that when the hearing aid is connected to the electronic device for communication, the hearing aid always plays the audio of the electronic device, regardless of whether other audio devices are connected to the electronic device or whether other audio devices play the audio of the electronic device. The single-sound mode means that when the hearing aid is connected to the electronic device for communication, regardless of whether other audio devices are connected to the electronic device, the electronic device only plays audio through the hearing aid and does not play audio through other audio devices. The silent mode means that the hearing aid does not play audio from the electronic device.

[0080] The sound output mode of the hearing aid may also include two sound output modes: a sound output mode all the time and a sound output mode not all the time. In the sound output mode all the time, the hearing aid plays the audio of the electronic device all the time. In the sound output mode not all the time, the electronic device may play the audio only through the hearing aid, or may play the audio through the first audio device. Exemplarily, a switch is set on the hearing aid to determine whether to turn on the sound output mode all the time. The hearing aid sends information on whether the user turns on the switch of the sound output mode all the time to the electronic device. When the electronic device detects that the user turns on the switch of the sound output mode all the time, it determines that the sound output mode of the hearing aid is the sound output mode all the time. When the electronic device detects that the user turns off the switch of the sound output mode all the time, it determines that the sound output mode of the hearing aid is not the sound output mode all the time.

[0081] When the electronic device detects that the hearing aid has turned off the switch of the always-sound mode, it can determine the audio output channel based on the communication connection between the hearing aid and the first audio device and the electronic device. Exemplarily, the electronic device can use the audio device that was most recently connected to the electronic device as the audio output channel, and only play the audio of the electronic device through the audio device that was most recently connected to the electronic device. For example, when the hearing aid is connected to the electronic device, and the hearing aid is not in the always-sound mode, if the electronic device connects the first audio device to the electronic device according to the user's operation, the first audio device is the audio device that was most recently connected to the electronic device, and the electronic device uses the first audio device as the audio output channel and plays the audio through the first audio device.

[0082] S202: When it is determined that the sound output mode of the hearing aid is the first mode, generate a first audio signal and a second audio signal according to audio data of the electronic device.

[0083] The first mode is a continuous sound mode. In the continuous sound mode, the hearing aid and the first audio device that are communicatively connected to the electronic device can play the audio of the electronic device at the same time.

[0084] The audio data of the electronic device can be obtained from an application for playing audio or video on the electronic device (such as music, video, The first audio signal and the second audio signal are obtained by encoding the audio data. The first audio signal and the second audio signal are determined according to the transmission protocol of the hearing aid and the first audio device, and are used to adapt the hearing aid and the first audio device respectively. The first audio signal and the second audio signal may be the same or different.

[0085] S203: Send the first audio signal to the hearing aid, and send the second audio signal to the first audio device, to instruct the hearing aid and the first audio device to play the sound corresponding to the audio data simultaneously.

[0086] Specifically, since both the first audio signal and the second audio signal are generated according to the audio data of the electronic device, the hearing aid can play the sound corresponding to the audio data after receiving the first audio signal. The first audio device can play the sound corresponding to the audio data after receiving the second audio signal.

[0087] In the above embodiment, when the electronic device determines that the sound output mode of the hearing aid is the first mode, it generates a first audio signal and a second audio signal according to the audio data of the electronic device, sends the first audio signal to the hearing aid, and sends the second audio signal to the first audio device, so that the hearing aid and the first audio device can be controlled to play the sound corresponding to the audio data at the same time according to user needs.

[0088] The following describes the audio playback method provided in the embodiment of the present application in conjunction with specific application scenarios.

[0089] In one application scenario, an electronic device establishes communication connections with a hearing aid and a first audio device in sequence. For example, the hearing aid and the first audio device are both Bluetooth devices, and the electronic device is a mobile phone. The mobile phone can pair with the hearing aid and the first audio device in sequence and establish a Bluetooth connection by searching for Bluetooth devices. Afterwards, when the electronic device detects an instruction from the user to play the audio in the application, it determines the sound mode of the hearing aid. Among them, when the electronic device detects an instruction from the user to play the audio, it can display a setting interface for the sound mode of the hearing aid, and determine the sound mode of the hearing aid according to the user's setting information. Or when the electronic device detects an instruction from the user to play the audio, it outputs prompt information for setting the sound mode of the hearing aid, and then determines the sound mode of the hearing aid according to the user's setting information on the hearing aid or the setting information on the electronic device.

[0090] If the sound output mode of the hearing aid is the always-on mode, the electronic device generates a first audio signal and a second audio signal according to the audio data, and sends the first audio signal and the second audio signal to the hearing aid and the first audio device, respectively. If the sound output mode of the hearing aid is the single sound output mode, the electronic device sends the audio signal generated according to the audio data to the hearing aid, and does not send the audio signal to the first audio device. If the sound output mode of the hearing aid is the silent mode, the electronic device sends the audio signal generated according to the audio data to the first audio device, and does not send the audio signal to the hearing aid.

[0091] For example, a mobile phone establishes a Bluetooth connection with a hearing aid and a speaker. When the mobile phone detects that the sound output mode of the hearing aid is in the always-on mode, the first audio signal is sent to the hearing aid and the second audio signal is sent to the speaker. That is, the hearing aid and the speaker can simultaneously play the sound corresponding to the audio data on the mobile phone.

[0092] For another example, a mobile phone establishes a Bluetooth connection with a hearing aid and a TV. When the mobile phone detects that the hearing aid is in the always-on sound mode, it sends a first audio signal to the hearing aid, sends a second audio signal to the TV, and sends a video signal corresponding to the second audio signal to the TV. The TV then plays the video on the mobile phone, and the TV and hearing aid play the sound corresponding to the audio data at the same time.

[0093] In another application scenario, an electronic device establishes a communication connection with a hearing aid. After that, when the electronic device detects an instruction from a user to play the audio in an application, the electronic device sends an audio signal generated according to the audio data to the hearing aid, and the hearing aid plays the sound corresponding to the audio data according to the received audio signal. After that, the electronic device establishes a communication connection with the first audio device according to the user's instruction. When it is determined that the first audio device is connected to the electronic device, the setting interface of the sound output mode of the hearing aid is displayed on the display interface, the first input information of the user in the setting interface is obtained, and the sound output mode is determined according to the first input information. If the first input information is an instruction to select a sound output mode that always outputs sound, the electronic device generates a first audio signal and a second audio signal according to the audio data, and sends the first audio signal and the second audio signal to the hearing aid and the first audio device respectively. If the first input information is an instruction to select a separate sound output mode, the electronic device sends the audio signal generated according to the audio data to the hearing aid, and does not send the audio signal to the first audio device. If the first input information is an instruction to select a silent mode, the electronic device sends the audio signal generated according to the audio data to the first audio device, and does not send the audio signal to the hearing aid.

[0094] In other embodiments, the electronic device may also set the hearing aid to the default always-sounding mode according to the user's setting information. The electronic device may also set the hearing aid's sound output mode to the always-sounding mode by default when it detects that at least two audio devices including the hearing aid are connected to the electronic device according to the user's setting information. In these cases, when the electronic device determines that the first audio device is connected to the electronic device, it generates a first audio signal and a second audio signal according to the audio data, and sends the first audio signal and the second audio signal to the hearing aid and the first audio device, respectively.

[0095] In another application scenario, the electronic device establishes a communication connection with the first audio device, and when a user instructs to play the audio in the application program is detected, the audio signal generated according to the audio data is sent to the first audio device, and the first audio device plays the sound corresponding to the audio data according to the received audio signal. Afterwards, the electronic device establishes a communication connection with the hearing aid according to the user's instructions, and when it is determined that the hearing aid is connected to the electronic device, it determines that the sound output mode of the hearing aid is a constant sound output mode. That is, the electronic device sets the sound output mode of the connected hearing aid to a constant sound output mode when the electronic device plays audio through the first audio device according to the user's setting information or according to the priority sound output rule of the hearing aid. Afterwards, the electronic device generates a first audio signal and a second audio signal according to the audio data, and sends the first audio signal and the second audio signal to the hearing aid and the first audio device, respectively.

[0096] In one embodiment, the electronic device may display a setting interface for the hearing aid sound mode each time it detects that a hearing aid is connected, and then instruct the hearing aid or the first audio device to play the sound corresponding to the audio data according to the sound mode selected by the user, or instruct the hearing aid and the first audio device to play the sound corresponding to the audio data at the same time.

[0097] In another embodiment, each time the hearing aid is connected to an electronic device, it plays a voice prompt instructing the user to set the sound mode. The user can select the sound mode setting button on the hearing aid according to the voice prompt, and the hearing aid sends the sound mode information selected by the user to the electronic device based on the user's operation information.

[0098] In another application scenario, an electronic device establishes a communication connection with a hearing aid and a first audio device, and the hearing aid and the first audio device simultaneously play the sound corresponding to the audio data of the electronic device, that is, the hearing aid plays the audio according to the received first audio signal, and the first audio device plays the audio according to the received second audio signal. If the electronic device receives a first control instruction, and the first control instruction is used to instruct to set the hearing aid to a silent mode, the electronic device encodes the audio data and sends it to the first audio device, so that the hearing aid does not play the sound corresponding to the audio data, and the first audio device plays the sound corresponding to the audio data.

[0099] The first control instruction may be input by the user, for example, the electronic device opens the setting interface of the sound mode of the hearing aid according to the user's instruction, and detects the first control instruction input by the user in the setting interface to set the sound mode to the silent mode. The first control instruction may also be sent by the hearing aid, for example, the user selects the silent mode on the hearing aid, and the hearing aid sends the silent mode information to the electronic device.

[0100] After the sound output mode of the hearing aid is set to the silent mode, the electronic device can set the hearing aid to the always-on sound output mode or the single sound output mode according to the user's instruction, and then control the hearing aid and the first audio device to play audio according to different modes.

[0101] In another application scenario, the electronic device establishes a communication connection with the hearing aid and the first audio device, and the hearing aid and the first audio device simultaneously play the sound corresponding to the audio data of the electronic device. If the electronic device detects that the first audio device is disconnected from the electronic device, the audio data is encoded and sent to the hearing aid, and only the hearing aid plays the sound corresponding to the audio data.

[0102] In one application scenario, when the electronic device establishes a communication connection with the hearing aid, the electronic device displays a message on the display interface as follows: Figure 4The audio switching options shown are currently available audio output devices, including the local device and the hearing aid. When the electronic device detects that the user selects the hearing aid, the audio data is encoded and sent to the hearing aid. When the electronic device detects that the user selects the local device, the sound corresponding to the audio data is played directly through the electronic device.

[0103] When the electronic device establishes a communication connection with the hearing aid and the first audio device, the electronic device displays on the display interface: Figure 5 The audio switching options shown are currently available audio output devices, including the local device, the hearing aid, and the first audio device. When the electronic device detects that the user only selects the hearing aid, it determines that the sound output mode of the hearing aid is a single sound output mode, encodes the audio data and sends it to the hearing aid, and only the hearing aid plays the sound corresponding to the audio data. When the electronic device detects that the user only selects the first audio device, it determines that the sound output mode of the hearing aid is a silent mode, encodes the audio data and sends it to the first audio device, and only the first audio device plays the sound corresponding to the audio data. When the electronic device detects that the user selects the hearing aid and the first audio device, it determines that the sound output mode of the hearing aid is a constant sound output mode, generates a first audio signal and a second audio signal according to the audio data, and sends the first audio signal and the second audio signal to the hearing aid and the first audio device, respectively.

[0104] In the above embodiment, when the audio device connected to the electronic device changes, the electronic device generates one audio signal or two audio signals according to the sound output mode of the hearing aid, so that one audio device or two audio devices can be controlled to play audio according to user needs.

[0105] In one embodiment, when the electronic device is in communication with the hearing aid and the first audio device, the volume of the hearing aid and the first audio device can be controlled by the electronic device. Figure 6 As shown, the electronic device is connected to the hearing aid and the first audio device via Bluetooth. When the electronic device detects that the user clicks the volume button, the first adjustment control 61 and the second adjustment control 62 for adjusting the volume are displayed on the display interface. The electronic device determines a first volume adjustment instruction according to the user's sliding operation on the first adjustment control 61, adjusts the volume of the hearing aid according to the first volume adjustment instruction, determines a second volume adjustment instruction according to the user's sliding operation on the second adjustment control 62, and adjusts the volume of the first audio device according to the second volume adjustment instruction. Alternatively, when the electronic device detects the user's volume setting instruction, it opens the Figure 7The volume setting interface shown in (a) of FIG. The volume setting interface displays a volume adjustment control 71 of the hearing aid and a volume adjustment control 72 of the first audio device. The electronic device adjusts the volume of the hearing aid and the first audio device respectively according to the user's operation on the volume setting interface.

[0106] It can be understood that when the electronic device is in communication connection with the hearing aid or the first audio device, the volume of the hearing aid or the first audio device can be adjusted by the electronic device.

[0107] In one embodiment, if Figure 7 As shown in (a) of FIG. 1 , the volume setting interface displays a sound effect setting option 73 of the hearing aid and a sound effect setting option 74 of the first audio device. When the electronic device detects that the user clicks the sound effect setting option 753 of the hearing aid, the electronic device opens the Figure 7 The sound effect setting interface of the hearing aid shown in (b) of FIG. For example, the sound effects of the sound effect setting interface of the hearing aid include intelligent sound effects, 3D immersive sound effects, fidelity sound effects, and ordinary sound effects. The electronic device processes the first audio signal according to the sound effect option selected by the user and sends it to the hearing aid. When the electronic device detects that the user clicks the sound effect setting option 74 of the first audio device, it opens the Figure 7 The sound effect setting interface of the first audio device shown in (c) in FIG. The sound effect setting interface of the first audio device may be the same as the sound effect setting interface of the hearing aid. The electronic device processes the second audio signal according to the sound effect option selected by the user and sends the second audio signal to the first audio device.

[0108] In other embodiments, the user may also adjust the volume and sound effects of the hearing aid on the hearing aid, and the hearing aid sends the corresponding volume or sound effect adjustment instruction to the electronic device according to the user operation, and the electronic device processes the first audio signal according to the corresponding volume or sound effect adjustment and sends it to the hearing aid. The user may also adjust the volume and sound effects of the first audio device on the first audio device, and the first audio device sends the corresponding volume or sound effect adjustment instruction to the electronic device according to the user operation, and the electronic device processes the second audio signal according to the corresponding volume or sound effect adjustment and sends it to the first audio device.

[0109] In one embodiment, the hearing aid is provided with MIC mute and MIC reception buttons. When the hearing aid detects the MIC mute command, it does not receive the surrounding environment sound. When the hearing aid detects the MIC reception command, it receives the surrounding environment sound and amplifies it for playback. The electronic device may also display the MIC mute and MIC reception options of the hearing aid. The electronic device sends the MIC mute or MIC reception command to the hearing aid according to the user operation to instruct the hearing aid to set the corresponding mode. For example, when the hearing aid used by the user plays audio together with the speakers used by others, if the user needs to talk to others, the MIC reception and the always-sounding mode can be selected on the electronic device, so that the user can hear the voices of others while listening to the original audio played by the mobile phone. If the user needs to experience the audio and video source experience, the MIC mute and the always-sounding mode can be selected on the electronic device, so that only the sound corresponding to the audio data played by the mobile phone can be heard.

[0110] In one embodiment, generating a first audio signal and a second audio signal according to audio data of an electronic device specifically includes: generating a digital signal to be sent according to the audio data of the electronic device, copying the digital signal to be sent to obtain a first digital signal and a second digital signal, encoding the first digital signal according to a first transmission protocol to obtain a first audio signal; encoding the second digital signal according to a second transmission protocol to obtain a second audio signal.

[0111] Specifically, the hearing aid and the first audio device can both communicate with the electronic device through a wired connection or a wireless connection. The first transmission protocol is determined by the electronic device according to the device information of the hearing aid. After the hearing aid receives the first audio signal encoded according to the first transmission protocol, it can decode to obtain the first digital signal, and play the sound corresponding to the audio data according to the first digital signal. The second transmission protocol is determined by the electronic device according to the device information of the first audio device. After the first audio device receives the second audio signal encoded according to the second transmission protocol, it can decode to obtain the second digital signal, and play the sound corresponding to the audio data according to the second digital signal.

[0112] For example, Figure 8As shown, the hearing aid and the first audio device are both connected to the electronic device via Bluetooth, and the audio processing module of the electronic device processes the audio data to obtain the digital signal to be sent, and the digital signal to be sent is sent to the Bluetooth transmission module of the electronic device via Bluetooth (Hardware Abstraction Layer, HAL). After detecting that the Bluetooth transmission module has received the digital signal to be sent, the electronic device copies the digital signal to be sent to obtain a first digital signal and a second digital signal, and the first digital signal and the second digital signal are the same. Among them, the digital signal to be sent can be a Bluetooth pulse code modulation (Pulse Code Modulation, PCM) signal. The Bluetooth protocol stack (BT stack) of the Bluetooth transmission module receives the first digital signal and the second digital signal respectively through the Bluetooth interface (Bluetooth Interface, BTIF), and then the two encoder modules (Encoder) in the Bluetooth protocol stack encode the first digital signal and the second digital signal respectively, and send the encoded first audio signal and the encoded second audio signal to the hearing aid and the first audio device respectively through the chip interface.

[0113] In one embodiment, the process of the electronic device sending the first audio signal and the second audio signal to the hearing aid and the first audio device respectively is as follows: Fig. 9 shown.

[0114] The application of the electronic device stores the audio source in the application cache, the Audio Track module reads the audio source from the application cache, obtains the audio information such as the sampling rate and bit width of the audio source, creates an audio stream according to the audio information, and puts the audio stream into the storage cache, the audioflinger module reads the audio stream from the storage cache, determines the audio path and the audio processing strategy according to the audio stream, processes the audio stream according to the audio path and the audio processing strategy, and the processed audio stream can be a digital signal. The digital signal is sent to the Bluetooth transmission module through the audio HAL layer and the BTHAL layer. After detecting that the Bluetooth transmission module receives the digital signal, the electronic device copies the digital signal to obtain the first digital signal and the second digital signal. The first digital signal and the second digital signal are respectively sent to the Bluetooth protocol stack through the corresponding BTIF and stored in the corresponding encoding cache. The two encoder modules (Encoder) read the first digital signal and the second digital signal from the corresponding encoding cache, respectively, encode the first digital signal and the second digital signal, and obtain the first audio signal and the second audio signal. The first audio signal and the second audio signal are respectively stored in corresponding queue buffers. The Bluetooth driver reads the first audio signal and the second audio signal from the queue buffer, sends the first audio signal to the hearing aid through the chip, and sends the second audio signal to the first audio device.

[0115] After receiving the first audio signal, the hearing aid decodes the first audio signal to obtain a digital signal, performs audio processing on the digital signal, obtains playable audio, and plays the audio through the speaker. After receiving the second audio signal, the first audio device decodes the second audio signal to obtain a digital signal, performs audio processing on the digital signal, obtains playable audio, and plays the audio through the speaker.

[0116] It can be understood that if the hearing aid and the first audio device communicate with the electronic device via Bluetooth and other communication methods respectively, the audio processing module of the electronic device processes the audio data to obtain the digital signal to be sent, and then sends the copied first digital signal and the second digital signal to the Bluetooth transmission module and other transmission modules of the electronic device respectively, so that the first digital signal and the second digital signal are processed by each transmission module and then sent to the corresponding audio device.

[0117] In one embodiment, generating a first audio signal and a second audio signal according to audio data of an electronic device specifically includes: generating a digital signal to be sent according to the audio data of the electronic device, encoding the digital signal to be sent to obtain an audio signal to be sent, and copying the audio signal to be sent to obtain the first audio signal and the second audio signal.

[0118] Specifically, the first transmission protocol between the hearing aid and the electronic device, and the second transmission protocol between the first audio device and the electronic device are the same. After obtaining the digital signal to be sent, the electronic device encodes the digital signal according to the same transmission protocol to obtain the audio signal to be sent. The electronic device copies the audio signal to be sent to obtain the same first audio signal and second audio signal. The electronic device sends the first audio signal and the second audio signal to the hearing aid and the first audio device respectively. After the hearing aid and the first audio device decode the first audio signal or the first audio signal respectively according to the same transmission protocol, a digital signal corresponding to the audio data of the electronic device can be obtained, so that the sound corresponding to the audio data can be played according to the digital signal.

[0119] For example, Fig.10 As shown, the hearing aid and the first audio device are both connected to the electronic device via Bluetooth, and the audio processing module of the electronic device processes the audio data to obtain the digital signal to be sent, and the digital signal to be sent is sent to the Bluetooth transmission module of the electronic device through HAL. The Bluetooth protocol stack of the Bluetooth transmission module receives the digital signal to be sent through the Bluetooth interface, sends the digital signal to be sent to the encoding module for encoding, and obtains the audio signal to be sent. The electronic device copies the audio signal to be sent to obtain the same first audio signal and second audio signal, and sends the first audio signal and the second audio signal to the hearing aid and the first audio device respectively through the chip interface.

[0120] In one embodiment, the hearing aid and the first audio device are both connected to the electronic device via Bluetooth, and the process of enabling the hearing aid and the first audio device to play audio simultaneously is as follows: Fig.11 shown.

[0121] The electronic device is connected to the hearing aid in communication, and the audio output device of the electronic device is the hearing aid, that is, the sound output channel of the electronic device is in the hearing aid. The electronic device is then connected to the first audio device in communication, and the audio output device of the electronic device also includes the first audio device, and the sound output channel of the electronic device is in the first audio device. When the electronic device detects an instruction to play audio, it determines the sound output mode of the hearing aid. If the sound output mode of the hearing aid is a continuous sound output mode, the electronic device generates a first audio signal and a second audio signal according to the audio data, sends the first audio signal to the hearing aid, and sends the second audio signal to the first audio device. The hearing aid and the first audio device play the sound corresponding to the audio data at the same time. If the sound output mode of the hearing aid is not a continuous sound output mode, the electronic device uses the first audio device that was connected the most recently as the sound output channel, and determines to use the first audio device as the audio output device. The electronic device generates a digital signal according to the audio data, encodes the digital signal and sends it to the first audio device, and the first audio device plays the audio according to the received encoded digital signal.

[0122] Among them, a diversion identifier can be stored on the electronic device. When the value of the diversion identifier is a first preset value (for example, 1), the audio diversion is determined, and the electronic device generates a first audio signal and a second audio signal according to the audio data, and sends the first audio signal and the second audio signal to the hearing aid and the first audio device, respectively. When the value of the diversion identifier is a second preset value (for example, 0), the electronic device determines that the audio is not diverted, generates an audio signal according to the audio data, and sends the audio signal to the hearing aid or the first audio device. For example, when the electronic device determines that it is connected to the hearing aid and the first audio device for communication, and the sound output mode of the hearing aid is a continuous sound output mode, the value of the diversion identifier is determined to be 1. When it is determined that the electronic device is connected to the hearing aid and the first audio device for communication, and the sound output mode of the hearing aid is a single sound output mode, or the electronic device is only connected to the hearing aid or the first audio device for communication, the value of the diversion identifier is determined to be 0.

[0123] In one embodiment, when the electronic device plays the sound corresponding to the audio data through the hearing aid, if it detects that the first audio device is connected to the electronic device, it can first pause the sound corresponding to the audio data, change the diversion flag from 0 to 1, and after the change is completed, generate a first audio signal and a second audio signal according to the diversion flag and the audio data, and send the first audio signal and the second audio signal to the hearing aid and the first audio device respectively. When the electronic device plays the sound corresponding to the audio data through the hearing aid and the first audio device, if it detects that the hearing aid or the first audio device is disconnected from the communication connection with the electronic device, it can also first pause the sound corresponding to the audio data, change the diversion flag from 1 to 0, and after the change is completed, generate an audio signal according to the audio data according to the audio device connected to the electronic device, and send the audio signal to the audio device connected to the electronic device.

[0124] In other embodiments, the first audio device may also include multiple devices, and the electronic device generates multiple audio signals according to the digital signal to be sent based on the number of connected devices, and sends them to the hearing aid and multiple devices respectively, so that multiple devices can play the sound corresponding to the audio data together. For example, the first audio device includes 2 devices, and after obtaining the digital signal to be sent, the electronic device copies the digital signal to be sent to obtain 3 digital signals to be sent. Afterwards, the electronic device encodes the 3 digital signals to be sent according to the transmission protocol of the corresponding device, and sends the encoded audio signals to the corresponding device.

[0125] In the above embodiment, the electronic device processes the audio signal differently according to the setting information of the sound output mode of the hearing aid, so that according to user needs, it can instruct the hearing aid and the first audio device to play the sound corresponding to the audio data of the electronic device, or instruct one of the hearing aid and the first audio device to play the sound corresponding to the audio data of the electronic device, thereby meeting the needs of hearing-impaired users to share audio and communicate in real time with other users.

[0126] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0127] The software system of the electronic device 100 may adopt a layered architecture, an event-driven architecture, a micro-core architecture, a micro-service architecture, or a cloud architecture. In the embodiment of the present invention, the Android system of the layered architecture is taken as an example to exemplify the software structure of the electronic device 100.

[0128] Fig.12 1 is a software structure block diagram of the electronic device 100 according to an embodiment of the present invention.

[0129] The layered architecture divides the software into several layers, each with clear roles and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers, from top to bottom: the application layer, the application framework layer, the Android runtime and system library, and the kernel layer.

[0130] The application layer can include a series of application packages.

[0131] like Fig.12 As shown, the application package may include applications such as camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, short message, etc. In the embodiment of the present application, the electronic device can obtain audio data from an audio or video application.

[0132] The application framework layer provides an application programming interface (API) and a programming framework for the applications in the application layer. The application framework layer includes some predefined functions.

[0133] like Fig.12 As shown, the application framework layer may include a window manager, a content provider, a view system, a phone manager, a resource manager, a notification manager, and the like.

[0134] The window manager is used to manage window programs. The window manager can obtain the display screen size, determine whether there is a status bar, lock the screen, capture the screen, etc.

[0135] Content providers are used to store and retrieve data and make it accessible to applications. The data may include videos, images, audio, calls made and received, browsing history and bookmarks, phone books, etc.

[0136] The view system includes visual controls, such as controls for displaying text, controls for displaying images, etc. The view system can be used to build applications. A display interface can be composed of one or more views. For example, a display interface including a text notification icon can include a view for displaying text and a view for displaying images.

[0137] The phone manager is used to provide communication functions of the electronic device 100, such as management of call status (including connecting, hanging up, etc.).

[0138] The resource manager provides various resources for applications, such as localized strings, icons, images, layout files, video files, and so on.

[0139] The notification manager enables applications to display notification information in the status bar. It can be used to convey notification-type messages and can disappear automatically after a short stay without user interaction. For example, the notification manager is used to notify download completion, message reminders, etc. The notification manager can also be a notification that appears in the system top status bar in the form of a chart or scroll bar text, such as notifications of applications running in the background, or a notification that appears on the screen in the form of a dialog window. For example, a text message is displayed in the status bar, a prompt sound is emitted, an electronic device vibrates, an indicator light flashes, etc.

[0140] In the embodiment of the present application, the electronic device can display the Bluetooth devices connected to the electronic device through the manager of the Bluetooth device, and adjust the volume of the Bluetooth devices connected to the electronic device.

[0141] Android Runtime includes core libraries and virtual machines. Android runtime is responsible for scheduling and management of the Android system.

[0142] The core library consists of two parts: one part is the function that needs to be called by the Java language, and the other part is the Android core library.

[0143] The application layer and the application framework layer run in a virtual machine. The virtual machine executes the Java files of the application layer and the application framework layer as binary files. The virtual machine is used to perform functions such as object life cycle management, stack management, thread management, security and exception management, and garbage collection.

[0144] The system library may include multiple functional modules, such as surface manager, media library, 3D graphics processing library (such as OpenGL ES), 2D graphics engine (such as SGL), etc.

[0145] The surface manager is used to manage the display subsystem and provide the fusion of 2D and 3D layers for multiple applications.

[0146] The media library supports playback and recording of a variety of commonly used audio and video formats, as well as static image files, etc. The media library can support a variety of audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.

[0147] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.

[0148] A 2D graphics engine is a drawing engine for 2D drawings.

[0149] The kernel layer is the layer between hardware and software. The kernel layer contains at least display driver, camera driver, audio driver, and sensor driver.

[0150] In the embodiment of the present application, the electronic device can send the audio data of the electronic device to the audio device connected to the electronic device through the audio driver.

[0151] Fig.13 A schematic structural diagram of an electronic device 100 is shown.

[0152] The electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.

[0153] It is to be understood that the structure illustrated in the embodiment of the present invention does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown in the figure, or combine some components, or separate some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.

[0154] The processor 110 may include one or more processing units, for example, the processor 110 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.

[0155] The controller can generate operation control signals according to the instruction operation code and timing signal to complete the control of instruction fetching and execution.

[0156] The processor 110 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may store instructions or data that the processor 110 has just used or cyclically used. If the processor 110 needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.

[0157] In some embodiments, the processor 110 may include one or more interfaces. The interface may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc.

[0158] Among them, the I2S interface can be used for audio communication. In some embodiments, the processor 110 can include multiple groups of I2S buses. The processor 110 can be coupled to the audio module 170 via the I2S bus to achieve communication between the processor 110 and the audio module 170. In some embodiments, the audio module 170 can transmit an audio signal to the wireless communication module 160 via the I2S interface to achieve the function of answering a call through a Bluetooth headset.

[0159] The PCM interface can also be used for audio communication, sampling, quantizing and encoding analog signals. In some embodiments, the audio module 170 and the wireless communication module 160 can be coupled via a PCM bus interface. In some embodiments, the audio module 170 can also transmit audio signals to the wireless communication module 160 via the PCM interface to realize the function of answering calls via a Bluetooth headset. Both the I2S interface and the PCM interface can be used for audio communication.

[0160] The UART interface is a universal serial data bus for asynchronous communication. The bus can be a bidirectional communication bus. It converts the data to be transmitted between serial communication and parallel communication. In some embodiments, the UART interface is generally used to connect the processor 110 and the wireless communication module 160. For example, the processor 110 communicates with the Bluetooth module in the wireless communication module 160 through the UART interface to implement the Bluetooth function. In some embodiments, the audio module 170 can transmit an audio signal to the wireless communication module 160 through the UART interface to implement the function of playing music through a Bluetooth headset.

[0161] The USB interface 130 is an interface that complies with USB standard specifications, and may be a Mini USB interface, a Micro USB interface, a USB Type C interface, etc. The USB interface 130 may be used to connect a charger to charge the electronic device 100, or may be used to transmit data between the electronic device 100 and a peripheral device. It may also be used to connect headphones to play audio through the headphones.

[0162] It is understandable that the interface connection relationship between the modules illustrated in the embodiment of the present invention is only a schematic illustration and does not constitute a structural limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.

[0163] The wireless communication function of the electronic device 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor.

[0164] The electronic device 100 implements the display function through a GPU, a display screen 194, and an application processor.

[0165] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 110 through the external memory interface 120 to implement a data storage function, such as storing music, video and other files in the external memory card.

[0166] The internal memory 121 can be used to store computer executable program codes, which include instructions. The internal memory 121 may include a program storage area and a data storage area. Among them, the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc. The data storage area may store data created during the use of the electronic device 100 (such as audio data, a phone book, etc.), etc. In addition, the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc. The processor 110 executes various functional applications and data processing of the electronic device 100 by running instructions stored in the internal memory 121, and / or instructions stored in a memory provided in the processor.

[0167] The electronic device 100 can implement audio functions such as music playing and recording through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone jack 170D, and the application processor.

[0168] The audio module 170 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signals. The audio module 170 can also be used to encode and decode audio signals. In some embodiments, the audio module 170 can be arranged in the processor 110, or some functional modules of the audio module 170 can be arranged in the processor 110.

[0169] The speaker 170A, also called a "speaker", is used to convert an audio electrical signal into a sound signal. The electronic device 100 can listen to music or listen to a hands-free call through the speaker 170A.

[0170] The receiver 170B, also called a "earpiece", is used to convert audio electrical signals into sound signals. When the electronic device 100 receives a call or voice message, the voice can be received by placing the receiver 170B close to the human ear.

[0171] Microphone 170C, also called "microphone" or "microphone", is used to convert sound signals into electrical signals. When making a call or sending a voice message, the user can speak by putting their mouth close to microphone 170C to input the sound signal into microphone 170C. The electronic device 100 can be provided with at least one microphone 170C. In other embodiments, the electronic device 100 can be provided with two microphones 170C, which can not only collect sound signals but also realize noise reduction function. In other embodiments, the electronic device 100 can also be provided with three, four or more microphones 170C to collect sound signals, reduce noise, identify the sound source, realize directional recording function, etc.

[0172] The earphone interface 170D is used to connect a wired earphone and can be a USB interface 130 or a 3.5 mm open mobile terminal platform (OMTP) standard interface or a cellular telecommunications industry association of the USA (CTIA) standard interface.

[0173] The touch sensor 180K is also called a "touch control device". The touch sensor 180K can be set on the display screen 194. The touch sensor 180K and the display screen 194 form a touch screen, also called a "touch control screen". The touch sensor 180K is used to detect touch operations acting on or near it. The touch sensor can pass the detected touch operation to the application processor to determine the type of touch event. Visual output related to the touch operation can be provided through the display screen 194. In other embodiments, the touch sensor 180K can also be set on the surface of the electronic device 100, which is different from the position of the display screen 194.

[0174] The key 190 includes a power key, a volume key, etc. The key 190 may be a mechanical key or a touch key. The electronic device 100 may receive key input and generate key signal input related to user settings and function control of the electronic device 100.

[0175] Indicator 192 may be an indicator light, which may be used to indicate charging status, power changes, messages, missed calls, notifications, etc.

[0176] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0177] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.

[0178] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, which can be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may at least include: any entity or device that can carry the computer program code to the camera / electronic device, a recording medium, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electrical carrier signal, a telecommunication signal, and a software distribution medium. For example, a USB flash drive, a mobile hard disk, a disk or an optical disk.

[0179] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0180] In the embodiments provided in the present application, it should be understood that the disclosed devices / network equipment and methods can be implemented in other ways. For example, the device / network equipment embodiments described above are merely schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0181] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0182] Finally, it should be noted that the above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions within the technical scope disclosed in the present application should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. An audio playback method, characterized in that: include: When the electronic device is in communication connection with the hearing aid and the first audio device, determining a sound output mode of the hearing aid; When it is determined that the sound output mode of the hearing aid is the first mode, generating a first audio signal and a second audio signal according to the audio data of the electronic device; The first audio signal is sent to the hearing aid, and the second audio signal is sent to the first audio device, so as to instruct the hearing aid and the first audio device to play the sound corresponding to the audio data simultaneously.

2. The method according to claim 1, characterized in that The step of generating a first audio signal and a second audio signal according to audio data of the electronic device comprises: Generate a digital signal to be sent according to the audio data of the electronic device; Copying the digital signal to be sent to obtain a first digital signal and a second digital signal; Encoding the first digital signal according to a first transmission protocol to obtain the first audio signal; The second digital signal is encoded according to a second transmission protocol to obtain the second audio signal.

3. The method according to claim 1, characterized in that The step of generating a first audio signal and a second audio signal according to audio data of the electronic device comprises: Generate a digital signal to be sent according to the audio data of the electronic device; Encoding the digital signal to be sent to obtain an audio signal to be sent; The to-be-sent audio signal is copied to obtain the first audio signal and the second audio signal.

4. The method according to any one of claims 1 to 3, characterized in that: The electronic device is connected to the hearing aid and the first audio device via Bluetooth.

5. The method according to claim 1, characterized in that The step of determining the sound output mode of the hearing aid when the electronic device is in communication connection with the hearing aid and the first audio device includes: When the electronic device instructs the hearing aid to play the sound corresponding to the audio data, if it is detected that the first audio device is connected to the electronic device, obtaining first input information; The sound output mode is determined according to the first input information.

6. The method according to claim 1, characterized in that The step of determining the sound output mode of the hearing aid when the electronic device is in communication connection with the hearing aid and the first audio device includes: In the case where the electronic device instructs the first audio device to play the sound corresponding to the audio data, if it is detected that the hearing aid is connected to the electronic device, the sound output mode is determined to be the first mode.

7. The method according to claim 1, characterized in that After sending the first audio signal to the hearing aid and sending the second audio signal to the first audio device, the method further includes: When a first control instruction is received, the audio data is encoded and sent to the first audio device, and the first control instruction is used to instruct the hearing aid to be set to a silent mode.

8. The method according to claim 1, characterized in that After sending the first audio signal to the hearing aid and sending the second audio signal to the first audio device, the method further includes: If it is detected that the first audio device is disconnected from the electronic device, the audio data is encoded and sent to the hearing aid.

9. The method according to claim 1, characterized in that: After sending the first audio signal to the hearing aid and sending the second audio signal to the first audio device, the method further includes: When a first volume adjustment instruction is detected, adjusting the volume of the hearing aid according to the first volume adjustment instruction, and / or, When a second volume adjustment instruction is detected, the volume of the first audio device is adjusted according to the second volume adjustment instruction.

10. An electronic device, characterized in that: The method comprises a processor, wherein the processor is used to execute a computer program stored in a memory to implement the method according to any one of claims 1 to 9.

11. An audio playback system, characterized in that: The device comprises a hearing aid, a first audio device, and the electronic device according to claim 10, wherein the electronic device is communicatively connected to the hearing aid, and the electronic device is communicatively connected to the first audio device.

12. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 9 is implemented.