WO2020107290A1 - Audio output control method and apparatus, computer readable storage medium, and electronic device - Google Patents

Audio output control method and apparatus, computer readable storage medium, and electronic device Download PDF

Info

Publication number
WO2020107290A1
WO2020107290A1 PCT/CN2018/118018 CN2018118018W WO2020107290A1 WO 2020107290 A1 WO2020107290 A1 WO 2020107290A1 CN 2018118018 W CN2018118018 W CN 2018118018W WO 2020107290 A1 WO2020107290 A1 WO 2020107290A1
Authority
WO
WIPO (PCT)
Prior art keywords
audio
channel
audio output
output channel
audio data
Prior art date
Application number
PCT/CN2018/118018
Other languages
French (fr)
Chinese (zh)
Inventor
李亚军
Original Assignee
深圳市欢太科技有限公司
Oppo广东移动通信有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 深圳市欢太科技有限公司, Oppo广东移动通信有限公司 filed Critical 深圳市欢太科技有限公司
Priority to PCT/CN2018/118018 priority Critical patent/WO2020107290A1/en
Priority to CN201880098450.5A priority patent/CN112997470B/en
Publication of WO2020107290A1 publication Critical patent/WO2020107290A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04MTELEPHONIC COMMUNICATION
    • H04M1/00Substation equipment, e.g. for use by subscribers
    • H04M1/72Mobile telephones; Cordless telephones, i.e. devices for establishing wireless links to base stations without route selection
    • H04M1/725Cordless telephones

