CN109284080B - Sound effect adjusting method and device, electronic equipment and storage medium - Google Patents
Sound effect adjusting method and device, electronic equipment and storage medium Download PDFInfo
- Publication number
- CN109284080B CN109284080B CN201811026569.XA CN201811026569A CN109284080B CN 109284080 B CN109284080 B CN 109284080B CN 201811026569 A CN201811026569 A CN 201811026569A CN 109284080 B CN109284080 B CN 109284080B
- Authority
- CN
- China
- Prior art keywords
- sound
- electronic equipment
- application program
- target application
- audio
- Prior art date
- Legal status (The legal status 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 status listed.)
- Active
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/16—Sound input; Sound output
- G06F3/167—Audio in a user interface, e.g. using voice commands for navigating, audio feedback
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Multimedia (AREA)
- Health & Medical Sciences (AREA)
- Audiology, Speech & Language Pathology (AREA)
- General Health & Medical Sciences (AREA)
- Human Computer Interaction (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Circuit For Audible Band Transducer (AREA)
- Telephone Function (AREA)
Abstract
The application discloses a sound effect adjusting method and device, electronic equipment and a storage medium, and relates to the technical field of electronic equipment. The method is applied to the electronic equipment, and comprises the following steps: the method comprises the steps of detecting whether the electronic equipment runs a target application program, wherein the target application program can output audio when running, acquiring current environment sound of the environment where the electronic equipment is located when the electronic equipment runs the target application program, and adjusting output sound effect of the electronic equipment in the running process of the target application program based on the current environment sound. According to the method and the device, the output sound effect of the electronic equipment is adjusted according to the environmental tone of the environment where the electronic equipment is located when the target application program runs, the output sound effect of the electronic equipment is automatically and quickly configured, and the effect of the output sound effect and the user experience are improved.
Description
Technical Field
The present disclosure relates to the field of electronic devices, and more particularly, to a sound effect adjusting method and apparatus, an electronic device, and a storage medium.
Background
With the development of science and technology, electronic devices have become one of the most common electronic products in people's daily life. Moreover, users often listen to music, watch videos, play games and the like through electronic equipment, but at present, the processing mode of the electronic equipment on audio data is fixed, the output sound effect is poor, and the user experience is poor.
Disclosure of Invention
In view of the foregoing problems, the present application provides a sound effect adjusting method, device, electronic device and storage medium to solve the foregoing problems.
In a first aspect, an embodiment of the present application provides a sound effect adjusting method, which is applied to an electronic device, and the method includes: detecting whether a target application program runs in the electronic equipment, wherein the target application program can output audio when running; when the target application program runs on the electronic equipment, acquiring current environment sound of the environment where the electronic equipment is located; and adjusting the output sound effect of the electronic equipment in the running process of the target application program based on the current environmental sound.
In a second aspect, an embodiment of the present application provides a sound effect adjusting apparatus, which is applied to an electronic device, the apparatus includes: the detection module is used for detecting whether a target application program runs in the electronic equipment, wherein the target application program can output audio when running; the acquisition module is used for acquiring the current environment sound of the environment where the electronic equipment is located when the target application program runs on the electronic equipment; and the adjusting module is used for adjusting the output sound effect of the electronic equipment in the running process of the target application program based on the current environmental sound.
In a third aspect, an embodiment of the present application provides an electronic device, including a memory and a processor, the memory being coupled to the processor, the memory storing instructions, and the processor performing the above method when the instructions are executed by the processor.
In a fourth aspect, the present application provides a computer-readable storage medium, in which a program code is stored, and the program code can be called by a processor to execute the above method.
Compared with the prior art, the scheme provided by the application detects whether the electronic equipment runs the target application program, wherein the target application program can output audio when running, when the electronic equipment runs the target application program, the current environment sound of the environment where the electronic equipment is located is obtained, the output sound effect of the electronic equipment in the running process of the target application program is adjusted based on the current environment sound, the output sound effect of the electronic equipment when the target application program is running is adjusted according to the environment sound of the environment where the electronic equipment is located, the automatic and fast configuration of the output sound effect of the electronic equipment is realized, and the effect of the output sound effect and the user experience are improved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
FIG. 1 is a flow chart illustrating a sound effect adjustment method according to an embodiment of the present disclosure;
FIG. 2 is a flow chart illustrating a sound effect adjustment method according to another embodiment of the present application;
FIG. 3 is a flowchart illustrating a step S250 of the sound effect adjusting method provided by the embodiment of the application shown in FIG. 2;
FIG. 4 is a flow chart illustrating a sound effect adjustment method according to still another embodiment of the present application;
FIG. 5 is a flowchart illustrating the step S340 of the sound effect adjusting method provided by the embodiment of the application shown in FIG. 4;
FIG. 6 is a block diagram illustrating an audio effect adjusting apparatus according to an embodiment of the present disclosure;
FIG. 7 is a block diagram of an electronic device for executing an audio effect adjustment method according to an embodiment of the present application;
fig. 8 illustrates a storage unit for storing or carrying program codes for implementing the sound effect adjustment method according to the embodiment of the present application.
Detailed Description
In order to make the technical solutions better understood by those skilled in the art, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application.
At present, the demand of users for electronic devices is increasing, and therefore, the electronic devices are beginning to support playing audio data in order to meet the demands of users and provide convenience for users, wherein the audio architecture of the electronic devices is similar to that of computers, and is mainly completed by processors and built-in audio CODECs (CODECs). Specifically, the processor receives the input of audio data, converts the audio data into an I2S signal, transmits the I2S signal to the CODEC, converts the I2 signal into an analog signal, and plays the analog signal.
Further, in order to enhance the hearing experience, more and more users are demanding on the output sound effect of the electronic device, wherein the sound effect refers to the effect made by sound, and refers to the artificial or enhanced sound added to the sound track for enhancing the reality, atmosphere or dramatic message of the scene, and the noise or sound added to the sound track is the sound processing for enhancing the artistic or other content of the movie, electronic game, music or other media, for example, the electronic game sound effect refers to the hitting sound, running sound, gunshot sound, etc. in the game. Therefore, with the development of electronic device technology, more and more electronic devices begin to provide sound effect output, but at present, the sound effect function of the electronic device mainly selects and sets a sound effect mode of a certain scene manually according to the preference of a user, adopts a conventional and fixed processing mode, does not consider the influence of external factors, and outputs fixed sound effects if the influence of different environmental sounds is not considered.
In view of the above problems, the inventor finds and provides a sound effect adjusting method, a sound effect adjusting device, an electronic device, and a storage medium provided in the embodiments of the present application, which adjust an output sound effect of the electronic device when a target application is running according to an environmental sound of an environment in which the electronic device is located, so as to automatically and quickly configure the output sound effect of the electronic device, and improve the sound effect output effect and user experience. The specific sound effect adjusting method is described in detail in the following embodiments.
Examples
Referring to fig. 1, fig. 1 is a schematic flow chart illustrating a sound effect adjusting method according to an embodiment of the present application. The sound effect adjusting method is used for adjusting the output sound effect of the electronic equipment when the target application program is operated according to the environmental tone of the environment where the electronic equipment is located, so that the output sound effect of the electronic equipment is automatically and quickly configured, and the sound effect output effect and the user experience are improved. In a specific embodiment, the sound effect adjusting method is applied to the sound effect adjusting apparatus 200 shown in fig. 6 and the electronic device 100 (fig. 7) equipped with the sound effect adjusting apparatus 200. The specific flow of the embodiment will be described below by taking an electronic device as an example, and it is understood that the electronic device applied in the embodiment may be a smart phone, a tablet computer, a wearable electronic device, a vehicle-mounted device, a gateway, and the like, and is not limited specifically herein. As will be described in detail with respect to the flow shown in fig. 1, the sound effect adjusting method may specifically include the following steps:
step S110: whether a target application program runs in the electronic equipment is detected, wherein the target application program can output audio when running.
In this embodiment, the application programs run by the electronic device may include an application program running in a foreground of the electronic device, an application program running in a background of the electronic device, or an application program that is switched to run in the foreground and the background of the electronic device, which is not limited herein. Specifically, the application program running in the foreground refers to an application program which can usually interact with a user and can run in the foreground, and the application program can be suspended when the application program is not visible (such as games); background running applications mean very limited interaction with the user, except during configuration, where other times of the lifetime are hidden (e.g., SMS auto-answer program and alarm clock program); the application program which is switched to run in the foreground and the background of the electronic equipment refers to the application program which can be switched between the foreground and the background at will. It is understood that when an application is not killed (kill), the application is characterized as running on the electronic device.
Furthermore, the electronic device may only run one application program, or may also run multiple application programs simultaneously, where when the electronic device only runs one application program, the application program may run in a foreground of the electronic device, run in a background of the electronic device, or switch between the foreground and the background of the electronic device; when the electronic device simultaneously runs a plurality of application programs, the plurality of application programs may all run in the background of the electronic device, one application program of the plurality of application programs runs in the foreground of the electronic device, the rest of application programs run in the background of the electronic device or one application program of the plurality of application programs is switched to run in the foreground and the background of the electronic device, the rest of application programs run in the background of the electronic device, and the like, which is not limited herein.
After the application program run by the electronic device is acquired, a target application program is determined from the application programs, and similarly, the target application program may include a single application program or may include a plurality of application programs, which is not limited herein. In this embodiment, the target application may output audio when running, that is, the target application has at least audio output, for example, the target application may include a music playing application, a video playing application, a call application, a game application, and the like, and the target application may output audio data, or may output audio data and image data at the same time.
Step S120: and when the target application program runs in the electronic equipment, acquiring the current environment sound of the environment where the electronic equipment is located.
In this embodiment, when it is determined that the electronic device runs the target application, it is characterized that the electronic device is outputting audio or will output audio at a next certain time, so as to be a way, when it is determined that the electronic device runs the target application, acquiring current environment sound of an environment where the electronic device is located may be performed; as another mode, whether the electronic device has audio output may be detected, and when it is detected that the electronic device has audio output, acquiring the current environment sound of the environment where the electronic device is located may be performed.
Specifically, when the target application is an application that has audio output when running, such as a music playing application, a video playing application, a conversation application, and the like, it may be considered that when the target application is running, the electronic device is outputting audio, and at this time, the current environmental sound of the environment where the electronic device is located is acquired by corresponding execution; when the target application program is an application program which can be output by audio when the target application program is a game application program, an instant messaging application program and the like, firstly, whether the electronic equipment has the audio output is detected, wherein when the electronic equipment is detected to have the audio output, the current environment sound of the environment where the electronic equipment is located is acquired. In this embodiment, an instant messaging application is taken as an example, the instant messaging application may include WeChat, QQ, and the like, and the WeChat application may output audio data during running, such as performing a voice chat or performing a video chat, and may not output audio data during running, such as performing a text chat, so that when the electronic device runs such a target application, the current environment sound of the environment where the electronic device is located may be obtained when it is determined that the electronic device has audio output at this time.
Further, the current environment sound of the environment where the electronic equipment is located is obtained. As a mode, the electronic device at least includes an electronic device body and a sound receiving device disposed on the electronic device body, where the sound receiving device is configured to receive an environmental sound of a location where the electronic device is located, and transmit the environmental sound to the processor for analysis and processing to obtain the current environmental sound, where the environmental sound may include a car sound, a human sound, a bird sound, a music sound, and the like, and is not limited herein. Further, take electronic equipment as an example of an intelligent terminal, the intelligent terminal may use a microphone as a sound receiving device, in this embodiment, the intelligent terminal may include at least a voice call microphone, wherein the voice call microphone is mainly used for receiving an environmental sound of a location where the electronic equipment is located, for example, when recording, the environmental sound of the location where the electronic equipment is located is recorded, and the environmental sound is converted into an electrical signal in real time to analyze the environmental sound so as to obtain the current environmental sound, wherein the current environmental sound may include a sound volume, a sound intensity, and the like.
As another way, current location information of the electronic device is detected, wherein the current location information of the electronic device can be obtained through Positioning, and as a way, the current location of the electronic device can be obtained through a Location Based Service (LBS) and/or a Global Positioning System (GPS). It can be understood that, since the location of the electronic device may change at any time, in this embodiment, the location information of the electronic device is obtained in real time, so that when the location of the current electronic device changes, the LBS and/or the GPS may obtain the current location information of the electronic device in real time according to the change of the location of the electronic device.
Further, after determining the current location information of the electronic device, another electronic device within a preset range of the location information may be obtained, where the preset range may be manually set by a user, may be configured by the electronic device when the electronic device leaves a factory, or may be configured by the electronic device according to an environment, and is not limited herein, and the preset range may be 10m, 5m, 3m, 2m, and the like, and is not limited herein. After the preset range is determined, the other electronic devices located in the preset range are correspondingly obtained, and as a manner, the number of the other electronic devices in the preset range may be one or multiple, which is not limited herein.
In this embodiment, it is detected whether the other electronic device acquires the environmental sound of the environment where the electronic device is located within a preset time period, for example, whether the other electronic device acquires the environmental sound of the environment where the electronic device is located within the first 30s of the current time is detected, where when the other electronic device acquires the current environmental sound of the environment where the electronic device is located within the preset time period, the electronic device acquires the environmental sound acquired by the other electronic device and uses the environmental sound as the current environmental sound of the electronic device, so as to acquire the current environmental sound of the environment where the electronic device is located. As a mode, when other electronic devices acquire the environmental sound of the environment where the electronic devices are located, the acquired environmental sound may be sent in a broadcast manner, so that the electronic devices located within the preset range of the other electronic devices receive the broadcast message, and the environmental sound of the environment where the other electronic devices are located is acquired based on the broadcast message.
Step S130: and adjusting the output sound effect of the electronic equipment in the running process of the target application program based on the current environmental sound.
In this embodiment, after determining the current environmental sound of the environment where the electronic device is located, the output sound effect of the electronic device in the running process of the target application program may be adjusted based on the current environmental sound. Specifically, the electronic device may increase or decrease the output sound effect of the electronic device during the running of the target application program based on the current environmental sound. As a mode, when the current environmental sound is too high, such as being higher than a sound threshold set by the electronic device or being higher than an output sound of the electronic device, the noise representing the environment where the electronic device is located is too high, and at this time, if the target application program is running the electronic device, the interference of the current environmental sound on the output sound is large, that is, the output sound of the electronic device is improved, and the current environmental sound of the environment where the electronic device is located is also affected by the current environmental sound, and the interference is caused to others, so that the output sound of the electronic device in the running process of the target application program can be correspondingly reduced.
When the current environmental sound is too low, if the current environmental sound is far lower than a sound threshold set by the electronic equipment or far lower than the output sound of the electronic equipment, the noise representing the environment where the electronic equipment is located is lower, at the moment, if the target application program is running in the electronic equipment, the interference of the current environmental sound on the output sound effect of the electronic equipment is smaller, the output sound effect of the electronic equipment in the running process of the target application program can be kept, or the output sound effect of the electronic equipment in the running process of the target application program is slightly improved, so that the adjustment of the output sound effect of the electronic equipment cannot cause interference to other people.
As one way, the electronic device may establish a mapping relationship between the ambient sound and the output sound effect in advance, and generate a mapping relationship table to be stored in the electronic device, as shown in table 1. The mapping relationship between the environmental sound and the output sound effect may be manually associated by a user, may be automatically associated by an electronic device or automatically associated by a server, and the like, and is not limited herein, and the mapping relationship between the environmental sound and the output sound effect may include that one environmental sound corresponds to one output sound effect, or that an environmental sound interval corresponds to one output sound effect, and the like, and is not limited herein.
Furthermore, after the current environmental sound is determined, the current environmental sound is compared with a plurality of environmental sounds stored in advance in the mapping relation table one by one to obtain the environmental sound or the environmental sound interval matched with the current environmental sound, and then the output sound effect corresponding to the environmental sound is searched according to the mapping relation table, so that the output sound effect corresponding to the current environmental sound can be obtained, the output sound effect of the electronic equipment when the target application program is operated can be adjusted according to the environmental sound of the environment where the electronic equipment is located, the output sound effect of the electronic equipment can be automatically and rapidly configured, and the effect of the output sound effect and the user experience can be improved.
TABLE 1
Ambient sound | Output sound effect |
A1 | B1 |
A2 | B2 |
A3 | B3 |
According to the sound effect adjusting method provided by one embodiment of the application, whether the electronic equipment runs the target application program is detected, wherein the target application program can output audio when running, when the electronic equipment runs the target application program, the current environment sound of the environment where the electronic equipment is located is obtained, the output sound effect of the electronic equipment in the running process of the target application program is adjusted based on the current environment sound, the output sound effect of the electronic equipment when the target application program runs is adjusted according to the environment sound of the environment where the electronic equipment is located, automatic and fast configuration of the output sound effect of the electronic equipment is achieved, and the effect of the output sound effect and user experience are improved.
Referring to fig. 2, fig. 2 is a schematic flow chart illustrating a sound effect adjusting method according to another embodiment of the present application. The sound effect adjusting method is applied to the electronic device, and will be described in detail with respect to the flow shown in fig. 2, and the method may specifically include the following steps:
step S210: whether a target application program runs in the electronic equipment is detected, wherein the target application program can output audio when running.
For detailed description of step S210, please refer to step S110, which is not described herein again.
Step S220: and when the target application program runs in the electronic equipment, identifying the type of the target application program.
In this embodiment, the electronic device may establish a mapping relationship between the application and the type in advance, and generate a mapping relationship table to be stored in the electronic device, as shown in table 2. The mapping relationship between the application programs and the types may be manually associated by a user, may be automatically associated by an electronic device or automatically associated by a server, and the like, and is not limited herein, and the mapping relationship between the application programs and the types may include that one application program corresponds to one type, or multiple application programs correspond to one type, and the like, and is not limited herein, for example, the wechat and the QQ are taken as examples, and the mapping relationship may be that the wechat and the QQ correspond to one type, or that the wechat and the QQ correspond to the same type, and the like.
After a target application program operated by the electronic equipment is determined, the target application program is compared with a plurality of application programs stored in a mapping relation table in advance one by one to obtain the application program matched with the target application program, and then the type corresponding to the application program is searched according to the mapping relation table, so that the type of the target application program can be obtained. For example, when the mapping relationship table includes a mapping relationship between a wechat and an instant messaging class, that is, the application program in the mapping relationship table stores the wechat, the type stores the instant messaging class, and the wechat is associated with the instant messaging class, then, when the target application program is the wechat, the target application program may be matched with the application program stored in the mapping relationship table, and it can be understood that the target application program may be matched with the wechat in the mapping relationship table, and then the type of the target application program is found to be the instant messaging class.
TABLE 2
Application program | Type (B) |
C1 | D1 |
C2 | D2 |
C3 | D3 |
As a mode, when the target application program and the plurality of application programs pre-stored in the mapping relation table are all unsuccessfully matched one to one, that is, when no application program matched with the target application program is stored under the application program of the mapping relation table, the type of the target application program can be acquired by searching for an application program similar to the type of the target application program and taking the type of the application program similar to the target application program as the type of the target application program. In this embodiment, the package name of the target application program may be obtained, and since the package name includes various information related to the application program, the package name may be analyzed to obtain a manufacturer of the target application program included in the package name, then search for another application program produced by the manufacturer, search for a type of the other application program in the mapping relationship table, and use the type of the other application program as the type of the target application program.
In this embodiment, taking an Android system as an example, in the Android system, a version number of an application program is configured in an Android package xml file, and a PackageInfo class encapsulates all information acquired from the configuration file and describes whole information of package content, so that a versioname attribute of the PackageInfo object may be used to acquire the version number of the application, and the PackageInfo object may be acquired through a PackageManager object, where the PackageManager is a class that retrieves various information of a related application package that is currently installed on a device, and a getfoackage method in the PackageManager object may acquire the PackageInfo object, where the method needs to transfer two parameters: the package name and conditions are applied. In general, the package name of an application can be obtained by the Activity or getpackagemame () method of Context (Activity inherits from Context), and there can be many settings for the addition, usually set to 0. Finally, the PackageManager object is obtained, and the Context object provides the getPackageManager () method to obtain the object. Therefore, the package name of the target application program can be acquired based on the method.
Step S230: and when the type of the target application program is a game type, acquiring the current environment sound of the environment where the electronic equipment is located.
In this embodiment, the target application may include multiple types, for example, the target application may be a music playing type, a video playing type, an instant messaging type, a text reading type, a game type, and the like, and when the type of the target application is identified as the game type, the current environmental sound of the environment where the electronic device is located is obtained correspondingly.
Step S240: and judging whether the current environment sound exceeds a sound threshold value.
As a mode, a sound threshold is preset and stored in the electronic device, and the sound threshold is used as a judgment basis for a current environment sound, it can be understood that, when a current environment sound of an environment where the electronic device is located is obtained, the current environment sound is compared with the sound threshold to judge whether the current environment sound exceeds the sound threshold, where when the current environment sound is greater than the sound threshold, it may be characterized that the current environment sound exceeds the sound threshold, and when the current environment sound is not greater than the sound threshold, it may be characterized that the current environment sound does not exceed the sound threshold.
Step S250: and when the current environmental sound exceeds the sound threshold, adjusting the output sound effect of the electronic equipment in the running process of the target application program based on the current environmental sound.
When the current environmental sound exceeds the sound threshold, the current environmental sound is represented to possibly interfere with the current output sound effect of the electronic equipment, so that the electronic equipment adjusts the output sound effect of the electronic equipment in the running process of the target application program based on the current environmental sound as a mode.
Referring to fig. 3, fig. 3 is a flowchart illustrating a step S250 of the sound effect adjusting method according to the embodiment of the application shown in fig. 2. As will be explained in detail with respect to the flow shown in fig. 3, the method may specifically include the following steps:
step S251: and when the current environment sound exceeds the sound threshold, detecting whether the electronic equipment is connected with an earphone.
In this embodiment, the electronic device includes an earphone call mode and a non-earphone call mode, where the non-earphone call mode includes a hands-free mode and an earphone mode, and is used for playing a voice signal sent by the electronic device in a call, a video, and the like. In one embodiment, the electronic communication mode may be detected by determining whether the electronic device is connected with an earphone, wherein the determination may be made by looking at a state of an earphone connecting hole of the electronic device, for example, when the earphone connecting hole of the electronic device is connected with the earphone, returning to a first state value, when the earphone in the connecting hole is pulled out, returning to a second state value, and determining whether the electronic device is connected with the earphone currently by detecting the first state value and the second state value. As a mode, the Android system sends a broadcast when the earphone is inserted into and pulled out of the connection hole, so the electronic device can determine whether the earphone is connected and the call mode of the electronic device by monitoring the broadcast.
Step S252: and when the electronic equipment is connected with the earphone, starting sound effect setting aiming at the audio stream of the target application program, and adjusting the output sound effect of the electronic equipment in the running process of the target application program based on the current environmental sound.
When the electronic equipment is connected with the earphone, the representation electronic equipment is less interfered by current environmental sound in the process of running the target application program, and the output sound effect can be transmitted to the ears of a user under the smaller interference, so that the sound effect setting of the audio stream aiming at the target application program can be started to improve the effect of the output sound effect. It can be understood that, at this time, the output sound effect of the electronic device in the running process of the target application program may be adjusted based on the current environment, for example, when the current environment sound is high, the output sound effect of the electronic device in the running process of the target application program may be correspondingly improved, so as to weaken the interference of the current environment sound on the output sound effect; when the current environmental sound is low, the output sound effect of the electronic equipment in the running process of the target application program can be correspondingly reduced, so that the power consumption of the electronic equipment is reduced under the condition that the current environmental sound has small interference on the output sound effect.
Step S253: and when the earphone is not connected with the electronic equipment, closing the sound effect setting of the audio stream of the target application program.
When the electronic equipment is not connected with the earphone, the representation that the electronic equipment is greatly interfered by current environmental sound in the process of running the target application program, the output sound effect of the electronic equipment is transmitted to the ear of a user under the large interference, and the adjustment effect of the output sound effect is poor, so that the sound effect setting of the audio stream aiming at the target application program can be closed, and the power consumption of the electronic equipment is further reduced.
In another embodiment of the present application, a sound effect adjusting method is provided, which detects whether a target application program is running on an electronic device, where the target application program can output audio when running, when the target application program is running on the electronic device, identifies a type of the target application program, when the type of the target application program is a game type, obtains a current environmental sound of an environment where the electronic device is located, determines whether the current environmental sound exceeds a sound threshold, and adjusts an output sound effect of the electronic device during a running process of the target application program based on the current environmental sound when the environmental sound exceeds the sound threshold, in comparison with the sound effect adjusting method shown in fig. 1, in this embodiment, adjustment is performed when the environmental sound of the electronic device exceeds the sound threshold, so as to reduce power consumption of the electronic device and improve applicability of the electronic device. Meanwhile, when the environmental sound of the electronic equipment exceeds the sound threshold and is connected with the earphone, the sound effect setting of the audio stream of the target application program is started, and when the environmental sound of the electronic equipment exceeds the sound threshold and is not connected with the earphone, the sound effect setting of the audio stream of the target application program is closed, so that the power consumption of the electronic equipment is further reduced, and the user experience is improved.
Referring to fig. 4, fig. 4 is a schematic flow chart illustrating a sound effect adjusting method according to still another embodiment of the present application. The sound effect adjusting method is applied to the electronic equipment, wherein in the embodiment, the electronic equipment is provided with a plurality of audio channels, and each audio channel in the plurality of audio channels corresponds to different sound effect processing algorithms. As will be explained in detail with respect to the flow shown in fig. 4, the method may specifically include the following steps:
step S310: whether a target application program runs in the electronic equipment is detected, wherein the target application program can output audio when running.
Step S320: and when the target application program runs in the electronic equipment, identifying the type of the target application program.
Step S330: and when the type of the target application program is a game type, acquiring the current environment sound of the environment where the electronic equipment is located.
For the detailed description of steps S310 to S330, refer to steps S210 to S230, which are not described herein again.
Step S340: selecting at least one audio channel from the plurality of audio channels as a target audio channel based on the current ambient sound.
In this embodiment, the electronic device is provided with a plurality of audio paths, each of the plurality of audio paths corresponds to a different audio processing algorithm, and specifically, the electronic device separately adds different audio paths for different scenes according to an existing framework of an audio system, where each audio path refers to a path through which different sounds travel. As a way, after obtaining the current environmental sound of the environment where the electronic device is located, at least one audio channel corresponding to the environmental sound is obtained, it can be understood that, different sound effect processing algorithms corresponding to each audio channel may have different sound effects, for example, different volumes, different loudness, different types of sounds, and the like, when the audio data transmitted through the audio channel is output. Therefore, in this embodiment, after determining the current environmental sound of the environment where the electronic device is located, if the current environmental sound is low and the volume of the outputable sound is high, the audio channel capable of outputting high volume is selected from the multiple audio channels as the target audio channel; and if the current environment sound is high and the volume of the required output sound effect is low, correspondingly selecting an audio channel capable of outputting low volume from the multiple audio channels as a target audio channel.
Further, after the type of the target application program is obtained, at least one audio channel corresponding to the type is obtained, specifically, the audio data of the target application program is analyzed to obtain the sound type in the audio data, and then at least one audio channel is selected from the plurality of audio channels as the target audio channel according to the analyzed result, that is, one application program may correspond to the plurality of audio channels. As one way, when only one kind of sound is included in the audio data, only one of the audio paths may be selected as a target audio path; when a plurality of kinds of sounds are included in the audio data, a plurality of audio paths may be selected as the target audio path.
Taking the target application as an example of a game application, wherein the game application may include sound types such as hitting sound, running sound, and gunshot sound, so that audio channels corresponding to the hitting sound, the running sound, the gunshot sound, and the like may be respectively selected from multiple audio channels and used as target audio channels to respectively transmit the hitting sound, the running sound, the gunshot sound, and the like, so that different audio data are processed by different audio processing algorithms, and the processing effect is better.
Of course, in this embodiment, each application may also have an audio channel corresponding to it individually, that is, one application corresponds to one audio channel, and the audio channel corresponding to each application sets different sound effect processing algorithms according to the type of the application, so after the type of the application corresponding to the package name is acquired, the audio channel corresponding to the target application is acquired as the target audio channel according to the type. Taking the target application as a game application as an example, determining an audio channel from a plurality of audio channels based on the game application as a target audio channel of the game application, and transmitting an output sound effect of the electronic device in the process of running the target application.
Referring to fig. 5, fig. 5 is a flowchart illustrating a step S340 of the sound effect adjusting method according to the embodiment shown in fig. 4 of the present application. As will be explained in detail with respect to the flow shown in fig. 4, the method may specifically include the following steps:
step S341: and determining a current audio channel corresponding to the current environmental sound according to a preset relation table, wherein the preset relation table comprises the corresponding relation between the environmental sound and the audio channel.
As an embodiment, the electronic device may establish a mapping relationship between the environmental sound and the audio path in advance, and generate a mapping relationship table to be stored in the electronic device, as shown in table 3. The mapping relationship between the environmental sound and the audio path may be associated manually by a user, may be associated automatically by an electronic device, or may be associated automatically by a server, and the like, which is not limited herein.
Further, after the current environmental sound is determined, the current environmental sound is compared with a plurality of environmental sounds stored in advance in a mapping relation table one by one to obtain the environmental sound matched with the current environmental sound, and then the audio channel corresponding to the environmental sound is searched according to the mapping relation table, so that the audio channel corresponding to the current environmental sound can be obtained.
TABLE 3
Ambient sound | Audio channel |
A1 | E1 |
A2 | E2 |
A3 | E3 |
Step S342: determining the current audio path as the target audio path.
Step S350: and transmitting the output sound effect of the electronic equipment in the running process of the target application program through the target audio channel.
It can be understood that the target audio channel at least comprises one audio channel, and when the number of the audio channels is one, the original audio data is processed through a sound effect processing algorithm corresponding to the audio channel to obtain a corresponding output sound effect; when the number of the audio channels is multiple, due to the independent sound effect processing algorithm corresponding to each audio channel, the output sound effect of the electronic equipment in the operation process of the target application program is transmitted through the target audio channel, different processing can be performed on original audio data, so that different output sound effects with different sounds can be obtained, and the processing effect is better.
In a sound effect adjusting method provided in another embodiment of the present application, whether a target application is running on an electronic device is detected, where the target application is capable of outputting audio when running, when the target application is running on the electronic device, the type of the target application is identified, when the type of the target application is a game type, a current environmental sound of an environment where the electronic device is located is obtained, at least one audio channel is selected from multiple audio channels as a target audio channel based on the current environmental sound, and an output sound effect of the electronic device during the running process of the target application is transmitted through the target audio channel.
Referring to fig. 6, fig. 6 is a block diagram illustrating a sound effect adjusting apparatus 200 according to an embodiment of the present disclosure. The sound effect adjusting apparatus 200 is applied to the electronic device. As will be described below with reference to the block diagram shown in fig. 6, the sound effect adjusting apparatus 200 includes: a detection module 210, an acquisition module 220, and an adjustment module 230, wherein:
the detecting module 210 is configured to detect whether a target application is running on the electronic device, where the target application may output audio when running.
The obtaining module 220 is configured to obtain a current environmental sound of an environment where the electronic device is located when the target application is run on the electronic device. Further, the obtaining module 220 includes: an identification submodule and an acquisition submodule, wherein:
and the identification submodule is used for identifying the type of the target application program when the target application program runs in the electronic equipment.
And the obtaining submodule is used for obtaining the current environment sound of the environment where the electronic equipment is located when the type of the target application program is a game type.
An adjusting module 230, configured to adjust an output sound effect of the electronic device during the running process of the target application based on the current environmental sound. Further, the adjusting module 230 includes: a judgment submodule and an adjustment submodule, wherein:
and the judging submodule is used for judging whether the current environmental sound exceeds a sound threshold value.
And the adjusting submodule is used for adjusting the output sound effect of the electronic equipment in the running process of the target application program based on the current environment sound when the current environment sound exceeds the sound threshold. Further, the adjusting sub-module includes: detection element, opening unit and closing unit, wherein:
and the detection unit is used for detecting whether the electronic equipment is connected with an earphone or not when the current environment sound exceeds the sound threshold.
And the starting unit is used for starting sound effect setting aiming at the audio stream of the target application program when the electronic equipment is connected with the earphone, and adjusting the output sound effect of the electronic equipment in the running process of the target application program based on the current environmental sound. Further, the opening unit includes: a lifting subunit, wherein:
and the lifting subunit is used for lifting the output sound effect of the electronic equipment in the running process of the target application program based on the current environmental sound.
And the closing unit is used for closing the sound effect setting of the audio stream of the target application program when the electronic equipment is not connected with the earphone.
Further, the electronic device is provided with a plurality of audio channels, each of the plurality of audio channels corresponds to a different sound effect processing algorithm, and the adjusting module 230 further includes: a selection sub-module and a transmission sub-module, wherein:
a selection submodule for selecting at least one audio channel from the plurality of audio channels as a target audio channel based on the current ambient sound. Further, the selection submodule includes:
and the determining unit is used for determining a current audio channel corresponding to the current environmental sound according to a preset relation table, wherein the preset relation table comprises the corresponding relation between the environmental sound and the audio channel.
The determining unit is further configured to determine the current audio path as the target audio path.
And the transmission sub-module is used for transmitting the output sound effect of the electronic equipment in the running process of the target application program through the target audio channel.
It can be clearly understood by those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described apparatuses and modules may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the several embodiments provided in the present application, the coupling between the modules may be electrical, mechanical or other type of coupling.
In addition, functional modules in the embodiments of the present application may be integrated into one processing module, or each of the modules may exist alone physically, or two or more modules are integrated into one module. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode.
The sound effect adjusting device that this application embodiment provided includes detection module, acquires module and adjusting module, wherein, detection module is used for detecting whether electronic equipment operates and has the target application, wherein, the target application can export audio when operation, acquires the module and is used for working as electronic equipment operates and has during the target application, acquires the current environment sound of electronic equipment place environment, adjusting module is used for being based on current environment sound adjustment electronic equipment is in output sound among the target application operation to according to the output sound of electronic equipment place environment sound regulation electronic equipment when operating the target application, realize automatic swift configuration electronic equipment's output sound, promote the effect and the user experience of output sound.
Referring to fig. 7, a block diagram of an electronic device 100 according to an embodiment of the present disclosure is shown. The electronic device 100 may be a smart phone, a tablet computer, an electronic book, or other electronic devices capable of running an application. The electronic device 100 in the present application may include one or more of the following components: a processor 110, a memory 120, and one or more applications, wherein the one or more applications may be stored in the memory 120 and configured to be executed by the one or more processors 110, the one or more programs configured to perform a method as described in the aforementioned method embodiments.
The Memory 120 may include a Random Access Memory (RAM) or a Read-Only Memory (Read-Only Memory). The memory 120 may be used to store instructions, programs, code sets, or instruction sets. The memory 120 may include a stored program area and a stored data area, wherein the stored program area may store instructions for implementing an operating system, instructions for implementing at least one function (such as a touch function, a sound playing function, an image playing function, etc.), instructions for implementing various method embodiments described below, and the like. The storage data area may also store data created by the terminal 100 in use, such as a phonebook, audio-video data, chat log data, and the like.
Referring to fig. 8, a block diagram of a computer-readable storage medium according to an embodiment of the present application is shown. The computer-readable medium 300 has stored therein a program code that can be called by a processor to execute the method described in the above-described method embodiments.
The computer-readable storage medium 300 may be an electronic memory such as a flash memory, an EEPROM (electrically erasable programmable read only memory), an EPROM, a hard disk, or a ROM. Alternatively, the computer-readable storage medium 300 includes a non-volatile computer-readable storage medium. The computer readable storage medium 300 has storage space for program code 310 for performing any of the method steps of the method described above. The program code can be read from or written to one or more computer program products. The program code 310 may be compressed, for example, in a suitable form.
In summary, the sound effect adjusting method, the sound effect adjusting device, the electronic device, and the storage medium provided in the embodiments of the present application detect whether the electronic device runs a target application, where the target application can output audio when running, and when the electronic device runs the target application, obtain a current environmental sound of an environment where the electronic device is located, and adjust an output sound effect of the electronic device in a running process of the target application based on the current environmental sound, so as to adjust the output sound effect of the electronic device when running the target application according to the environmental sound of the environment where the electronic device is located, thereby implementing automatic and fast configuration of the output sound effect of the electronic device, and improving an effect of the output sound effect and user experience.
Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present application, and not to limit the same; although the present application has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not necessarily depart from the spirit and scope of the corresponding technical solutions in the embodiments of the present application.
Claims (6)
1. A sound effect adjusting method is applied to electronic equipment, wherein the electronic equipment is provided with a plurality of audio channels corresponding to the sound types of target application programs, each audio channel in the plurality of audio channels corresponds to a different sound effect processing algorithm, and the method comprises the following steps:
detecting whether a target application program runs in the electronic equipment, wherein the target application program can output audio when running;
when the target application program runs on the electronic equipment, acquiring current environment sound of the environment where the electronic equipment is located;
judging whether the current environment sound exceeds a sound threshold value;
when the current environmental sound exceeds the sound threshold, detecting whether an earphone is connected to the electronic equipment;
when the earphone is connected with the electronic equipment, starting sound effect setting of an audio stream aiming at the target application program, and selecting at least one audio channel from the multiple audio channels as a target audio channel based on the current environmental sound;
transmitting the output sound effect of the electronic equipment in the running process of the target application program through the target audio channel;
and when the earphone is not connected with the electronic equipment, closing the sound effect setting of the audio stream of the target application program.
2. The method of claim 1, wherein the selecting at least one audio lane from the plurality of audio lanes as a target audio lane based on the current ambient sound comprises:
determining a current audio channel corresponding to the current environmental sound according to a preset relation table, wherein the preset relation table comprises the corresponding relation between the environmental sound and the audio channel;
determining the current audio path as the target audio path.
3. The method according to claim 1, wherein the obtaining a current environment sound of an environment in which the electronic device is located when the target application is running on the electronic device comprises:
when the target application program runs on the electronic equipment, identifying the type of the target application program;
and when the type of the target application program is a game type, acquiring the current environment sound of the environment where the electronic equipment is located.
4. The utility model provides a sound effect adjusting device which characterized in that is applied to electronic equipment, electronic equipment is provided with many audio channels that correspond with the sound kind of target application program, every audio channel in many audio channels all corresponds different sound effect processing algorithm, the device includes:
the detection module is used for detecting whether a target application program runs in the electronic equipment, wherein the target application program can output audio when running;
the acquisition module is used for acquiring the current environment sound of the environment where the electronic equipment is located when the target application program runs on the electronic equipment;
the adjusting module is used for judging whether the current environmental sound exceeds a sound threshold value; when the current environmental sound exceeds the sound threshold, detecting whether an earphone is connected to the electronic equipment; when the earphone is connected with the electronic equipment, starting sound effect setting of an audio stream aiming at the target application program, and selecting at least one audio channel from the multiple audio channels as a target audio channel based on the current environmental sound; transmitting the output sound effect of the electronic equipment in the running process of the target application program through the target audio channel; and when the earphone is not connected with the electronic equipment, closing the sound effect setting of the audio stream of the target application program.
5. An electronic device comprising a memory and a processor, the memory coupled to the processor, the memory storing instructions that, when executed by the processor, the processor performs the method of any of claims 1-3.
6. A computer-readable storage medium, having stored thereon program code that can be invoked by a processor to perform the method according to any one of claims 1 to 3.
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811026569.XA CN109284080B (en) | 2018-09-04 | 2018-09-04 | Sound effect adjusting method and device, electronic equipment and storage medium |
PCT/CN2019/094933 WO2020048216A1 (en) | 2018-09-04 | 2019-07-05 | Audio effect adjustment method and apparatus, electronic device, and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811026569.XA CN109284080B (en) | 2018-09-04 | 2018-09-04 | Sound effect adjusting method and device, electronic equipment and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN109284080A CN109284080A (en) | 2019-01-29 |
CN109284080B true CN109284080B (en) | 2021-01-05 |
Family
ID=65183971
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201811026569.XA Active CN109284080B (en) | 2018-09-04 | 2018-09-04 | Sound effect adjusting method and device, electronic equipment and storage medium |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN109284080B (en) |
WO (1) | WO2020048216A1 (en) |
Families Citing this family (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109284080B (en) * | 2018-09-04 | 2021-01-05 | Oppo广东移动通信有限公司 | Sound effect adjusting method and device, electronic equipment and storage medium |
CN111741156A (en) * | 2019-03-25 | 2020-10-02 | 奇酷互联网络科技(深圳)有限公司 | Audio output method, mobile terminal and wearable device |
CN111935583B (en) * | 2020-08-24 | 2022-09-27 | Oppo(重庆)智能科技有限公司 | Earphone mode control method, earphone mode control device, terminal equipment, earphone mode control system and storage medium |
CN113220123A (en) * | 2021-05-10 | 2021-08-06 | 深圳市慧鲤科技有限公司 | Sound effect control method and device, electronic equipment and storage medium |
CN114666706B (en) * | 2021-11-30 | 2024-05-14 | 北京达佳互联信息技术有限公司 | Sound effect enhancement method, device and system |
CN116312430B (en) * | 2023-03-20 | 2024-01-02 | 广州资云科技有限公司 | Electric tone key control method, apparatus, computer device, and storage medium |
CN117201665B (en) * | 2023-08-26 | 2024-03-29 | 哈尔滨师范大学 | Data processing method, device and system |
Family Cites Families (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR100773539B1 (en) * | 2004-07-14 | 2007-11-05 | 삼성전자주식회사 | Multi channel audio data encoding/decoding method and apparatus |
US9202509B2 (en) * | 2006-09-12 | 2015-12-01 | Sonos, Inc. | Controlling and grouping in a multi-zone media system |
TWM487509U (en) * | 2013-06-19 | 2014-10-01 | 杜比實驗室特許公司 | Audio processing apparatus and electrical device |
CN105630586B (en) * | 2014-10-30 | 2020-03-24 | 联想(北京)有限公司 | Information processing method and electronic equipment |
CN104934048A (en) * | 2015-06-24 | 2015-09-23 | 小米科技有限责任公司 | Sound effect regulation method and device |
CN104951273B (en) * | 2015-06-30 | 2018-07-03 | 联想(北京)有限公司 | A kind of information processing method, electronic equipment and system |
CN105376689A (en) * | 2015-10-13 | 2016-03-02 | 广东欧珀移动通信有限公司 | Self-adaptive audio playing control method and system |
CN106126163A (en) * | 2016-06-16 | 2016-11-16 | 广东欧珀移动通信有限公司 | A kind of method adjusting audio and terminal |
CN106375576B (en) * | 2016-08-31 | 2019-08-20 | 维沃移动通信有限公司 | A kind of voice-frequency channel control method and mobile terminal |
CN107193527A (en) * | 2017-05-19 | 2017-09-22 | 深圳市金立通信设备有限公司 | A kind of audio control method, terminal and computer-readable recording medium |
CN109284080B (en) * | 2018-09-04 | 2021-01-05 | Oppo广东移动通信有限公司 | Sound effect adjusting method and device, electronic equipment and storage medium |
-
2018
- 2018-09-04 CN CN201811026569.XA patent/CN109284080B/en active Active
-
2019
- 2019-07-05 WO PCT/CN2019/094933 patent/WO2020048216A1/en active Application Filing
Also Published As
Publication number | Publication date |
---|---|
CN109284080A (en) | 2019-01-29 |
WO2020048216A1 (en) | 2020-03-12 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109284080B (en) | Sound effect adjusting method and device, electronic equipment and storage medium | |
CN109388367B (en) | Sound effect adjusting method and device, electronic equipment and storage medium | |
CN109151194B (en) | Data transmission method, device, electronic equipment and storage medium | |
CN109101216B (en) | Sound effect adjusting method and device, electronic equipment and storage medium | |
CN109271129B (en) | Sound effect adjusting method and device, electronic equipment and storage medium | |
CN110876180B (en) | Power consumption processing method and device, electronic equipment and computer readable medium | |
CN108337362A (en) | Voice interactive method, device, equipment and storage medium | |
US11587560B2 (en) | Voice interaction method, device, apparatus and server | |
CN109240641B (en) | Sound effect adjusting method and device, electronic equipment and storage medium | |
CN103986839A (en) | Method for automatically setting contextual model and mobile terminal | |
CN109286772B (en) | Sound effect adjusting method and device, electronic equipment and storage medium | |
CN109151789B (en) | Translation method, device and system and Bluetooth headset | |
US10312874B2 (en) | Volume control methods and devices, and multimedia playback control methods and devices | |
CN109271131B (en) | Earphone control method and device, electronic equipment and storage medium | |
CN111124351B (en) | Audio output method, audio output device, electronic equipment and storage medium | |
WO2020048175A1 (en) | Sound effect processing method, device, electronic device and storage medium | |
CN112233676A (en) | Intelligent device awakening method and device, electronic device and storage medium | |
CN113157240A (en) | Voice processing method, device, equipment, storage medium and computer program product | |
CN113411725B (en) | Audio playing method and device, mobile terminal and storage medium | |
CN109298846B (en) | Audio transmission method and device, electronic equipment and storage medium | |
CN113422866B (en) | Volume adjusting method and device, storage medium and electronic equipment | |
CN113660599B (en) | Speaker control method and device, mobile terminal and storage medium | |
US11580954B2 (en) | Systems and methods of handling speech audio stream interruptions | |
CN113885827A (en) | Audio playing method and device, electronic equipment, computer readable medium and product | |
CN112420043A (en) | Intelligent awakening method and device based on voice, electronic equipment and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |