CN110730408A - Audio parameter switching method and device, electronic equipment and storage medium - Google Patents

Audio parameter switching method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN110730408A
CN110730408A CN201911096552.6A CN201911096552A CN110730408A CN 110730408 A CN110730408 A CN 110730408A CN 201911096552 A CN201911096552 A CN 201911096552A CN 110730408 A CN110730408 A CN 110730408A
Authority
CN
China
Prior art keywords
audio
frame
audio frame
switching
energy
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.)
Pending
Application number
CN201911096552.6A
Other languages
Chinese (zh)
Inventor
邢文浩
张晨
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Dajia Internet Information Technology Co Ltd
Original Assignee
Beijing Dajia Internet Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Dajia Internet Information Technology Co Ltd filed Critical Beijing Dajia Internet Information Technology Co Ltd
Priority to CN201911096552.6A priority Critical patent/CN110730408A/en
Publication of CN110730408A publication Critical patent/CN110730408A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04RLOUDSPEAKERS, MICROPHONES, GRAMOPHONE PICK-UPS OR LIKE ACOUSTIC ELECTROMECHANICAL TRANSDUCERS; DEAF-AID SETS; PUBLIC ADDRESS SYSTEMS
    • H04R3/00Circuits for transducers, loudspeakers or microphones
    • H04R3/12Circuits for transducers, loudspeakers or microphones for distributing signals to two or more loudspeakers
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04RLOUDSPEAKERS, MICROPHONES, GRAMOPHONE PICK-UPS OR LIKE ACOUSTIC ELECTROMECHANICAL TRANSDUCERS; DEAF-AID SETS; PUBLIC ADDRESS SYSTEMS
    • H04R2430/00Signal processing covered by H04R, not provided for in its groups

Landscapes

  • Health & Medical Sciences (AREA)
  • General Health & Medical Sciences (AREA)
  • Otolaryngology (AREA)
  • Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Acoustics & Sound (AREA)
  • Signal Processing (AREA)
  • Telephone Function (AREA)

Abstract

The embodiment of the application discloses an audio parameter switching method, an audio parameter switching device, electronic equipment and a storage medium, relates to the technical field of audio, and solves the problem that in the prior art, tone quality is likely to be reduced and even noise is likely to occur at the moment of audio parameter switching. The specific scheme is as follows: acquiring a first instruction, wherein the first instruction is used for indicating that a first audio parameter of the electronic equipment is switched to a second audio parameter; determining audio frames with energy less than or equal to a first threshold value in N audio frames contained in a preset time length from the acquisition of a first instruction as target switching audio frames; n is greater than or equal to 1 and is an integer; and switching the first audio parameters into second audio parameters on the target audio switching frame. Based on the scheme, the probability of tone quality reduction or noise occurrence caused by audio parameter switching can be reduced or eliminated.

Description

