Method and device for audio control, equipment and medium

By detecting the switching of the audio output device and setting the speaker to mute, the disturbance and privacy leakage caused by audio output to the speaker is solved, and better audio control and privacy protection is achieved.

CN120223802APending Publication Date: 2025-06-27BEIJING ZITIAO NETWORK TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311808756.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-12-26
Publication Date
2025-06-27

AI Technical Summary

Technical Problem

After disconnecting using the audio peripheral, the audio output may switch from the speaker to the speaker of the electronic device, causing direct sound output, causing problems of disturbing people and privacy leakage.

Method used

By detecting the switching of the audio output device, if you switch from an external audio playback device to the speaker, immediately set the speaker to mute to avoid sound output.

Benefits of technology

It effectively avoids the output of sound directly from the speaker, reduces the risk of disturbing people and privacy leakage, and improves the accuracy of audio control and the protection of user privacy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120223802A_ABST
    Figure CN120223802A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides an audio control method and device, equipment and a storage medium. The method includes detecting switching of an audio output device associated with an audio service configured to control the audio output device to play audio of an application via an audio connection established with the application; and in response to detecting that the audio output equipment is switched from the external audio playing equipment of the electronic equipment to a loudspeaker of the electronic equipment, controlling the loudspeaker to be in a mute state. Therefore, the sound is prevented from being directly output from the loudspeaker, so that the problems of disturbing residents and leaking user privacy are avoided.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Example embodiments of the present disclosure generally relate to the field of computers, and in particular, to methods, apparatuses, devices, and computer-readable storage media for audio control. Background Art

[0002] Currently, an audio system can use PulseAudio to provide audio services. PulseAudio is generally used in the Linux operating system. It can act as middleware between applications and hardware devices, accept audio inputs from one or more sources, and redirect these audio inputs to one or more receiving points, such as a sound card, a PulseAudio service on a remote network, or other processes. When an application uses PulseAudio to play audio, it can first establish a connection with the PulseAudio service through the PulseAudio application programming interface (API). After the connection is successfully established, a playback stream is created and connected, and then audio data is written through the playback stream for audio playback. During the connection establishment process, the audio playback process, and after the playback ends, various problems may occur, thus affecting system performance. Summary of the Invention

[0003] In a first aspect of the present disclosure, a method for audio control is provided. The method includes: detecting a switch of an audio output device related to an audio service, the audio service being configured to control an audio output device to play audio of an application via an audio connection established with the application; and in response to detecting that the audio output device switches from an external audio playback device of the electronic device to a speaker of the electronic device, controlling the speaker to be in a mute state.

[0004] In a second aspect of the present disclosure, an apparatus for audio control is provided. The apparatus includes: a detection module configured to detect a switch of an audio output device related to an audio service, the audio service being configured to control an audio output device to play audio of an application via an audio connection established with the application; and a control module configured to, in response to detecting that the audio output device switches from an external audio playback device of the electronic device to a speaker of the electronic device, control the speaker to be in a mute state.

[0005] In a third aspect of the present disclosure, an electronic device is provided. The device includes at least one processing unit; and at least one memory coupled to the at least one processing unit and storing instructions for execution by the at least one processing unit. The instructions, when executed by the at least one processing unit, cause the device to execute the method of the first aspect.

[0006] In a fourth aspect of the present disclosure, a computer-readable storage medium is provided. A computer program is stored on the computer-readable storage medium, and the computer program can be executed by a processor to implement the method of the first aspect.

[0007] It should be understood that the content described in the present invention content section is not intended to limit the key features or important features of the embodiments of the present disclosure, nor is it used to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0008] In combination with the accompanying drawings and with reference to the following detailed description, the above and other features, advantages, and aspects of the embodiments of the present disclosure will become more apparent. In the drawings, the same or similar reference numerals represent the same or similar elements, where:

[0009] Figure 1 A schematic diagram showing an example environment in which the embodiments of the present disclosure can be implemented;

[0010] Figure 2 A flowchart showing a method for audio control according to some embodiments of the present disclosure;

[0011] Figure 3 An example notification bar of an electronic device for presenting a notification message according to some embodiments of the present disclosure;

[0012] Figure 4 An architecture diagram showing an example system for audio control according to some embodiments of the present disclosure;

[0013] Figure 5 A diagram showing an example operation process of an audio peripheral management and control module according to some embodiments of the present disclosure;