Definitions

  • the present application relates to the technical field of electronic devices, and in particular to audio output control methods and devices, electronic devices, and computer-readable storage media.
  • the applications installed on electronic devices are more diverse.
  • the audio data can be output from the earpiece, speaker, and headphone channels.
  • an abnormal call to the audio output channel occurs, which changes the output channel of the audio data.
  • the alarm sound should be output from the speaker channel, and the result is output from the earphone, which affects the user experience.
  • the embodiments of the present application provide an audio output control method and device, a computer-readable storage medium, and electronic equipment, which can repair abnormal audio output channels, enhance the stability of audio data output, and improve the user experience.
  • An audio output control method is applied to an electronic device having multiple audio output channels.
  • the audio output channel includes an earpiece channel, an earphone channel, and a speaker channel.
  • the method includes:
  • the audio output channel of the audio data is changed so that the changed audio output channel plays the audio data.
  • An audio output control device is applied to electronic equipment having multiple audio output channels.
  • the audio output channel includes an earpiece channel, a headphone channel, and a speaker channel.
  • the device includes:
  • Mode acquisition module used to obtain the audio mode of the target application
  • a channel monitoring module configured to monitor whether the audio output channel used by the target application to play audio data according to the audio mode is abnormal
  • the channel processing module is configured to change the audio output channel of the audio data so that the changed audio output channel plays the audio data when the audio output channel is abnormal, wherein the audio output channel includes an earpiece channel, Headphone channel and speaker channel.
  • An electronic device includes a memory and a processor.
  • the memory stores computer-readable instructions.
  • the processor causes the processor to execute the audio output control method according to the claims.
  • the above audio output control method and apparatus, computer-readable storage medium, and electronic equipment can acquire the audio mode of the target application program; monitor whether the audio output channel used by the target application to play audio data according to the audio mode is abnormal; when the audio output channel is abnormal When changing the audio output channel of the audio data, so that the changed audio output channel plays audio data, you can repair the abnormal audio output channel, automatically make the audio data output from the default audio output channel, and enhance the stability of the audio data output. It can avoid the situation that the audio data is output from other audio output channels, and improve the user experience.
  • FIG. 1 is a schematic diagram of the internal structure of an electronic device in an embodiment
  • FIG. 2 is a schematic diagram of a part of the architecture of an Android audio system in an embodiment
  • FIG. 3 is a schematic flowchart of an audio output control method in an embodiment
  • FIG. 4 is a schematic flowchart of whether an audio output channel used to listen to a target application program for playing audio data according to the audio mode is abnormal according to an embodiment
  • FIG. 5 is a schematic flowchart of changing the audio output channel of the audio data when the audio output channel is abnormal in another embodiment
  • FIG. 6 is a schematic flowchart of an audio output control method in another embodiment
  • FIG. 7 is a schematic flowchart of a method for controlling audio output in another embodiment
  • FIG. 8 is a schematic flowchart of playing the audio data in the changed audio output channel in an embodiment
  • FIG. 9 is a schematic diagram of an audio output control device in an embodiment
  • FIG. 10 is a block diagram of a partial structure of a mobile phone related to an electronic device provided by an embodiment of the present application.
  • FIG. 1 a schematic diagram of an internal structure of an electronic device is provided.
  • the electronic device includes a processor, memory, and display screen connected by a system bus.
  • the processor is used to provide computing and control capabilities to support the operation of the entire electronic device.
  • the memory is used to store data, programs, and/or instruction codes, etc. At least one computer program is stored on the memory, and the computer program can be executed by the processor to implement the audio output control method for electronic devices provided in the embodiments of the present application .
  • the memory may include a non-volatile storage medium such as a magnetic disk, an optical disk, a read-only memory (Read-Only Memory, ROM), or a random-access memory (Random-Access-Memory, RAM).
  • the memory includes a non-volatile storage medium and internal memory.
  • the non-volatile storage medium stores the operating system, database, and computer program.
  • the database stores data related to an audio output control method provided by the above embodiments, for example, information such as the name of each process or application may be stored.
  • the computer program can be executed by the processor to implement an audio output control method provided by various embodiments of the present application.
  • the internal memory provides a cached operating environment for operating systems, databases, and computer programs in non-volatile storage media.
  • the display screen may be a touch screen, such as a capacitive screen or an electronic screen, which is used to display interface information of applications corresponding to the foreground process, and may also be used to detect a touch operation acting on the display screen, and generate corresponding instructions, such as performing front and background Application switching instructions, etc.
  • the structure shown in FIG. 1 is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the electronic device to which the solution of the present application is applied.
  • the specific electronic device may It includes more or fewer components than shown in the figure, or some components are combined, or have a different component arrangement.
  • the electronic device further includes a network interface connected through a system bus.
  • the network interface may be an Ethernet card or a wireless network card, etc., and is used to communicate with external electronic devices, for example, it may be used to communicate with a server.
  • a partial architecture diagram of an Android audio system is provided.
  • the architecture system of the Android audio system includes a kernel space layer 210, a local layer 220, a framework layer 230, and a client layer 240.
  • the Kernel space layer 210 may include an Audio driver module 211, where the Audio driver module interacts with the hardware and implements the local layer interface for the upper layer to call normally.
  • ALSA, OSS, and a custom audio driver can be selected.
  • the local layer 220 includes an AtlasService_Jni module 221, an AtlasService Interface module 223, and an AtlasService module 225.
  • the framework layer 230 includes an AtlasManager module 231 and an AtlasService module 233. Among them, the AtlasManager module 231 is provided with a conventional interface and a registration callback interface.
  • the AtlasService module 225 in the local layer 220 and the AtlasService module 233 in the framework layer 230 are used for event reception and processing, information collection, abnormal feedback, and log collection, where the information collection may include the collection of display information and the collection of audio information.
  • the audio information includes playback information, recording information, audio mode setting information, and so on. Because the AtlasService module is set up in the system-level framework layer, it can facilitate interaction with other system services, and at the same time, there is no need to worry about permissions during system calls.
  • the audio output control methods in various embodiments of the present application can be implemented.
  • an audio output control method is provided, which is applied to an electronic device having multiple audio output channels.
  • the electronic device may include a mobile phone, a tablet computer, a laptop computer, a palmtop computer, a mobile Internet device (Mobile Internet Device (MID), a wearable device (such as a smart watch, smart bracelet, pedometer, etc.) Or other electronic devices with voice call function and speakers.
  • a mobile phone a tablet computer, a laptop computer, a palmtop computer
  • a mobile Internet device Mobile Internet Device (MID)
  • a wearable device such as a smart watch, smart bracelet, pedometer, etc.
  • the audio output channel includes an earpiece channel, a speaker channel, and a headset channel, where the headset channel may include a wired headset channel and a wireless headset (Bluetooth headset) channel.
  • the audio output channel is the earpiece channel
  • the audio data is sent by the earpiece
  • the audio output channel is the speaker channel
  • the audio data is sent by the external speaker
  • the audio output channel is the earphone channel
  • the audio data can be through wired headphones or Bluetooth headphones issue.
  • the audio output control method includes steps 302-306.
  • Step 302 Acquire the audio mode of the target application.
  • the target application program may be understood as an application program capable of outputting and/or outputting audio signals, and the number of target application programs may be 1, 2, 3 or more.
  • the target application may include applications such as call, instant messaging, audio playback, video playback, sound control, and voice input.
  • the audio mode may include a multimedia mode, a ringtone mode, an alarm mode, a call mode, a call mode (including audio/video, VoIP call), and a system mode.
  • Each target application corresponds to an audio mode, for example, the audio mode corresponding to the audio playback and video playback target applications is the multimedia mode, the audio mode corresponding to the clock is the alarm clock mode, and the audio mode corresponding to the call target application Can be a call mode, etc.
  • the electronic device can manage the audio mode based on the AudioManager in the architecture system of the Android audio system. Specifically, the audio mode of the target application can be set based on the setting function setMode(). The electronic device can obtain the audio mode of the target application program in the running state based on the AudioManager.
  • the running state can be understood as running in the foreground or running in the background.
  • the electronic device may preset to construct a list or database including all target applications, for storing identification information of the target applications, and the like.
  • Step 304 Monitor whether the audio output channel used by the target application to play audio data is abnormal according to the audio mode.
  • Each audio mode can correspond to multiple audio output channels for playing audio data.
  • the audio mode corresponding to the target application is a call mode
  • the electronic device is in a call state
  • each audio mode can be provided with at least one default audio output channel.
  • the corresponding default audio output channels may include a receiver channel and a headset channel.
  • the default audio output channel is the headset channel.
  • the electronic device is not connected to the headset, the default The audio output channel is the earpiece channel.
  • the audio mode is the bell mode or the alarm mode, the corresponding default audio output channel is the speaker mode.
  • the electronic device can monitor the audio output channel currently used to play the audio data. If the audio output channel is consistent with the default audio output channel corresponding to the audio mode of the target application, it can be considered The audio output channel used by the target application to play audio data is normal; otherwise, the audio output channel used by the target application to play audio data is abnormal. For example, when an electronic device calls, its ringtone is sent from the earpiece channel or its ringtone is sent from the headset channel, it can be considered that the audio output channel of the target application used to play the ringtone is abnormal.
  • the audio data includes voice data, ringtone data, alarm data, multimedia data (video streaming, audio streaming data, etc.) and so on.
  • Step 306 when the audio output channel is abnormal, the audio output channel of the audio data is changed, so that the changed audio output channel plays audio data.
  • the electronic device can determine whether the audio output channel currently used to play audio data is abnormal. When the audio output channel is abnormal, the audio output channel currently used to play audio data can be changed so that the changed audio output channel can play the target application Control audio data for playback. For example, when an electronic device calls, the ringtone is sent from the earpiece channel or the ringtone is sent from the earphone channel, the electronic device can switch the earphone channel or the earphone channel currently used to play the ringtone to the speaker channel, and the audio data is played by the speaker.
  • the above audio output control method can obtain the audio mode of the target application; monitor whether the audio output channel used by the target application to play audio data is abnormal according to the audio mode; when the audio output channel is abnormal, change the audio output channel of the audio data to Make the changed audio output channel play audio data, can repair abnormal audio output channel, automatically make the audio data output from the default audio output channel, enhance the stability of the audio data output, can avoid the audio data output from other audio output channels The situation occurs, improving the user experience.
  • monitoring the audio output channel used by the target application to play audio data according to the audio mode is abnormal, including
  • Step 402 When the target application plays audio data, monitor the audio output channel that plays the audio data.
  • a monitoring module is created based on the operating system of the electronic device, and the audio output channel of the target application program is monitored through the monitoring module.
  • the monitoring module can also be used to monitor the audio mode, volume adjustment, recording and other information related to the input and/or output of audio data of the target application.
  • a system-level monitoring module (AtlasService module) can be created at the system framework layer (native/framework layer) to monitor the audio output channel and audio mode of the target application through the monitoring module.
  • system_server system service program
  • the listener module is established in the system-level service framework layer, you can easily interact with other system services without worrying about system calls. Permissions issue.
  • the electronic device can also create an independent monitoring process to monitor the audio output channel of the target application through the message transmission mechanism.
  • a separate monitoring function is set up and called, which can be set to start automatically after power-on, and monitor the audio mode setting of any other target application and the audio output channel that plays audio data in real time.
  • Step 404 Identify whether the audio output channel conforms to the audio mode playback standard.
  • Step 406 when the audio output channel does not meet the playback standard of the audio mode, the audio output channel is abnormal.
  • Electronic equipment can also pre-construct a mapping table of audio output channels and audio mode matching; in this mapping table, all audio output channels of the audio mode and the default audio output channel are stored, where the default audio output channel can be understood as the target application
  • the audio output channel used to play the audio data has the highest priority, that is, the default audio output channel has the highest playback priority among all audio output channels. If the default audio output channel is used to play audio data, it can be considered to comply with the playback standards of the audio mode.
  • the mapping table identify whether the audio output channel meets the playback standards of the audio mode.
  • the target application that controls the playback of audio data is a video application, and its audio mode is a multimedia mode, and the default audio output channel corresponding to the multimedia mode is a speaker channel. If the video application plays the video, the audio data is sent from the earphone channel, and the multimedia mode playback standard is that the audio data is sent from the speaker channel, it can be considered that the earphone channel does not meet the multimedia mode playback standard.
  • the audio output channel does not meet the playback standards of the audio mode, the audio output channel is abnormal.
  • changing the audio output channel of the audio data includes:
  • Step 502 when the audio output channel is abnormal, the preset interface function is called.
  • Step 504 Change the audio output channel of the audio data according to the preset interface function.
  • the electronic device can call a preset interface function to set the audio output channel.
  • the preset interface functions include at least the setSpeakerphoneOn() interface function, setMode(AudioManager.MODE_IN_CALL) interface function, isWiredHeadsetOn() interface function or other interface functions for setting the earphone channel and headphone channel.
  • the electronic device can set the speaker channel by calling the interface function setSpeakerphoneOn() in the AudioManager, that is, the speaker channel can be turned on or off.
  • the electronic device can set the earpiece channel by calling the function setMode(AudioManager.MODE_IN_CALL) in AudioManager or the construction parameter streamType(STREAM_VOICE_CALL); the electronic device can set and detect the earpiece channel by calling the function isWiredHeadsetOn() in AudioManager.
  • the interface function setMode() can be used to set the sound mode, for example, void setMode(intmode).
  • the settable values are NORMAL, RINGTONE and IN_CALL.
  • setRingerMode intraMode
  • the audio output control method includes steps 602-610. among them,
  • Step 602 Acquire the audio mode of the target application.
  • Step 604 Monitor whether the audio output channel used by the target application to play audio data is abnormal according to the audio mode.
  • step 602 and step 604 correspond to step 302 and step 304 in the foregoing embodiment, and will not be described here.
  • Step 606 when the earphone channel is abnormal, it is detected whether the electronic device is connected to the earphone.
  • the electronic device can obtain the audio mode of the target application used to control the playback of audio data and determine the default audio output channel of the audio mode.
  • the earpiece channel is considered abnormal.
  • the electronic device can detect whether a headset is currently connected to the electronic device.
  • the connection may be a wired connection or a wireless connection (Bluetooth connection).
  • an electronic device can set and detect whether a wired headset is connected by calling the function isWiredHeadsetOn() in AudioManager, or detect whether a wired headset is connected by detecting the high and low level of GPIO (General Purpose/Input, Output) .
  • GPIO General Purpose/Input, Output
  • the preset state of the GPIO interface is a high level
  • the current detection state is a low level, indicating that the state of the GPIO interface has changed and the electronic device is connected to a wired headset.
  • an electronic device can detect whether a Bluetooth headset is connected through the BluetoothAdapter class. At the same time, the electronic device can also detect the interface state of the corresponding audio interface based on the Bluetooth protocol, and then detect whether the electronic device is connected to the Bluetooth headset.
  • the electronic device can also detect whether it is connected to the earphone based on other software or hardware, which is not limited to the above example.
  • Step 608 When the electronic device is connected to the earphone, change the earphone channel of the audio data so that the earphone channel plays the audio data.
  • the preset interface function for switching to the headset channel can be called, and the audio will be output according to the preset interface function
  • the audio output channel of the data is switched from the earpiece mode to the headphone channel, and the headphone channel plays the audio data.
  • Step 610 When the electronic device is not connected with the earphone, change the earphone channel of the audio data, so that the speaker channel plays the audio data.
  • the preset interface function for switching to the speaker channel can be called, and the audio will be output according to the preset interface function
  • the audio output channel of the data is switched from the receiver mode to the speaker channel, and the speaker channel plays the audio data.
  • the electronic device when the earphone channel in the audio output channel is abnormal, the electronic device can adaptively switch its earphone channel to an audio output channel that matches the user's use scenario according to whether the headset is connected, which can improve the audio output. Stability and user experience.
  • the audio output control method includes steps 702-710. among them,
  • Step 702 Acquire the audio mode of the target application.
  • Step 704 Monitor whether the audio output channel used by the target application to play audio data is abnormal according to the audio mode.
  • Step 702 and step 704 correspond to step 302 and step 304 in the foregoing embodiment, and will not be repeated here.
  • Step 706 when the speaker channel is abnormal, it is detected whether the electronic device is connected to the earphone.
  • the electronic device can obtain the audio mode of the target application used to control the playback of audio data, and determine the default audio output channel of the audio mode. If the default audio output channel is not a speaker channel, but its audio data is output through the speaker channel, The speaker channel is considered abnormal.
  • the detection method for detecting whether the electronic device is connected to the earphone in this step is the same as the detection method for detecting whether the electronic device is connected to the earphone in the foregoing embodiment, and details are not described here.
  • Step 708 when the electronic device is connected to the earphone, change the earphone channel of the audio data, so that the earphone channel plays the audio data.
  • the electronic device When the electronic device is connected to the headset, if the default audio output channel corresponding to the audio mode of the target application is a speaker channel, a preset interface function for switching to the headset channel can be called, and the audio will be output according to the preset interface function
  • the audio output channel of the data is switched from the speaker mode to the headphone channel, and the headphone channel plays the audio data.
  • Step 710 when the electronic device is not connected with the earphone, change the earphone channel of the audio data, so that the earphone channel plays the audio data.
  • the electronic device When the electronic device is connected to a headset, if the default audio output channel corresponding to the audio mode of the target application is a speaker channel, a preset interface function for switching to the earpiece channel can be called, and the audio will be output according to the preset interface function
  • the audio output channel of the data is switched from the speaker mode to the receiver channel, and the receiver channel plays the audio data.
  • the electronic device when the speaker channel in the audio output channel is abnormal, the electronic device can adaptively switch its speaker channel to an audio output channel that matches the user's use scenario according to whether the headset is connected, which can improve the audio output. Stability and user experience.
  • changing the audio output channel of the audio data may further include: when the speaker channel is abnormal, muting the volume of the speaker channel and changing the audio output channel of the audio data. Specifically, if the speaker channel is abnormal, the audio data can be output from the speaker channel. If the volume of the speaker output channel is adjusted to mute, the audio data can be prevented from being exposed by the speaker and leaking the privacy of the user's audio data, which improves the risk Protection of audio data played by the speaker output channel.
  • the audio output channel of the audio data is changed so that the changed audio output channel plays audio data, specifically including the earphone that changes the audio data when the electronic device is connected to the earphone and the earphone channel is abnormal Steps to enable the speaker channel to play audio data.
  • the electronic device can obtain the audio mode of the target application used to control the playback of audio data, and determine the default audio output channel of the audio mode. If the default audio output channel is not the headphone channel, but its audio data is output through the headphone channel, The earphone channel is considered abnormal. For example, in the alarm clock mode, the corresponding default audio output channel is the speaker.
  • the electronic device When the electronic device is connected to the headset, the alarm is output from the headset channel, but not from the speaker, it can be considered that the current headset channel is abnormal, then the electronic device It can call the preset calling function for switching to the speaker channel to make the alarm output from the speaker channel, so as to avoid the alarm output from the headset channel, and the user cannot perceive the alarm occurrence when the alarm is output from the speaker , The user can hear the alarm normally without affecting the user's normal work and rest.
  • playing audio data on the changed audio output channel includes:
  • Step 802 Acquire environmental noise of an electronic device.
  • the electronic device determines that the audio output channel of the audio data is abnormal, it can change the audio output channel of the audio data, and at the same time, it can also obtain the environmental noise of the electronic device.
  • the environmental noise may be the sound that interferes with the surrounding living environment generated in industrial production, building construction, transportation and social life.
  • the electronic device may collect environmental sounds based on at least one microphone, and analyze and process the environmental sounds to obtain environmental noise.
  • Step 804 Adjust the volume of the audio data played by the audio output channel according to the environmental noise.
  • the electronic device can adjust the volume of the audio data played by the audio output channel according to the environmental noise, that is, when the electronic device determines that the audio output channel of the audio data is abnormal, it can change the audio output channel of the audio data and adjust the audio output according to the environmental noise Channel playback volume for playing audio data. For example, the greater the environmental noise, the higher the correspondingly adjusted volume. However, the maximum value of the volume does not exceed the preset value.
  • the audio output channel of the audio data when the audio output channel is abnormal, the audio output channel of the audio data is changed, and at the same time, the volume of the audio data played by the changed audio output channel can be adjusted according to the environmental noise of the electronic device, thereby improving the user experience.
  • enabling the changed audio output channel to play audio data includes: acquiring a playback time point of the audio data; and starting to play audio data from the playback time point according to the changed audio output channel.
  • the audio output channel of the audio data can be changed, and at the same time, the electronic device can also obtain the playback time point of the abnormal audio output channel to play the audio data, and make the changed audio output channel from the The audio data starts playing at the playback time.
  • the playing time of the earpiece channel playing audio data can be obtained.
  • the playback time point can be understood as the initial time on the time axis of the audio data played by the earpiece, and record the time, for example, the time is 10:01:05, when the changed audio output channel is a speaker, you can use The speaker starts to play the audio data from the playback time point 10:01:05.
  • the audio control output method in this embodiment can automatically realize the replay of audio data in a period before switching the audio output channel, so that the user can learn the audio data in the process of switching the audio output mode, reducing user operations and improving the user experience.
  • steps in this embodiment can also be used before or after steps 802 to 804 to improve the playback quality of the audio data played during the audio output channel switching process and enhance the user experience.
  • steps in the flowcharts of FIGS. 3-8 are sequentially displayed according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless clearly stated in this article, the execution of these steps is not strictly limited in order, and these steps can be executed in other orders. Moreover, at least some of the steps in FIGS. 3-8 may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but may be executed at different times. These sub-steps or stages The execution order of is not necessarily sequential, but may be executed in turn or alternately with at least a part of other steps or sub-steps or stages of other steps.
  • the present application also provides an audio output control device, including: an acquisition module 910, a listening module 920, and a processing module 930. among them,
  • the mode obtaining module 910 is used to obtain the audio mode of the target application program
  • the channel monitoring module 920 is used to monitor whether the audio output channel used by the target application to play audio data is abnormal according to the audio mode;
  • the channel processing module 930 is configured to change the audio output channel of the audio data so that the changed audio output channel plays audio data when the audio output channel is abnormal, wherein the audio output channel includes an earphone channel, a headphone channel, and a speaker channel.
  • the above audio output control device can acquire the audio mode of the target application; monitor whether the audio output channel used by the target application to play audio data is abnormal according to the audio mode; when the audio output channel is abnormal, change the audio output channel of the audio data to Make the changed audio output channel play audio data, can repair abnormal audio output channel, automatically make the audio data output from the default audio output channel, enhance the stability of the audio data output, can avoid the audio data output from other audio output channels The situation occurs, improving the user experience.
  • the channel monitoring module 920 includes:
  • the channel monitoring unit is used to monitor the audio output channel of the audio data when the target application plays the audio data
  • Standard identification unit used to identify whether the audio output channel meets the playback standards of the audio mode
  • the abnormality judging unit is used to make the audio output channel abnormal when the audio output channel does not meet the playback standard of the audio mode.
  • the channel monitoring unit is also used to:
  • the operating system based on the electronic device creates a monitoring module to monitor the audio output channel of the target application through the monitoring module, or creates a monitoring process to monitor the audio output channel of the target application through the message transmission mechanism.
  • the standard identification unit is also used to:
  • mapping table between the audio output channel and the audio mode; according to the mapping table, identify whether the audio output channel meets the playback standards of the audio mode.
  • the channel processing module 930 includes:
  • the calling unit is used to call a preset interface function when the audio output channel is abnormal
  • the processing unit is used to change the audio output channel of the audio data according to the preset interface function.
  • the channel processing module 930 further includes:
  • the setting unit is used to set a preset interface function based on the operating system of the electronic device, and the preset interface function is used to set an audio output channel.
  • the channel processing module 930 when the earpiece channel is abnormal, the channel processing module 930 further includes:
  • the detection unit is used to detect whether the electronic device is connected to the earphone;
  • the processing unit is also used to change the earphone channel of the audio data when the electronic device is connected to the earphone, so that the earphone channel plays audio data; when the electronic device is not connected to the earphone, change the earphone channel of the audio data, so that the speaker channel plays audio data .
  • the electronic device when the earphone channel in the audio output channel is abnormal, the electronic device can adaptively switch its earphone channel to an audio output channel that matches the user's use scenario according to whether the headset is connected, which can improve the audio output. Stability and user experience.
  • the processing unit when the speaker channel is abnormal, is further used to change the earphone channel of the audio data when the electronic device is connected to the earphone, so that the earphone channel plays audio data
  • the processing unit when the speaker channel is abnormal, is also used to mute the volume of the speaker channel and change the audio output channel of the audio data.
  • the electronic device when the speaker channel in the audio output channel is abnormal, the electronic device can adaptively switch its speaker channel to an audio output channel that matches the user's use scenario according to whether the headset is connected, which can improve the audio output. Stability and user experience.
  • the channel processing module 930 further includes: a noise acquisition unit for acquiring environmental noise of the electronic device;
  • the processing unit is also used to adjust the volume of the audio output channel playing audio data according to the environmental noise.
  • the audio output channel of the audio data when the audio output channel is abnormal, the audio output channel of the audio data is changed, and at the same time, the volume of the audio data played by the changed audio output channel can be adjusted according to the environmental noise of the electronic device, thereby improving the user experience.
  • the channel processing module 930 further includes: a playback acquisition unit, configured to acquire a playback time point of audio data;
  • the processing unit is also used to start playing audio data from the playing time according to the changed audio output channel.
  • the audio control output method in this embodiment can automatically realize the replay of audio data in a period before switching the audio output channel, so that the user can learn the audio data in the process of switching the audio output mode, reducing user operations and improving the user experience.
  • each module in the above audio output control device is for illustration only. In other embodiments, the audio output control device may be divided into different modules as needed to complete all or part of the functions of the above audio output control device.
  • Each module in the above audio output control device may be implemented in whole or in part by software, hardware, or a combination thereof.
  • the above modules may be embedded in the hardware or independent of the processor in the electronic device, or may be stored in the memory in the electronic device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
  • the embodiments of the present application also provide a computer-readable storage medium.
  • One or more non-volatile computer-readable storage media containing computer-executable instructions when the computer-executable instructions are executed by one or more processors, cause the processor to perform the following steps of the audio output control method:
  • the audio output channel of the audio data is changed so that the changed audio output channel plays audio data.
  • one or more non-volatile computer-readable storage media containing computer-executable instructions when the computer-executable instructions are executed by one or more processors, may also cause the processor to perform any of the foregoing implementations Example audio output control method.
  • a computer program product containing instructions that, when run on a computer, causes the computer to perform the steps of the audio output control method:
  • the audio output channel of the audio data is changed so that the changed audio output channel plays audio data.
  • a computer program product containing instructions when run on a computer, causes the computer to execute the steps of the audio output control method in any of the above embodiments.
  • An embodiment of the present application also provides an electronic device. As shown in FIG. 10, for ease of description, only parts related to the embodiments of the present application are shown, and specific technical details are not disclosed, please refer to the method part of the embodiments of the present application.
  • the electronic device may be any terminal device including a mobile phone, tablet computer, PDA (Personal Digital Assistant), POS (Point of Sales), in-vehicle computer, wearable device, etc. that has a voice call function and has a speaker , Taking an electronic device as a mobile phone as an example:
  • the mobile phone includes: a radio frequency (Radio Frequency) circuit 1010, a memory 1020, an input unit 1030, a display unit 1040, a sensor 1050, an audio circuit 1060, a wireless fidelity (WiFi) module 1070, a processor 1080 , And power supply 1090 and other components.
  • a radio frequency (Radio Frequency) circuit 1010 the mobile phone includes: a radio frequency (Radio Frequency) circuit 1010, a memory 1020, an input unit 1030, a display unit 1040, a sensor 1050, an audio circuit 1060, a wireless fidelity (WiFi) module 1070, a processor 1080 , And power supply 1090 and other components.
  • WiFi wireless fidelity
  • FIG. 10 does not constitute a limitation on the mobile phone, and may include more or less components than those shown in the figure, or a combination of certain components, or a different component arrangement.
  • the RF circuit 1010 can be used to receive and send signals during sending and receiving information or during a call. It can receive the downlink information of the base station and process it to the processor 1080; it can also send uplink data to the base station.
  • RF circuits include but are not limited to antennas, at least one amplifier, transceiver, coupler, low noise amplifier (Low Noise Amplifier, LNA), duplexer, and so on.
  • the RF circuit 1010 can also communicate with the network and other devices through wireless communication.
  • the above wireless communication can use any communication standard or protocol, including but not limited to Global System of Mobile (GSM), General Packet Radio Service (GPRS), and Code Division Multiple Access (Code Division) Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA), Long Term Evolution (LTE), e-mail, Short Message Service (SMS), etc.
  • GSM Global System of Mobile
  • GPRS General Packet Radio Service
  • CDMA Code Division Multiple Access
  • WCDMA Wideband Code Division Multiple Access
  • LTE Long Term Evolution
  • SMS Short Message Service
  • the memory 1020 may be used to store software programs and modules.
  • the processor 1080 executes various functional applications and data processing of the mobile phone by running the software programs and modules stored in the memory 1020.
  • the memory 1020 may mainly include a program storage area and a data storage area, where the program storage area may store an operating system and at least one function-required application program (such as a sound playback function application program, an image playback function application program, etc.), etc.;
  • the data storage area can store data (such as audio data, address book, etc.) created according to the use of the mobile phone.
  • the memory 1020 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, or other volatile solid-state storage devices.
  • the input unit 1030 may be used to receive input numeric or character information, and generate key signal input related to user settings and function control of the mobile phone 1000.
  • the input unit 1030 may include a touch panel 1031 and other input devices 1032.
  • the touch panel 1031 also known as a touch screen, can collect user's touch operations on or near it (for example, the user uses any suitable objects or accessories such as fingers, stylus, etc. on or near the touch panel 1031 Operation), and drive the corresponding connection device according to the preset program.
  • the touch panel 1031 may include a touch detection device and a touch controller.
  • the touch detection device detects the user's touch orientation, and detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives touch information from the touch detection device and converts it into contact coordinates, and then sends To the processor 1080, and can receive the commands sent by the processor 1080 and execute them.
  • the touch panel 1031 can be implemented in various types such as resistive, capacitive, infrared, and surface acoustic waves.
  • the input unit 1030 may also include other input devices 1032.
  • other input devices 1032 may include, but are not limited to, one or more of a physical keyboard, function keys (such as volume control keys, switch keys, etc.), and the like.
  • the display unit 1040 may be used to display information input by the user or information provided to the user and various menus of the mobile phone.
  • the display unit 1040 may include a display panel 1041.
  • the display panel 1041 may be configured in the form of a liquid crystal display (Liquid Crystal) (LCD), an organic light-emitting diode (Organic Light-Emitting Diode, OLED), or the like.
  • the touch panel 1031 may cover the display panel 1041, and when the touch panel 1031 detects a touch operation on or near it, it is transmitted to the processor 1080 to determine the type of touch event, and then the processor 1080 according to The type of touch event provides a corresponding visual output on the display panel 1041.
  • the touch panel 1031 and the display panel 1041 are implemented as two independent components to realize the input and input functions of the mobile phone, in some embodiments, the touch panel 1031 and the display panel 1041 may be integrated to Realize the input and output functions of the mobile phone.
  • the mobile phone 1000 may further include at least one sensor 1050, such as a light sensor, a motion sensor, and other sensors.
  • the light sensor may include an ambient light sensor and a proximity sensor, wherein the ambient light sensor may adjust the brightness of the display panel 1041 according to the brightness of the ambient light, and the proximity sensor may close the display panel 1041 and/or when the mobile phone moves to the ear Or backlight.
  • the motion sensor may include an acceleration sensor. The acceleration sensor can detect the magnitude of acceleration in various directions, and can detect the magnitude and direction of gravity when at rest. Pedometer, percussion), etc.
  • the mobile phone can also be equipped with other sensors such as gyroscope, barometer, hygrometer, thermometer, infrared sensor and so on.
  • the audio circuit 1060, the speaker 1061, and the microphone 1062 may provide an audio interface between the user and the mobile phone.
  • the audio circuit 1060 can transmit the received audio data converted electrical signal to the speaker 1061, which converts the speaker 1061 into a sound signal output; on the other hand, the microphone 1062 converts the collected sound signal into an electrical signal, which is converted by the audio circuit 1060 After receiving, it is converted into audio data, and then processed by the audio data output processor 1080, and then sent to another mobile phone through the RF circuit 1010, or the audio data is output to the memory 1020 for subsequent processing.
  • WiFi is a short-range wireless transmission technology. Mobile phones can help users send and receive emails, browse web pages, and access streaming media through the WiFi module 1070. It provides users with wireless broadband Internet access.
  • FIG. 10 shows the WiFi module 1070, it can be understood that it is not a necessary component of the mobile phone 1000, and may be omitted as needed.
  • the processor 1080 is the control center of the mobile phone, and uses various interfaces and lines to connect the various parts of the entire mobile phone, by running or executing the software programs and/or modules stored in the memory 1020, and calling the data stored in the memory 1020 to execute Various functions and processing data of the mobile phone, so as to monitor the mobile phone as a whole.
  • the processor 1080 may include one or more processing units.
  • the processor 1080 may integrate an application processor and a modem processor, where the application processor mainly processes an operating system, user interface, application programs, and the like; the modem processor mainly processes wireless communication. It can be understood that the foregoing modem processor may not be integrated into the processor 1080.
  • the mobile phone 1000 further includes a power supply 1090 (such as a battery) for powering various components.
  • a power supply 1090 (such as a battery) for powering various components.
  • the power supply can be logically connected to the processor 1080 through a power management system, so as to realize functions such as charging, discharging, and power management through the power management system.
  • the mobile phone 1000 may further include a camera, a Bluetooth module, and the like.
  • the processor 1080 included in the electronic device implements the following steps when executing the computer program stored in the memory:
  • the audio output channel of the audio data is changed so that the changed audio output channel plays audio data.
  • processor 880 included in the electronic device implements the audio output control method in any of the foregoing embodiments when the computer program stored in the memory is executed.
  • Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory.
  • Volatile memory can include random access memory (RAM), which acts as external cache memory.
  • RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR) SDRAM, enhanced SDRAM (ESDRAM), synchronous Link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
  • SRAM static RAM
  • DRAM dynamic RAM
  • SDRAM synchronous DRAM
  • DDR double data rate SDRAM
  • ESDRAM enhanced SDRAM
  • SLDRAM synchronous Link (Synchlink) DRAM
  • Rambus direct RAM
  • DRAM direct memory bus dynamic RAM
  • RDRAM memory bus dynamic RAM

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Circuit For Audible Band Transducer (AREA)