Audio parameter switching method and device, electronic equipment and storage medium
Technical Field
The embodiment of the application relates to the technical field of audio, in particular to an audio parameter switching method and device, electronic equipment and a storage medium.
Background
With the rapid development of multimedia technology, live webcasting becomes a very common entertainment mode, and more users use electronic devices to conduct live webcasting. In the process of network live broadcast, the anchor can be live broadcast in the live broadcast room through the electronic equipment, and audience users can enter the live broadcast room of the anchor through the electronic equipment to watch the live broadcast of the anchor. The anchor can also select friends or other live users to randomly match in live broadcast to connect the microphone, the anchor and the microphone connecting users can carry out audio-video interaction after microphone connection, and audience users can watch the audio-video interaction process of the anchor and the microphone connecting users.
In the live broadcast or live broadcast with wheat, due to the influence of various factors such as network speed change, user sound effect change and the like, audio parameters (for example, parameters such as parameters of an encoder, code rate, sampling rate, Forward Error Correction (FEC), and the like) may be switched. In the prior art, when audio parameters are switched, the audio parameters are changed immediately, so that tone quality is likely to be reduced and even noise is likely to occur at the moment of switching the audio parameters.
Disclosure of Invention
The embodiment of the application provides an audio parameter switching method, an audio parameter switching device, electronic equipment and a storage medium, which can reduce or eliminate the problem of tone quality reduction or noise occurrence caused by audio parameter switching.
In order to achieve the above purpose, the embodiment of the present application adopts the following technical solutions:
in a first aspect of the embodiments of the present application, a method for switching audio parameters is provided, where the method includes: acquiring a first instruction, wherein the first instruction is used for indicating that a first audio parameter of the electronic equipment is switched to a second audio parameter; determining audio frames with energy less than or equal to a first threshold value in N audio frames contained in a preset time length from the acquisition of the first instruction as target switching audio frames; n is greater than or equal to 1 and is an integer; and switching the first audio parameter to the second audio parameter on the target audio switching frame. Based on the scheme, when the audio parameter is determined to be switched, the audio parameter is not directly switched as in the prior art, but a target audio switching frame with smaller energy is determined within the preset time length from the determination of the switching of the audio parameter, and the audio parameter is switched on the target audio switching frame, so that the influence caused by the switching of the audio parameter is smaller, and the probability of tone quality reduction or noise occurrence caused by the switching of the audio parameter can be reduced or eliminated.
With reference to the first aspect, in a possible implementation manner, the first threshold includes a preset threshold and a second threshold, where the preset threshold is smaller than the second threshold, the second threshold is energy of an audio frame with the smallest energy from a1 st audio frame to an M th audio frame from which the first instruction is obtained, M is greater than or equal to 2 and smaller than N, and M is an integer; the determining, as the target switching audio frame, an audio frame whose energy is less than or equal to the first threshold among the N audio frames included in the preset duration includes: sequentially acquiring the energy of the currently played audio frame from the 1 st audio frame; if the energy of the ith audio frame is less than or equal to the preset threshold, determining the ith audio frame as the target audio switching frame, wherein i is greater than or equal to 1 and less than or equal to M, and is an integer; if no audio frame with energy less than or equal to the preset threshold value exists from the 1 st audio frame to the Mth audio frame, if the energy of the jth audio frame is less than or equal to the second threshold value, the jth audio frame is determined as the target audio switching frame, j is greater than or equal to M +1 and less than or equal to N, and j is an integer. Based on the scheme, the audio frame with the energy less than or equal to the preset threshold value can be determined as the target audio frame by comparing the energy of the currently played audio frame with the preset threshold value. When there is no audio frame with energy less than or equal to the preset threshold in the first M audio frames, the audio frame with energy less than or equal to the second threshold (the energy of the audio frame with the minimum energy in the first M audio frames) from the M +1 th audio frame to the nth audio frame may be determined as the target audio switching frame.
With reference to the first aspect and the foregoing possible implementation manners, in another possible implementation manner, the value of M is
Figure BDA0002268504550000021
Or
Figure BDA0002268504550000022
Wherein the content of the first and second substances,
Figure BDA0002268504550000023
meaning that the rounding is done down for N/e,
Figure BDA0002268504550000024
it means rounding up N/e, e is the base of the logarithm of the natural number. Based on the scheme, the probability that an audio frame with energy smaller than the second threshold (the energy of the audio frame with the minimum energy in the first M audio frames) appears after the Mth audio frame (the M +1 th audio frame to the Nth audio frame) is larger from the moment of determining the switching of the audio parameters.
With reference to the first aspect and the foregoing possible implementation manner, in another possible implementation manner, the determining that the audio frame whose energy is less than or equal to the first threshold among the N audio frames included in the preset time duration is the target switching audio frame includes: sequentially acquiring the energy of the currently played audio frame from the 1 st audio frame starting from the acquisition of the first instruction; and if the energy of the mth audio frame is less than or equal to the preset threshold, determining the mth audio frame as the target audio switching frame, wherein m is greater than or equal to 1 and less than or equal to N, and is an integer. Based on the scheme, by comparing the energy of the currently played audio frame with the preset threshold, the audio frame with the energy less than or equal to the preset threshold from the 1 st audio frame to the nth audio frame can be determined as the target audio frame. Optionally, the target audio frame may be an audio frame whose first energy is less than or equal to a preset threshold from the 1 st audio frame to the nth audio frame.
With reference to the first aspect and the foregoing possible implementation manners, in another possible implementation manner, if the target audio switching frame does not exist in the 1 st audio frame to the nth audio frame, the method further includes: and switching the first audio parameter to the second audio parameter in the Nth audio frame. Based on the scheme, when no target audio switching frame exists from the 1 st audio frame to the nth audio frame, the first audio parameter may be switched to the second audio parameter in the nth audio frame. It is understood that the audio parameters are switched within a preset time period from the start of determining to switch the first audio parameters to the second audio parameters. If a target audio switching frame is found in the N audio frames included in the preset duration for determining the start of switching the audio parameters, the first audio parameters may be switched to the second audio parameters at the target audio switching frame. If the target audio switching frame is not found in the N audio frames contained in the preset time length for determining the start of switching the audio parameters, the first audio parameters can be switched to the second audio parameters on the Nth audio frame.
With reference to the first aspect and the foregoing possible implementation manners, in another possible implementation manner, the acquiring energy of a currently played audio frame includes: acquiring the number of sampling points in the currently played audio frame and the amplitude of each sampling point; according to the number of sampling points in the current playing audio frame and the amplitude of each sampling point, acquiring the energy of the current playing audio frame by adopting the following formula:
Figure BDA0002268504550000025
wherein k represents that the currently played audio frame is the kth audio frame, e (k) represents the energy of the currently played audio frame, L represents the number of sampling points in the currently played audio frame, and s (n) represents the amplitude of each sampling point in the currently played audio frame. Based on the scheme, the energy of the currently played audio frame can be determined according to the number of the sampling points in the currently played audio frame and the amplitude of each sampling point.
With reference to the first aspect and the foregoing possible implementation manners, in another possible implementation manner, the value of N is
Figure BDA0002268504550000026
Wherein the content of the first and second substances,
Figure BDA0002268504550000027
it means rounding down T/T, where T is the preset duration and T is the duration of an audio frame. Based on the scheme, the audio parameters can be switched in N audio frames contained in the preset time length for determining the start of switching the audio parameters.
In a second aspect of the embodiments of the present application, an audio parameter switching apparatus is provided, where the audio parameter switching apparatus includes: the electronic equipment comprises an acquisition module, a processing module and a processing module, wherein the acquisition module is configured to acquire a first instruction which is used for instructing to switch a first audio parameter of the electronic equipment into a second audio parameter; a determining module configured to determine, within a preset time period from the acquisition of the first instruction by the acquiring module, an audio frame of which the energy is less than or equal to a first threshold among N audio frames included in the preset time period as a target switching audio frame; n is greater than or equal to 1 and is an integer; a switching module configured to switch the first audio parameter to the second audio parameter on the target audio switching frame.
With reference to the second aspect, in a possible implementation manner, the first threshold includes a preset threshold and a second threshold, where the preset threshold is smaller than the second threshold, the second threshold is energy of an audio frame with the smallest energy from a1 st audio frame to an M th audio frame from which the first instruction is obtained, M is greater than or equal to 2 and smaller than N, and M is an integer; the determining module is configured to: sequentially acquiring the energy of the currently played audio frame from the 1 st audio frame; if the energy of the ith audio frame is less than or equal to the preset threshold, determining the ith audio frame as the target audio switching frame, wherein i is greater than or equal to 1 and less than or equal to M, and is an integer; if no audio frame with energy less than or equal to the preset threshold value exists from the 1 st audio frame to the Mth audio frame, if the energy of the jth audio frame is less than or equal to the second threshold value, the jth audio frame is determined as the target audio switching frame, j is greater than or equal to M +1 and less than or equal to N, and j is an integer.
With reference to the second aspect and the foregoing possible implementation manners, in another possible implementation manner, a value of M is
Figure BDA0002268504550000035
Or
Figure BDA0002268504550000036
Wherein the content of the first and second substances,
Figure BDA0002268504550000031
meaning that the rounding is done down for N/e,
Figure BDA0002268504550000032
it means rounding up N/e, e is the base of the logarithm of the natural number.
With reference to the second aspect and the foregoing possible implementation manner, in another possible implementation manner, the first threshold is a preset threshold, and the determining module is configured to: sequentially acquiring the energy of the currently played audio frame from the 1 st audio frame starting from the acquisition of the first instruction; and if the energy of the mth audio frame is less than or equal to the preset threshold, determining the mth audio frame as the target audio switching frame, wherein m is greater than or equal to 1 and less than or equal to N, and is an integer.
With reference to the second aspect and the foregoing possible implementation manner, in another possible implementation manner, if the target audio switching frame does not exist in the 1 st audio frame to the nth audio frame, the switching module is configured to: and switching the first audio parameter to the second audio parameter in the Nth audio frame.
With reference to the second aspect and the foregoing possible implementation manner, in another possible implementation manner, the determining module is configured to: acquiring the number of sampling points in a currently played audio frame and the amplitude of each sampling point: acquiring the energy of the current playing audio frame by adopting the following formula according to the number of samples in the current playing audio frame and the amplitude of each sampling point;obtaining the energy of the current playing audio frame; wherein k represents that the currently played audio frame is the kth audio frame, E (k) represents the energy of the currently played audio frame, L represents the number of sampling points in the currently played audio frame, and s (n) represents the amplitude of each sampling point in the currently played audio frame.
With reference to the second aspect and the foregoing possible implementation manners, in another possible implementation manner, the value of N is
Figure BDA0002268504550000034
And rounding the T/T downwards, wherein T is the preset time length, and T is the time length of one audio frame.
For the second aspect and various implementations of the second aspect, reference may be made to the description of corresponding effects of the first aspect and various implementations of the first aspect, and details are not repeated here.
In a third aspect of embodiments of the present application, an electronic device is provided, which includes a processor; a memory for storing the processor-executable instructions; wherein the processor is configured to execute the above instructions to implement the audio parameter switching method according to the first aspect.
In a fourth aspect of embodiments of the present application, a computer-readable storage medium is provided, where computer instructions are stored in the computer-readable storage medium, and when the computer instructions are run on an electronic device, the audio parameter switching method according to the first aspect is implemented.
In a fifth aspect of the embodiments of the present application, there is provided a computer program product, which when run on a computer, causes the computer to execute the audio parameter switching method according to the first aspect.
The technical scheme provided by the embodiment of the application can have the following beneficial effects: the method comprises the steps of obtaining a first instruction, wherein the first instruction is used for indicating that a first audio parameter of the electronic equipment is switched to a second audio parameter; determining audio frames with energy less than or equal to a first threshold value in N audio frames contained in a preset time length from the acquisition of the first instruction as target switching audio frames; and switching the first audio parameters into second audio parameters on the target audio switching frame. According to the scheme of the embodiment of the application, when the first audio parameter is determined to be switched to the second audio parameter, the audio parameter is not directly switched as in the prior art, but a target audio switching frame with smaller energy is determined within the preset time length from the start of determining the audio parameter switching, and the audio parameter is switched on the target audio switching frame. Therefore, by switching the audio parameters on the target audio switching frame with low energy, the influence caused by switching the audio parameters can be ensured to be small, and the probability of tone quality reduction or noise occurrence caused by switching the audio parameters is reduced or eliminated.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and together with the description, serve to explain the principles of the application.
Fig. 1 is a schematic diagram of an application scenario provided in an embodiment of the present application;
FIG. 2 is a schematic diagram of an implementation environment provided by an embodiment of the present application;
fig. 3 is a schematic flowchart of an audio parameter switching method according to an embodiment of the present disclosure;
fig. 4 is a first scene schematic diagram of an audio parameter switching method according to an embodiment of the present disclosure;
fig. 5 is a schematic view of a second scenario of an audio parameter switching method according to an embodiment of the present application;
FIG. 6 is a first comparison graph of the effect of the audio parameter switching method according to the present embodiment and the effect of the audio parameter switching method according to the prior art;
FIG. 7 is a diagram illustrating a comparison between the audio parameter switching method according to the present embodiment and the audio parameter switching method according to the prior art;
fig. 8 is a flowchart illustrating another audio parameter switching method according to an embodiment of the present application;
fig. 9 is a schematic composition diagram of an audio parameter switching apparatus according to an embodiment of the present application;
fig. 10 is a schematic composition diagram of an electronic device according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be described below with reference to the drawings in the embodiments of the present application. In the present application, "at least one" means one or more, "a plurality" means two or more. "and/or" describes the association relationship of the associated objects, meaning that there may be three relationships, e.g., a and/or B, which may mean: a exists alone, A and B exist simultaneously, and B exists alone, wherein A and B can be singular or plural. The character "/" generally indicates that the former and latter associated objects are in an "or" relationship. "at least one of the following" or similar expressions refer to any combination of these items, including any combination of the singular or plural items. For example, at least one (one) of a, b, or c, may represent: a, b, c, a and b, a and c, b and c, or a and b and c, wherein a, b and c can be single or multiple. In addition, for the convenience of clearly describing the technical solutions of the embodiments of the present application, in the embodiments of the present application, the words "first", "second", and the like are used to distinguish the same items or similar items with basically the same functions and actions, and those skilled in the art can understand that the words "first", "second", and the like do not limit the quantity and execution order. For example, the "first" in the first electronic device and the "second" in the second electronic device in the embodiment of the present application are only used to distinguish different electronic devices. The descriptions of the first, second, etc. appearing in the embodiments of the present application are only for illustrating and differentiating the objects, and do not represent the order or the particular limitation of the number of the devices in the embodiments of the present application, and do not constitute any limitation to the embodiments of the present application.
It is noted that, in the present application, words such as "exemplary" or "for example" are used to mean exemplary, illustrative, or descriptive. Any embodiment or design described herein as "exemplary" or "e.g.," is not necessarily to be construed as preferred or advantageous over other embodiments or designs. Rather, use of the word "exemplary" or "such as" is intended to present concepts related in a concrete fashion.
Before describing the audio parameter switching method provided by the embodiment of the present application in detail, first, a brief description is given to an application scenario and an implementation environment related to the embodiment of the present application.
First, a brief description is given of an application scenario related to an embodiment of the present application.
The audio parameter switching method provided by the embodiment of the application can be applied to scenes such as live broadcast or live broadcast microphone connection. As shown in fig. 1 (a), in a live scene, a webcast may live in a live room through an electronic device used by the webcast, and a viewer may enter the live room of the webcast through the electronic device used by the viewer to watch the live of the webcast. As shown in (b) of fig. 1, in a live-broadcast wheat-connecting scene, two or more webcasts are interacting instantaneously through the internet, and an audience user can watch the audio-video interaction process among the webcasts in a live broadcast room of the webcasts. In the above live broadcast or live broadcast and live broadcast scenarios, due to the influence of various factors such as network speed state change, sound effect change, volume adjustment, and noise reduction, audio parameters (for example, parameters of an encoder, such as a code rate, a sampling rate, and Forward Error Correction (FEC)) on the electronic device of the network anchor need to be switched, so as to ensure good sound quality. If the audio parameters are determined to be switched, the audio parameters are immediately changed, so that the tone quality is likely to be reduced and even noise is likely to occur at the moment of switching the audio parameters, and the problem of poor watching experience of a user is caused. In order to solve the problem that the tone quality is reduced and even noise occurs at the moment when the audio parameters are switched, the embodiment of the application provides an audio parameter switching method, which can reduce or eliminate the probability of the occurrence of the phenomenon that the tone quality is reduced or noise occurs due to the switching of the audio parameters when the audio parameters are switched, and improve the watching experience of a user.
Next, a brief description will be given of an implementation environment related to the embodiments of the present application.
Fig. 2 is a schematic diagram of an implementation environment provided in the embodiment of the present application. The implementation environment may include a first electronic device 110 and a server 120, and the first electronic device 110 may establish a connection with the server 120 through a wired network or a wireless network. Optionally, the implementation environment may further include a second electronic device 130, and the second electronic device 130 may also establish a connection with the server 120 through a wired network or a wireless network.
Wherein the first electronic device 110 is a device used by an anchor user. The anchor user can log in the webcast platform to perform webcast by using the first electronic device 110, and further, the first electronic device 110 can be configured with a camera device or connected with the camera device to perform video live broadcast through the camera device. In some embodiments, the first electronic device 110 may be a mobile phone, a tablet computer, a notebook computer, a desktop computer, a portable computer, or the like, and the embodiment of the present application is not limited to the specific form of the first electronic device. The first electronic device 110 is configured to implement the audio parameter switching method provided by the embodiment of the application. For example, the first electronic device 110 is configured to determine to switch a first audio parameter to a second audio parameter. For another example, the first electronic device 110 is further configured to determine a target audio switching frame, and switch the first audio parameter to the second audio parameter on the target audio switching frame.
For example, in the embodiment of the present application, the first electronic device 110 may be one electronic device or may be multiple electronic devices. For example, in a live scene, the first electronic device 110 is an electronic device used by a host user. In a live-broadcasting and live-broadcasting scene, the first electronic device 110 includes an electronic device used by a main broadcasting user and an electronic device used by a live-broadcasting user.
The server 120 is used for managing the webcast, such as managing the live interactive data between the anchor user and the audience user. The server 120 may be a single server, or may also be a server cluster composed of multiple servers, which is not limited in this embodiment of the present application.
The second electronic device 130 is a device used by the viewer user. The audience user can log in the webcast platform to watch webcast by using the second electronic device 130, and further, the audience user can interact with the anchor user through the second electronic device 130, for example, giving virtual goods to the anchor user, commenting in the anchor interface of the anchor user, and the like. The second electronic device 130 may be a mobile phone, a tablet computer, a notebook computer, a desktop computer, a portable computer, and the like, which is not limited in this embodiment.
After the application scenarios and the implementation environments related to the embodiments of the present application are described, the audio parameter switching method provided by the embodiments of the present application will be described in detail with reference to the accompanying drawings.
Referring to fig. 1-2 and fig. 3, an audio parameter switching method provided in an embodiment of the present application includes steps S301-S303.
S301, a first instruction is obtained, and the first instruction is used for indicating that a first audio parameter of the electronic equipment is switched to a second audio parameter.
Illustratively, in the live broadcast or live broadcast with microphone, the electronic device used by the anchor user and the electronic device used by the user with microphone can determine to switch the audio parameters according to the current network state, the change of the sound effect, the adjustment of the volume, the opening of the noise reduction and other conditions, so as to ensure that the sound quality of the electronic device is good. For example, the audio parameters may include, but are not limited to, parameters of the encoder, such as code rate, sampling rate, FEC settings, and the like.
Illustratively, the first audio parameter is an audio parameter before switching, and the second audio parameter is an audio parameter after switching. The first audio parameter and the second audio parameter may include one audio parameter or may include a plurality of audio parameters. For example, the first audio parameter may be bitrate 1 and the second audio parameter may be bitrate 2. For another example, the first audio parameter may also be a code rate 1 and a sampling rate 1, and the second audio parameter may be a code rate 2 and a sampling rate 2.
For example, the switching of the first audio parameter to the second audio parameter may be switching one set of audio parameters to another set of audio parameters, where values of the audio parameters in the set of audio parameters and the another set of audio parameters may be completely different or partially different. For example, the first audio parameter may include a code rate 1 and a sampling rate 1, the second audio parameter may include a code rate 2 and a sampling rate 2, and when the first audio parameter is switched to the second audio parameter, values of both the code rate and the sampling rate are changed. For another example, the first audio parameter may include a code rate 1 and a sampling rate 1, the second audio parameter may include a code rate 1 and a sampling rate 2, and when the first audio parameter is switched to the second audio parameter, only a value of the sampling rate changes.
For example, in the live broadcast or live broadcast with microphone, if the current network state is poor, the electronic device used by the anchor user or the live broadcast with microphone detects the current network state, and then determines to switch the first audio parameter (code rate 1) to the second audio parameter (code rate 2) according to the network state, so as to ensure that the sound quality of the electronic device is good under the condition of poor network state. For another example, if the sound effect is changed by the anchor user or the microphone user, after receiving the operation of changing the sound effect input by the user, the electronic device may determine to switch the first audio parameter to the second audio parameter to change the sound effect, where the second audio parameter corresponds to the audio parameter after the sound effect is switched.
S302, determining the audio frame with the energy less than or equal to the first threshold value in the N audio frames contained in the preset duration as the target switching audio frame within the preset duration from the acquisition of the first instruction.
N is an integer greater than or equal to 1.
For example, the preset duration may represent that, from the time of acquiring the first instruction indicating to switch the first audio parameter to the second audio parameter, the experience of the user listening to the audio is not affected or is less affected when the audio parameter is switched within the preset duration. For example, the preset time period may be denoted as T. For example, the preset duration may be a predefined duration or a factory configured duration. It should be noted that, when audio parameters are switched in different scenes, the preset duration may be different. For example, in a sound effect changing scene, starting from determining to switch audio parameters, switching the audio parameters within a first preset time length; and switching the audio parameters within a second preset time length from the beginning of determining switching of the audio parameters in the noise reduction scene, wherein the first preset time length and the second preset time length can be different. The embodiment of the application does not limit the specific values of the corresponding preset duration in different scenes.
For example, the specific number N of N audio frames included in the preset duration may be set to beWherein the content of the first and second substances,
Figure BDA0002268504550000062
the method comprises the following steps of rounding T/T downwards, wherein T is preset duration, and T is duration of one audio frame.
For example, the preset duration is 1s, the duration of an audio frame is 10ms, and the value of N is 100. Namely, the switching of the audio parameters is performed within 1s from the first instruction for acquiring the instruction for switching the first audio parameters to the second audio parameters, and the experience of listening to the audio by the user is not influenced. The target audio switching frame may be one audio frame of 100 audio frames included in 1s, starting from a first instruction for acquiring an instruction to switch the first audio parameter to the second audio parameter, and the energy of the target audio switching frame is less than or equal to a first threshold.
For example, as shown in fig. 4, taking the time at which the first instruction is acquired in step S301 as time T1 as an example, the target audio switching frame may be determined within the preset time period T from time T1. In fig. 4, N audio frames are included from time T1 to time T1+ T, and the target audio switch frame is one audio frame of the N audio frames included from time T1 to time T1+ T.
Two implementations of determining the target audio switching frame in step S302 are described in detail below.
In a first implementation manner, the first threshold includes a preset threshold and a second threshold, where the preset threshold is smaller than the second threshold, and the second threshold is Energy _ min of an audio frame with the smallest Energy from a1 st audio frame to an M th audio frame from which the first instruction is obtained, where M is greater than or equal to 2 and smaller than N, and M is an integer. That is, the second threshold is the energy of the audio frame with the smallest energy among the first M audio frames from the acquisition of the first instruction. For example, the preset threshold may be a value close to 0, and a specific value of the preset threshold is not limited in the embodiment of the present application.
For example, as shown in fig. 4, the second threshold may be set to the energy of the audio frame with the smallest energy from the 1 st audio frame to the mth audio frame (the first M audio frames) starting from the time t 1.
Illustratively, the value of M may be
Figure BDA0002268504550000071
Or
Figure BDA0002268504550000072
Wherein the content of the first and second substances,
Figure BDA0002268504550000073
meaning that the rounding is done down for N/e,
Figure BDA0002268504550000074
it means rounding up N/e, e is the base of the logarithm of the natural number.
As shown in FIG. 5, the energy of the 1 st audio frame to the Nth audio frame is arranged in N! And (4) carrying out the following steps. For a certain fixed M, if the audio frame with the minimum energy is the P-th audio frame (M < P ≦ N), the probability that the audio frame with the minimum energy in the previous P-1 audio frames (the 1 st audio frame to the P-1 st audio frame) is in the previous M audio frames is M/(P-1) needs to be satisfied. That is, when the audio frame with the minimum energy is the pth audio frame and the pth audio frame is the target audio switching frame, the energy from the M +1 th audio frame to the P-1 th audio frame is greater than the energy of the audio frame with the minimum energy from the 1 st audio frame to the mth audio frame. Then for all possible audio frames P, after examining M audio frames, the probability of finding the minimum point of the audio frame energy is:
Figure BDA0002268504550000075
if N is large enough, and
Figure BDA0002268504550000076
then p (x) x lnx.
Taking the derivative of p (x) and making the derivative 0, x ═ e can be obtained-1Thus obtaining M-N/e. That is, when the value of M is N/e, starting from the determination of switching the audio parameters, the second threshold of the energy ratio (the first M audio frames) appears after the Mth audio frameThe energy of the audio frame with the least energy in the frame) is greater. Optionally, the value of M may specifically be
Figure BDA0002268504550000077
Or
Figure BDA0002268504550000078
In the embodiment of the present application, it is not limited to whether the value of M is specifically N/e rounding up or N/e rounding down.
It will be appreciated that, as shown in FIG. 4, M has a value ofOr
Figure BDA00022685045500000710
In the time, the probability that an audio frame with energy smaller than that of the audio frame with the minimum energy in the previous M audio frames appears from the (M + 1) th audio frame to the Nth audio frame is higher.
For example, in this implementation, the step S302 may include steps a 1-c 1.
And a1, sequentially acquiring the energy of the currently played audio frame from the 1 st audio frame from which the first instruction is acquired.
For example, the obtaining the energy of the currently played audio frame may include: acquiring the number of sampling points in a currently played audio frame and the amplitude of each sampling point; according to the number of samples in the currently played audio frame and the amplitude of each sampling point, the energy of the currently played audio frame is obtained by adopting the following formula:
wherein k represents that the currently played audio frame is the kth audio frame, E (k) represents the energy of the currently played audio frame, L represents the number of sampling points in the currently played audio frame, and s (n) represents the amplitude of each sampling point in the currently played audio frame.
It can be understood that, when the energy of the currently played audio frame is obtained, the energy of the currently played audio frame can also be obtained through an equivalent deformation form of the above formula.
Illustratively, taking the time of acquiring the first instruction as time t1 as an example, the energy of the currently played audio frame is sequentially acquired according to the above formula from time t 1. For example, as shown in fig. 4, the energy E (1) of the currently played 1 st audio frame, the energy E (2) of the currently played 2 nd audio frame, and so on may be obtained sequentially from the time t 1.
Step b1, if the energy of the ith audio frame is less than or equal to the preset threshold, determining the ith audio frame as the target audio switching frame, wherein i is greater than or equal to 1 and less than or equal to M, and i is an integer.
For example, according to the step a1, the energy of the 1 st audio frame to the mth audio frame may be sequentially obtained from the time t1, and the audio frame whose energy is less than or equal to the preset threshold value in the 1 st audio frame to the mth audio frame is determined as the target audio switching frame, that is, the energy of the target audio switching frame is close to 0, so the energy of the target audio switching frame determined in this embodiment is smaller.
For example, the target audio switching frame may be an audio frame whose first energy is less than or equal to a preset threshold from the 1 st audio frame to the mth audio frame starting at time t 1. For example, the energy of the currently played audio frame may be sequentially calculated from time t1, and whether the energy of the currently played audio frame is less than or equal to a preset threshold is compared, if the energy of the currently played audio frame is less than or equal to the preset threshold, the audio frame is determined as the target audio switching frame, and the acquisition of the energy of the audio frames after the target audio switching frame is stopped.
For example, as shown in fig. 4, from time t1, the energy of the currently played 1 st audio frame is obtained, if the energy of the 1 st audio frame is greater than the preset threshold, the energy of the currently played 2 nd audio frame is obtained, and if the energy of the 2 nd audio frame is less than the preset threshold, the 2 nd audio frame is determined as the target audio switching frame, and the obtaining of the energy of the audio frames after the 2 nd audio frame is stopped.
Step c1, if there is no audio frame with energy less than or equal to the preset threshold from the 1 st audio frame to the Mth audio frame, if the energy of the jth audio frame is less than or equal to the second threshold, determining the jth audio frame as the target audio switching frame, where j is greater than or equal to M +1 and less than or equal to N, and j is an integer.
For example, if the energy of the 1 st audio frame to the mth audio frame is greater than the preset threshold, that is, there is no audio frame with energy close to 0 in the 1 st audio frame to the mth audio frame, the audio frame with energy less than or equal to the second threshold (the energy of the audio frame with the least energy in the 1 st audio frame to the mth audio frame) may be determined as the target audio switch frame from the M +1 st audio frame to the nth audio frame.
For example, the target audio switching frame may be an audio frame with a first energy less than or equal to a second threshold from the M +1 th audio frame to the nth audio frame. For example, the energy of the currently played audio frame is sequentially calculated from the M +1 th audio frame, and whether the energy of the currently played audio frame is less than or equal to a second threshold is compared, if the energy of the currently played audio frame is less than or equal to the second threshold, the audio frame is determined as a target audio switching frame, and the acquisition of the energy of the audio frames after the target audio switching frame is stopped.
For example, as shown in fig. 4, if the energy from the 1 st audio frame to the mth audio frame is greater than the preset threshold, the energy of the currently played M +1 th audio frame is obtained from the M +1 th audio frame, if the energy of the M +1 th audio frame is greater than the second threshold (the energy of the audio frame with the lowest energy from the 1 st audio frame to the mth audio frame), the energy of the currently played M +2 th audio frame is obtained, and if the energy of the M +2 th audio frame is less than the second threshold, the M +2 th audio frame is determined as the target audio switching frame, and the obtaining of the energy of the audio frames after the M +2 th audio frame is stopped.
In a second implementation manner, the first threshold is a preset threshold, and the step S302 may include: step a 2-step b 2.
And a2, sequentially acquiring the energy of the currently played audio frame from the 1 st audio frame from which the first instruction is acquired.
It is understood that, the specific implementation manner of step a2 can refer to step a1, which is not described herein again.
Step b2, if the energy of the mth audio frame is less than or equal to the preset threshold, determining the mth audio frame as the target audio switching frame, wherein m is greater than or equal to 1 and less than or equal to N, and m is an integer.
For example, from time t1 when the first instruction is obtained, the audio frame with the first energy less than or equal to the preset threshold from the 1 st audio frame to the nth audio frame may be determined as the target audio switching frame. Namely, from the time t1, sequentially calculating the energy of the currently played audio frame, comparing whether the energy of the currently played audio frame is less than or equal to a preset threshold, determining the audio frame with the energy of the first currently played audio frame being less than or equal to the preset threshold as a target audio switching frame, and stopping acquiring the energy of the audio frame after the target audio switching frame.
For example, as shown in fig. 4, starting from time t1, the energy of the currently played 1 st audio frame is obtained, and it is compared whether the energy of the first audio frame is less than or equal to a preset threshold. If the energy of the 1 st audio frame is larger than a preset threshold value, the energy of the currently played 2 nd audio frame is acquired, if the energy of the 2 nd audio frame is larger than the preset threshold value, the energy of the currently played 3 rd audio frame is acquired, if the energy of the 3 rd audio frame is smaller than the preset threshold value, the 3 rd audio frame is determined as a target audio switching frame, and the acquisition of the energy of the audio frames after the 3 rd audio frame is stopped.
It should be noted that, the manner of determining the target audio switching frame in the above steps a 1-c 1 and the manner of determining the target audio switching frame in the above steps a 2-b 2 may be parallel, and the first audio frame satisfying the condition in the two manners is determined as the target audio switching frame.
It can be understood that, in the embodiment of the present application, when the first instruction for switching the first audio parameter to the second audio parameter is obtained, the audio parameter is not immediately switched, but the target audio switching frame with smaller energy is determined within the preset time length from the obtaining of the first instruction, so that when the audio parameter is switched in the target audio switching frame with smaller energy, the probability of sound quality degradation or noise occurrence caused by the change of the audio parameter can be reduced or eliminated.
And S303, switching the first audio parameter into a second audio parameter on the target audio switching frame.
For example, if the target audio switching frame exists in the 1 st audio frame to the nth audio frame, step S303 may switch the first audio parameter to the second audio parameter on the target audio switching frame determined in step S302.
For example, as shown in fig. 4, if the target audio switch frame determined in step S302 is the M +2 th audio frame, the M +2 th audio frame is one of the N audio frames included from the time T1 to the time T1+ T. The electronic device may switch the first audio parameter to the second audio parameter over the M +2 th audio frame.
It can be understood that, when determining to switch the audio parameter, the embodiment of the present application does not directly switch the audio parameter as in the prior art, but determines a target audio switching frame with smaller energy within a preset time period from the acquisition of a first instruction for switching a first audio parameter to a second audio parameter, and switches the audio parameter on the target audio switching frame, thereby ensuring that the influence caused by switching the audio parameter is smaller, and reducing or eliminating the probability of tone quality degradation or noise occurrence caused by switching the audio parameter.
Illustratively, fig. 6 is a comparison graph of the effect of the scheme of the first implementation manner in step S302 and the scheme in the prior art. As shown in fig. 6, starting from time t1 when the first instruction is obtained, the audio frame with the minimum energy in the first M audio frames is the Q-th audio frame, and the audio frame from the M + 1-th audio frame to the N-th audio frame whose first energy is smaller than the energy of the Q-th audio frame is the M + 3-th audio frame, so that the M + 3-th audio frame is determined as the target audio switching frame. As shown in spectrum 1 in fig. 6, with the scheme in the prior art, the audio parameters are switched immediately at time t1 when the first instruction is acquired, but since the energy of the audio frame at time t1 is large, noise occurs when the audio parameters are switched at a point with large energy, and the user experience is poor. As shown in a spectrum 2 in fig. 6, at a time t1 when the first instruction is obtained, the audio parameter is not switched immediately, but a target audio switching frame (M +3 th audio frame) with smaller energy within a preset time duration is determined from a time t1, and the audio parameter is switched on the M +3 th audio frame, so that no noise occurs when the audio parameter is switched, and compared with the prior art, the phenomenon of noise occurrence caused by audio parameter switching is eliminated, and user experience is improved.
Illustratively, fig. 7 is a comparison graph of the effect of the solution of the second implementation manner adopted in step S302 and the solution in the prior art. As shown in fig. 7, the energy of the currently played audio frame is sequentially calculated from the time t1 when the first instruction is obtained, and the audio frame with the first energy smaller than the preset threshold (the energy is close to 0) from the 1 st audio frame to the nth audio frame from the time t1 is determined as the target audio switching frame, where the R-th audio frame in fig. 7 is the target audio switching frame. As shown in spectrum 1 in fig. 7, with the scheme in the prior art, the audio parameter is switched immediately at time t1 when the audio parameter is determined to be switched, but the energy of the audio frame is large at this time, so noise occurs when the audio parameter is switched at a point with large energy, and the user experience is poor. As shown in a spectrum 2 in fig. 7, at the time t1 when the first instruction is obtained, the audio parameter is not switched immediately, but a target audio switching frame (an R-th audio frame) with a smaller energy within a preset time duration is determined from the time t1, and the audio parameter is switched on the R-th audio frame, so that no noise occurs when the audio parameter is switched, and user experience is improved compared with the prior art.
The embodiment of the application provides an audio parameter switching method, which comprises the steps of obtaining a first instruction, wherein the first instruction is used for indicating to switch a first audio parameter into a second audio parameter; determining audio frames with energy less than or equal to a first threshold value in N audio frames contained in a preset time length from the acquisition of a first instruction as target switching audio frames; and switching the first audio parameters into second audio parameters on the target audio switching frame. In this embodiment, when the first instruction for switching the first audio parameter to the second audio parameter is obtained, the audio parameter is not directly switched as in the prior art, but a target audio switching frame with smaller energy is determined within a preset time length from the obtaining of the first instruction, and the audio parameter is switched on the target audio switching frame. Therefore, by switching the audio parameters on the target audio switching frame with low energy, the influence caused by switching the audio parameters can be ensured to be small, and the probability of tone quality reduction or noise occurrence caused by switching the audio parameters is reduced or eliminated.
For example, as shown in fig. 8, after the steps S301 to S302, if it is determined that the target audio switching frame does not exist in the 1 st audio frame to the nth audio frame, the method further includes step S304.
S304, if no target audio switching frame exists from the 1 st audio frame to the Nth audio frame, switching the first audio parameter to the second audio parameter on the Nth audio frame.
For example, in a first implementation manner corresponding to step S302, the absence of the target audio switching frame from the 1 st audio frame to the nth audio frame in step S304 includes: audio frames with energy less than or equal to a preset threshold do not exist from the 1 st audio frame to the Mth audio frame, and audio frames with energy less than or equal to a second threshold do not exist from the M +1 th audio frame to the Nth audio frame. In this case, the first audio parameter may be switched to the second audio parameter on the nth audio frame.
For example, referring to fig. 4, if the energy from the 1 st audio frame to the mth audio frame is greater than the preset threshold, and the energy from the M +1 th audio frame to the nth audio frame is greater than the energy of the audio frame with the minimum energy in the previous M audio frames, it is determined that no target audio switching frame exists from the 1 st audio frame to the nth audio frame, and the audio parameter may be switched on the nth audio frame.
For example, in a second implementation manner corresponding to step S302, the absence of the target audio switching frame from the 1 st audio frame to the nth audio frame in step S304 includes: audio frames with energy less than or equal to a preset threshold value do not exist in the 1 st audio frame to the Nth audio frame. In this case, the first audio parameter may be switched to the second audio parameter on the nth audio frame.
For example, as shown in fig. 4, if the energies of the 1 st audio frame to the nth audio frame are all greater than the preset threshold, it is determined that no target audio switching frame exists in the 1 st audio frame to the nth audio frame, and the audio parameter may be switched on the nth audio frame.
It can be understood that, in the embodiment of the present application, the switching of the audio parameters is performed within a preset time length (T) from the acquisition of the first instruction for switching the first audio parameter to the second audio parameter. That is, the time point at which the audio parameter is switched is within the time range from the time T1 to the time T1+ T at which the audio parameter is determined to be switched. Specifically, if a target audio switching frame is found from N audio frames included from time T1 to time T1+ T, the first audio parameter may be switched to the second audio parameter at the target audio switching frame. From the N audio frames included from the time T1 to the time T1+ T, if the target audio switching frame is not found, the first audio parameter may be switched to the second audio parameter on the nth audio frame.
The embodiment of the application provides an audio parameter switching method, which comprises the steps of obtaining a first instruction, wherein the first instruction is used for indicating to switch a first audio parameter into a second audio parameter; determining audio frames with energy less than or equal to a first threshold value in N audio frames contained in a preset time length from the acquisition of a first instruction as target switching audio frames; switching the first audio parameter into a second audio parameter on the target audio switching frame; and if the target audio switching frame does not exist from the 1 st audio frame to the Nth audio frame, switching the first audio parameter into the second audio parameter on the Nth audio frame. In this embodiment, when the first instruction for switching the first audio parameter to the second audio parameter is obtained, the audio parameter is not directly switched as in the prior art, but a target audio switching frame with smaller energy is determined within a preset time length from the obtaining of the first instruction, and the audio parameter is switched on the target audio switching frame. Therefore, by switching the audio parameters on the target audio switching frame with low energy, the influence caused by switching the audio parameters can be ensured to be small, and the probability of tone quality reduction or noise occurrence caused by switching the audio parameters is reduced or eliminated. And when no target audio switching frame exists from the 1 st audio frame to the Nth audio frame, the first audio parameter is switched to the second audio parameter on the Nth audio frame, so that the influence on user experience caused by too long delay of switching the audio parameters is avoided.
Fig. 9 is a schematic composition diagram of an audio parameter switching apparatus according to an embodiment of the present application. As shown in fig. 9, the audio parameter switching apparatus 900 includes an obtaining module 901, a determining module 901, and a switching module 903.
The obtaining module 901 is configured to obtain a first instruction, where the first instruction is used to instruct to switch a first audio parameter of the electronic device to a second audio parameter.
A determining module 902, configured to determine, within a preset time period from the acquisition of the first instruction by the acquiring module 901, an audio frame, of the N audio frames included in the preset time period, whose energy is less than or equal to the first threshold, as a target handover audio frame. N is greater than or equal to 1 and is an integer. Optionally, the value of N is
Figure BDA0002268504550000111
Wherein, T is a preset duration, and T is the duration of one audio frame.
A switching module 903 configured to switch the first audio parameter to the second audio parameter on the target audio switching frame.
Optionally, the first threshold includes a preset threshold and a second threshold, where the preset threshold is smaller than the second threshold, the second threshold is energy of an audio frame with the smallest energy from the 1 st audio frame to the M th audio frame from the time when the obtaining module 901 obtains the first instruction, M is greater than or equal to 2 and smaller than N, and M is an integer. The determining module 902, configured to:
the energy of the currently played audio frame is sequentially acquired from the 1 st audio frame from which the acquiring module 901 acquires the first instruction.
And if the energy of the ith audio frame is less than or equal to a preset threshold value, determining the ith audio frame as a target audio switching frame, wherein i is greater than or equal to 1 and less than or equal to M and is an integer.
If no audio frame with energy less than or equal to a preset threshold value exists from the 1 st audio frame to the Mth audio frame, if the energy of the jth audio frame is less than or equal to a second threshold value, determining the jth audio frame as a target audio switching frame, wherein j is greater than or equal to M +1 and less than or equal to N, and j is an integer.
Optionally, the value of M may be
Figure BDA0002268504550000112
Or
Figure BDA0002268504550000113
Wherein the content of the first and second substances,meaning that the rounding is done down for N/e,
Figure BDA0002268504550000115
it means rounding up N/e, e is the base of the logarithm of the natural number.
Optionally, the first threshold is a preset threshold, and the determining module 902 is configured to:
the energy of the currently played audio frame is sequentially acquired from the 1 st audio frame from which the acquiring module 901 acquires the first instruction.
And if the energy of the mth audio frame is less than or equal to the preset threshold, determining the mth audio frame as a target audio switching frame, wherein m is greater than or equal to 1 and less than or equal to N, and is an integer.
Optionally, the determining module 902 is configured to:
acquiring the number of sampling points in a currently played audio frame and the amplitude of each sampling point;
according to the number of samples in the currently played audio frame and the amplitude of each sampling point, the energy of the currently played audio frame is obtained by adopting the following formula:
wherein k represents that the currently played audio frame is the kth audio frame, E (k) represents the energy of the currently played audio frame, L represents the number of sampling points in the currently played audio frame, and s (n) represents the amplitude of each sampling point in the currently played audio frame.
Optionally, if there is no target audio switching frame from the 1 st audio frame to the nth audio frame, the switching module 903 is configured to: and switching the first audio parameters into the second audio parameters on the Nth audio frame.
The embodiment of the application provides an audio parameter switching device which comprises an acquisition module, a determination module and a switching module. The obtaining module is configured to obtain a first instruction, wherein the first instruction is used for indicating that the first audio parameter is switched to the second audio parameter; the determining module is configured to determine, within a preset time length from the acquisition of the first instruction by the acquisition module, an audio frame of which the energy is less than or equal to a first threshold value among the N audio frames included in the preset time length as a target switching audio frame; a switching module configured to switch the first audio parameter to the second audio parameter on the target audio switching frame. In this embodiment, when the first instruction for switching the first audio parameter to the second audio parameter is obtained, the audio parameter is not directly switched as in the prior art, but a target audio switching frame with smaller energy is determined within a preset time length from the obtaining of the first instruction, and the audio parameter is switched on the target audio switching frame. Therefore, by switching the audio parameters on the target audio switching frame with low energy, the influence caused by switching the audio parameters can be ensured to be small, and the probability of tone quality reduction or noise occurrence caused by switching the audio parameters is reduced or eliminated.
With regard to the apparatus in the above-described embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.
Exemplarily, fig. 10 is a schematic composition diagram of an electronic device provided in an embodiment of the present application. The electronic device 1000 may include one or more processors 1001 and one or more memories 1002. The processor 1001 may include an Application Processor (AP), a video codec, and the like. The memory 1002 stores at least one instruction, which is loaded and executed by the processor 1001 to implement the audio parameter switching method provided by the above-mentioned method embodiments. The memory 1002 may be a read-only memory (ROM) or other type of static storage device that may store static information and instructions, a Random Access Memory (RAM), or the like.
It should be noted that the electronic device 1000 may further include components such as a camera, an audio module, a microphone, a speaker, a wireless communication module, an antenna, and the like, and certainly, the electronic device 1000 may further include other components for implementing functions of the device, which is not described herein again.
The embodiment of the present application further provides a computer-readable storage medium, where instructions are stored on the computer-readable storage medium, and when the instructions in the storage medium are executed by a processor of a computer device, the instructions enable a computer to execute the audio parameter switching method provided by the above-described illustrated embodiment.
Embodiments of the present application further provide a computer program product containing instructions, which when run on a computer, cause the computer device to execute the audio parameter switching method provided by the above-described illustrated embodiments.
Other embodiments of the present application will be apparent to those skilled in the art from consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the invention following, in general, the principles of the application and including such departures from the present disclosure as come within known or customary practice within the art to which the invention pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the application being indicated by the following claims.
It will be understood that the present application is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the application is limited only by the appended claims.
Those skilled in the art will recognize that in one or more of the examples described above, the functions described herein may be implemented in hardware, software, firmware, or any combination thereof. When implemented in software, the functions may be stored on or transmitted over as one or more instructions or code on a computer-readable medium. Computer-readable media includes both computer storage media and communication media including any medium that facilitates transfer of a computer program from one place to another. A storage media may be any available media that can be accessed by a general purpose or special purpose computer.
The above-mentioned embodiments, objects, technical solutions and advantages of the present application are further described in detail, it should be understood that the above-mentioned embodiments are only examples of the present application, and are not intended to limit the scope of the present application, and any modifications, equivalent substitutions, improvements and the like made on the basis of the technical solutions of the present application should be included in the scope of the present application.