[0014] Figure 6 A schematic structural block diagram showing a device for audio control according to some embodiments of the present disclosure; and

[0015] Figure 7 A block diagram showing an electronic device capable of implementing one or more embodiments of the present disclosure. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0016] It can be understood that before using the technical solutions disclosed in the embodiments of the present disclosure, the types, usage scopes, usage scenarios, etc. of the personal information involved in the present disclosure should be informed to the user and the user's authorization should be obtained in an appropriate manner in accordance with relevant laws and regulations.

[0017] For example, when responding to an active request from a user, a prompt message is sent to the user to clearly prompt the user that the operation requested by the user will require obtaining and using the user's personal information. Thus, the user can autonomously choose whether to provide personal information to software or hardware such as an electronic device, an application program, a server, or a storage medium that performs the operations of the present disclosure technical solution based on the prompt message.

[0018] As an optional but non-limiting implementation manner, the manner of sending a prompt message to the user in response to receiving an active request from the user may be, for example, in the form of a pop-up window, and the prompt message may be presented in text in the pop-up window. In addition, the pop-up window may also carry a selection control for the user to choose "agree" or "disagree" to provide personal information to the electronic device.

[0019] It can be understood that the above notification and obtaining user authorization process is only illustrative and does not constitute a limitation on the implementation manner of the present disclosure. Other manners that comply with relevant laws and regulations can also be applied to the implementation manner of the present disclosure.

[0020] It can be understood that the data involved in the present technical solution (including but not limited to the data itself, the acquisition or use of the data) should comply with the requirements of corresponding laws, regulations and related provisions.

[0021] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although some embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. On the contrary, these embodiments are provided to more thoroughly and completely understand the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not used to limit the protection scope of the present disclosure.

[0022] It should be noted that the title of any section / subsection provided herein is not restrictive. Various embodiments are described throughout this document, and any type of embodiment can be included under any section / subsection. In addition, the embodiments described in any section / subsection can be combined with any other embodiments described in the same section / subsection and / or different section / subsections in any manner.

[0023] In the description of the embodiments of the present disclosure, the term "including" and its like terms should be understood as open inclusion, that is, "including but not limited to". The term "based on" should be understood as "at least partially based on". The term "one embodiment" or "the embodiment" should be understood as "at least one embodiment". The term "some embodiments" should be understood as "at least some embodiments". There may also be other explicit and implicit definitions hereinafter. The terms "first", "second", etc. may refer to different or the same objects. There may also be other explicit and implicit definitions hereinafter.

[0024] The term "responsive to" means that the corresponding event occurs or the condition is satisfied. It will be understood that the execution timing of the subsequent actions executed in response to the event or condition and the time when the event occurs or the condition is satisfied are not necessarily strongly correlated. In some cases, the subsequent actions can be executed immediately when the event occurs or the condition holds; in other cases, the subsequent actions can also be executed after a period of time after the event occurs or the condition holds.

[0025] Various computing devices and systems can use pulseaudio to provide audio services. However, due to the performance differences of the operating systems used by various computing devices, during the process of a user using an audio peripheral (such as a Bluetooth or wired headset, etc.) to listen to music and / or watch videos, sometimes when disconnecting the audio peripheral, the audio does not pause playing, and its sound will be output from the speaker. This will cause the following problems. The first problem is that it will disturb others. For example, if using a computer in a public place such as a library or a coffee shop, if sound suddenly plays from the computer speaker, it may disturb the work or rest of others. The second problem is that it will leak privacy. For example, if some private content (such as music, videos, voice chats, etc.) is being played, and the sound is played from the speaker, it may leak the user's privacy.

[0026] For this reason, some embodiments of the present disclosure provide an audio control solution. In this solution, the audio service controls an audio output device to play the audio of an application via an audio connection established with the application. If it is detected that the audio output device related to the audio service switches from an external audio playback device (also referred to as an "audio peripheral") of the electronic device to the speaker of the electronic device, then the speaker is controlled to be in a mute state.

[0027] In this way, in the case where the electronic device is connected to an audio peripheral to play audio, after disconnecting the audio peripheral, if the output device switches to the speaker, the speaker is muted to avoid the sound being output from the speaker. Thus, the problems of disturbing others and leaking the user's privacy caused by the sound directly being output from the speaker can be avoided.

