Audio Processing Method and Apparatus, Computer-Readable Storage Medium, and Electronic Device
The method and apparatus address audio playback anomalies by comparing and correcting audio behavior information, enhancing stability and user experience in electronic devices.
Patent Information
- Application Number
- CN201880099587.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2018-12-21
- Publication Date
- 2025-07-15
- Estimated Expiration
- 2038-12-21
AI Technical Summary
When an electronic device plays audio data, it cannot systematically monitor audio behavior information, resulting in abnormal audio data playback and affecting the user experience.
By setting up a monitoring module in the electronic device, the first audio behavior information in the audio service is obtained, and the second audio behavior information is obtained during playback, and an abnormality is identified and corrected to repair abnormal playback.
It realizes monitoring and repair of abnormal situations in audio data playback, improving the stability and user experience of audio data output.
Smart Images

Figure CN113168303B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of electronic devices, and particularly to an audio processing method and apparatus, an electronic device, and a computer-readable storage medium. Background Art
[0002] With the wide application of electronic devices and the increasing richness of their functions, electronic devices have become an indispensable part of people's daily lives. Among them, the application programs installed on electronic devices are more diverse. During the use of application programs, when an application program plays audio data, the audio behavior information of the audio data can be set.
[0003] However, during the use of application programs, electronic devices cannot systematically monitor the audio behavior information of audio data, resulting in abnormal calls of audio behavior information and abnormal playback of audio data. Summary of the Invention
[0004] Embodiments of this application provide an audio processing method and apparatus, a computer-readable storage medium, and an electronic device, which can monitor abnormal situations during the playback of audio data, enable the normal playback of audio data, enhance the stability of audio data output, and improve the user experience.
[0005] An audio processing method is applied to an electronic device. The method includes:
[0006] When a target application program is running, obtain first audio behavior information set in an audio service, where the first audio behavior information is parameter information for playing the audio data;
[0007] When the target application program plays the audio data, obtain second audio behavior information of the electronic device for playing the audio data;
[0008] Identify whether the playback of the audio data is abnormal according to the first audio behavior information and the second audio behavior information;
[0009] When the playback of the audio data is abnormal, correct the second audio behavior information to repair the abnormal playback.
[0010] An audio processing apparatus is applied to an electronic device. The apparatus includes:
[0011] An information collection module, configured to obtain first audio behavior information set in an audio service when a target application program is running, where the first audio behavior information is parameter information for playing the audio data;
[0012] An information acquisition module, configured to obtain second audio behavior information of the electronic device for playing the audio data when the target application program plays the audio data;
[0013] Anomaly interpretation module, configured to identify whether the playback of the audio data is abnormal according to the first audio behavior information and the second audio behavior information; and
[0014] Anomaly correction module, configured to correct the second audio behavior information to repair abnormal playback when the playback of the audio data is abnormal.
[0015] A computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the above audio processing method are implemented.
[0016] An electronic device, including a memory and a processor, wherein the memory stores computer-readable instructions, and when the instructions are executed by the processor, the processor executes the audio processing method as described in the above claims.
[0017] The above audio processing method and device, computer-readable storage medium, and electronic device can, when a target application program is running, obtain the first audio behavior information set in the audio service; when the target application program plays audio data, obtain the second audio behavior information of the electronic device playing the audio data; identify whether the playback of the audio data is abnormal according to the first audio behavior information and the second audio behavior information; when the playback of the audio data is abnormal, correct the second audio behavior information to repair abnormal playback, can monitor abnormal situations in the playback of audio data, and make the audio data play normally, enhance the stability of audio data output, and improve the user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained based on these drawings.
[0019] Figure 1 It is a schematic internal structure diagram of an electronic device in an embodiment;
[0020] Figure 2 It is a partial architecture schematic diagram of an Android audio system in an embodiment;
[0021] Figure 3 It is a schematic flowchart of an audio processing method in an embodiment;
[0022] Figure 4 It is a schematic flowchart of controlling a monitoring module to collect the first audio behavior information used to set the playback of audio data in the audio service when a target application program is running;
[0023] Figure 5 It is a schematic flow chart for identifying whether the playback of audio data is abnormal according to the first audio behavior information and the second audio behavior information in an embodiment;
[0024] Figure 6 It is a schematic flow chart for correcting the second audio behavior information to repair abnormal playback when the playback of audio data is abnormal in an embodiment;
[0025] Figure 7 It is a schematic flow chart of an audio processing method in another embodiment;
[0026] Figure 8 It is a schematic flow chart of an audio processing method in yet another embodiment;
[0027] Figure 9 It is a schematic framework diagram of an audio processing device in an embodiment;
[0028] Figure 10 It is a block diagram of a partial structure of a mobile phone related to the electronic device provided in the embodiment of the present application. Specific Embodiments
[0029] To facilitate the understanding of the present invention, the present invention will be described more comprehensively below with reference to the relevant drawings. The preferred embodiments of the present invention are shown in the drawings. However, the present invention can be implemented in many different forms and is not limited to the embodiments described herein. On the contrary, these embodiments are provided to make the understanding of the disclosure of the present invention more thorough and comprehensive.
[0030] In one embodiment, as Figure 1As shown in the figure, a schematic diagram of the internal structure of an electronic device is provided. The electronic device includes a processor, a memory, and a display screen connected via 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 processing method applicable to the electronic device provided in the embodiments of the present application. The memory may include non-volatile storage media such as magnetic disks, optical disks, read-only memory (ROM), or random access memory (RAM), etc. For example, in one embodiment, the memory includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a database, and a computer program. The database stores data related to implementing the audio processing method provided in each of the above embodiments, such as information such as the name of each process or application. The computer program can be executed by the processor to implement the audio processing method provided in each embodiment of the present application. The internal memory provides a cache operating environment for the operating system, database, and computer program in the non-volatile storage medium. The display screen can be a touch screen, such as a capacitive screen or an electronic screen, which is used to display the interface information of the application corresponding to the foreground process and can also be used to detect touch operations on the display screen to generate corresponding instructions, such as instructions for switching between foreground and background applications, etc.
[0031] Those skilled in the art can understand that Figure 1 the structure shown in the figure is only a block diagram of some structures 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 include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements. For example, the electronic device further includes a network interface connected via the system bus. The network interface can be an Ethernet card or a wireless network card, etc., and is used to communicate with external electronic devices, such as for communicating with a server.
[0032] In one embodiment, as Figure 2 shown, an architecture diagram of the Atlas part of an Android audio system is provided. Among them, the Atlas architecture system of the Android audio system includes a Kernel space layer 210, a native layer 220, a framework layer 230, and a Client layer 240.
[0033] The Atlas architecture can integrate multiple existing multimedia APKs into Atlas, turning them into one APK and saving some resources. That is, the Atlas architecture system can integrate the Dirac sound effect APK, intelligent volume APK, intelligent headset APK, GiFT process, daemon system service, and other features into the Atlas APK.
[0034] The Audio driver module 211 can be included in the Kernel space layer 210. Among them, the Audio driver module interacts with the hardware and implements the interface of the local layer for the upper layer to call normally. Here, ALSA, OSS, and custom audio drivers can be selected. The AtlasService_Jni module 221, AtlasService Interface module 223, and AtlasService module 225 are included in the local layer 220. The AtlasManager module 231 and AtlasService module 233 are included in the framework layer 230. Among them, the AtlasManager module 231 is provided with a general 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, exception feedback, and log collection. Among them, information collection can include the collection of display information and audio information. Among them, audio information includes playback information (audio output channel, volume, sound effect, etc.), recording information, audio mode setting information, etc. Since the AtlasService module is established in the system-level framework layer, it is convenient to interact with other system services, and at the same time, there is no need to worry about permission issues during system calls. Through the above architecture, the audio processing methods in various embodiments of the present application can be implemented.
[0035] In one embodiment, as Figure 3 shown, an audio processing method is provided. This audio processing method is applied to an electronic device with multiple audio output channels. In one embodiment, the electronic device can be a mobile phone, tablet computer, laptop computer, palmtop computer, Mobile Internet Device (MID), wearable device (such as a smart watch, smart bracelet, pedometer, etc.), or other electronic devices with a voice call function and a speaker.
[0036] As Figure 3 shown, in one embodiment, the audio processing method includes steps 302 - step 308.
[0037] Step 302, when the target application is running, obtain the first audio behavior information set in the audio service.
[0038] In one embodiment, a monitoring module is created based on the operating system of the electronic device. Through the monitoring module, the first audio behavior information set in the audio service during the operation of the target application can be collected. Among them, the first audio behavior information is the parameter information for playing the audio data. 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), and the first audio behavior information for playing audio data set in the audio service during the operation of the target application is collected through the monitoring module. For example, a monitoring module can be set up in the framework layer and run in the system service program (system_server). Since this monitoring module is set up in the system-level service framework layer, it can facilitate interaction with other audio services, display services, system services, etc., and at the same time, there is no need to worry about permission issues during system calls.
[0039] When the monitoring module interacts with the audio service, the first audio behavior information for playing audio data set in the audio service during the operation of the target application can be collected in the audio service. Among them, the first audio behavior information may at least include audio output channels, audio mode, volume, recording, and information related to audio data input and / or output. Audio output channels include the earpiece channel, the speaker channel, and the headphone channel, where the headphone channel can include a wired headphone channel and a wireless headphone (Bluetooth headphone) channel. When the audio output channel is the earpiece channel, the audio data is emitted by the earpiece; when the audio output channel is the speaker channel, the audio data is emitted by the external speaker; when the audio output channel is the headphone channel, the audio data can be emitted through a wired headphone or a Bluetooth headphone. The audio mode may include multimedia mode, ringtone mode, alarm mode, call mode, call mode (including audio / video, VoIP call), and system mode.
[0040] The target application can be understood as an application that can output and / or output audio signals, and the number of target applications can be 1, 2, 3, or more. For example, the target application may include call applications, instant messaging applications, audio playback applications, video playback applications, sound control applications, voice input applications, etc. When the target application is running, it can be understood as running in the foreground or in the background.
[0041] The audio data includes voice data, ringtone data, alarm data, multimedia data (video stream, audio stream data, etc.), and so on.
[0042] Step 304, when the target application plays audio data, obtain the second audio behavior information of the electronic device for playing the audio data.
[0043] When the target application plays audio data, the second audio behavior information of the electronic device actually playing the audio data currently can be obtained. Among them, the second audio behavior information can also at least include audio output channels, audio mode, volume, recording, and information related to audio data input and / or output. For example, if the electronic device is currently in a call state and uses the speaker to transmit call audio, the second audio behavior information of the currently played audio data (call voice data) obtained by the electronic device includes: call mode, speaker transmission channel, volume is A, and other information.
[0044] Step 306: Identify whether the playback of the audio data is abnormal according to the first audio behavior information and the second audio behavior information.
[0045] Both the first audio behavior information and the second audio behavior information can at least include information such as audio output channels, audio mode, volume, etc. The first audio behavior information can be understood as the standard audio behavior information set in the audio service when the target application plays audio data. The second audio behavior information can be understood as the actual audio behavior information currently played by the target application. Under normal circumstances, the first audio behavior information and the second audio behavior information should be exactly the same. At this time, it can be considered that the playback action of the target application playing audio data is normal. If the first audio behavior information and the second audio behavior information are inconsistent, it can be considered that the playback action of the target application playing audio data is abnormal. For example, when the electronic device is in a call state, the set first audio behavior information includes call mode, earpiece output channel, volume is A; however, during the actual call, the second audio behavior information includes call mode, speaker output channel, volume is A. At this time, since the audio output channels in the first audio behavior information and the second audio behavior information are different, it can be considered that the playback of the audio data in the current call state is abnormal.
[0046] Step 308: When the playback of the audio data is abnormal, correct the second audio behavior information to repair the abnormal playback.
[0047] When the electronic device determines that the playback of the audio data is abnormal, it can correct the second audio behavior information according to the first audio behavior information, so that the second audio behavior information of the electronic device actually playing the audio data currently is consistent with the first audio behavior set in the audio service, thereby repairing the abnormal playback and enabling the audio data to be played normally, and improving the user experience. For example, when the electronic device is in a call and its audio output channel is abnormal, the electronic device can call a preset interface function to correct the abnormal audio output channel so that the call audio is output from the normal audio output channel; when the audio mode of the electronic device is abnormal, the electronic device can perform a mode conversion on the abnormal audio mode through a preset mode conversion interface to correct and repair the abnormal playback.
[0048] The above audio processing method can control the monitoring module to collect the first audio behavior information used to set the playback of audio data in the audio service when the target application is running; when the target application plays audio data, obtain the second audio behavior information of the electronic device playing the audio data; identify whether the playback of the audio data is abnormal according to the first audio behavior information and the second audio behavior information; when the playback of the audio data is abnormal, correct the second audio behavior information to repair the abnormal playback, which can monitor the abnormal situation of the audio data playback and make the audio data play normally, enhance the stability of the audio data output, and improve the user experience.
[0049] As Figure 4 shown, in one embodiment, controlling the monitoring module to collect the first audio behavior information used to set the playback of audio data in the audio service when the target application is running includes steps 402 to 404. Among them:
[0050] Step 402, when the target application is running, control the monitoring module to send an audio acquisition request to the audio service. Among them, the audio acquisition request is used to instruct the audio service to collect the first audio behavior information.
[0051] Step 404, receive the first audio behavior information fed back by the audio service.
[0052] The monitoring module of the electronic device and the audio service can communicate using the binder and socket communication mechanisms. That is, the monitoring module can communicate with the audio service using the binder and socket communication mechanisms. When the target application is running, the electronic device can control the monitoring module to send an audio acquisition request to the audio service using the binder and socket communication mechanisms. The audio service can collect the first audio behavior information used to set the playback of the audio data of the target application according to the received acquisition request. After the audio service collects the first audio behavior information, it can use the binder and socket communication mechanisms to feed back the collected first audio behavior information to the monitoring module, so that the monitoring module can obtain the first audio behavior information set when the target application plays audio data.
[0053] Furthermore, in the audio service, there is also the same interface, and the monitoring module can communicate with the monitoring module through this interface using the binder and socket communication mechanisms.
[0054] As Figure 5 shown, in one embodiment, identifying whether the playback of the audio data is abnormal according to the first audio behavior information and the second audio behavior information includes steps 502 to 506. Among them,
[0055] Step 502, obtain the application information of the target application.
[0056] In one embodiment, the electronic device may obtain application information of a target application based on identification information of the target application. The application information may include usage information of the target application, application type, and other information. The usage information may refer to cumulative usage time, usage frequency, etc. within a preset time. The application type may be classified according to the function of the target application. For example, call type, instant messaging interaction type, video type, audio type, entertainment type, system customization type, and so on. The system customization type may include ringtones, alarms, etc.
[0057] Specifically, the electronic device may pre-identify each target application to form identification information, which can be represented by any one or a combination of letters, numbers, and special symbols. Different types of target applications can be represented by different identification information, and the identification information can distinguish the application types of the target applications.
[0058] Furthermore, the electronic device can count the usage information of the target application or inject the usage information into the identification information so that the identification information carries the usage information of the target application.
[0059] Step 504: Determine whether the second audio behavior information is abnormal according to the application information and the first audio behavior information.
[0060] Step 506: If the second audio behavior information is abnormal, the playback of the audio data is abnormal.
[0061] In one embodiment, the electronic device can determine the determination order of the audio output channel, audio mode, and volume in the first audio behavior information and the second audio behavior information according to the application information of the target application. Specifically, if any information in the first audio behavior information is inconsistent with the second audio behavior information, the second audio behavior information can be considered abnormal. Both the first audio behavior information and the second audio behavior information include information such as audio output channel, audio mode, and volume. When determining whether the second audio behavior information is abnormal, it is necessary to determine the comparison order of each piece of information in the first audio behavior information and the second audio behavior information. The electronic device can determine the determination order according to the application information. For example, when the current target application is a call application, the judgment order can be audio output channel, volume, audio mode, or audio output channel, audio mode, volume. Among them, it is preferred to determine whether the audio output channel is abnormal first. When the current target application is a system application, the judgment order can be audio mode, volume, audio output channel, or audio mode, audio output channel, volume. Among them, it is preferred to determine whether the audio mode is abnormal first.
[0062] The electronic device can determine the determination order of whether the second audio behavior information is abnormal according to the application information, and sequentially compare whether the audio output channels, audio modes, and volumes in the first audio behavior information and the second audio behavior information are all the same according to this determination order. If any one of the audio output channels, audio modes, and volumes is inconsistent, it can be considered that the second audio behavior information is abnormal.
[0063] When the second audio behavior information is abnormal, it can be considered that the playback behavior of the currently playing audio data is abnormal, that is, the playback of the audio data is abnormal, and the abnormal playback needs to be corrected.
[0064] In this embodiment, the electronic device can determine the determination order of the audio output channels, audio modes, and volumes in the first audio behavior information and the second audio behavior information according to the application information of the target application program, improving the determination efficiency of whether the second audio behavior information is abnormal.
[0065] As Figure 6 shown, in one embodiment, when the playback of the audio data is abnormal, correcting the second audio behavior information to repair the abnormal playback includes steps 602 - step 604. Among them,
[0066] Step 602, when the audio data playback is abnormal, obtain the abnormal type according to the second audio behavior information; the abnormal type includes mode abnormality, channel abnormality, and volume abnormality.
[0067] When the audio data playback of the electronic device is abnormal, the abnormal type of the abnormal playback can be obtained according to the second audio behavior information. Among them, the abnormal type includes mode abnormality, channel abnormality, and volume abnormality. For example, if the audio modes in the first audio behavior information and the second audio behavior information are inconsistent, then the abnormal type is mode abnormality; if the audio output channels in the first audio behavior information and the second audio behavior information are inconsistent, then the abnormal type is channel abnormality; if the volumes in the first audio behavior information and the second audio behavior information are inconsistent, or the volume in the second audio behavior information exceeds the preset volume range, then the abnormal type is volume abnormality. It should be noted that the preset volume range can be set according to the volume of the first audio behavior information. For example, the volume of the first audio behavior information is a, and the volume of the second audio behavior information is b, then the preset volume range δ can be understood as the absolute value of the difference between a and b. If the absolute value of the difference between a and b is greater than the preset volume range δ, then it can be considered that the volume is abnormal. Further, if the audio output channels, audio modes, and volumes in the first audio behavior information and the second audio behavior information are all inconsistent, then the abnormal type includes channel abnormality, mode abnormality, and volume abnormality.
[0068] Step 604, adopt a preset correction strategy according to the abnormal type to correct the second audio behavior information to repair the abnormal playback.
[0069] The abnormal types include mode abnormality, channel abnormality, and volume abnormality, and the corresponding preset correction strategies for different abnormal types are different.
[0070] In one embodiment, when a channel abnormality occurs, a preset interface function is called to correct the abnormal audio output channel in the second audio behavior information to repair abnormal playback.
[0071] In one embodiment, when a mode abnormality occurs, a mode conversion interface is set, and the audio mode is converted through the mode conversion interface to correct the second audio behavior information to repair abnormal playback.
[0072] Furthermore, when the abnormal types include at least two of channel abnormality, mode abnormality, and volume abnormality, the correction order can be determined according to the above determination order, and all abnormal types are corrected in sequence according to this correction order.
[0073] In this embodiment, the electronic device can determine the abnormal type of abnormal playback according to the second audio behavior information, and can adaptively adopt corresponding correction strategies to correct it according to different abnormal types, so as to improve the correction efficiency, enable the audio data to be played normally, and improve the user experience.
[0074] In one embodiment, when the audio data playback is abnormal, the abnormal type is obtained according to the second audio behavior information. If the abnormal type is a channel abnormality, it may include headphone channel abnormality, earpiece channel abnormality, and speaker channel abnormality. For example, if the audio output channel in the second audio behavior information is inconsistent with that in the first audio behavior information, if the audio output channel in the second audio behavior information is the headphone channel, it can be considered as a headphone channel abnormality; if the audio output channel in the second audio behavior information is the earpiece channel, it can be considered as an earpiece channel abnormality; if the audio output channel in the second audio behavior information is the speaker channel, it can be considered as a speaker channel abnormality.
[0075] When the channel for playing audio data is abnormal, the electronic device can call a preset interface function to set the audio output channel. The preset interface function at least includes the setSpeakerphoneOn() interface function, the setMode(AudioManager.MODE_IN_CALL) interface function, the isWiredHeadsetOn() interface function, or other interface functions for setting the earpiece channel and headphone channel, etc.
[0076] 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, it can turn on or off the speaker channel. The electronic device can set the earpiece channel by calling the function setMode(AudioManager.MODE_IN_CALL) or the constructor parameter streamType(STREAM_VOICE_CALL) in the AudioManager; the electronic device can set and detect the earpiece channel by calling the function isWiredHeadsetOn() in the AudioManager.
[0077] Specifically, when the earpiece channel of the audio output channel is abnormal, it is detected whether the electronic device is connected to a headset; when the electronic device is connected to a headset, the earpiece channel of the audio data is changed so that the headset channel plays the audio data; when the electronic device is not connected to a headset, the earpiece channel of the audio data is changed so that the speaker channel plays the audio data.
[0078] For example, the electronic device can set and detect whether a wired headset is connected by calling the function isWiredHeadsetOn() in the AudioManager, or detect whether a wired headset is connected by detecting the high and low levels of the GPIO (General Purpose Input / Output). Specifically, if the preset state of the GPIO interface is high level and the current detection state is low level, it indicates that the state of the GPIO interface has changed and the electronic device is connected to a wired headset. The electronic device can also 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 a Bluetooth headset.
[0079] It should be noted that the electronic device can also detect whether it is connected to a headset based on other software or hardware methods, not limited to the above examples.
[0080] When the electronic device is connected to a headset, it can call the preset interface function for switching to the headset channel, and according to this preset interface function, switch the audio output channel for outputting audio data from the earpiece mode to the headset channel, and play the audio data through the headset channel. When the electronic device is not connected to a headset, it can call the preset interface function for switching to the speaker channel, and according to this preset interface function, switch the audio output channel for outputting audio data from the earpiece mode to the speaker channel, and play the audio data through the speaker channel.
[0081] In this embodiment, when an abnormality occurs in the earpiece channel of the audio output channel, the electronic device can adaptively switch its earpiece channel to an audio output channel that conforms to the user's usage scenario according to the state of whether a headset is connected, which can improve the stability of audio output and the user experience.
[0082] Optionally, when an abnormality occurs in the speaker channel of the audio output channel, detect whether the electronic device is connected to a headset; when the electronic device is connected to a headset, change the earpiece channel of the audio data so that the headset channel plays the audio data; when the electronic device is not connected to a headset, change the earpiece channel of the audio data so that the earpiece channel plays the audio data.
[0083] When the electronic device is connected to a headset, a preset interface function for switching to the headset channel can be called, and according to this preset interface function, the audio output channel for outputting the audio data is switched from the speaker mode to the headset channel, and the audio data is played by the headset channel. When the electronic device is not connected to a headset, if the default audio output channel corresponding to the audio mode of the target application is the speaker channel, a preset interface function for switching to the earpiece channel can be called, and according to this preset interface function, the audio output channel for outputting the audio data is switched from the speaker mode to the earpiece channel, and the audio data is played by the earpiece channel.
[0084] In this embodiment, when an abnormality occurs in the speaker channel of the audio output channel, the electronic device can adaptively switch its speaker channel to an audio output channel that conforms to the user's usage scenario according to the state of whether a headset is connected, which can improve the stability of audio output and the user experience.
[0085] Optionally, when an abnormality occurs in the headset channel of the audio output channel, call a preset interface function to change the headset channel of the audio data so that the speaker channel plays the audio data. For example, when the audio output channel in the first audio behavior information of the target application is the speaker channel, when the electronic device is connected to a headset and its alarm is output from the headset channel instead of the speaker, it can be considered that the current headset channel is abnormal. Then the electronic device can call a preset call function for switching to the speaker channel to make its alarm output from the speaker channel, which can avoid the situation where the alarm is output from the headset channel and the user cannot perceive the alarm. When the alarm is output from the speaker, the user can normally hear the alarm without affecting the user's normal schedule.
[0086] In one embodiment, when a mode abnormality occurs, set a mode conversion interface, and perform mode conversion on the audio mode through the mode conversion interface to correct the second audio behavior information to repair abnormal playback.
[0087] Specifically, a mode conversion interface is set up, and the audio mode is converted through the mode conversion interface. In the Android system, according to the current Google SDK development package protocol, there is a setmode function that can be used as this mode conversion interface. In the Android framework, the audio mode conversion can be achieved by calling this setmode function. For example, define setmode(0) as the media audio mode, setmode(1) as the ringtone mode, setmode(2) as the voice call mode, etc. Specifically, setting up the mode conversion interface and converting the audio mode through the mode conversion interface can convert the abnormal audio mode in the second audio behavior information into a normal audio mode.
[0088] In one embodiment, when the volume is abnormal, the audio mode is converted according to the mode conversion interface to correct the abnormal audio mode; the volume is adjusted in the corrected audio mode to correct the abnormal volume so that the audio data is played at a normal volume.
[0089] For example, mode anomalies include media audio mode anomalies, mute mode anomalies, call mode anomalies, ringtone mode anomalies, etc. When the media audio mode is abnormal, the abnormal audio mode can be corrected to the media audio mode, and adjusting the media audio can specifically be adjusting the sound quality, volume, etc. of the media audio mode. When the mute mode is abnormal, the audio mode of the target application can be corrected to the mute mode. Specifically, it can be: setting the audio mode to the media audio mode and adjusting the media audio volume to 0, or setting the audio mode to the system audio mode and adjusting the system audio volume to 0. When the call mode is abnormal, the audio mode of the target application is corrected to the call mode. In addition, when the call mode is the earpiece mode, the volume of the earpiece mode is adjusted to correct the abnormal volume, or when the call mode is the hands-free mode, the volume of the hands-free mode is adjusted to correct the abnormal volume. When the ringtone mode is abnormal, the audio mode of the target application is corrected to the ringtone mode. Among them, correcting the audio mode to the ringtone audio can specifically be: correcting the audio mode to adjust the ringtone and adjusting the volume of the ringtone audio to correct the abnormal volume.
[0090] In the embodiment of the present application, when the electronic device detects an abnormal audio mode through monitoring, it can adaptively correct the abnormal audio mode so that the corrected audio mode is consistent with the audio mode in the first audio behavior information, improving the stability of audio data playback and enhancing the user experience.
[0091] As Figure 7 shown, in one embodiment, the audio processing method includes steps 702 - step 710. Among them,
[0092] Step 702: Control the monitoring module 606 to collect the first audio behavior information used to set the played audio data in the audio service when the target application is running.
[0093] Step 704: When the target application plays audio data, obtain the second audio behavior information of the electronic device when playing the audio data.
[0094] Step 706: Identify whether the playback of the audio data is abnormal according to the first audio behavior information and the second audio behavior information.
[0095] Step 708: When the playback of the audio data is abnormal, correct the second audio behavior information to repair the abnormal playback.
[0096] The above steps 702 - 708 correspond one by one to steps 302 - 308 in the foregoing embodiment, and will not be elaborated here.
[0097] Step 710: Obtain the correction data for correcting the second audio behavior information, and perform reporting and storage processing on the correction data.
[0098] After the electronic device corrects the second audio behavior information, corresponding correction data can be obtained. The correction data includes abnormal information (channel abnormality, mode abnormality, volume abnormality) of the second audio behavior information, correction time, correction cumulative times, identification of the target application, identity identification of the electronic device, and other information. The electronic device can report and store the obtained correction data to count the correction data, which can prove the processing effect and efficiency of this audio processing method, and reduce or avoid abnormal playback during subsequent audio playback.
[0099] As Figure 8 shown, in one embodiment, the audio processing method further includes steps 802 - 808. Among them,
[0100] Step 802: Control the monitoring module to collect the first display information used to set the displayed image in the display service when the target application is running.
[0101] In one embodiment, a monitoring module is created based on the operating system of the electronic device, and the first display information used to set the displayed image in the display service when the target application is running is collected through the monitoring module.
[0102] The monitoring module of the electronic device and the display service can communicate with each other using the binder and socket communication mechanisms. When the target application is running, the electronic device can control the monitoring module to send a display acquisition request to the display service using the binder and socket communication mechanisms. The display service can collect first display information for setting the display image of the target application according to the received display acquisition request. After the display service collects the first display information, it can use the binder and socket communication mechanisms to feedback the collected first display information to the monitoring module, so that the monitoring module can set the first display information when obtaining the display image of the target application.
[0103] Step 804, when the target application displays an image, obtain second display information of the electronic device for displaying the image.
[0104] Step 806, identify whether the display of the image is abnormal according to the first display information and the first display information.
[0105] Among them, both the first display information and the second display information can include LCD / backlight information, frame rate information, display size information, display brightness information, etc. If at least one of the first display information and the second display information is inconsistent, it can be considered that the display of the image is abnormal.
[0106] Specifically, the abnormal types that can be displayed abnormally can include flash screen abnormality, black screen, frame rate processing abnormality, display screen abnormality, display brightness abnormality, etc.
[0107] Step 808, when the display of the image is abnormal, correct the second display information to repair the abnormal display.
[0108] When the display of the image is abnormal, the electronic device can adopt different strategies according to the abnormal type of the display abnormality to correct the second display information to repair the abnormal display. Among them, the correction strategies can include correction processing of the display layer, correction processing of the display area, correction processing of the allocated leakage, correction processing of the brightness adjustment, correction processing of the frame rate adjustment, and so on.
[0109] In this embodiment, the electronic device can monitor the abnormal display of the image and perform correction processing on the abnormal image display to improve the stability of the image display of the electronic device and improve the user experience.
[0110] It should be noted that the steps in this embodiment can also be used before or after the above steps 802 - step 804 to improve the playback quality of the audio data during the switching of the audio output channel and enhance the user experience.
[0111] It should be understood that although Figure 3 - 8The steps in the flowchart are shown in sequence according to the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise clearly stated in this document, there is no strict order limit for the execution of these steps, and these steps can be executed in other orders. Moreover, Figure 3 - 8 At least a portion of the steps in
[0112] can include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed alternately or in rotation with at least a portion of other steps or sub-steps or stages of other steps. Figure 9 As shown in
[0113] This application also provides an audio processing device, which is applied to an electronic device. The device includes: an information collection module 910, an information acquisition module 920, an anomaly judgment module 930, and an anomaly correction module 940. Among them,
[0114] The information collection module 910 is used to obtain first audio behavior information set in the audio service when the target application is running, where the first audio behavior information is parameter information for playing the audio data;
[0115] The information acquisition module 920 is used to obtain second audio behavior information of the electronic device for playing the audio data when the target application plays the audio data;
[0116] The anomaly judgment module 930 is used to identify whether the playing of the audio data is abnormal according to the first audio behavior information and the second audio behavior information; and
[0117] The anomaly correction module 940 is used to correct the second audio behavior information to repair abnormal playing when the playing of the audio data is abnormal.
[0118] In one embodiment, the information collection module includes:
[0119] A sending unit, configured to control a listening module to send an audio acquisition request to an audio service when a target application is running; wherein, the audio acquisition request is used to instruct the audio service to collect first audio behavior information.
[0120] A receiving unit, configured to receive the first audio behavior information fed back by the audio service.
[0121] In one embodiment, the listening module communicates with the audio service by using a binder and a socket communication mechanism.
[0122] In one embodiment, both the first audio behavior information and the second audio behavior information at least include an audio output channel, an audio mode, and a volume; an anomaly judgment module includes:
[0123] An information acquisition unit, configured to acquire application information of the target application.
[0124] An anomaly determination unit, configured to determine whether the second audio behavior information is abnormal according to the application information and the first audio behavior information.
[0125] A playback anomaly unit, configured to indicate that the playback of audio data is abnormal if the second audio behavior information is abnormal.
[0126] In one embodiment, the anomaly determination unit is further configured to determine the determination order of the audio output channel, the audio mode, and the volume in the first audio behavior information and the second audio behavior information according to the application information; determine whether the first audio behavior information and the second audio behavior information are consistent according to the determination order; if any one of the audio output channel, the audio mode, and the volume is inconsistent, then the second audio behavior information is abnormal.
[0127] In this embodiment, the electronic device can determine the determination order of the audio output channel, the audio mode, and the volume in the first audio behavior information and the second audio behavior information according to the application information of the target application, improving the determination efficiency of whether the second audio behavior information is abnormal.
[0128] In one embodiment, the anomaly correction module includes:
[0129] A type acquisition unit, configured to acquire an anomaly type according to the second audio behavior information when the audio data playback is abnormal; the anomaly type includes mode anomaly, channel anomaly, and volume anomaly.
[0130] An anomaly correction unit, configured to correct the second audio behavior information by using a preset correction strategy according to the anomaly type to repair abnormal playback.
[0131] In one embodiment, the anomaly correction unit is further configured to call a preset interface function to correct the abnormal audio output channel in the second audio behavior information to repair abnormal playback when a channel anomaly occurs.
[0132] In this embodiment, the electronic device can determine the abnormal type of abnormal playback according to the second audio behavior information, and can adaptively adopt corresponding correction strategies to correct it according to different abnormal types, so as to improve the correction efficiency, enable the audio data to be played normally, and improve the user experience.
[0133] In one embodiment, the abnormal correction unit is further configured to, when the headphone channel of the audio output channel is abnormal, call a preset interface function to change the headphone channel of the audio data, so that the speaker channel plays the audio data; or, the abnormal correction unit is further configured to, when the receiver channel of the audio output channel is abnormal, detect whether the electronic device is connected to headphones; when the electronic device is connected to headphones, change the receiver channel of the audio data, so that the headphone channel plays the audio data; when the electronic device is not connected to headphones, change the receiver channel of the audio data, so that the speaker channel plays the audio data; or, the abnormal correction unit is further configured to, when the speaker channel of the audio output channel is abnormal, detect whether the electronic device is connected to headphones; when the electronic device is connected to headphones, change the receiver channel of the audio data, so that the headphone channel plays the audio data; when the electronic device is not connected to headphones, change the receiver channel of the audio data, so that the receiver channel plays the audio data.
[0134] In this embodiment, when the receiver channel in the audio output channel is abnormal, the electronic device can adaptively switch its receiver channel to an audio output channel that conforms to the user's usage scenario according to the state of whether it is connected to headphones, which can improve the stability of audio output and the user experience. 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 conforms to the user's usage scenario according to the state of whether it is connected to headphones, which can improve the stability of audio output and the user experience.
[0135] In one embodiment, the abnormal correction unit is further configured to set a mode conversion interface when the mode is abnormal, and perform mode conversion on the audio mode through the mode conversion interface to correct the second audio behavior information to repair abnormal playback.
[0136] In one embodiment, the abnormal correction unit is further configured to, when the volume is abnormal, perform mode conversion on the audio mode according to the mode conversion interface to correct the abnormal audio mode; adjust the volume in the corrected audio mode to correct the abnormal volume.
[0137] In the embodiment of the present application, when the monitored audio mode is abnormal, the electronic device can adaptively correct the abnormal audio mode, so that the corrected audio mode is consistent with the audio mode in the first audio behavior information, improving the stability of audio data playback and the user experience.
[0138] In one embodiment, the device further includes:
[0139] A data acquisition module, configured to acquire calibration data for calibrating second audio behavior information, and report and store the calibration data for processing.
[0140] The electronic device can report and store the acquired calibration data to count the calibration data, which can prove the processing effect and efficiency of the audio processing method, and reduce or avoid abnormal playback during subsequent audio playback.
[0141] In one embodiment,
[0142] The information collection module is further configured to control the monitoring module to collect first display information used for setting a display image in a display service when a target application is running;
[0143] The information acquisition module is further configured to acquire second display information of the electronic device's display image when the target application displays an image;
[0144] The abnormality determination module is further configured to identify whether the display of the image is abnormal according to the first display information and the second display information; and
[0145] The abnormality correction module is further configured to correct the second display information to repair abnormal display when the image is displayed.
[0146] In this embodiment, the electronic device can monitor the abnormal display of the image and perform correction processing on the abnormal image display to improve the stability of the electronic device's display image and enhance the user experience.
[0147] The division of each module in the above audio processing device is only for illustrative purposes. In other embodiments, the audio processing device can be divided into different modules as needed to complete all or part of the functions of the above audio processing device.
[0148] Each module in the above audio processing device can be implemented in whole or in part by software, hardware, and their combination. The above modules can be embedded in the processor of the electronic device in hardware form or be independent of it, or be stored in the memory of the electronic device in software form, so that the processor can call and execute the operations corresponding to the above modules.
[0149] This application embodiment also provides 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 processors to execute the following steps of an audio processing method:
[0150] Control the monitoring module to collect first audio behavior information used for setting audio playback data in an audio service when a target application is running;
[0151] When the target application plays the audio data, obtain second audio behavior information of the electronic device playing the audio data;
[0152] Identify whether the playing of the audio data is abnormal according to the first audio behavior information and the second audio behavior information;
[0153] When the playing of the audio data is abnormal, correct the second audio behavior information to repair the abnormal playing.
[0154] 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, can also cause the processors to execute the audio processing method in any of the above embodiments.
[0155] A computer program product containing instructions, when it runs on a computer, causes the computer to execute the steps of the audio processing method:
[0156] Control the monitoring module to collect first audio behavior information used to set the playing of audio data in the audio service when the target application runs;
[0157] When the target application plays the audio data, obtain second audio behavior information of the electronic device playing the audio data;
[0158] Identify whether the playing of the audio data is abnormal according to the first audio behavior information and the second audio behavior information;
[0159] When the playing of the audio data is abnormal, correct the second audio behavior information to repair the abnormal playing.
[0160] It should be noted that a computer program product containing instructions, when it runs on a computer, causes the computer to execute the steps of the audio processing method in any of the above embodiments.
[0161] The embodiments of the present application also provide an electronic device. As Figure 10 shown, for ease of explanation, only the parts related to the embodiments of the present application are shown. For the specific technical details not disclosed, please refer to the method part of the embodiments of the present application. The electronic device can be any terminal device including a mobile phone, a tablet computer, a PDA (Personal Digital Assistant), a POS (Point of Sales), an in-vehicle computer, a wearable device, etc. that has a voice call function and a speaker. Taking the electronic device as a mobile phone as an example:
[0162] Figure 10It is a block diagram of a partial structure of a mobile phone related to the electronic device provided in an embodiment of the present application. Refer to Figure 10 , the mobile phone includes: a Radio Frequency (RF) 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 a power supply 1090 and other components. Those skilled in the art can understand that Figure 10 the mobile phone structure shown does not limit the mobile phone, and may include more or fewer components than shown, or combine certain components, or have different component arrangements.
[0163] Among them, the RF circuit 1010 can be used for receiving and sending signals during information reception or call processes. After receiving the downlink information from the base station, it can be given to the processor 1080 for processing; it can also send the uplink data to the base station. Generally, the RF circuit includes but is not limited to antennas, at least one amplifier, a transceiver, a coupler, a Low Noise Amplifier (LNA), a duplexer, etc. 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 communication (GSM), General Packet Radio Service (GPRS), Code Division Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA), Long Term Evolution (LTE), email, Short Messaging Service (SMS), etc.
[0164] The memory 1020 can 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. Among them, the program storage area can store an operating system, application programs required for at least one function (such as an application program for sound playback function, an application program for image playback function, etc.); the data storage area can store data created according to the use of the mobile phone (such as audio data, address book, etc.). In addition, the memory 1020 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, or other volatile solid-state storage devices.
[0165] The input unit 1030 can be used to receive input digital or character information, and generate key signal inputs related to the 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 touch operations of the user on or near it (such as operations of the user using a finger, a stylus, or any suitable object or accessory on or near the touch panel 1031), and drive the corresponding connection device according to a pre-set program. In one embodiment, the touch panel 1031 may include two parts: a touch detection device and a touch controller. Among them, the touch detection device detects the touch orientation of the user, detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts it into contact coordinates, and then sends it to the processor 1080, and can receive and execute the commands sent by the processor 1080. In addition, the touch panel 1031 can be implemented in multiple types such as resistive, capacitive, infrared, and surface acoustic wave. In addition to the touch panel 1031, the input unit 1030 may further include other input devices 1032. Specifically, the 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, power on / off keys, etc.).
[0166] The display unit 1040 can be used to display information input by the user or information provided to the user, as well as 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 (LCD), an organic light-emitting diode (OLED), etc. In one embodiment, the touch panel 1031 may cover the display panel 1041. 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. Subsequently, the processor 1080 provides a corresponding visual output on the display panel 1041 according to the type of touch event. Although in Figure 10 this example, the touch panel 1031 and the display panel 1041 are implemented as two independent components to realize the input and output functions of the mobile phone, in some embodiments, the touch panel 1031 and the display panel 1041 can be integrated to realize the input and output functions of the mobile phone.
[0167] 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. Among them, the ambient light sensor can adjust the brightness of the display panel 1041 according to the brightness of the ambient light. The proximity sensor can turn off the display panel 1041 and / or the backlight when the mobile phone is moved to the ear. The motion sensor may include an acceleration sensor. Through the acceleration sensor, the magnitude of the acceleration in each direction can be detected. When stationary, the magnitude and direction of gravity can be detected, which can be used for applications that identify the posture of the mobile phone (such as horizontal and vertical screen switching), vibration recognition-related functions (such as a pedometer, tapping), etc.; in addition, the mobile phone may also be configured with other sensors such as a gyroscope, a barometer, a hygrometer, a thermometer, an infrared sensor, etc.
[0168] The audio circuit 1060, the speaker 1061, and the microphone 1062 can provide an audio interface between the user and the mobile phone. The audio circuit 1060 can transmit the electrical signal converted from the received audio data to the speaker 1061, and the speaker 1061 converts it into a sound signal for output; on the other hand, the microphone 1062 converts the collected sound signal into an electrical signal, which is received by the audio circuit 1060 and then converted into audio data. After the audio data is output to the processor 1080 for processing, it can be sent to another mobile phone through the RF circuit 1010, or the audio data can be output to the memory 1020 for subsequent processing.
[0169] WiFi belongs to short - range wireless transmission technology. Through the WiFi module 1070, a mobile phone can help users send and receive emails, browse the web, and access streaming media, etc. It provides users with wireless broadband Internet access. Although Figure 10 the WiFi module 1070 is shown, it can be understood that it does not belong to the essential components of the mobile phone 1000 and can be omitted as needed.
[0170] The processor 1080 is the control center of the mobile phone, connecting various parts of the entire mobile phone using various interfaces and circuits. By running or executing software programs and / or modules stored in the memory 1020, and by calling the data stored in the memory 1020, it executes various functions of the mobile phone and processes data, thereby monitoring 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. Among them, the application processor mainly processes the operating system, user interface, and application programs, etc.; the modem processor mainly processes wireless communication. It can be understood that the above - mentioned modem processor may not be integrated into the processor 1080 either.
[0171] The mobile phone 1000 also includes a power source 1090 (such as a battery) for supplying power to each component. Preferably, the power source can be logically connected to the processor 1080 through a power management system, so as to realize functions such as management of charging, discharging, and power consumption management through the power management system.
[0172] In one embodiment, the mobile phone 1000 may also include a camera, a Bluetooth module, etc.
[0173] In the embodiments of the present application, when the processor 1080 included in the electronic device executes the computer program stored in the memory, the following steps are implemented:
[0174] Control the monitoring module to collect the first audio behavior information used to set the playback of audio data in the audio service when the target application is running;
[0175] When the target application plays the audio data, obtain the second audio behavior information of the electronic device when playing the audio data;
[0176] Identify whether the playback of the audio data is abnormal according to the first audio behavior information and the second audio behavior information;
[0177] When the playback of the audio data is abnormal, correct the second audio behavior information to repair the abnormal playback.
[0178] It should be noted that an electronic device includes a memory and a processor. Computer-readable instructions are stored in the memory. When the instructions are executed by the processor, the processor executes the steps of the audio processing method in any of the above embodiments.
[0179] Any reference in this application to a memory, storage, database, or other medium 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 may include random access memory (RAM), which serves as an external cache. 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), Rambus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and Rambus dynamic RAM (RDRAM).
[0180] The technical features of the above embodiments can be combined arbitrarily. For the sake of brevity of description, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, it should be considered as the scope described in this specification.
[0181] The above embodiments merely represent several implementation manners of the present invention. The description thereof is relatively specific and detailed, but it should not be construed as a limitation on the scope of the invention patent. It should be noted that for those of ordinary skill in the art, without departing from the concept of the present invention, several modifications and improvements can be made, and these all belong to the protection scope of the present invention. Therefore, the protection scope of the invention patent should be subject to the appended claims.
Claims
1. An audio processing method, applied to an electronic device, characterized in that, The method includes: When the target application is running, controlling the monitoring module to send an audio acquisition request to the audio service; wherein, the audio acquisition request is used to instruct the audio service to collect first audio behavior information; Receiving the first audio behavior information fed back by the audio service; wherein, the first audio behavior information is parameter information for playing audio data; the first audio behavior information is the standard audio behavior information set in the audio service when the target application plays audio data; When the target application plays the audio data, acquiring second audio behavior information of the electronic device for playing the audio data; Identifying whether the playing of the audio data is abnormal according to the first audio behavior information and the second audio behavior information; When the playing of the audio data is abnormal, acquiring an abnormal type according to the second audio behavior information; Adopting a preset correction strategy according to the abnormal type to correct the second audio behavior information to repair abnormal playing.
2. The method according to claim 1, characterized in that, The monitoring module communicates with the audio service by using binder and socket communication mechanisms.
3. The method according to claim 1, wherein The identifying whether the playing of the audio data is abnormal according to the first audio behavior information and the second audio behavior information includes: Acquiring application information of the target application; Determining whether the second audio behavior information is abnormal according to the application information and the first audio behavior information; If the second audio behavior information is abnormal, the playing of the audio data is abnormal.
4. The method according to claim 3, characterized in that The determining whether the second audio behavior information is abnormal according to the application information and the first audio behavior information includes: Determining the determination order of the audio output channel, audio mode, and volume in the first audio behavior information and the second audio behavior information according to the application information; Judging whether the first audio behavior information and the second audio behavior information are consistent according to the determination order; If any one of the audio output channel, the audio mode, and the volume is inconsistent, the second audio behavior information is abnormal.
5. The method according to claim 1, wherein The abnormal types include mode abnormality, channel abnormality, and volume abnormality.
6. The method according to claim 5, wherein The adopting a corresponding correction strategy according to the abnormal type to correct the second audio behavior information to repair abnormal playing includes: When the channel is abnormal, calling a preset interface function to correct the abnormal audio output channel in the second audio behavior information to repair abnormal playing.
7. The method according to claim 6, wherein The calling to correct the abnormal audio output channel in the second audio behavior information to repair abnormal playing when the channel is abnormal includes: When the headphone channel of the audio output channel is abnormal, calling the preset interface function to change the headphone channel of the audio data so that the speaker channel plays the audio data.
8. The method according to claim 6, characterized in that, The calling to correct the abnormal audio output channel in the second audio behavior information to repair abnormal playing when the channel is abnormal includes: When the earpiece channel of the audio output channel is abnormal, detecting whether the electronic device is connected to headphones; When the electronic device is connected to headphones, changing the earpiece channel of the audio data so that the headphone channel plays the audio data; When the electronic device is not connected to the headset, change the earpiece channel of the audio data so that the speaker channel plays the audio data.
9. The method according to claim 6, wherein The calling to correct the abnormal audio output channel in the second audio behavior information to repair abnormal playback when the channel is abnormal includes: When the speaker channel of the audio output channel is abnormal, detect whether the electronic device is connected to the headset; When the electronic device is connected to the headset, change the earpiece channel of the audio data so that the headset channel plays the audio data; When the electronic device is not connected to the headset, change the earpiece channel of the audio data so that the earpiece channel plays the audio data.
10. The method according to claim 5, characterized in that The adopting corresponding correction strategies according to the abnormal type to correct the second audio behavior information to repair abnormal playback includes: When the mode is abnormal, set a mode conversion interface, and perform mode conversion on the audio mode through the mode conversion interface to correct the second audio behavior information to repair abnormal playback.
11. The method according to claim 10, wherein The adopting corresponding correction strategies according to the abnormal type to correct the second audio behavior information to repair abnormal playback includes: When the volume is abnormal, perform mode conversion on the audio mode according to the mode conversion interface to correct the abnormal audio mode; Adjust the volume in the corrected audio mode to correct the abnormal volume.
12. The method according to claim 1, wherein The method further includes: Obtain correction data for correcting the second audio behavior information, and perform reporting and storage processing on the correction data.
13. The method according to claim 1, characterized in that The method further includes: Control the monitoring module to collect first display information used to set the display image in the display service when the target application is running; When the target application displays the image, obtain second display information of the electronic device for displaying the image; Identify whether the display of the image is abnormal according to the first display information and the first display information; When the display of the image is abnormal, correct the second display information to repair the abnormal display.
14. An audio processing device, applied to an electronic device, characterized in that, The device includes: An information collection module, configured to control the monitoring module to send an audio acquisition request to the audio service when the target application is running; wherein, the audio acquisition request is used to instruct the audio service to collect first audio behavior information; Receive the first audio behavior information fed back by the audio service, where the first audio behavior information is parameter information for playing audio data; the first audio behavior information is the standard audio behavior information set in the audio service when the target application plays audio data; An information acquisition module, configured to obtain second audio behavior information of the electronic device for playing the audio data when the target application plays the audio data; An abnormality judgment module, configured to identify whether the playback of the audio data is abnormal according to the first audio behavior information and the second audio behavior information; and An abnormality correction module, configured to, when the playback of the audio data is abnormal, obtain an abnormal type according to the second audio behavior information; adopt a preset correction strategy according to the abnormal type to correct the second audio behavior information to repair abnormal playback.
15. A computer-readable storage medium, characterized in that, A computer program is stored thereon, and when the computer program is executed by a processor, the steps of the audio processing method according to any one of claims 1 to 13 are implemented.
16. An electronic device, characterized in that, It includes a memory and a processor. Computer-readable instructions are stored in the memory, and when the instructions are executed by the processor, the processor is caused to execute the audio processing method according to any one of claims 1 to 13.
Citation Information
Patent Citations
Sound channel switching method and switching system of mobile terminal
CN105681973A
Sound effect processing method and mobile terminal
CN106170034A
Method of adaptively switching sound effect output channels and terminal
CN106534497A