Claims (10)

1. An audio parameter switching method, the method comprising:
acquiring a first instruction, wherein the first instruction is used for indicating that a first audio parameter of the electronic equipment is switched to a second audio parameter;
determining audio frames with energy less than or equal to a first threshold value in the N audio frames contained in the preset duration as target switching audio frames within the preset duration from the acquisition of the first instruction; n is greater than or equal to 1 and is an integer;
and switching the first audio parameters to the second audio parameters on the target audio switching frame.
2. The method according to claim 1, wherein the first threshold includes a preset threshold and a second threshold, the preset threshold is smaller than the second threshold, the second threshold is energy of an audio frame with minimum energy from a1 st audio frame to an Mth audio frame from which the first instruction is obtained, M is greater than or equal to 2 and smaller than N, and M is an integer; determining the audio frame with the energy less than or equal to the first threshold among the N audio frames included in the preset duration as the target switching audio frame, including:
sequentially acquiring the energy of the currently played audio frame from the 1 st audio frame;
if the energy of the ith audio frame is less than or equal to the preset threshold, determining the ith audio frame as the target audio switching frame, wherein i is greater than or equal to 1 and less than or equal to M, and is an integer;
if no audio frame with energy less than or equal to the preset threshold value exists from the 1 st audio frame to the Mth audio frame, if the energy of the jth audio frame is less than or equal to the second threshold value, determining the jth audio frame as the target audio switching frame, wherein j is greater than or equal to M +1 and less than or equal to N, and j is an integer.
3. The method of claim 2, wherein M has a value of
Figure FDA0002268504540000012
OrWherein the content of the first and second substances,
Figure FDA0002268504540000014
Figure FDA0002268504540000015
meaning that the rounding is done down for N/e,
Figure FDA0002268504540000016
the expression is rounding up for N/e, and e is the base of the logarithm of the natural number.
4. The method according to claim 1, wherein the first threshold is a preset threshold, and the determining that an audio frame with an energy less than or equal to the first threshold among the N audio frames included in the preset time period is a target switching audio frame comprises:
sequentially acquiring the energy of the currently played audio frame from the 1 st audio frame starting from the acquisition of the first instruction;
if the energy of the mth audio frame is less than or equal to the preset threshold, determining the mth audio frame as the target audio switching frame, wherein m is greater than or equal to 1 and less than or equal to N, and is an integer.
5. The method according to any of claims 2-4, wherein if the target audio switch frame does not exist in the 1 st audio frame to the Nth audio frame, the method further comprises:
switching the first audio parameter to the second audio parameter on the Nth audio frame.
6. The method according to any of claims 2-4, wherein said obtaining the energy of the currently playing audio frame comprises:
acquiring the number of sampling points in the currently played audio frame and the amplitude of each sampling point;
according to the number of samples in the currently played audio frame and the amplitude of each sampling point, acquiring the energy of the currently played audio frame by adopting the following formula:
Figure FDA0002268504540000011
wherein k represents that the currently played audio frame is the kth audio frame, E (k) represents the energy of the currently played audio frame, L represents the number of sampling points in the currently played audio frame, and s (n) represents the amplitude of each sampling point in the currently played audio frame.
7. The method of any one of claims 1-4, wherein N is at a value of
Figure FDA0002268504540000017
Wherein the content of the first and second substances,and rounding the T/T downwards, wherein T is the preset duration, and T is the duration of one audio frame.
8. An audio parameter switching apparatus, comprising:
the electronic equipment comprises an acquisition module, a processing module and a processing module, wherein the acquisition module is configured to acquire a first instruction which is used for instructing to switch a first audio parameter of the electronic equipment into a second audio parameter;
the determining module is configured to determine, within a preset time length from the acquisition of the first instruction by the acquiring module, an audio frame of which the energy is less than or equal to a first threshold among the N audio frames included in the preset time length as a target switching audio frame; n is greater than or equal to 1 and is an integer;
a switching module configured to switch the first audio parameter to the second audio parameter on the target audio switching frame.
9. An electronic device, comprising:
a processor;
a memory for storing the processor-executable instructions;
wherein the processor is configured to execute the instructions to implement the audio parameter switching method of any one of claims 1 to 7.
10. A computer-readable storage medium having computer instructions stored thereon, wherein the computer instructions, when executed on an electronic device, implement the audio parameter switching method according to any one of claims 1 to 7.
CN201911096552.6A 2019-11-11 2019-11-11 Audio parameter switching method and device, electronic equipment and storage medium Pending CN110730408A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911096552.6A CN110730408A (en) 2019-11-11 2019-11-11 Audio parameter switching method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911096552.6A CN110730408A (en) 2019-11-11 2019-11-11 Audio parameter switching method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN110730408A true CN110730408A (en) 2020-01-24