[0028] Figure 1 A schematic diagram of an example environment 100 in which embodiments of the present disclosure can be implemented is shown. As Figure 1 shown, in the environment 100, the electronic device 110 can perform audio playback based on the operations of the user 120. In some examples, an application 130 is installed in the electronic device 110. The user 120 can interact with the application 130 via the electronic device 110 and / or the attached devices of the electronic device 110. According to specific designs, the application 130 can be designed to provide various audio and has various page architectures to implement user interactions.

[0029] An audio service 140, such as the pulseaudio service, is also installed in the electronic device 110. The application 130 can play audio through the API (not shown) of the audio service 140. For example, the application 130 can establish one or more audio connections with the audio service 140 by calling the API of the audio service 140. Through the established audio connections, the application 130 creates one or more audio playback streams for audio playback.

[0030] The audio service 140 controls the audio output device to play the audio of the application 130 via the audio connection established with the application 130. The audio output device can include an audio output device inside the electronic device 110, such as the speaker 150, and an audio output device 155 outside the electronic device 110.

[0031] The electronic device 110 can be any type of device, including virtual and physical devices. As an example, the electronic device 110 can include, but is not limited to, mobile devices, fixed devices, or portable devices, etc., including mobile phones, desktop computers, laptop computers, notebook computers, netbook computers, tablet computers, media computers, multimedia tablets, personal communication system (PCS) devices, personal navigation devices, personal digital assistants (PDAs), audio / video players, digital cameras / camcorders, positioning devices, television receivers, radio broadcast receivers, e-book devices, virtual reality (VR) all-in-ones, game consoles, gaming laptops, or any combination of the foregoing, including accessories and peripherals of these devices or any combination thereof. In some embodiments, the electronic device 110 is also capable of supporting any type of user interface (such as a "wearable" circuit, etc.).

[0032] In the environment 100, during the process of the application 130 playing audio through the audio service 140, the audio output device can be switched. If the audio output device is switched from the external audio playback device 155 of the electronic device 110 to the speaker 150 of the electronic device 110, the speaker 150 is controlled to be in a mute state.

[0033] In some embodiments, an audio peripheral control module 160 can be installed in the electronic device 110, which can interact with the audio service 140 to monitor the status of the audio output device, such as listening for the disconnection status of the external audio playback device 155. After receiving the notification of this status from the audio service 140, the speaker 150 can be set to the mute state. The following refers to Figures 2 to 4 Discuss some example implementations of the present disclosure.

[0034] Figure 2FIG. 200 is a flowchart of a method for audio control according to some embodiments of the present disclosure. The method 200 may be executed by an electronic device 110, for example, through an audio peripheral management and control module 160. For ease of discussion, the method 200 will be described with reference to Figure 1 the environment 100.

[0035] As Figure 2 shown, at block 210, a switch of an audio output device (e.g., from an external audio playback device 155 to a speaker 150) associated with an audio service 140 is detected. The audio service 140 is configured to control an audio output device to play the audio of an application 130 via an audio connection established with the application 130.

[0036] In some embodiments, an event notification of the disconnection of the external audio playback device 155 may be received from the audio service 140. In some embodiments, a callback of the disconnection event of the external audio playback device 155 may be registered with the audio service 140. Based on the callback of the disconnection event of the external audio playback device 155, an event notification of the disconnection of the external audio playback device may be received from the audio service 140.

[0037] If an event notification of the disconnection of the external audio playback device 155 is received, it is determined whether the audio playback device for playing audio in the electronic device 110 is the speaker 150. If it is determined that the audio playback device is the speaker 150, it is determined that the audio output device has switched from the external audio playback device 155 of the electronic device 110 to the speaker 150 of the electronic device 110.

[0038] At block 220, in response to detecting that the audio output device has switched from the external audio playback device 155 of the electronic device 110 to the speaker 150 of the electronic device 110, the speaker 150 is controlled to be in a mute state.

[0039] In some embodiments, if it is detected that the audio output device has switched from the external audio playback device 155 of the electronic device 110 to the speaker 150 of the electronic device 110, it is determined whether audio is being played. If it is determined that audio is being played, the speaker 150 may be controlled to be in a mute state. In some embodiments, the speaker status setting interface of the audio service 140 may be called to set the status of the speaker 150 to the mute state.