Abstract

An audio output control method and apparatus, a computer readable storage medium, and an electronic device. The audio output control method is applied to the electronic device having multiple audio output channels. The audio output control method comprises: obtaining an audio mode of a target application (302); monitoring whether the audio output channel of the target application for playing back audio data is abnormal according to the audio mode (304); when the audio output channel is abnormal, changing the audio output channel of the audio data, so that the changed audio output channel plays back the audio data (306).

Description

音频输出控制方法和装置、计算机可读存储介质、电子设备Audio output control method and device, computer readable storage medium, electronic equipment 技术领域Technical field
本申请涉及电子设备技术领域,特别是涉及音频输出控制方法和装置、电子设备、计算机可读存储介质。The present application relates to the technical field of electronic devices, and in particular to audio output control methods and devices, electronic devices, and computer-readable storage media.
背景技术Background technique
随着电子设备的广泛应用和其功能的日益丰富,电子设备已成为人们日常生活中不可或缺的一部分。其中,电子设备安装的应用程序更具多样化。在使用应用程序的过程中,当应用程序播放音频数据时,该音频数据可从听筒、扬声器和耳机通道输出。With the wide application of electronic devices and their increasingly rich functions, electronic devices have become an indispensable part of people's daily lives. Among them, the applications installed on electronic devices are more diverse. In the process of using the application, when the application plays audio data, the audio data can be output from the earpiece, speaker, and headphone channels.
但是,在应用程序的使用过程中,会出现音频输出通道调用异常,使音频数据的输出通道发生变化,例如闹铃声应该从扬声器通道输出,结果从听筒输出,影响了用户的使用体验。However, during the use of the application, an abnormal call to the audio output channel occurs, which changes the output channel of the audio data. For example, the alarm sound should be output from the speaker channel, and the result is output from the earphone, which affects the user experience.
发明内容Summary of the invention
本申请实施例提供一种音频输出控制方法和装置、计算机可读存储介质、电子设备,可以修复异常的音频输出通道,增强音频数据输出的稳定性,提高用户体验。The embodiments of the present application provide an audio output control method and device, a computer-readable storage medium, and electronic equipment, which can repair abnormal audio output channels, enhance the stability of audio data output, and improve the user experience.
一种音频输出控制方法,应用于具有多个音频输出通道的电子设备,所述音频输出通道包括听筒通道、耳机通道和扬声器通道,方法包括:An audio output control method is applied to an electronic device having multiple audio output channels. The audio output channel includes an earpiece channel, an earphone channel, and a speaker channel. The method includes:
获取目标应用程序的音频模式;Get the audio mode of the target application;
根据所述音频模式监听目标应用程序用于播放音频数据的音频输出通道是否异常;Monitoring whether the audio output channel used by the target application to play audio data according to the audio mode is abnormal;
当所述音频输出通道异常时,改变所述音频数据的音频输出通道,以使改变后的音频输出通道播放所述音频数据。When the audio output channel is abnormal, the audio output channel of the audio data is changed so that the changed audio output channel plays the audio data.
一种音频输出控制装置,应用于具有多个音频输出通道的电子设备,所述音频输出通道包括听筒通道、耳机通道和扬声器通道,装置包括:An audio output control device is applied to electronic equipment having multiple audio output channels. The audio output channel includes an earpiece channel, a headphone channel, and a speaker channel. The device includes:
模式获取模块,用于获取目标应用程序的音频模式;Mode acquisition module, used to obtain the audio mode of the target application;
通道监听模块,用于根据所述音频模式监听目标应用程序用于播放音频数据的音频输出通道是否异常;A channel monitoring module, configured to monitor whether the audio output channel used by the target application to play audio data according to the audio mode is abnormal;
通道处理模块,用于当所述音频输出通道异常时,改变所述音频数据的音频输出通道,以使改变后的音频输出通道播放所述音频数据,其中,所述音频输出通道包括听筒通道、耳机通道和扬声器通道。The channel processing module is configured to change the audio output channel of the audio data so that the changed audio output channel plays the audio data when the audio output channel is abnormal, wherein the audio output channel includes an earpiece channel, Headphone channel and speaker channel.
一种计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现上述的音频输出控制方法的步骤。A computer-readable storage medium on which a computer program is stored, which when executed by a processor implements the steps of the audio output control method described above.
一种电子设备,包括存储器及处理器,所述存储器中储存有计算机可读指令,所述指令被所述处理器执行时,使得所述处理器执行如权利要求上述的音频输出 控制方法。An electronic device includes a memory and a processor. The memory stores computer-readable instructions. When the instructions are executed by the processor, the processor causes the processor to execute the audio output control method according to the claims.
上述音频输出控制方法和装置、计算机可读存储介质、电子设备,能够获取目标应用程序的音频模式;根据音频模式监听目标应用程序用于播放音频数据的音频输出通道是否异常;当音频输出通道异常时,改变音频数据的音频输出通道,以使改变后的音频输出通道播放音频数据,可以修复异常的音频输出通道,自动使音频数据从默认的音频输出通道输出,增强音频数据输出的稳定性,可以避免音频数据从其他音频输出通道输出的情况发生,提高用户体验。The above audio output control method and apparatus, computer-readable storage medium, and electronic equipment can acquire the audio mode of the target application program; monitor whether the audio output channel used by the target application to play audio data according to the audio mode is abnormal; when the audio output channel is abnormal When changing the audio output channel of the audio data, so that the changed audio output channel plays audio data, you can repair the abnormal audio output channel, automatically make the audio data output from the default audio output channel, and enhance the stability of the audio data output. It can avoid the situation that the audio data is output from other audio output channels, and improve the user experience.
附图说明BRIEF DESCRIPTION
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他实施例的附图。In order to more clearly explain the embodiments of the present invention or the technical solutions in the prior art, the following will briefly introduce the drawings required in the embodiments or the description of the prior art. Obviously, the drawings in the following description are only These are some embodiments of the present invention. For those of ordinary skill in the art, without paying any creative labor, drawings of other embodiments can be obtained based on these drawings.
图1为一实施例中的电子设备的内部结构示意图;1 is a schematic diagram of the internal structure of an electronic device in an embodiment;
图2为一实施例中的安卓音频系统的部分架构示意图;2 is a schematic diagram of a part of the architecture of an Android audio system in an embodiment;
图3为一实施例中的音频输出控制方法的流程示意图;3 is a schematic flowchart of an audio output control method in an embodiment;
图4为一实施例中的根据所述音频模式监听目标应用程序用于播放音频数据的音频输出通道是否异常的流程示意图;4 is a schematic flowchart of whether an audio output channel used to listen to a target application program for playing audio data according to the audio mode is abnormal according to an embodiment;
图5为又一实施例中当所述音频输出通道异常时,改变所述音频数据的音频输出通道的流程示意图;5 is a schematic flowchart of changing the audio output channel of the audio data when the audio output channel is abnormal in another embodiment;
图6为另一个实施例中音频输出控制方法的流程示意图;6 is a schematic flowchart of an audio output control method in another embodiment;
图7为又一个实施例中音频输出控制方法的流程示意图;7 is a schematic flowchart of a method for controlling audio output in another embodiment;
图8为一个实施例中以使改变后的音频输出通道播放所述音频数据的流程示意图;FIG. 8 is a schematic flowchart of playing the audio data in the changed audio output channel in an embodiment;
图9为一个实施例中的音频输出控制装置的框架示意图;9 is a schematic diagram of an audio output control device in an embodiment;
图10为与本申请实施例提供的电子设备相关的手机的部分结构的框图。10 is a block diagram of a partial structure of a mobile phone related to an electronic device provided by an embodiment of the present application.
具体实施方式detailed description
为了便于理解本发明,下面将参照相关附图对本发明进行更全面的描述。附图中给出了本发明的较佳实施例。但是,本发明可以以许多不同的形式来实现,并不限于本文所描述的实施例。相反地,提供这些实施例的目的是使对本发明的公开内容的理解更加透彻全面。In order to facilitate understanding of the present invention, the present invention will be described more fully below with reference to related drawings. The drawings show preferred embodiments of the invention. However, the present invention can be implemented in many different forms, and is not limited to the embodiments described herein. On the contrary, the purpose of providing these embodiments is to make the understanding of the disclosure of the present invention more thorough and comprehensive.
在一个实施例中,如图1所示,提供了一种电子设备的内部结构示意图。该电子设备包括通过系统总线连接的处理器、存储器和显示屏。其中,该处理器用于提供计算和控制能力,支撑整个电子设备的运行。存储器用于存储数据、程序、和/或指令代码等,存储器上存储至少一个计算机程序,该计算机程序可被处理器执行,以实现本申请实施例中提供的适用于电子设备的音频输出控制方法。存储器可包括磁碟、光盘、只读存储记忆体(Read-Only Memory,ROM)等非易失 性存储介质,或随机存储记忆体(Random-Access-Memory,RAM)等。例如,在一个实施例中,存储器包括非易失性存储介质及内存储器。非易失性存储介质存储有操作系统、数据库和计算机程序。该数据库中存储有用于实现以上各个实施例所提供的一种音频输出控制方法相关的数据,比如可存储有每个进程或应用的名称等信息。该计算机程序可被处理器所执行,以用于实现本申请各个实施例所提供的一种音频输出控制方法。内存储器为非易失性存储介质中的操作系统、数据库和计算机程序提供高速缓存的运行环境。显示屏可以是触摸屏,比如为电容屏或电子屏,用于显示前台进程对应的应用的界面信息,还可以被用于检测作用于该显示屏的触摸操作,生成相应的指令,比如进行前后台应用的切换指令等。In one embodiment, as shown in FIG. 1, a schematic diagram of an internal structure of an electronic device is provided. The electronic device includes a processor, memory, and display screen connected by a system bus. Among them, the processor is used to provide computing and control capabilities to support the operation of the entire electronic device. The memory is used to store data, programs, and/or instruction codes, etc. At least one computer program is stored on the memory, and the computer program can be executed by the processor to implement the audio output control method for electronic devices provided in the embodiments of the present application . The memory may include a non-volatile storage medium such as a magnetic disk, an optical disk, a read-only memory (Read-Only Memory, ROM), or a random-access memory (Random-Access-Memory, RAM). For example, in one embodiment, the memory includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores the operating system, database, and computer program. The database stores data related to an audio output control method provided by the above embodiments, for example, information such as the name of each process or application may be stored. The computer program can be executed by the processor to implement an audio output control method provided by various embodiments of the present application. The internal memory provides a cached operating environment for operating systems, databases, and computer programs in non-volatile storage media. The display screen may be a touch screen, such as a capacitive screen or an electronic screen, which is used to display interface information of applications corresponding to the foreground process, and may also be used to detect a touch operation acting on the display screen, and generate corresponding instructions, such as performing front and background Application switching instructions, etc.
本领域技术人员可以理解,图1中示出的结构,仅仅是与本申请方案相关的部分结构的框图,并不构成对本申请方案所应用于其上的电子设备的限定,具体的电子设备可以包括比图中所示更多或更少的部件,或者组合某些部件,或者具有不同的部件布置。如该电子设备还包括通过系统总线连接的网络接口,网络接口可以是以太网卡或无线网卡等,用于与外部的电子设备进行通信,比如可用于同服务器进行通信。Those skilled in the art may understand that the structure shown in FIG. 1 is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the electronic device to which the solution of the present application is applied. The specific electronic device may It includes more or fewer components than shown in the figure, or some components are combined, or have a different component arrangement. For example, the electronic device further includes a network interface connected through a system bus. The network interface may be an Ethernet card or a wireless network card, etc., and is used to communicate with external electronic devices, for example, it may be used to communicate with a server.
在一个实施例中,如图2所示,提供了一种Android音频系统的部分架构图。其中,该Android音频系统的架构系统中包括内核(Kernel)空间层210、本地层220、框架层230以及Client层240。In one embodiment, as shown in FIG. 2, a partial architecture diagram of an Android audio system is provided. The architecture system of the Android audio system includes a kernel space layer 210, a local layer 220, a framework layer 230, and a client layer 240.
内核(Kernel)空间层210上可包含Audio驱动模块211,其中,Audio驱动模块是与硬件进行交互,并且实现本地层的接口供上层正常调用,这里可以选择ALSA,OSS以及自定义的音频驱动。本地层220中包含AtlasService_Jni模块221、AtlasService Interface模块223以及AtlasService模块225。框架层230中包含AtlasManager模块231和AtlasService模块233。其中,AtlasManager模块231中设有常规接口和注册回调接口。本地层220中的AtlasService模块225以及框架层230中的AtlasService模块233用于事件接收和处理、信息收集、异常反馈以及日志收集,其中,信息收集可包括显示信息的收集和音频信息的收集。其中,音频信息包括播放信息、录音信息、音频模式设置信息等。由于该AtlasService模块设立在系统级的框架层中,可方便与其他系统服务进行交互,同时无需担心系统调用时的权限问题。通过上述的架构,可实现本申请各个实施例中的音频输出控制方法。The Kernel space layer 210 may include an Audio driver module 211, where the Audio driver module interacts with the hardware and implements the local layer interface for the upper layer to call normally. Here, ALSA, OSS, and a custom audio driver can be selected. The local layer 220 includes an AtlasService_Jni module 221, an AtlasService Interface module 223, and an AtlasService module 225. The framework layer 230 includes an AtlasManager module 231 and an AtlasService module 233. Among them, the AtlasManager module 231 is provided with a conventional interface and a registration callback interface. The AtlasService module 225 in the local layer 220 and the AtlasService module 233 in the framework layer 230 are used for event reception and processing, information collection, abnormal feedback, and log collection, where the information collection may include the collection of display information and the collection of audio information. Among them, the audio information includes playback information, recording information, audio mode setting information, and so on. Because the AtlasService module is set up in the system-level framework layer, it can facilitate interaction with other system services, and at the same time, there is no need to worry about permissions during system calls. Through the above-mentioned architecture, the audio output control methods in various embodiments of the present application can be implemented.
在一个实施例中,如图3所示,提供了一种音频输出控制方法,该音频输出控制方法应用于具有多个音频输出通道的电子设备。在一个实施例中,电子设备可以为包括手机、平板电脑、笔记本电脑、掌上电脑、移动互联网设备(Mobile Internet Device,MID)、可穿戴设备(例如智能手表、智能手环、计步器等)或其他等具有语音通话功能并具有扬声器的电子设备。In one embodiment, as shown in FIG. 3, an audio output control method is provided, which is applied to an electronic device having multiple audio output channels. In one embodiment, the electronic device may include a mobile phone, a tablet computer, a laptop computer, a palmtop computer, a mobile Internet device (Mobile Internet Device (MID), a wearable device (such as a smart watch, smart bracelet, pedometer, etc.) Or other electronic devices with voice call function and speakers.
音频输出通道包括听筒通道、扬声器通道、耳机通道,其中耳机通道可以包括有线耳机通道和无线耳机(蓝牙耳机)通道。当音频输出通道为听筒通道时,音频数据由听筒发出;当音频输出通道为扬声器通道时,音频数据由外放扬声器发出;当音频输出通道为耳机通道时,音频数据可通过有线耳机或蓝牙耳机发出。The audio output channel includes an earpiece channel, a speaker channel, and a headset channel, where the headset channel may include a wired headset channel and a wireless headset (Bluetooth headset) channel. When the audio output channel is the earpiece channel, the audio data is sent by the earpiece; when the audio output channel is the speaker channel, the audio data is sent by the external speaker; when the audio output channel is the earphone channel, the audio data can be through wired headphones or Bluetooth headphones issue.
如图3所示,在一个实施例中,音频输出控制方法,包括步骤302-步骤306。As shown in FIG. 3, in one embodiment, the audio output control method includes steps 302-306.
步骤302,获取目标应用程序的音频模式。Step 302: Acquire the audio mode of the target application.
目标应用程序可以理解为能够输出和/或输出音频信号的应用程序,且目标应用程序的数量可以为1个2个、3个或更多个。例如,目标应用程序可包括通话类、即时通信类、音频播放类、视频播放类、声音控制类、语音输入类等应用程序。其中,音频模式可包括多媒体模式、铃声模式、闹钟模式、呼叫模式、通话模式(包括音/视频、VoIP通话)和系统模式。The target application program may be understood as an application program capable of outputting and/or outputting audio signals, and the number of target application programs may be 1, 2, 3 or more. For example, the target application may include applications such as call, instant messaging, audio playback, video playback, sound control, and voice input. Among them, the audio mode may include a multimedia mode, a ringtone mode, an alarm mode, a call mode, a call mode (including audio/video, VoIP call), and a system mode.
每个目标应用程序对应一种音频模式,例如音频播放类、视频播放类目标应用程序对应的音频模式为多媒体模式,时钟对应的音频模式为可为闹钟模式,通话类目标应用程序对应的音频模式可为通话模式等等。Each target application corresponds to an audio mode, for example, the audio mode corresponding to the audio playback and video playback target applications is the multimedia mode, the audio mode corresponding to the clock is the alarm clock mode, and the audio mode corresponding to the call target application Can be a call mode, etc.
电子设备可以基于Android音频系统的架构系统中的AudioManager来管理音频模式,具体地,可以基于设置函数setMode()来设置目标应用程序的音频模式。电子设备基于AudioManager可以获取处于运行状态的目标应用程序的音频模式。运行状态可以理解为前台运行,也可以理解为在后台运行。The electronic device can manage the audio mode based on the AudioManager in the architecture system of the Android audio system. Specifically, the audio mode of the target application can be set based on the setting function setMode(). The electronic device can obtain the audio mode of the target application program in the running state based on the AudioManager. The running state can be understood as running in the foreground or running in the background.
在一个实施例中,电子设备可以预设构建包括所有目标应用程序的列表或数据库,用于存储目标应用程序的标识信息等。In one embodiment, the electronic device may preset to construct a list or database including all target applications, for storing identification information of the target applications, and the like.
步骤304,根据音频模式监听目标应用程序用于播放音频数据的音频输出通道是否异常。Step 304: Monitor whether the audio output channel used by the target application to play audio data is abnormal according to the audio mode.
每个音频模式可对应多个用于播放音频数据的音频输出通道,例如,当目标应用程序为通话类应用程序时,该目标应用程序对应的音频模式为通话模式,当电子设备处于通话状态时,可以通过听筒通道、扬声器通道或耳机通道进行语音通话,也即,通话模式对应的音频输出通道包括听筒通道、扬声器通道和耳机通道。Each audio mode can correspond to multiple audio output channels for playing audio data. For example, when the target application is a call application, the audio mode corresponding to the target application is a call mode, when the electronic device is in a call state , You can make a voice call through the receiver channel, speaker channel or headset channel, that is, the audio output channel corresponding to the call mode includes the receiver channel, speaker channel and headset channel.
同时,每种音频模式可设有至少一种默认的音频输出通道。例如,音频模式为通话模式时,其对应的默认音频输出通道可包括听筒通道和耳机通道,当电子终端连接耳机时,其默认音频输出通道为耳机通道,当电子设备未连接耳机时,其默认音频输出通道为听筒通道。例如,音频模式为铃声模式或闹钟模式时,其对应的默认音频输出通道为扬声器模式。At the same time, each audio mode can be provided with at least one default audio output channel. For example, when the audio mode is a call mode, the corresponding default audio output channels may include a receiver channel and a headset channel. When the electronic terminal is connected to the headset, the default audio output channel is the headset channel. When the electronic device is not connected to the headset, the default The audio output channel is the earpiece channel. For example, when the audio mode is the bell mode or the alarm mode, the corresponding default audio output channel is the speaker mode.
当目标应用程序播放音频数据时,电子设备可以监听当前用于播放该音频数据的音频输出通道,若该音频输出通道与该目标应用程序的音频模式对应的默认音频输出通道一致时,则可认为目标应用程序用于播放音频数据的音频输出通道是正常的,反之,则可认为目标应用程序用于播放音频数据的音频输出通道是异常的。例如,电子设备来电时,其铃声从听筒通道发出或其铃声从耳机通道发出,则都可认为用于播放来电铃声的目标应用程序的音频输出通道异常。When the target application plays audio data, the electronic device can monitor the audio output channel currently used to play the audio data. If the audio output channel is consistent with the default audio output channel corresponding to the audio mode of the target application, it can be considered The audio output channel used by the target application to play audio data is normal; otherwise, the audio output channel used by the target application to play audio data is abnormal. For example, when an electronic device calls, its ringtone is sent from the earpiece channel or its ringtone is sent from the headset channel, it can be considered that the audio output channel of the target application used to play the ringtone is abnormal.
需要说明的是,音频数据包括语音数据、铃声数据、闹铃数据、多媒体数据(视频流、音频流输数据等)等等。It should be noted that the audio data includes voice data, ringtone data, alarm data, multimedia data (video streaming, audio streaming data, etc.) and so on.
步骤306,当音频输出通道异常时,改变音频数据的音频输出通道,以使改变后的音频输出通道播放音频数据。 Step 306, when the audio output channel is abnormal, the audio output channel of the audio data is changed, so that the changed audio output channel plays audio data.
电子设备可判断当前用于播放音频数据的音频输出通道是否异常,当音频输出通道异常时,可以改变当前用于播放音频数据的音频输出通道,以使改变后的音频输出通道来播放目标应用程序控制播放的音频数据。例如,电子设备来电时,其铃声从听筒通道发出或其铃声从耳机通道发出时,电子设备可以将当前用于播放铃声的听筒通道或耳机通道切换为扬声器通道,由扬声器来播放该音频数据。The electronic device can determine whether the audio output channel currently used to play audio data is abnormal. When the audio output channel is abnormal, the audio output channel currently used to play audio data can be changed so that the changed audio output channel can play the target application Control audio data for playback. For example, when an electronic device calls, the ringtone is sent from the earpiece channel or the ringtone is sent from the earphone channel, the electronic device can switch the earphone channel or the earphone channel currently used to play the ringtone to the speaker channel, and the audio data is played by the speaker.
上述音频输出控制方法,能够获取目标应用程序的音频模式;根据音频模式监听目标应用程序用于播放音频数据的音频输出通道是否异常;当音频输出通道异常时,改变音频数据的音频输出通道,以使改变后的音频输出通道播放音频数据,可以修复异常的音频输出通道,自动使音频数据从默认的音频输出通道输出,增强音频数据输出的稳定性,可以避免音频数据从其他音频输出通道输出的情况发生,提高用户体验。The above audio output control method can obtain the audio mode of the target application; monitor whether the audio output channel used by the target application to play audio data is abnormal according to the audio mode; when the audio output channel is abnormal, change the audio output channel of the audio data to Make the changed audio output channel play audio data, can repair abnormal audio output channel, automatically make the audio data output from the default audio output channel, enhance the stability of the audio data output, can avoid the audio data output from other audio output channels The situation occurs, improving the user experience.
如图4所示,在一个实施例中,根据音频模式监听目标应用程序用于播放音频数据的音频输出通道是否异常,包括As shown in FIG. 4, in one embodiment, monitoring the audio output channel used by the target application to play audio data according to the audio mode is abnormal, including
步骤402,当目标应用程序播放音频数据时,监听播放音频数据的音频输出通道。Step 402: When the target application plays audio data, monitor the audio output channel that plays the audio data.
在一个实施例中,基于电子设备的操作系统创建监听模块,通过监听模块对目标应用程序的音频输出通道进行监听。其中,该监听模块还可以用于监听目标应用程序的音频模式、音量调节、录音等与音频数据输入和/或输出相关的信息。以具有安卓操作系统的电子设备为例,可在系统框架层(native/framework层)创建系统级的监听模块(AtlasService模块),通过监听模块对目标应用程序的音频输出通道和音频模式进行监听。例如,可在框架层设立监听模块并运行在系统服务程序(system_server)中,由于该监听模块设立在系统级的服务框架层中,可方便与其他系统服务进行交互,同时无需担心系统调用时的权限问题。In one embodiment, a monitoring module is created based on the operating system of the electronic device, and the audio output channel of the target application program is monitored through the monitoring module. Wherein, the monitoring module can also be used to monitor the audio mode, volume adjustment, recording and other information related to the input and/or output of audio data of the target application. Taking an electronic device with an Android operating system as an example, a system-level monitoring module (AtlasService module) can be created at the system framework layer (native/framework layer) to monitor the audio output channel and audio mode of the target application through the monitoring module. For example, you can set up a listener module in the framework layer and run it in the system service program (system_server). Since the listener module is established in the system-level service framework layer, you can easily interact with other system services without worrying about system calls. Permissions issue.
可选的,电子设备也可以创建独立的监听进程,通过消息传输机制监听目标应用程序的音频输出通道。在该进程中设立并调用单独的监听函数,可设置为开机自启动,并实时对其他任何一个目标应用程序的音频模式设置以及播放音频数据的音频输出通道进行监控。Optionally, the electronic device can also create an independent monitoring process to monitor the audio output channel of the target application through the message transmission mechanism. In this process, a separate monitoring function is set up and called, which can be set to start automatically after power-on, and monitor the audio mode setting of any other target application and the audio output channel that plays audio data in real time.
步骤404,识别音频输出通道是否符合音频模式的播放标准。Step 404: Identify whether the audio output channel conforms to the audio mode playback standard.
步骤406,当音频输出通道不符合音频模式的播放标准时,则音频输出通道异常。 Step 406, when the audio output channel does not meet the playback standard of the audio mode, the audio output channel is abnormal.
电子设备中还可预先构建音频输出通道与音频模式匹配映射表;在该映射表中,会存储音频模式的所有音频输出通道以及默认音频输出通道,其中,默认音频输出通道可理解为该目标应用程序播放音频数据时,用于播放该音频数据的音频输出通道具有最高优先级,也即,默认音频输出通道的在所有音频输出通道中的播放优先级最高。若采用默认音频输出通道播放音频数据时,则可认为符合音频模式的播放标准。Electronic equipment can also pre-construct a mapping table of audio output channels and audio mode matching; in this mapping table, all audio output channels of the audio mode and the default audio output channel are stored, where the default audio output channel can be understood as the target application When a program plays audio data, the audio output channel used to play the audio data has the highest priority, that is, the default audio output channel has the highest playback priority among all audio output channels. If the default audio output channel is used to play audio data, it can be considered to comply with the playback standards of the audio mode.
根据映射表,识别音频输出通道是否符合音频模式的播放标准。例如,控制播放音频数据的目标应用程序为视频类应用程序,其音频模式为多媒体模式,该 多媒体模式对应的默认音频输出通道为扬声器通道。若该视频类应用程序播放视频时,其音频数据由听筒通道发出,而多媒体模式的播放标准为音频数据由扬声器通道发出,则可认为该听筒通道不符合多媒体模式的播放标准。According to the mapping table, identify whether the audio output channel meets the playback standards of the audio mode. For example, the target application that controls the playback of audio data is a video application, and its audio mode is a multimedia mode, and the default audio output channel corresponding to the multimedia mode is a speaker channel. If the video application plays the video, the audio data is sent from the earphone channel, and the multimedia mode playback standard is that the audio data is sent from the speaker channel, it can be considered that the earphone channel does not meet the multimedia mode playback standard.
当音频输出通道不符合音频模式的播放标准时,则音频输出通道异常。When the audio output channel does not meet the playback standards of the audio mode, the audio output channel is abnormal.
如图5所示,在一个实施例中,当音频输出通道异常时,改变音频数据的音频输出通道,包括:As shown in FIG. 5, in one embodiment, when the audio output channel is abnormal, changing the audio output channel of the audio data includes:
步骤502,当音频输出通道异常时,调用预设接口函数。 Step 502, when the audio output channel is abnormal, the preset interface function is called.
步骤504,根据预设接口函数改变音频数据的音频输出通道。Step 504: Change the audio output channel of the audio data according to the preset interface function.
当播放音频数据的音频输出通道异常时,电子设备可以调用预设接口函数来设置音频输出通道。预设接口函数至少包括setSpeakerphoneOn()接口函数、setMode(AudioManager.MODE_IN_CALL)接口函数、isWiredHeadsetOn()接口函数或其他用于设置听筒通道、耳机通道的接口函数等。When the audio output channel playing audio data is abnormal, the electronic device can call a preset interface function to set the audio output channel. The preset interface functions include at least the setSpeakerphoneOn() interface function, setMode(AudioManager.MODE_IN_CALL) interface function, isWiredHeadsetOn() interface function or other interface functions for setting the earphone channel and headphone channel.
例如,基于安卓操作系统的电子设备中,电子设备可以通过调用AudioManager中的接口函数setSpeakerphoneOn()来设置扬声器通道,也即,可以开启或关闭扬声器通道。电子设备可以通过调用AudioManager中的函数setMode(AudioManager.MODE_IN_CALL)或构造参数streamType(STREAM_VOICE_CALL)设置听筒通道;电子设备可以通过调用AudioManager中的函数isWiredHeadsetOn()来设置并检测听筒通道。For example, in an electronic device based on the Android operating system, the electronic device can set the speaker channel by calling the interface function setSpeakerphoneOn() in the AudioManager, that is, the speaker channel can be turned on or off. The electronic device can set the earpiece channel by calling the function setMode(AudioManager.MODE_IN_CALL) in AudioManager or the construction parameter streamType(STREAM_VOICE_CALL); the electronic device can set and detect the earpiece channel by calling the function isWiredHeadsetOn() in AudioManager.
可选的,接口函数setMode()可用于设置声音模式,例如,void setMode(intmode)。其中,可设置的值有NORMAL,RINGTONE和IN_CALL。例如,setRingerMode(intringerMode)可用于设置电话铃声的模式,其包括正常铃声(RINGER_MODE_NORMAL)、铃声静音(RINGER_MODE_SILENT)和震动(RINGER_MODE_VIBRATE)。Optionally, the interface function setMode() can be used to set the sound mode, for example, void setMode(intmode). Among them, the settable values are NORMAL, RINGTONE and IN_CALL. For example, setRingerMode (intringerMode) can be used to set the ringtone mode of the phone, which includes normal ringtone (RINGER_MODE_NORMAL), ringtone silence (RINGER_MODE_SILENT), and vibration (RINGER_MODE_VIBRATE).
如图6所示,在一个实施例中,音频输出控制方法包括步骤602-步骤610。其中,As shown in FIG. 6, in one embodiment, the audio output control method includes steps 602-610. among them,
步骤602,获取目标应用程序的音频模式。Step 602: Acquire the audio mode of the target application.
步骤604,根据音频模式监听目标应用程序用于播放音频数据的音频输出通道是否异常。Step 604: Monitor whether the audio output channel used by the target application to play audio data is abnormal according to the audio mode.
上述步骤602、步骤604与前述实施例中步骤302、步骤304一一对应,在此,不再赘述。The above step 602 and step 604 correspond to step 302 and step 304 in the foregoing embodiment, and will not be described here.
步骤606,当听筒通道异常时,检测电子设备是否连接耳机。Step 606, when the earphone channel is abnormal, it is detected whether the electronic device is connected to the earphone.
电子设备可以获取用于控制播放音频数据的目标应用程序的音频模式,并确定该音频模式的默认音频输出通道,若该默认音频输出通道不是听筒通道时,但是其音频数据通过听筒通道输出时,则认为听筒通道异常。The electronic device can obtain the audio mode of the target application used to control the playback of audio data and determine the default audio output channel of the audio mode. The earpiece channel is considered abnormal.
当听筒通道异常时,电子设备可检测当前是否有耳机与电子设备进行连接。其中,该连接可以为有线连接,也可以为无线连接(蓝牙连接)。When the earpiece channel is abnormal, the electronic device can detect whether a headset is currently connected to the electronic device. The connection may be a wired connection or a wireless connection (Bluetooth connection).
例如,电子设备可通过调用AudioManager中的函数isWiredHeadsetOn()来设置并检测是否有连接有线耳机,或通过检测GPIO(通用输入/输出,General  Purpose Input Output)的高低电平来检测是否连接了有线耳机。具体的,GPIO接口的预设状态为高电平,当前的检测状态为低电平,则表明GPIO接口的状态发生了变化,电子设备连接了有线耳机。For example, an electronic device can set and detect whether a wired headset is connected by calling the function isWiredHeadsetOn() in AudioManager, or detect whether a wired headset is connected by detecting the high and low level of GPIO (General Purpose/Input, Output) . Specifically, the preset state of the GPIO interface is a high level, and the current detection state is a low level, indicating that the state of the GPIO interface has changed and the electronic device is connected to a wired headset.
例如,电子设备可通过BluetoothAdapter类来检测是否有连接蓝牙耳机。同时,电子设备还可以基于蓝牙协议来检测相应的音频接口的接口状态,进而检测电子设备是否与连接蓝牙耳机。For example, an electronic device can detect whether a Bluetooth headset is connected through the BluetoothAdapter class. At the same time, the electronic device can also detect the interface state of the corresponding audio interface based on the Bluetooth protocol, and then detect whether the electronic device is connected to the Bluetooth headset.
需要说明的是,电子设备还可以基于其他软件或硬件的方式检测是否与耳机连接,并不限于上述举例说明。It should be noted that the electronic device can also detect whether it is connected to the earphone based on other software or hardware, which is not limited to the above example.
步骤608,当电子设备连接耳机时,改变音频数据的听筒通道,以使耳机通道播放音频数据。Step 608: When the electronic device is connected to the earphone, change the earphone channel of the audio data so that the earphone channel plays the audio data.
当电子设备连接耳机时,若该目标应用程序的音频模式对应的默认音频输出通道为听筒通道时,则可调用用于切换至耳机通道的预设接口函数,根据该预设接口函数将输出音频数据的音频输出通道由听筒模式切换为耳机通道,并由耳机通道来播放该音频数据。When the electronic device is connected to the headset, if the default audio output channel corresponding to the audio mode of the target application is the earpiece channel, the preset interface function for switching to the headset channel can be called, and the audio will be output according to the preset interface function The audio output channel of the data is switched from the earpiece mode to the headphone channel, and the headphone channel plays the audio data.
步骤610,当电子设备未连接耳机时,改变音频数据的听筒通道,以使扬声器通道播放音频数据。Step 610: When the electronic device is not connected with the earphone, change the earphone channel of the audio data, so that the speaker channel plays the audio data.
当电子设备连接耳机时,则该目标应用程序的音频模式对应的默认音频输出通道为扬声器通道时,则可调用用于切换至扬声器通道的预设接口函数,根据该预设接口函数将输出音频数据的音频输出通道由听筒模式切换为扬声器通道,并由扬声器通道来播放该音频数据。When the electronic device is connected to the headset, when the default audio output channel corresponding to the audio mode of the target application is the speaker channel, the preset interface function for switching to the speaker channel can be called, and the audio will be output according to the preset interface function The audio output channel of the data is switched from the receiver mode to the speaker channel, and the speaker channel plays the audio data.
本实施例中,当音频输出通道中的听筒通道出现异常时,电子设备可以根据是否连接耳机的状态,自适应的将其听筒通道切换至符合用户使用场景的音频输出通道,可以提高音频输出的稳定性和用户体验度。In this embodiment, when the earphone channel in the audio output channel is abnormal, the electronic device can adaptively switch its earphone channel to an audio output channel that matches the user's use scenario according to whether the headset is connected, which can improve the audio output. Stability and user experience.
如图7所示,在一个实施例中,音频输出控制方法包括步骤702-步骤710。其中,As shown in FIG. 7, in one embodiment, the audio output control method includes steps 702-710. among them,
步骤702,获取目标应用程序的音频模式。Step 702: Acquire the audio mode of the target application.
步骤704,根据音频模式监听目标应用程序用于播放音频数据的音频输出通道是否异常。Step 704: Monitor whether the audio output channel used by the target application to play audio data is abnormal according to the audio mode.
步骤702、步骤704与前述实施例中步骤302、步骤304一一对应,在此,不再赘述。Step 702 and step 704 correspond to step 302 and step 304 in the foregoing embodiment, and will not be repeated here.
步骤706,当扬声器通道异常时,检测电子设备是否连接耳机。Step 706, when the speaker channel is abnormal, it is detected whether the electronic device is connected to the earphone.
电子设备可以获取用于控制播放音频数据的目标应用程序的音频模式,并确定该音频模式的默认音频输出通道,若该默认音频输出通道不是扬声器通道时,但是其音频数据通过扬声器通道输出时,则认为扬声器通道异常。The electronic device can obtain the audio mode of the target application used to control the playback of audio data, and determine the default audio output channel of the audio mode. If the default audio output channel is not a speaker channel, but its audio data is output through the speaker channel, The speaker channel is considered abnormal.
需要说明的是,本步骤中检测电子设备是否连接耳机的检测方法与前述实施例中检测电子设备是否连接耳机的检测方法一致,在此,不再赘述。It should be noted that the detection method for detecting whether the electronic device is connected to the earphone in this step is the same as the detection method for detecting whether the electronic device is connected to the earphone in the foregoing embodiment, and details are not described here.
步骤708,当电子设备连接耳机时,改变音频数据的听筒通道,以使耳机通道播放音频数据。 Step 708, when the electronic device is connected to the earphone, change the earphone channel of the audio data, so that the earphone channel plays the audio data.
当电子设备连接耳机时,若该目标应用程序的音频模式对应的默认音频输出通道为扬声器通道时,则可调用用于切换至耳机通道的预设接口函数,根据该预设接口函数将输出音频数据的音频输出通道由扬声器模式切换为耳机通道,并由耳机通道来播放该音频数据。When the electronic device is connected to the headset, if the default audio output channel corresponding to the audio mode of the target application is a speaker channel, a preset interface function for switching to the headset channel can be called, and the audio will be output according to the preset interface function The audio output channel of the data is switched from the speaker mode to the headphone channel, and the headphone channel plays the audio data.
步骤710,当电子设备未连接耳机时,改变音频数据的听筒通道,以使听筒通道播放音频数据。 Step 710, when the electronic device is not connected with the earphone, change the earphone channel of the audio data, so that the earphone channel plays the audio data.
当电子设备连接耳机时,若该目标应用程序的音频模式对应的默认音频输出通道为扬声器通道时,则可调用用于切换至听筒通道的预设接口函数,根据该预设接口函数将输出音频数据的音频输出通道由扬声器模式切换为听筒通道,并由听筒通道来播放该音频数据。When the electronic device is connected to a headset, if the default audio output channel corresponding to the audio mode of the target application is a speaker channel, a preset interface function for switching to the earpiece channel can be called, and the audio will be output according to the preset interface function The audio output channel of the data is switched from the speaker mode to the receiver channel, and the receiver channel plays the audio data.
本实施例中,当音频输出通道中的扬声器通道出现异常时,电子设备可以根据是否连接耳机的状态,自适应的将其扬声器通道切换至符合用户使用场景的音频输出通道,可以提高音频输出的稳定性和用户体验度。In this embodiment, when the speaker channel in the audio output channel is abnormal, the electronic device can adaptively switch its speaker channel to an audio output channel that matches the user's use scenario according to whether the headset is connected, which can improve the audio output. Stability and user experience.
进一步的,当扬声器通道异常时,改变音频数据的音频输出通道,还可包括:当扬声器通道异常时,将扬声器通道的音量调为静音,并改变音频数据的音频输出通道的步骤。具体地,若扬声器通道异常时,其音频数据可从扬声器通道输出,若将该扬声器输出通道的音量调节至为静音,可以避免音频数据由扬声器外放而泄露用户音频数据的隐私,提高对由扬声器输出通道播放的音频数据的保护。Further, when the speaker channel is abnormal, changing the audio output channel of the audio data may further include: when the speaker channel is abnormal, muting the volume of the speaker channel and changing the audio output channel of the audio data. Specifically, if the speaker channel is abnormal, the audio data can be output from the speaker channel. If the volume of the speaker output channel is adjusted to mute, the audio data can be prevented from being exposed by the speaker and leaking the privacy of the user's audio data, which improves the risk Protection of audio data played by the speaker output channel.
在一个实施例中,当耳机通道异常时,改变音频数据的音频输出通道,以使改变后的音频输出通道播放音频数据,具体包括当电子设备连接耳机且耳机通道异常时,改变音频数据的耳机通道,以使扬声器通道播放音频数据的步骤。In one embodiment, when the earphone channel is abnormal, the audio output channel of the audio data is changed so that the changed audio output channel plays audio data, specifically including the earphone that changes the audio data when the electronic device is connected to the earphone and the earphone channel is abnormal Steps to enable the speaker channel to play audio data.
电子设备可以获取用于控制播放音频数据的目标应用程序的音频模式,并确定该音频模式的默认音频输出通道,若该默认音频输出通道不是耳机通道时,但是其音频数据通过耳机通道输出时,则认为耳机通道异常。例如,闹钟模式下,其对应的默认音频输出通道为扬声器,当电子设备连接耳机时,其闹铃由耳机通道输出,而并未从扬声器输出时,则可认为当前耳机通道异常,则电子设备可调用用于切换至扬声器通道的预设调用函数,使其闹铃从扬声器通道输出,这样可以避免闹铃从耳机通道输出,用户不能感知其闹铃的情况发生,当闹铃从扬声器输出时,用户可正常听到闹铃,不会影响用户的正常作息。The electronic device can obtain the audio mode of the target application used to control the playback of audio data, and determine the default audio output channel of the audio mode. If the default audio output channel is not the headphone channel, but its audio data is output through the headphone channel, The earphone channel is considered abnormal. For example, in the alarm clock mode, the corresponding default audio output channel is the speaker. When the electronic device is connected to the headset, the alarm is output from the headset channel, but not from the speaker, it can be considered that the current headset channel is abnormal, then the electronic device It can call the preset calling function for switching to the speaker channel to make the alarm output from the speaker channel, so as to avoid the alarm output from the headset channel, and the user cannot perceive the alarm occurrence when the alarm is output from the speaker , The user can hear the alarm normally without affecting the user's normal work and rest.
如图8所示,在一个实施例中,以使改变后的音频输出通道播放音频数据,包括:As shown in FIG. 8, in one embodiment, playing audio data on the changed audio output channel includes:
步骤802,获取电子设备的环境噪声。Step 802: Acquire environmental noise of an electronic device.
电子设备当判断出音频数据的音频输出通道异常时,可以改变音频数据的音频输出通道,同时,还可以同时获取电子设备的环境噪声。其中,环境噪声可为工业生产、建筑施工、交通运输和社会生活中所产生的干扰周围生活环境的声音。例如,电子设备可以基于至少一个麦克风采集环境音,并对其环境音进行分析处理以获取环境噪声。When the electronic device determines that the audio output channel of the audio data is abnormal, it can change the audio output channel of the audio data, and at the same time, it can also obtain the environmental noise of the electronic device. Among them, the environmental noise may be the sound that interferes with the surrounding living environment generated in industrial production, building construction, transportation and social life. For example, the electronic device may collect environmental sounds based on at least one microphone, and analyze and process the environmental sounds to obtain environmental noise.
步骤804,根据环境噪声调节音频输出通道播放播放音频数据的音量。Step 804: Adjust the volume of the audio data played by the audio output channel according to the environmental noise.
电子设备可根据环境噪声调节音频输出通道播放音频数据的音量,也即,电子设备当判断出音频数据的音频输出通道异常时,可以改变音频数据的音频输出通道,同时根据环境噪声来调节音频输出通道播放播放音频数据的音量。例如,环境噪声越大,其对应调节的音量也就越高,但是,音量的最大值不超过预设值。The electronic device can adjust the volume of the audio data played by the audio output channel according to the environmental noise, that is, when the electronic device determines that the audio output channel of the audio data is abnormal, it can change the audio output channel of the audio data and adjust the audio output according to the environmental noise Channel playback volume for playing audio data. For example, the greater the environmental noise, the higher the correspondingly adjusted volume. However, the maximum value of the volume does not exceed the preset value.
本实施例中,当音频输出通道异常时,改变音频数据的音频输出通道,同时,还可根据电子设备的环境噪声来调节改变后的音频输出通道播放音频数据的音量,提高了用户体验度。In this embodiment, when the audio output channel is abnormal, the audio output channel of the audio data is changed, and at the same time, the volume of the audio data played by the changed audio output channel can be adjusted according to the environmental noise of the electronic device, thereby improving the user experience.
在一个实施例中,以使改变后的音频输出通道播放音频数据,包括:获取音频数据的播放时间点;根据改变后的音频输出通道从播放时间点开始播放音频数据。In one embodiment, enabling the changed audio output channel to play audio data includes: acquiring a playback time point of the audio data; and starting to play audio data from the playback time point according to the changed audio output channel.
具体的,当音频输出通道异常时,可改变音频数据的音频输出通道,同时,电子设备还可获取异常的音频输出通道播放该音频数据的播放时间点,并使改变后的音频输出通道从该播放时间点开始播放音频数据。例如,若听筒通道异常时,可以获取听筒通道播放音频数据的播放时间点。其中,该播放时间点可理解为听筒播放音频数据的时间轴上的初始时刻,并记录该时刻,例如,该时刻为10:01:05,其改变后的音频输出通道为扬声器时,可以使扬声器从该播放时间点10:01:05开始播放该音频数据。Specifically, when the audio output channel is abnormal, the audio output channel of the audio data can be changed, and at the same time, the electronic device can also obtain the playback time point of the abnormal audio output channel to play the audio data, and make the changed audio output channel from the The audio data starts playing at the playback time. For example, if the earpiece channel is abnormal, the playing time of the earpiece channel playing audio data can be obtained. The playback time point can be understood as the initial time on the time axis of the audio data played by the earpiece, and record the time, for example, the time is 10:01:05, when the changed audio output channel is a speaker, you can use The speaker starts to play the audio data from the playback time point 10:01:05.
本实施例中的音频控制输出方法能够自动实现切换音频输出通道前的一段时间内的音频数据的重播,使得用户能够获知音频输出方式切换过程中的音频数据,减少用户操作,提升用户体验。The audio control output method in this embodiment can automatically realize the replay of audio data in a period before switching the audio output channel, so that the user can learn the audio data in the process of switching the audio output mode, reducing user operations and improving the user experience.
需要说明的是,本实施例中的步骤也可用于上述步骤802-步骤804前或后,以提高音频输出通道切换过程中播放音频数据的播放质量,提升用户体验。It should be noted that the steps in this embodiment can also be used before or after steps 802 to 804 to improve the playback quality of the audio data played during the audio output channel switching process and enhance the user experience.
应该理解的是,虽然图3-8的流程图中的各个步骤按照箭头的指示依次显示,但是这些步骤并不是必然按照箭头指示的顺序依次执行。除非本文中有明确的说明,这些步骤的执行并没有严格的顺序限制,这些步骤可以以其它的顺序执行。而且,图3-8中的至少一部分步骤可以包括多个子步骤或者多个阶段,这些子步骤或者阶段并不必然是在同一时刻执行完成,而是可以在不同的时刻执行,这些子步骤或者阶段的执行顺序也不必然是依次进行,而是可以与其它步骤或者其它步骤的子步骤或者阶段的至少一部分轮流或者交替地执行。It should be understood that although the steps in the flowcharts of FIGS. 3-8 are sequentially displayed according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless clearly stated in this article, the execution of these steps is not strictly limited in order, and these steps can be executed in other orders. Moreover, at least some of the steps in FIGS. 3-8 may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but may be executed at different times. These sub-steps or stages The execution order of is not necessarily sequential, but may be executed in turn or alternately with at least a part of other steps or sub-steps or stages of other steps.
如图9所示,本申请还提供一种音频输出控制装置,包括:获取模块910、监听模块920以及处理模块930。其中,As shown in FIG. 9, the present application also provides an audio output control device, including: an acquisition module 910, a listening module 920, and a processing module 930. among them,
模式获取模块910,用于获取目标应用程序的音频模式;The mode obtaining module 910 is used to obtain the audio mode of the target application program;
通道监听模块920,用于根据音频模式监听目标应用程序用于播放音频数据的音频输出通道是否异常;The channel monitoring module 920 is used to monitor whether the audio output channel used by the target application to play audio data is abnormal according to the audio mode;
通道处理模块930,用于当音频输出通道异常时,改变音频数据的音频输出通道,以使改变后的音频输出通道播放音频数据,其中,音频输出通道包括听筒通道、耳机通道和扬声器通道。The channel processing module 930 is configured to change the audio output channel of the audio data so that the changed audio output channel plays audio data when the audio output channel is abnormal, wherein the audio output channel includes an earphone channel, a headphone channel, and a speaker channel.
上述音频输出控制装置,能够获取目标应用程序的音频模式;根据音频模式 监听目标应用程序用于播放音频数据的音频输出通道是否异常;当音频输出通道异常时,改变音频数据的音频输出通道,以使改变后的音频输出通道播放音频数据,可以修复异常的音频输出通道,自动使音频数据从默认的音频输出通道输出,增强音频数据输出的稳定性,可以避免音频数据从其他音频输出通道输出的情况发生,提高用户体验。The above audio output control device can acquire the audio mode of the target application; monitor whether the audio output channel used by the target application to play audio data is abnormal according to the audio mode; when the audio output channel is abnormal, change the audio output channel of the audio data to Make the changed audio output channel play audio data, can repair abnormal audio output channel, automatically make the audio data output from the default audio output channel, enhance the stability of the audio data output, can avoid the audio data output from other audio output channels The situation occurs, improving the user experience.
在一个实施例中,通道监听模块920,包括:In one embodiment, the channel monitoring module 920 includes:
通道监听单元,用于当目标应用程序播放音频数据时,监听播放音频数据的音频输出通道;The channel monitoring unit is used to monitor the audio output channel of the audio data when the target application plays the audio data;
标准识别单元,用于识别音频输出通道是否符合音频模式的播放标准;Standard identification unit, used to identify whether the audio output channel meets the playback standards of the audio mode;
异常判断单元,用于当音频输出通道不符合音频模式的播放标准时,则音频输出通道异常。The abnormality judging unit is used to make the audio output channel abnormal when the audio output channel does not meet the playback standard of the audio mode.
在一个实施例中,通道监听单元,还用于:In one embodiment, the channel monitoring unit is also used to:
基于电子设备的操作系统创建监听模块,通过监听模块对目标应用程序的音频输出通道进行监听,或,创建监听进程,通过消息传输机制监听目标应用程序的音频输出通道。The operating system based on the electronic device creates a monitoring module to monitor the audio output channel of the target application through the monitoring module, or creates a monitoring process to monitor the audio output channel of the target application through the message transmission mechanism.
在一个实施例中,标准识别单元还用于:In one embodiment, the standard identification unit is also used to:
构建音频输出通道与音频模式匹配映射表;根据映射表,识别音频输出通道是否符合音频模式的播放标准。Build a mapping table between the audio output channel and the audio mode; according to the mapping table, identify whether the audio output channel meets the playback standards of the audio mode.
在一个实施例中,通道处理模块930包括:In one embodiment, the channel processing module 930 includes:
调用单元,用于当音频输出通道异常时,调用预设接口函数;The calling unit is used to call a preset interface function when the audio output channel is abnormal;
处理单元,用于根据预设接口函数改变音频数据的音频输出通道。The processing unit is used to change the audio output channel of the audio data according to the preset interface function.
在一个实施例中,通道处理模块930进一步包括:In one embodiment, the channel processing module 930 further includes:
设置单元,用于基于电子设备的操作系统设置预设接口函数,预设接口函数用于设置音频输出通道。The setting unit is used to set a preset interface function based on the operating system of the electronic device, and the preset interface function is used to set an audio output channel.
在一个实施例中,当听筒通道异常时,通道处理模块930进一步包括:In one embodiment, when the earpiece channel is abnormal, the channel processing module 930 further includes:
检测单元,用于检测电子设备是否连接耳机;The detection unit is used to detect whether the electronic device is connected to the earphone;
处理单元,还用于当电子设备连接耳机时,改变音频数据的听筒通道,以使耳机通道播放音频数据;当电子设备未连接耳机时,改变音频数据的听筒通道,以使扬声器通道播放音频数据。The processing unit is also used to change the earphone channel of the audio data when the electronic device is connected to the earphone, so that the earphone channel plays audio data; when the electronic device is not connected to the earphone, change the earphone channel of the audio data, so that the speaker channel plays audio data .
本实施例中,当音频输出通道中的听筒通道出现异常时,电子设备可以根据是否连接耳机的状态,自适应的将其听筒通道切换至符合用户使用场景的音频输出通道,可以提高音频输出的稳定性和用户体验度。In this embodiment, when the earphone channel in the audio output channel is abnormal, the electronic device can adaptively switch its earphone channel to an audio output channel that matches the user's use scenario according to whether the headset is connected, which can improve the audio output. Stability and user experience.
在一个实施例中,当扬声器通道异常时,处理单元还用于当电子设备连接耳机时,改变音频数据的听筒通道,以使耳机通道播放音频数据;当电子In one embodiment, when the speaker channel is abnormal, the processing unit is further used to change the earphone channel of the audio data when the electronic device is connected to the earphone, so that the earphone channel plays audio data
设备未连接耳机时,改变音频数据的听筒通道,以使听筒通道播放音频数据。When no earphone is connected to the device, change the earphone channel of the audio data so that the earphone channel plays audio data.
在一个实施例中,当扬声器通道异常时,处理单元还用于将扬声器通道的音量调为静音,并改变音频数据的音频输出通道。In one embodiment, when the speaker channel is abnormal, the processing unit is also used to mute the volume of the speaker channel and change the audio output channel of the audio data.
本实施例中,当音频输出通道中的扬声器通道出现异常时,电子设备可以根 据是否连接耳机的状态,自适应的将其扬声器通道切换至符合用户使用场景的音频输出通道,可以提高音频输出的稳定性和用户体验度。In this embodiment, when the speaker channel in the audio output channel is abnormal, the electronic device can adaptively switch its speaker channel to an audio output channel that matches the user's use scenario according to whether the headset is connected, which can improve the audio output. Stability and user experience.
在一个实施例中,通道处理模块930进一步包括:噪声获取单元,用于获取电子设备的环境噪声;In one embodiment, the channel processing module 930 further includes: a noise acquisition unit for acquiring environmental noise of the electronic device;
处理单元,还用于根据环境噪声调节音频输出通道播放播放音频数据的音量。The processing unit is also used to adjust the volume of the audio output channel playing audio data according to the environmental noise.
本实施例中,当音频输出通道异常时,改变音频数据的音频输出通道,同时,还可根据电子设备的环境噪声来调节改变后的音频输出通道播放音频数据的音量,提高了用户体验度。In this embodiment, when the audio output channel is abnormal, the audio output channel of the audio data is changed, and at the same time, the volume of the audio data played by the changed audio output channel can be adjusted according to the environmental noise of the electronic device, thereby improving the user experience.
在一个实施例中,通道处理模块930进一步包括:播放获取单元,用于获取音频数据的播放时间点;In one embodiment, the channel processing module 930 further includes: a playback acquisition unit, configured to acquire a playback time point of audio data;
处理单元,还用于根据改变后的音频输出通道从播放时间点开始播放音频数据。The processing unit is also used to start playing audio data from the playing time according to the changed audio output channel.
本实施例中的音频控制输出方法能够自动实现切换音频输出通道前的一段时间内的音频数据的重播,使得用户能够获知音频输出方式切换过程中的音频数据,减少用户操作,提升用户体验。The audio control output method in this embodiment can automatically realize the replay of audio data in a period before switching the audio output channel, so that the user can learn the audio data in the process of switching the audio output mode, reducing user operations and improving the user experience.
上述音频输出控制装置中各个模块的划分仅用于举例说明,在其他实施例中,可将音频输出控制装置按照需要划分为不同的模块,以完成上述音频输出控制装置的全部或部分功能。The division of each module in the above audio output control device is for illustration only. In other embodiments, the audio output control device may be divided into different modules as needed to complete all or part of the functions of the above audio output control device.
上述音频输出控制装置中的各个模块可全部或部分通过软件、硬件及其组合来实现。上述各模块可以硬件形式内嵌于或独立于电子设备中的处理器中,也可以以软件形式存储于电子设备中的存储器中,以便于处理器调用执行以上各个模块对应的操作。Each module in the above audio output control device may be implemented in whole or in part by software, hardware, or a combination thereof. The above modules may be embedded in the hardware or independent of the processor in the electronic device, or may be stored in the memory in the electronic device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
本申请实施例还提供了一种计算机可读存储介质。一个或多个包含计算机可执行指令的非易失性计算机可读存储介质,当计算机可执行指令被一个或多个处理器执行时,使得处理器执行以下音频输出控制方法的步骤:The embodiments of the present application also provide a computer-readable storage medium. One or more non-volatile computer-readable storage media containing computer-executable instructions, when the computer-executable instructions are executed by one or more processors, cause the processor to perform the following steps of the audio output control method:
获取目标应用程序的音频模式;Get the audio mode of the target application;
根据音频模式监听目标应用程序用于播放音频数据的音频输出通道是否异常;Monitor the audio output channel used by the target application to play audio data according to the audio mode for abnormality;
当音频输出通道异常时,改变音频数据的音频输出通道,以使改变后的音频输出通道播放音频数据。When the audio output channel is abnormal, the audio output channel of the audio data is changed so that the changed audio output channel plays audio data.
需要说明的是,一个或多个包含计算机可执行指令的非易失性计算机可读存储介质,当计算机可执行指令被一个或多个处理器执行时,还可以使得处理器执行上述任一实施例中的音频输出控制方法。It should be noted that one or more non-volatile computer-readable storage media containing computer-executable instructions, when the computer-executable instructions are executed by one or more processors, may also cause the processor to perform any of the foregoing implementations Example audio output control method.
一种包含指令的计算机程序产品,当其在计算机上运行时,使得计算机执行音频输出控制方法的步骤:A computer program product containing instructions that, when run on a computer, causes the computer to perform the steps of the audio output control method:
获取目标应用程序的音频模式;Get the audio mode of the target application;
根据音频模式监听目标应用程序用于播放音频数据的音频输出通道是否异 常;Whether the audio output channel used by the target application to play audio data according to the audio mode is abnormal;
当音频输出通道异常时,改变音频数据的音频输出通道,以使改变后的音频输出通道播放音频数据。When the audio output channel is abnormal, the audio output channel of the audio data is changed so that the changed audio output channel plays audio data.
需要说明的是,一种包含指令的计算机程序产品,当其在计算机上运行时使得计算机执行上述任一实施例中的音频输出控制方法的步骤。It should be noted that a computer program product containing instructions, when run on a computer, causes the computer to execute the steps of the audio output control method in any of the above embodiments.
本申请实施例还提供了一种电子设备。如图10所示,为了便于说明,仅示出了与本申请实施例相关的部分,具体技术细节未揭示的,请参照本申请实施例方法部分。该电子设备可以为包括手机、平板电脑、PDA(Personal Digital Assistant,个人数字助理)、POS(Point of Sales,销售终端)、车载电脑、穿戴式设备等具有语音通话功能并具有扬声器的任意终端设备,以电子设备为手机为例:An embodiment of the present application also provides an electronic device. As shown in FIG. 10, for ease of description, only parts related to the embodiments of the present application are shown, and specific technical details are not disclosed, please refer to the method part of the embodiments of the present application. The electronic device may be any terminal device including a mobile phone, tablet computer, PDA (Personal Digital Assistant), POS (Point of Sales), in-vehicle computer, wearable device, etc. that has a voice call function and has a speaker , Taking an electronic device as a mobile phone as an example:
图10为与本申请实施例提供的电子设备相关的手机的部分结构的框图。参考图10,手机包括:射频(Radio Frequency,RF)电路1010、存储器1020、输入单元1030、显示单元1040、传感器1050、音频电路1060、无线保真(wireless fidelity,WiFi)模块1070、处理器1080、以及电源1090等部件。本领域技术人员可以理解,图10所示的手机结构并不构成对手机的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置。10 is a block diagram of a partial structure of a mobile phone related to an electronic device provided by an embodiment of the present application. 10, the mobile phone includes: a radio frequency (Radio Frequency) circuit 1010, a memory 1020, an input unit 1030, a display unit 1040, a sensor 1050, an audio circuit 1060, a wireless fidelity (WiFi) module 1070, a processor 1080 , And power supply 1090 and other components. Those skilled in the art may understand that the structure of the mobile phone shown in FIG. 10 does not constitute a limitation on the mobile phone, and may include more or less components than those shown in the figure, or a combination of certain components, or a different component arrangement.
其中,RF电路1010可用于收发信息或通话过程中,信号的接收和发送,可将基站的下行信息接收后,给处理器1080处理;也可以将上行的数据发送给基站。通常,RF电路包括但不限于天线、至少一个放大器、收发信机、耦合器、低噪声放大器(Low Noise Amplifier,LNA)、双工器等。此外,RF电路1010还可以通过无线通信与网络和其他设备通信。上述无线通信可以使用任一通信标准或协议,包括但不限于全球移动通讯系统(Global System of Mobile communication,GSM)、通用分组无线服务(General Packet Radio Service,GPRS)、码分多址(Code Division Multiple Access,CDMA)、宽带码分多址(Wideband Code Division Multiple Access,WCDMA)、长期演进(Long Term Evolution,LTE))、电子邮件、短消息服务(Short Messaging Service,SMS)等。Among them, the RF circuit 1010 can be used to receive and send signals during sending and receiving information or during a call. It can receive the downlink information of the base station and process it to the processor 1080; it can also send uplink data to the base station. Generally, RF circuits include but are not limited to antennas, at least one amplifier, transceiver, coupler, low noise amplifier (Low Noise Amplifier, LNA), duplexer, and so on. In addition, the RF circuit 1010 can also communicate with the network and other devices through wireless communication. The above wireless communication can use any communication standard or protocol, including but not limited to Global System of Mobile (GSM), General Packet Radio Service (GPRS), and Code Division Multiple Access (Code Division) Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA), Long Term Evolution (LTE), e-mail, Short Message Service (SMS), etc.
存储器1020可用于存储软件程序以及模块,处理器1080通过运行存储在存储器1020的软件程序以及模块,从而执行手机的各种功能应用以及数据处理。存储器1020可主要包括程序存储区和数据存储区,其中,程序存储区可存储操作系统、至少一个功能所需的应用程序(比如声音播放功能的应用程序、图像播放功能的应用程序等)等;数据存储区可存储根据手机的使用所创建的数据(比如音频数据、通讯录等)等。此外,存储器1020可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件、闪存器件、或其他易失性固态存储器件。The memory 1020 may be used to store software programs and modules. The processor 1080 executes various functional applications and data processing of the mobile phone by running the software programs and modules stored in the memory 1020. The memory 1020 may mainly include a program storage area and a data storage area, where the program storage area may store an operating system and at least one function-required application program (such as a sound playback function application program, an image playback function application program, etc.), etc.; The data storage area can store data (such as audio data, address book, etc.) created according to the use of the mobile phone. In addition, the memory 1020 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, or other volatile solid-state storage devices.
输入单元1030可用于接收输入的数字或字符信息,以及产生与手机1000的用户设置以及功能控制有关的键信号输入。具体地,输入单元1030可包括触控面板1031以及其他输入设备1032。触控面板1031,也可称为触摸屏,可收集用 户在其上或附近的触摸操作(比如用户使用手指、触笔等任何适合的物体或附件在触控面板1031上或在触控面板1031附近的操作),并根据预先设定的程式驱动相应的连接装置。在一个实施例中,触控面板1031可包括触摸检测装置和触摸控制器两个部分。其中,触摸检测装置检测用户的触摸方位,并检测触摸操作带来的信号,将信号传送给触摸控制器;触摸控制器从触摸检测装置上接收触摸信息,并将它转换成触点坐标,再送给处理器1080,并能接收处理器1080发来的命令并加以执行。此外,可以采用电阻式、电容式、红外线以及表面声波等多种类型实现触控面板1031。除了触控面板1031,输入单元1030还可以包括其他输入设备1032。具体地,其他输入设备1032可以包括但不限于物理键盘、功能键(比如音量控制按键、开关按键等)等中的一种或多种。The input unit 1030 may be used to receive input numeric or character information, and generate key signal input related to user settings and function control of the mobile phone 1000. Specifically, the input unit 1030 may include a touch panel 1031 and other input devices 1032. The touch panel 1031, also known as a touch screen, can collect user's touch operations on or near it (for example, the user uses any suitable objects or accessories such as fingers, stylus, etc. on or near the touch panel 1031 Operation), and drive the corresponding connection device according to the preset program. In one embodiment, the touch panel 1031 may include a touch detection device and a touch controller. Among them, the touch detection device detects the user's touch orientation, and detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives touch information from the touch detection device and converts it into contact coordinates, and then sends To the processor 1080, and can receive the commands sent by the processor 1080 and execute them. In addition, the touch panel 1031 can be implemented in various types such as resistive, capacitive, infrared, and surface acoustic waves. In addition to the touch panel 1031, the input unit 1030 may also include other input devices 1032. Specifically, other input devices 1032 may include, but are not limited to, one or more of a physical keyboard, function keys (such as volume control keys, switch keys, etc.), and the like.
显示单元1040可用于显示由用户输入的信息或提供给用户的信息以及手机的各种菜单。显示单元1040可包括显示面板1041。在一个实施例中,可以采用液晶显示器(Liquid Crystal Display,LCD)、有机发光二极管(Organic Light-Emitting Diode,OLED)等形式来配置显示面板1041。在一个实施例中,触控面板1031可覆盖显示面板1041,当触控面板1031检测到在其上或附近的触摸操作后,传送给处理器1080以确定触摸事件的类型,随后处理器1080根据触摸事件的类型在显示面板1041上提供相应的视觉输出。虽然在图10中,触控面板1031与显示面板1041是作为两个独立的部件来实现手机的输入和输入功能,但是在某些实施例中,可以将触控面板1031与显示面板1041集成而实现手机的输入和输出功能。The display unit 1040 may be used to display information input by the user or information provided to the user and various menus of the mobile phone. The display unit 1040 may include a display panel 1041. In one embodiment, the display panel 1041 may be configured in the form of a liquid crystal display (Liquid Crystal) (LCD), an organic light-emitting diode (Organic Light-Emitting Diode, OLED), or the like. In one embodiment, the touch panel 1031 may cover the display panel 1041, and when the touch panel 1031 detects a touch operation on or near it, it is transmitted to the processor 1080 to determine the type of touch event, and then the processor 1080 according to The type of touch event provides a corresponding visual output on the display panel 1041. Although in FIG. 10, the touch panel 1031 and the display panel 1041 are implemented as two independent components to realize the input and input functions of the mobile phone, in some embodiments, the touch panel 1031 and the display panel 1041 may be integrated to Realize the input and output functions of the mobile phone.
手机1000还可包括至少一种传感器1050,比如光传感器、运动传感器以及其他传感器。具体地,光传感器可包括环境光传感器及接近传感器,其中,环境光传感器可根据环境光线的明暗来调节显示面板1041的亮度,接近传感器可在手机移动到耳边时,关闭显示面板1041和/或背光。运动传感器可包括加速度传感器,通过加速度传感器可检测各个方向上加速度的大小,静止时可检测出重力的大小及方向,可用于识别手机姿态的应用(比如横竖屏切换)、振动识别相关功能(比如计步器、敲击)等;此外,手机还可配置陀螺仪、气压计、湿度计、温度计、红外线传感器等其他传感器等。The mobile phone 1000 may further include at least one sensor 1050, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor may include an ambient light sensor and a proximity sensor, wherein the ambient light sensor may adjust the brightness of the display panel 1041 according to the brightness of the ambient light, and the proximity sensor may close the display panel 1041 and/or when the mobile phone moves to the ear Or backlight. The motion sensor may include an acceleration sensor. The acceleration sensor can detect the magnitude of acceleration in various directions, and can detect the magnitude and direction of gravity when at rest. Pedometer, percussion), etc. In addition, the mobile phone can also be equipped with other sensors such as gyroscope, barometer, hygrometer, thermometer, infrared sensor and so on.
音频电路1060、扬声器1061和传声器1062可提供用户与手机之间的音频接口。音频电路1060可将接收到的音频数据转换后的电信号,传输到扬声器1061,由扬声器1061转换为声音信号输出;另一方面,传声器1062将收集的声音信号转换为电信号,由音频电路1060接收后转换为音频数据,再将音频数据输出处理器1080处理后,经RF电路1010可以发送给另一手机,或者将音频数据输出至存储器1020以便后续处理。The audio circuit 1060, the speaker 1061, and the microphone 1062 may provide an audio interface between the user and the mobile phone. The audio circuit 1060 can transmit the received audio data converted electrical signal to the speaker 1061, which converts the speaker 1061 into a sound signal output; on the other hand, the microphone 1062 converts the collected sound signal into an electrical signal, which is converted by the audio circuit 1060 After receiving, it is converted into audio data, and then processed by the audio data output processor 1080, and then sent to another mobile phone through the RF circuit 1010, or the audio data is output to the memory 1020 for subsequent processing.
WiFi属于短距离无线传输技术,手机通过WiFi模块1070可以帮助用户收发电子邮件、浏览网页和访问流式媒体等,它为用户提供了无线的宽带互联网访问。虽然图10示出了WiFi模块1070,但是可以理解的是,其并不属于手机1000的必须构成,可以根据需要而省略。WiFi is a short-range wireless transmission technology. Mobile phones can help users send and receive emails, browse web pages, and access streaming media through the WiFi module 1070. It provides users with wireless broadband Internet access. Although FIG. 10 shows the WiFi module 1070, it can be understood that it is not a necessary component of the mobile phone 1000, and may be omitted as needed.
处理器1080是手机的控制中心,利用各种接口和线路连接整个手机的各个部分,通过运行或执行存储在存储器1020内的软件程序和/或模块,以及调用存储在存储器1020内的数据,执行手机的各种功能和处理数据,从而对手机进行整体监控。在一个实施例中,处理器1080可包括一个或多个处理单元。在一个实施例中,处理器1080可集成应用处理器和调制解调处理器,其中,应用处理器主要处理操作系统、用户界面和应用程序等;调制解调处理器主要处理无线通信。可以理解的是,上述调制解调处理器也可以不集成到处理器1080中。The processor 1080 is the control center of the mobile phone, and uses various interfaces and lines to connect the various parts of the entire mobile phone, by running or executing the software programs and/or modules stored in the memory 1020, and calling the data stored in the memory 1020 to execute Various functions and processing data of the mobile phone, so as to monitor the mobile phone as a whole. In one embodiment, the processor 1080 may include one or more processing units. In one embodiment, the processor 1080 may integrate an application processor and a modem processor, where the application processor mainly processes an operating system, user interface, application programs, and the like; the modem processor mainly processes wireless communication. It can be understood that the foregoing modem processor may not be integrated into the processor 1080.
手机1000还包括给各个部件供电的电源1090(比如电池),优选的,电源可以通过电源管理系统与处理器1080逻辑相连,从而通过电源管理系统实现管理充电、放电、以及功耗管理等功能。The mobile phone 1000 further includes a power supply 1090 (such as a battery) for powering various components. Preferably, the power supply can be logically connected to the processor 1080 through a power management system, so as to realize functions such as charging, discharging, and power management through the power management system.
在一个实施例中,手机1000还可以包括摄像头、蓝牙模块等。In one embodiment, the mobile phone 1000 may further include a camera, a Bluetooth module, and the like.
在本申请实施例中,该电子设备所包括的处理器1080执行存储在存储器上的计算机程序时实现以下步骤:In the embodiment of the present application, the processor 1080 included in the electronic device implements the following steps when executing the computer program stored in the memory:
获取目标应用程序的音频模式;Get the audio mode of the target application;
根据音频模式监听目标应用程序用于播放音频数据的音频输出通道是否异常;Monitor the audio output channel used by the target application to play audio data according to the audio mode for abnormality;
当音频输出通道异常时,改变音频数据的音频输出通道,以使改变后的音频输出通道播放音频数据。When the audio output channel is abnormal, the audio output channel of the audio data is changed so that the changed audio output channel plays audio data.
需要说明的是,电子设备所包括的处理器880执行存储在存储器上的计算机程序时实现上述任一实施例中的音频输出控制方法。It should be noted that the processor 880 included in the electronic device implements the audio output control method in any of the foregoing embodiments when the computer program stored in the memory is executed.
本申请所使用的对存储器、存储、数据库或其它介质的任何引用可包括非易失性和/或易失性存储器。合适的非易失性存储器可包括只读存储器(ROM)、可编程ROM(PROM)、电可编程ROM(EPROM)、电可擦除可编程ROM(EEPROM)或闪存。易失性存储器可包括随机存取存储器(RAM),它用作外部高速缓冲存储器。作为说明而非局限,RAM以多种形式可得,诸如静态RAM(SRAM)、动态RAM(DRAM)、同步DRAM(SDRAM)、双数据率SDRAM(DDR SDRAM)、增强型SDRAM(ESDRAM)、同步链路(Synchlink)DRAM(SLDRAM)、存储器总线(Rambus)直接RAM(RDRAM)、直接存储器总线动态RAM(DRDRAM)、以及存储器总线动态RAM(RDRAM)。Any references to memory, storage, databases, or other media used in this application may include non-volatile and/or volatile memory. Suitable non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM), which acts as external cache memory. By way of illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR) SDRAM, enhanced SDRAM (ESDRAM), synchronous Link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
以上所述实施例的各技术特征可以进行任意的组合,为使描述简洁,未对上述实施例中的各个技术特征所有可能的组合都进行描述,然而,只要这些技术特征的组合不存在矛盾,都应当认为是本说明书记载的范围。The technical features of the above-mentioned embodiments can be combined arbitrarily. To simplify the description, all possible combinations of the technical features in the above-mentioned embodiments are not described. However, as long as there is no contradiction in the combination of these technical features, All should be considered within the scope of this description.
以上所述实施例仅表达了本发明的几种实施方式,其描述较为具体和详细,但并不能因此而理解为对发明专利范围的限制。应当指出的是,对于本领域的普通技术人员来说,在不脱离本发明构思的前提下,还可以做出若干变形和改进,这些都属于本发明的保护范围。因此,本发明专利的保护范围应以所附权利要求为准。The above-mentioned embodiments only express several embodiments of the present invention, and their descriptions are more specific and detailed, but they should not be construed as limiting the scope of the invention patent. It should be noted that, for a person of ordinary skill in the art, without departing from the concept of the present invention, several modifications and improvements can also be made, which all fall within the protection scope of the present invention. Therefore, the protection scope of the invention patent shall be subject to the appended claims.