Family

ID=69223852

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911096552.6A Pending CN110730408A (en) 2019-11-11 2019-11-11 Audio parameter switching method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN110730408A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111883147A (en) * 2020-07-23 2020-11-03 北京达佳互联信息技术有限公司 Audio data processing method and device, computer equipment and storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102099856A (en) * 2008-07-17 2011-06-15 弗劳恩霍夫应用研究促进协会 Audio encoding/decoding scheme having a switchable bypass
CN108352165A (en) * 2015-11-09 2018-07-31 索尼公司 Decoding apparatus, coding/decoding method and program

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102099856A (en) * 2008-07-17 2011-06-15 弗劳恩霍夫应用研究促进协会 Audio encoding/decoding scheme having a switchable bypass
CN108352165A (en) * 2015-11-09 2018-07-31 索尼公司 Decoding apparatus, coding/decoding method and program

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111883147A (en) * 2020-07-23 2020-11-03 北京达佳互联信息技术有限公司 Audio data processing method and device, computer equipment and storage medium
CN111883147B (en) * 2020-07-23 2024-05-07 北京达佳互联信息技术有限公司 Audio data processing method, device, computer equipment and storage medium

Similar Documents

Publication Publication Date Title
US20170171278A1 (en) Method and electronic device for continuously playing video
WO2021034870A1 (en) Multiple device conferencing with improved destination playback
EP3846020A1 (en) Sound effect adjusting method and apparatus, electronic device, and storage medium
US11405448B1 (en) Systems and methods for adaptively improving the perceived quality of a video conference by passive users
CN105099949A (en) Jitter buffer control based on monitoring for dynamic states of delay jitter and conversation
CN104464743B (en) Method for playing background music in voice chat room and mobile terminal
US20150134846A1 (en) Method and apparatus for media segment request retry control
US11870940B2 (en) Method and system for facilitating high-fidelity audio sharing
CN112423075A (en) Audio and video timestamp processing method and device, electronic equipment and storage medium
US20120240180A1 (en) Set-top box, earphone, and multimedia playing method
US10893333B2 (en) Video playing method, device and storage
US20170171497A1 (en) Method and Device for Automatically Adjusting Volume
CN110992920B (en) Live broadcasting chorus method and device, electronic equipment and storage medium
JP7311707B2 (en) Human-machine interaction processing method
CN110730408A (en) Audio parameter switching method and device, electronic equipment and storage medium
CN112423074B (en) Audio and video synchronization processing method and device, electronic equipment and storage medium
US8976223B1 (en) Speaker switching in multiway conversation
CN112565876A (en) Screen projection method, device, equipment, system and storage medium
US20230146871A1 (en) Audio data processing method and apparatus, device, and storage medium
CN104869347A (en) Video calling method and apparatus
CN110061814B (en) Voice delay jitter control method and device, electronic equipment and storage medium
CN108833825B (en) Method, device, equipment and storage medium for determining speaker terminal in video conference
US20230124470A1 (en) Enhancing musical sound during a networked conference
CN111954041A (en) Video loading method, computer equipment and readable storage medium
CN106776010B (en) Resource allocation method and terminal

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
RJ01 Rejection of invention patent application after publication

Application publication date: 20200124

RJ01 Rejection of invention patent application after publication