[0040] For example, when the connection and disconnection status of the external audio playback device 155 is monitored by the audio peripheral control module 160, after the audio peripheral control module 160 receives the audio peripheral disconnection event, it can be determined whether there is currently audio playback. If there is audio playback, it can be determined whether the current audio output device is the speaker 150. If it is the speaker 150, then when the audio service 140 is implemented by the pulseaudio service, the pulseaudiopa_sink_set_mute interface (as an example of a speaker status setting interface) can be called to mute the speaker 150.

[0041] In some embodiments, in addition to muting the speaker 150, a notification message may be presented to the user 120 to indicate that the speaker is in a muted state. For example, if it is detected that the audio output device is switched from the external audio playback device 155 of the electronic device 110 to the speaker 150 of the electronic device 110, the presentation of the notification message may be controlled to at least indicate that the speaker 150 is in a muted state.

[0042] In some embodiments, an instruction to present the notification message may be sent to a notification bar (e.g., a status bar) of the electronic device 110 so that the notification message is presented by the notification bar. For example, the notification message may be presented to the user 120 in a pop-up window through the notification bar of the electronic device 110.

[0043] Figure 3 An example notification bar 300 of an electronic device 110 for presenting notification messages according to some embodiments of the present disclosure is shown.

[0044] In this example, the notification bar 300 can be implemented as a pop-up window, in which an indication about "the speaker has been muted" is presented. In addition, the notification message presented in the notification bar 300 also includes a mute release control for the speaker 150. For example, a control 310 for releasing the mute of the speaker 150 and a control 315 for maintaining the mute of the speaker 150 are presented in the multiple selection box 305. The user 120 can select to release the mute for the speaker 150 by clicking the control 310.

[0045] In some embodiments, in response to a trigger operation on a mute release control (e.g., control 310), the speaker 150 can be controlled to be in a non-muted state. For example, in the case where a notification message is presented by a notification bar of the electronic device 110, an indication of a trigger operation of a mute release control can be received from the notification bar of the electronic device 110. If an indication of a detected trigger operation is received, the speaker 150 can be controlled to be in a non-muted state. In some embodiments, the speaker state setting interface of the audio service 140 can be called to set the state of the speaker 150 to a non-muted state. In this way, the speaker 150 can be restored to output sound according to the selection of the user 120.

[0046] For example, when the disconnection state of the external audio playback device 155 is monitored by the audio peripheral control module 160, the speaker 150 can be set to a mute state according to the disconnection state of the external audio playback device 155, and the notification bar pop-up window of the electronic device 110 is notified. After the notification bar receives the notification that a pop-up window is required, the pop-up window notifies the user 120 that the speaker is muted, and presents a multiple-choice box (for example, multiple-choice box 305) so that the user 120 can choose whether to unmute. If the user 120 chooses to unmute, the notification bar can send an unmute command to the audio peripheral control module 160, thereby updating the speaker state. For example, when the audio service 140 is implemented by the pulseaudio service, the audio peripheral control module 160 can call the pulseaudio pa_sink_set_mute interface to unmute and make the speaker sound again.

[0047] Figure 4 An architecture 400 of an example system for audio control is shown according to some embodiments of the present disclosure.

[0048] In this example, the audio service 140 may be implemented via the pulseaudio service 405. Figure 4 As shown, the audio peripheral control module 160 can register the callback of the external audio playback device (or audio peripheral) disconnection event with the pulseaudio service 405. After receiving the audio peripheral disconnection event, the audio peripheral control module 160 determines whether there is audio currently playing. If there is audio playing, it is determined whether the current audio output device is the speaker 150. If it is the speaker 150, the pulseaudio pa_sink_set_mute interface is called to mute the speaker 150.

[0049] The audio peripheral control module 160 can also send a broadcast to the status bar 410 (as an example of the notification bar) via DBus to instruct it to pop up a window. After receiving the instruction to pop up a window, the status bar 410 can pop up a window to notify that the speaker is muted, and can pop up and present a multi - select box (for example, the multi - select box 305) so that the user 120 can select whether to unmute. If the user 120 selects to unmute, the status bar 410 can send an unmute command to the audio peripheral control module 160 via DBus. The audio peripheral control module 160 can call the pulseaudio pa_sink_set_mute interface to unmute the speaker 150.

[0050] Figure 5 FIG. 500 shows an example operation process of the audio peripheral control module 160 according to some embodiments of the present disclosure.