Claims (14)

  1. 一种音频输出控制方法,应用于具有多个音频输出通道的电子设备,其中,所述音频输出通道包括听筒通道、耳机通道和扬声器通道,所述方法包括:An audio output control method is applied to an electronic device having multiple audio output channels, wherein the audio output channel includes an earpiece channel, an earphone channel, and a speaker channel, and the method includes:
    获取目标应用程序的音频模式;Get the audio mode of the target application;
    根据所述音频模式监听目标应用程序用于播放音频数据的音频输出通道是否异常;Monitoring whether the audio output channel used by the target application to play audio data according to the audio mode is abnormal;
    当所述音频输出通道异常时,改变所述音频数据的音频输出通道,以使改变后的音频输出通道播放所述音频数据。When the audio output channel is abnormal, the audio output channel of the audio data is changed so that the changed audio output channel plays the audio data.
  2. 根据权利要求1所述的方法,其中,所述根据所述音频模式监听目标应用程序用于播放音频数据的音频输出通道是否异常,包括:The method according to claim 1, wherein the monitoring of whether the audio output channel used by the target application to play audio data according to the audio mode is abnormal includes:
    当所述目标应用程序播放所述音频数据时,监听播放所述音频数据的音频输出通道;When the target application plays the audio data, monitor the audio output channel that plays the audio data;
    识别所述音频输出通道是否符合所述音频模式的播放标准;Identify whether the audio output channel conforms to the playback standard of the audio mode;
    当所述音频输出通道不符合所述音频模式的播放标准时,则所述音频输出通道异常。When the audio output channel does not meet the playback standard of the audio mode, the audio output channel is abnormal.
  3. 根据权利要求2所述的方法,其中,所述监听播放所述音频数据的音频输出通道,包括:The method according to claim 2, wherein the audio output channel for monitoring and playing the audio data includes:
    基于所述电子设备的操作系统创建监听模块,通过所述监听模块对所述目标应用程序的音频输出通道进行监听,或,Creating a monitoring module based on the operating system of the electronic device, and monitoring the audio output channel of the target application through the monitoring module, or,
    创建监听进程,通过消息传输机制监听所述目标应用程序的音频输出通道。Create a monitoring process to monitor the audio output channel of the target application through a message transmission mechanism.
  4. 根据权利要求2所述的方法,其中,所述识别所述音频输出通道是否符合所述音频模式的播放标准,包括:The method according to claim 2, wherein the identifying whether the audio output channel conforms to the playback standard of the audio mode includes:
    构建音频输出通道与音频模式匹配映射表;Build a mapping table between audio output channels and audio patterns;
    根据所述映射表,识别所述音频输出通道是否符合所述音频模式的播放标准。According to the mapping table, identify whether the audio output channel conforms to the playback standard of the audio mode.
  5. 根据权利要求1所述的方法,其中,所述当所述音频输出通道异常时,改变所述音频数据的音频输出通道,包括:The method according to claim 1, wherein said changing the audio output channel of the audio data when the audio output channel is abnormal includes:
    当所述音频输出通道异常时,调用预设接口函数;When the audio output channel is abnormal, call a preset interface function;
    根据所述预设接口函数改变所述音频数据的音频输出通道。Changing the audio output channel of the audio data according to the preset interface function.
  6. 根据权利要求1所述的方法,其中,当所述听筒通道异常时,改变所述音频数据的音频输出通道,以使改变后的音频输出通道播放所述音频数据,包括:The method according to claim 1, wherein, when the earpiece channel is abnormal, changing the audio output channel of the audio data so that the changed audio output channel plays the audio data includes:
    检测所述电子设备是否连接耳机;Detect whether the electronic device is connected to a headset;
    当所述电子设备连接耳机时,改变所述音频数据的听筒通道,以使所述耳机通道播放所述音频数据;When the electronic device is connected with a headset, changing the earphone channel of the audio data, so that the headset channel plays the audio data;
    当所述电子设备未连接耳机时,改变所述音频数据的听筒通道,以使所述扬声器通道播放所述音频数据。When no earphone is connected to the electronic device, the earphone channel of the audio data is changed so that the speaker channel plays the audio data.
  7. 根据权利要求1所述的方法,其中,当所述扬声器通道异常时,改变所述音频数据的音频输出通道,以使改变后的音频输出通道播放所述音频数据,包括:The method according to claim 1, wherein, when the speaker channel is abnormal, changing the audio output channel of the audio data so that the changed audio output channel plays the audio data includes:
    检测所述电子设备是否连接耳机;Detect whether the electronic device is connected to a headset;
    当所述电子设备连接耳机时,改变所述音频数据的听筒通道,以使所述耳机通道播放所述音频数据;When the electronic device is connected with a headset, changing the earphone channel of the audio data, so that the headset channel plays the audio data;
    当所述电子设备未连接耳机时,改变所述音频数据的听筒通道,以使所述听筒通道播放所述音频数据。When no earphone is connected to the electronic device, the earphone channel of the audio data is changed so that the earphone channel plays the audio data.
  8. 根据权利要求7所述的方法,其中,所述当所述扬声器通道异常时,改变所述音频数据的音频输出通道,包括:The method according to claim 7, wherein said changing the audio output channel of the audio data when the speaker channel is abnormal includes:
    当所述扬声器通道异常时,将所述扬声器通道的音量调为静音,并改变所述音频数据的音频输出通道。When the speaker channel is abnormal, the volume of the speaker channel is muted, and the audio output channel of the audio data is changed.
  9. 根据权利要求1所述的方法,其中,当所述耳机通道异常时,改变所述音频数据的音频输出通道,以使改变后的音频输出通道播放所述音频数据,包括:The method according to claim 1, wherein, when the earphone channel is abnormal, changing the audio output channel of the audio data so that the changed audio output channel plays the audio data includes:
    当所述电子设备连接耳机且所述耳机通道异常时,改变所述音频数据的耳机通道,以使所述扬声器通道播放所述音频数据。When the electronic device is connected to an earphone and the earphone channel is abnormal, the earphone channel of the audio data is changed so that the speaker channel plays the audio data.
  10. 根据权利要求1或7或8所述的方法,其中,所述以使改变后的音频输出通道播放所述音频数据,包括:The method according to claim 1 or 7 or 8, wherein the making the changed audio output channel play the audio data includes:
    获取所述电子设备的环境噪声;Obtain the environmental noise of the electronic device;
    根据所述环境噪声调节所述音频输出通道播放播放所述音频数据的音量。Adjusting the volume of the audio output channel to play the audio data according to the environmental noise.
  11. 根据权利要求1或7或8所述的方法,其中,所述以使改变后的音频输出通道播放所述音频数据,包括:The method according to claim 1 or 7 or 8, wherein the making the changed audio output channel play the audio data includes:
    获取所述音频数据的播放时间点;Acquiring the playback time point of the audio data;
    根据改变后的音频输出通道从所述播放时间点开始播放所述音频数据。Play the audio data from the playback time point according to the changed audio output channel.
  12. 一种音频输出控制装置,应用于具有多个音频输出通道的电子设备,其中,所述音频输出通道包括听筒通道、耳机通道和扬声器通道,所述装置包括:An audio output control device is applied to electronic equipment having multiple audio output channels, wherein the audio output channel includes an earpiece channel, a headphone channel, and a speaker channel, and the device includes:
    模式获取模块,用于获取目标应用程序的音频模式;Mode acquisition module, used to obtain the audio mode of the target application;
    通道监听模块,用于根据所述音频模式监听目标应用程序用于播放音频数据的音频输出通道是否异常;A channel monitoring module, configured to monitor whether the audio output channel used by the target application to play audio data according to the audio mode is abnormal;
    通道处理模块,用于当所述音频输出通道异常时,改变所述音频数据的音频输出通道,以使改变后的音频输出通道播放所述音频数据。The channel processing module is configured to change the audio output channel of the audio data when the audio output channel is abnormal, so that the changed audio output channel plays the audio data.
  13. 一种计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现如权利要求1至11中任一项所述的音频输出控制方法的步骤。A computer-readable storage medium on which a computer program is stored, which when executed by a processor implements the steps of the audio output control method according to any one of claims 1 to 11.
  14. 一种电子设备,包括存储器及处理器,所述存储器中储存有计算机可读指令,所述指令被所述处理器执行时,使得所述处理器执行如权利要求 1至11中任一项所述的音频输出控制方法。An electronic device includes a memory and a processor, and the memory stores computer-readable instructions, and when the instructions are executed by the processor, the processor is caused to perform as described in any one of claims 1 to 11. The audio output control method described.
PCT/CN2018/118018 2018-11-28 2018-11-28 Audio output control method and apparatus, computer readable storage medium, and electronic device WO2020107290A1 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
PCT/CN2018/118018 WO2020107290A1 (en) 2018-11-28 2018-11-28 Audio output control method and apparatus, computer readable storage medium, and electronic device
CN201880098450.5A CN112997470B (en) 2018-11-28 2018-11-28 Audio output control method and device, computer readable storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2018/118018 WO2020107290A1 (en) 2018-11-28 2018-11-28 Audio output control method and apparatus, computer readable storage medium, and electronic device

Publications (1)

Publication Number Publication Date
WO2020107290A1 true WO2020107290A1 (en) 2020-06-04

Family

ID=70854191

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/118018 WO2020107290A1 (en) 2018-11-28 2018-11-28 Audio output control method and apparatus, computer readable storage medium, and electronic device

Country Status (2)

Country Link
CN (1) CN112997470B (en)
WO (1) WO2020107290A1 (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112333533A (en) * 2020-09-07 2021-02-05 深圳Tcl新技术有限公司 Selection method, device and equipment of playing equipment and computer readable storage medium
CN112786070A (en) * 2020-12-28 2021-05-11 Oppo广东移动通信有限公司 Audio data processing method and device, storage medium and electronic equipment
CN113676818A (en) * 2021-08-02 2021-11-19 维沃移动通信有限公司 Player, control method and control device thereof, and computer-readable storage medium
CN114121050A (en) * 2021-11-30 2022-03-01 云知声智能科技股份有限公司 Audio playing method and device, electronic equipment and storage medium
CN116744187A (en) * 2022-09-30 2023-09-12 荣耀终端有限公司 Speaker control method and device

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101867657A (en) * 2010-06-24 2010-10-20 中兴通讯股份有限公司 Method and device for switching audio output equipment on mobile phone
CN102215287A (en) * 2010-04-12 2011-10-12 中兴通讯股份有限公司 Method and device for switching audio channels of communication module
US20160105756A1 (en) * 2013-04-28 2016-04-14 Innovation Sound Technology Co., Ltd. Headset Capable of Converting Sound Channels
CN106534497A (en) * 2016-10-31 2017-03-22 努比亚技术有限公司 Method of adaptively switching sound effect output channels and terminal
CN107959903A (en) * 2016-10-18 2018-04-24 中兴通讯股份有限公司 Audio output switching method, feedback earphone wearing state method, apparatus and earphone

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102215287A (en) * 2010-04-12 2011-10-12 中兴通讯股份有限公司 Method and device for switching audio channels of communication module
CN101867657A (en) * 2010-06-24 2010-10-20 中兴通讯股份有限公司 Method and device for switching audio output equipment on mobile phone
US20160105756A1 (en) * 2013-04-28 2016-04-14 Innovation Sound Technology Co., Ltd. Headset Capable of Converting Sound Channels
CN107959903A (en) * 2016-10-18 2018-04-24 中兴通讯股份有限公司 Audio output switching method, feedback earphone wearing state method, apparatus and earphone
CN106534497A (en) * 2016-10-31 2017-03-22 努比亚技术有限公司 Method of adaptively switching sound effect output channels and terminal

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112333533A (en) * 2020-09-07 2021-02-05 深圳Tcl新技术有限公司 Selection method, device and equipment of playing equipment and computer readable storage medium
CN112333533B (en) * 2020-09-07 2023-12-05 深圳Tcl新技术有限公司 Method, device, equipment and computer readable storage medium for selecting playing equipment
CN112786070A (en) * 2020-12-28 2021-05-11 Oppo广东移动通信有限公司 Audio data processing method and device, storage medium and electronic equipment
CN112786070B (en) * 2020-12-28 2024-03-15 Oppo广东移动通信有限公司 Audio data processing method and device, storage medium and electronic equipment
CN113676818A (en) * 2021-08-02 2021-11-19 维沃移动通信有限公司 Player, control method and control device thereof, and computer-readable storage medium
CN113676818B (en) * 2021-08-02 2023-11-10 维沃移动通信有限公司 Playback apparatus, control method and control device thereof, and computer-readable storage medium
CN114121050A (en) * 2021-11-30 2022-03-01 云知声智能科技股份有限公司 Audio playing method and device, electronic equipment and storage medium
CN116744187A (en) * 2022-09-30 2023-09-12 荣耀终端有限公司 Speaker control method and device
CN116744187B (en) * 2022-09-30 2024-04-26 荣耀终端有限公司 Speaker control method and device

Also Published As

Publication number Publication date
CN112997470A (en) 2021-06-18
CN112997470B (en) 2022-04-15

Similar Documents

Publication Publication Date Title
EP3547710B1 (en) Method for processing signals, terminal device, and non-transitory computer-readable storage medium
US10609483B2 (en) Method for sound effect compensation, non-transitory computer-readable storage medium, and terminal device
US10466961B2 (en) Method for processing audio signal and related products
WO2020107290A1 (en) Audio output control method and apparatus, computer readable storage medium, and electronic device
US10349176B1 (en) Method for processing signals, terminal device, and non-transitory computer-readable storage medium
CN108391205B (en) Left and right channel switching method and device, readable storage medium and terminal
WO2017215639A1 (en) Sound effect configuration method and system and related device
CN107231473B (en) Audio output regulation and control method, equipment and computer readable storage medium
CN108668009B (en) Input operation control method, device, terminal, earphone and readable storage medium
CN108540900B (en) Volume adjusting method and related product
CN116684514A (en) Sound masking method and device and terminal equipment
WO2017215661A1 (en) Scenario-based sound effect control method and electronic device
WO2020097927A1 (en) Call control method and device, computer-readable storage medium and electronic device
WO2020124541A1 (en) Audio processing method and apparatus, computer readable storage medium, and electronic device
WO2020118496A1 (en) Audio path switching method and device, readable storage medium and electronic equipment
CN116471355B (en) Audio playing method and electronic equipment
CN113039518B (en) Playing control method and device, computer readable storage medium and electronic equipment
CN108391208B (en) Signal switching method, device, terminal, earphone and computer readable storage medium
WO2020103073A1 (en) Method and device for processing audio resources, computer readable storage medium and electronic device
WO2020107169A1 (en) Audio mode correction method and apparatus, and electronic device
WO2020097914A1 (en) Audio mode adjustment method and apparatus, and electronic device
WO2023284403A1 (en) Audio processing method and device
WO2019061292A1 (en) Noise reduction method for terminal and terminal
CN111741156A (en) Audio output method, mobile terminal and wearable device

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 18941222

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 03/11/2021)

122 Ep: pct application non-entry in european phase

Ref document number: 18941222

Country of ref document: EP

Kind code of ref document: A1