[0051] As Figure 5 shown, at block 510, the audio peripheral control module 160 receives an event notification of the disconnection of the audio peripheral from the audio service 140. At block 515, the audio peripheral control module 160 determines whether there is currently audio playing. If so, at block 520, the audio peripheral control module 160 determines whether the current audio output device of the system is the speaker 150. If the current audio output device of the system is the speaker 150, then at block 525, the audio peripheral control module 160 calls the speaker status setting interface of the audio service 140 to mute the speaker 150.

[0052] At block 525, the audio peripheral control module 160 sends an instruction to present a notification message to the notification bar of the electronic device 110. At block 540, the audio peripheral control module 160 receives an instruction regarding the triggering operation of detecting the unmute control in the notification bar. At block 545, the speaker 150 is controlled to be unmuted. Then, the process 500 ends.

[0053] After the audio peripheral control module 160 receives an event notification of the disconnection of the audio peripheral from the audio service 140, if at block 515 it is determined that there is currently no audio playing, or although there is currently audio playing, but at block 520 it is determined that the current audio output device of the system is not the speaker 150, then the process 500 also ends.

[0054] Example devices and equipment

[0055] Figure 6 FIG. 600 shows a schematic structural block diagram of a device 600 for audio control according to some embodiments of the present disclosure. The device 600 can be implemented at Figure 1 the electronic device 110, for example, implemented by the audio peripheral control module 160.

[0056] AsFigure 6 As shown, the apparatus 600 includes a detection module 610 and a mute control module 620. The detection module 610 is configured to detect the switching of an audio output device related to an audio service, and the audio service is configured to control the audio output device to play the audio of the application via an audio connection established with the application. The mute control module 620 is configured to control the speaker to be in a mute state in response to detecting that the audio output device is switched from an external audio playback device of the electronic device to a speaker of the electronic device.

[0057] In some embodiments, the mute control module 620 can be configured to: determine whether audio is playing in response to detecting that the audio output device is switched from an external audio playback device of the electronic device to a speaker of the electronic device; and control the speaker to be in a mute state in response to determining that the audio is playing.

[0058] In some embodiments, the detection module 620 can be configured to: receive an event notification of a disconnection of an external audio playback device from an audio service; determine whether the audio playback device used to play audio in the electronic device is a speaker in response to receiving the event notification of a disconnection of the external audio playback device; and determine that a switch of the audio output device from the external audio playback device of the electronic device to the speaker of the electronic device is detected in response to determining that the audio playback device is a speaker.

[0059] In some embodiments, the device 600 may also include: a registration module, which is configured to register a callback of an external audio playback device disconnection event with an audio service; and a receiving module, which is configured to receive an event notification of an external audio playback device disconnection from the audio service based on the callback of the external audio playback device disconnection event.

[0060] In some embodiments, the mute control module 620 may be configured to call a speaker state setting interface of the audio service to set the state of the speaker to a mute state.

[0061] In some embodiments, the device 600 may also include: a notification control module, which is configured to control the presentation of a notification message in response to detecting that the audio output device is switched from an external audio playback device of the electronic device to a speaker of the electronic device, wherein the notification message at least indicates that the speaker is in a muted state.

[0062] In some embodiments, the notification control module may be configured to send an instruction to present the notification message to a notification bar of the electronic device so that the notification message is presented by the notification bar.

[0063] In some embodiments, the notification message may include a mute release control for the speaker. The mute control module 620 may also be configured to: in response to a triggering operation on the mute release control, control the speaker to be in a non-mute state.

[0064] In some embodiments, the mute control module 620 may be configured to: receive an indication of a triggering operation for detecting an unmute control from the notification bar of the electronic device; and in response to receiving the indication of the detected triggering operation, control the speaker to be in an unmuted state.

[0065] In some embodiments, the mute control module 620 may be configured to: call the speaker status setting interface of the audio service to set the status of the speaker to the unmuted state.

[0066] It should be understood that the features and effects discussed above with reference to Figures 1 to 5 equally apply to the apparatus 600 and will not be elaborated herein. Additionally, the modules included in the apparatus 600 may be implemented in various ways, including software, hardware, firmware, or any combination thereof. In some embodiments, one or more modules may be implemented using software and / or firmware, such as machine-executable instructions stored on a storage medium. In addition to or as an alternative to the machine-executable instructions, some or all of the modules in the apparatus 300 may be at least partially implemented by one or more hardware logic components. By way of example and not limitation, exemplary types of hardware logic components that may be used include field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on a chip (SOCs), complex programmable logic devices (CPLDs), and the like.

[0067] Figure 7 A block diagram of an electronic device 700 in which one or more embodiments of the present disclosure may be implemented is shown. It should be understood that Figure 7 the illustrated electronic device 700 is merely exemplary and should not impose any limitation on the functions and scopes of the embodiments described herein. Figure 7 The illustrated electronic device 700 may be used to implement Figure 1 the electronic device 110.

[0068] As Figure 7 shown, the electronic device 700 is in the form of a general-purpose electronic device. The components of the electronic device 700 may include, but are not limited to, one or more processors or processing units 710, a memory 720, a storage device 730, one or more communication units 740, one or more input devices 750, and one or more output devices 760. The processing unit 710 may be an actual or virtual processor and be capable of performing various processes according to the programs stored in the memory 720. In a multi-processor system, multiple processing units execute computer-executable instructions in parallel to improve the parallel processing ability of the electronic device 700.

[0069] The electronic device 700 generally includes multiple computer storage media. Such media can be any accessible media that the electronic device 700 can access, including but not limited to volatile and non-volatile media, removable and non-removable media. The memory 720 can be volatile memory (such as registers, caches, random access memory (RAM)), non-volatile memory (such as read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory), or some combination thereof. The storage device 730 can be removable or non-removable media and can include machine-readable media, such as a flash drive, a magnetic disk, or any other media that can be capable of storing information and / or data (such as training data for training) and can be accessed within the electronic device 700.

[0070] The electronic device 700 can further include additional removable / non-removable, volatile / non-volatile storage media. Although not shown in Figure 7 it, a disk drive for reading from or writing to a removable, non-volatile magnetic disk (such as a "floppy disk") and an optical disk drive for reading from or writing to a removable, non-volatile optical disk can be provided. In these cases, each drive can be connected to a bus (not shown) by one or more data media interfaces. The memory 720 can include a computer program product 725 having one or more program modules that are configured to execute the various methods or actions of the various embodiments of the present disclosure.

[0071] The communication unit 740 enables communication with other electronic devices via a communication medium. Additionally, the functions of the components of the electronic device 700 can be implemented in a single computing cluster or multiple computer machines that can communicate via a communication connection. Thus, the electronic device 700 can operate in a networked environment using a logical connection to one or more other servers, network personal computers (PCs), or another network node.

[0072] The input device 750 can be one or more input devices, such as a mouse, a keyboard, a trackball, etc. The output device 760 can be one or more output devices, such as a display, a speaker, a printer, etc. The electronic device 700 can also communicate with one or more external devices (not shown) as needed via the communication unit 740, such as storage devices, display devices, etc., communicate with one or more devices that enable a user to interact with the electronic device 700, or communicate with any device that enables the electronic device 700 to communicate with one or more other electronic devices (such as a network card, a modem, etc.). Such communication can be performed via an input / output (I / O) interface (not shown).

[0073] According to an exemplary implementation of the present disclosure, a computer-readable storage medium is provided, on which computer-executable instructions are stored, and the computer-executable instructions are executed by a processor to implement the method described above. According to an exemplary implementation of the present disclosure, a computer program product is also provided, the computer program product being tangibly stored on a non-transitory computer-readable medium and including computer-executable instructions, and the computer-executable instructions being executed by a processor to implement the method described above.

[0074] Aspects of the present disclosure are described herein with reference to the flowcharts and / or block diagrams of methods, apparatuses, devices, and computer program products implemented according to the present disclosure. It should be understood that each block of the flowcharts and / or block diagrams, and combinations of blocks in the flowcharts and / or block diagrams, can be implemented by computer-readable program instructions.

[0075] These computer-readable program instructions can be provided to a processing unit of a general-purpose computer, a special-purpose computer, or other programmable data processing device, thereby producing a machine such that when these instructions are executed by the processing unit of the computer or other programmable data processing device, a device is produced that implements the functions / actions specified in one or more blocks of the flowchart and / or block diagram. These computer-readable program instructions can also be stored in a computer-readable storage medium, and these instructions cause the computer, programmable data processing device, and / or other devices to work in a specific manner, so that the computer-readable medium storing the instructions includes a manufactured article that includes instructions for implementing various aspects of the functions / actions specified in one or more blocks of the flowchart and / or block diagram.

[0076] The computer-readable program instructions can be loaded onto a computer, other programmable data processing device, or other device, so that a series of operation steps are executed on the computer, other programmable data processing device, or other device to produce a computer-implemented process, so that the instructions executed on the computer, other programmable data processing device, or other device implement the functions / actions specified in one or more blocks of the flowchart and / or block diagram.

[0077] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various implementations of the present disclosure. In this regard, each block in the flowchart or block diagram may represent a module, a segment of a program, or a portion of an instruction, which contains one or more executable instructions for implementing a specified logical function. In some alternative implementations, the functions noted in the blocks may occur in a different order than noted in the accompanying drawings. For example, two consecutive blocks may actually be executed substantially in parallel, or they may sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented by a dedicated hardware-based system that performs the specified functions or actions, or by a combination of dedicated hardware and computer instructions.

[0078] The various implementations of the present disclosure have been described above. The above description is exemplary, not exhaustive, and is not limited to the disclosed implementations. Many modifications and variations will be apparent to those of ordinary skill in the art in the field without departing from the scope and spirit of the described implementations. The choice of terms used herein is intended to best explain the principles of the implementations, the practical application, or the improvement of the technology in the market, or to enable other ordinary skilled artisans in the field to understand the various implementation manners disclosed herein.

Claims

1. A method for audio control, comprising: Detecting a switch of an audio output device associated with an audio service, the audio service being configured to control the audio output device to play audio of the application via an audio connection established with the application; as well as In response to detecting that the audio output device is switched from an external audio playback device of the electronic device to a speaker of the electronic device, the speaker is controlled to be in a mute state.

2. The method according to claim 1, wherein controlling the speaker to be in a muted state comprises: In response to detecting that the audio output device is switched from an external audio playback device of the electronic device to a speaker of the electronic device, determining whether audio is being played; as well as In response to determining that audio is playing, the speaker is controlled to be in a muted state.

3. The method of claim 1, wherein detecting a switch of an audio output device associated with an audio service comprises: receiving, from the audio service, an event notification that the external audio playback device is disconnected; In response to receiving an event notification that the external audio playback device is disconnected, determining whether the audio playback device in the electronic device for playing audio is the speaker; as well as In response to determining that the audio playback device is the speaker, it is determined that the audio output device is detected to be switched from an external audio playback device of the electronic device to the speaker of the electronic device.

4. The method according to claim 3, further comprising: Register a callback for an external audio playback device disconnection event with the audio service; as well as Based on the callback of the external audio playback device disconnection event, an event notification of the external audio playback device disconnection is received from the audio service.

5. The method according to claim 1, wherein controlling the speaker to be in a muted state comprises: The speaker state setting interface of the audio service is called to set the state of the speaker to the mute state.

6. The method according to claim 1, further comprising: In response to detecting that the audio output device is switched from an external audio playback device of the electronic device to a speaker of the electronic device, the presentation of a notification message is controlled, the notification message at least indicating that the speaker is in a muted state.

7. The method of claim 6, wherein controlling the presentation of the notification message comprises: An instruction to present the notification message is sent to a notification bar of the electronic device so that the notification message is presented by the notification bar.

8. The method of claim 6, wherein the notification message includes an unmute control for the speaker, and the method further comprises: In response to a triggering operation on the mute release control, the speaker is controlled to be in a non-mute state.

9. The method according to claim 8, wherein controlling the speaker to be in a non-mute state comprises: Receiving, from a notification bar of the electronic device, an indication of detecting the triggering operation of the mute release control; as well as In response to receiving the indication that the triggering operation is detected, the speaker is controlled to be in an un-muted state.

10. The method according to claim 8, wherein controlling the speaker to be in a non-mute state comprises: Call the speaker status setting interface of the audio service to set the status of the speaker to the non-mute status.

11. An apparatus for audio control, comprising: a detection module configured to detect a switch of an audio output device related to an audio service, the audio service being configured to control an audio output device to play audio of an application via an audio connection established with the application; and a mute control module configured to control the speaker to be in a mute status in response to detecting that the audio output device switches from an external audio playback device of the electronic device to the speaker of the electronic device.

12. An electronic device, comprising: at least one processing unit; and at least one memory coupled to the at least one processing unit and storing instructions for execution by the at least one processing unit, the instructions, when executed by the at least one processing unit, causing the electronic device to perform the method according to any one of claims 1 to 10.

13. A computer-readable storage medium having stored thereon a computer program, the computer program being executable by a processor to implement the method according to any one of claims 1 to 10.