Audio processing method and device, electronic equipment, storage medium and program product
By performing attitude detection and audio attenuation coefficient adjustment on audio devices, the problems of high cost and low accuracy in audio calibration are solved, achieving efficient and low-cost audio calibration that is applicable to a variety of audio devices.
Patent Information
- Application Number
- CN202411119138.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-14
- Publication Date
- 2026-03-03
AI Technical Summary
Existing technologies for audio calibration of large audio equipment are costly and inaccurate, and do not take into account the impact of environment and equipment posture on audio signals.
By performing attitude detection on the audio device, the audio attenuation coefficient is obtained, and the audio signal is compensated according to the device's attitude and the surrounding environment to obtain the target audio signal.
It reduces the cost of audio calibration, improves the accuracy of audio calibration, and expands the application range to be suitable for more types of audio devices.
Smart Images

Figure CN121603854A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of audio processing technology, specifically to an audio processing method, apparatus, electronic device, storage medium, and program product. Background Technology
[0002] With the development of smart device technology, the application of audio devices is becoming more and more widespread, and people's requirements for audio listening quality are also getting higher and higher.
[0003] Under current technology, some large audio equipment typically uses multiple professional test microphones for audio testing and calibration to improve the audio listening effect.
[0004] However, this method usually requires the use of expensive, specialized test microphones for audio testing and calibration, and does not take into account the influence of environmental and other factors on the audio signal. The cost of audio calibration is high, and the accuracy of calibration is not high. Summary of the Invention
[0005] The purpose of this application is to provide an audio processing method, apparatus, electronic device, storage medium, and program product that balances the cost and accuracy of audio calibration during audio calibration.
[0006] On one hand, this application provides an audio processing method, the method including:
[0007] Perform attitude detection on the audio device to obtain its current device attitude;
[0008] Obtain the audio attenuation coefficient between the target user's location and the audio device's location; the audio attenuation coefficient represents the impact of the audio device's surrounding environment and signal transmission distance on the attenuation of the audio signal;
[0009] The audio attenuation coefficient is adjusted according to the device's orientation to obtain the target attenuation coefficient.
[0010] The source audio signal is compensated based on the target attenuation coefficient to obtain the target audio signal to be played.
[0011] In one embodiment, the audio device is subjected to attitude detection to obtain its current device attitude, including:
[0012] Send an ultrasonic sweep signal in a specified direction;
[0013] Detect whether an ultrasonic reflection signal based on the ultrasonic sweep frequency signal is received;
[0014] If no ultrasonic reflection signal is received within the set time period, it is determined that the signal blockage status of the audio device is not blocked; the signal blockage status indicates whether the signal transmitter of the audio device is blocked.
[0015] If an ultrasonic reflection signal is received within the set time period, it is determined that the signal of the audio device is blocked, and the distance to the obstacle is determined based on the interval between the ultrasonic sweep signal and the ultrasonic reflection signal and the speed of sound transmission.
[0016] The device's attitude is determined based on the signal obstruction status and the distance to obstacles.
[0017] In one embodiment, determining the device attitude based on the signal obstruction state and the distance to the obstacle includes:
[0018] Determine the device attitude using at least one of the following:
[0019] If the signal obstruction status is unobstructed, then the device attitude is determined to be the first attitude;
[0020] If the signal is blocked and the distance to the obstacle is less than the set distance, then the device attitude is determined to be the second attitude.
[0021] If the signal is blocked and the distance to the obstacle is not less than the set distance, then the device attitude is determined to be the third attitude.
[0022] In one embodiment, before obtaining the audio attenuation coefficient between the target user's location and the audio device's location, the method further includes:
[0023] Send an audio test signal;
[0024] Receive the audio reflection signal returned based on the audio test signal;
[0025] The user-received signal corresponding to the audio test signal is received through the signal receiver at the target user's location;
[0026] The audio attenuation coefficient is determined based on the audio test signal, the audio reflection signal, and the user's received signal.
[0027] In one embodiment, determining the audio attenuation coefficient based on the audio test signal, the audio reflection signal, and the user received signal includes:
[0028] The energy attenuation coefficient is determined based on the audio test signal and the user received signal. The energy attenuation coefficient represents the effect of signal transmission distance on the attenuation of the audio signal. The energy attenuation coefficient is positively correlated with the user received signal and negatively correlated with the audio test signal.
[0029] The environmental attenuation coefficient of the surrounding environment is determined based on the audio test signal and the audio reflection signal; the environmental attenuation coefficient is positively correlated with the audio reflection signal and negatively correlated with the audio test signal.
[0030] The audio attenuation coefficient is determined based on the energy attenuation coefficient and the environmental attenuation coefficient; the audio attenuation coefficient is positively correlated with both the energy attenuation coefficient and the environmental attenuation coefficient.
[0031] In one embodiment, adjusting the audio attenuation coefficient according to the device orientation to obtain a target attenuation coefficient includes:
[0032] Detect the movement status of audio devices;
[0033] Obtain the adjustment coefficients corresponding to the device's attitude and movement state;
[0034] The target attenuation coefficient is determined based on the adjustment coefficient and the audio attenuation coefficient; the target attenuation coefficient is positively correlated with both the adjustment coefficient and the audio attenuation coefficient.
[0035] In one embodiment, the source audio signal is compensated according to a target attenuation coefficient to obtain a target audio signal, including:
[0036] The target audio signal is determined based on the source audio signal, the target attenuation coefficient, and the set target frequency response;
[0037] Among them, the target audio signal is positively correlated with the source audio signal, and negatively correlated with the target attenuation coefficient and the set target frequency response.
[0038] On one hand, this application provides an audio processing apparatus, including:
[0039] The detection unit is used to perform attitude detection on the audio device and obtain the current device attitude.
[0040] The acquisition unit is used to acquire the audio attenuation coefficient between the target user's location and the audio device's location; the audio attenuation coefficient represents the impact of the audio device's surrounding environment and signal transmission distance on the attenuation of the audio signal;
[0041] The adjustment unit is used to adjust the audio attenuation coefficient according to the device's orientation to obtain the target attenuation coefficient;
[0042] The compensation unit is used to compensate the source audio signal according to the target attenuation coefficient to obtain the target audio signal to be played.
[0043] In one embodiment, the detection unit is used for:
[0044] Send an ultrasonic sweep signal in a specified direction;
[0045] Detect whether an ultrasonic reflection signal based on the ultrasonic sweep frequency signal is received;
[0046] If no ultrasonic reflection signal is received within the set time period, it is determined that the signal blockage status of the audio device is not blocked; the signal blockage status indicates whether the signal transmitter of the audio device is blocked.
[0047] If an ultrasonic reflection signal is received within the set time period, it is determined that the signal of the audio device is blocked, and the distance to the obstacle is determined based on the interval between the ultrasonic sweep signal and the ultrasonic reflection signal and the speed of sound transmission.
[0048] The device's attitude is determined based on the signal obstruction status and the distance to obstacles.
[0049] In one embodiment, the detection unit is used for:
[0050] Determine the device attitude using at least one of the following:
[0051] If the signal obstruction status is unobstructed, then the device attitude is determined to be the first attitude;
[0052] If the signal is blocked and the distance to the obstacle is less than the set distance, then the device attitude is determined to be the second attitude.
[0053] If the signal is blocked and the distance to the obstacle is not less than the set distance, then the device attitude is determined to be the third attitude.
[0054] In one embodiment, the acquisition unit is further configured to:
[0055] Send an audio test signal;
[0056] Receive the audio reflection signal returned based on the audio test signal;
[0057] The user-received signal corresponding to the audio test signal is received through the signal receiver at the target user's location;
[0058] The audio attenuation coefficient is determined based on the audio test signal, the audio reflection signal, and the user's received signal.
[0059] In one embodiment, the acquisition unit is further configured to:
[0060] The energy attenuation coefficient is determined based on the audio test signal and the user received signal. The energy attenuation coefficient represents the effect of signal transmission distance on the attenuation of the audio signal. The energy attenuation coefficient is positively correlated with the user received signal and negatively correlated with the audio test signal.
[0061] The environmental attenuation coefficient of the surrounding environment is determined based on the audio test signal and the audio reflection signal; the environmental attenuation coefficient is positively correlated with the audio reflection signal and negatively correlated with the audio test signal.
[0062] The audio attenuation coefficient is determined based on the energy attenuation coefficient and the environmental attenuation coefficient; the audio attenuation coefficient is positively correlated with both the energy attenuation coefficient and the environmental attenuation coefficient.
[0063] In one embodiment, the adjustment unit is used for:
[0064] Detect the movement status of audio devices;
[0065] Obtain the adjustment coefficients corresponding to the device's attitude and movement state;
[0066] The target attenuation coefficient is determined based on the adjustment coefficient and the audio attenuation coefficient; the target attenuation coefficient is positively correlated with both the adjustment coefficient and the audio attenuation coefficient.
[0067] In one embodiment, the compensation unit is used for:
[0068] The target audio signal is determined based on the source audio signal, the target attenuation coefficient, and the set target frequency response;
[0069] Among them, the target audio signal is positively correlated with the source audio signal, and negatively correlated with the target attenuation coefficient and the set target frequency response.
[0070] On one hand, this application provides an electronic device, including:
[0071] Processor; and
[0072] The memory stores computer instructions that cause the processor to perform the steps of the methods provided in the various alternative implementations of any of the above-described audio processing methods.
[0073] On one hand, embodiments of this application provide a computer-readable storage medium storing computer instructions for causing a computer to perform steps of the methods provided in various alternative implementations of any of the above-described audio processing methods.
[0074] On one hand, this application provides a computer program product including computer-readable code or a non-volatile computer-readable storage medium carrying computer-readable code. When the computer-readable code is run in the processor of an electronic device, the processor in the electronic device performs the steps of the method provided in various optional implementations of any of the above-described audio processing methods.
[0075] The audio processing method in this embodiment includes: performing attitude detection on the audio device to obtain its current device attitude; obtaining an audio attenuation coefficient between the target user's position and the audio device's position; the audio attenuation coefficient representing the attenuation effect of the surrounding environment and signal transmission distance on the audio signal; adjusting the audio attenuation coefficient according to the device attitude to obtain a target attenuation coefficient; and compensating the source audio signal according to the target attenuation coefficient to obtain the target audio signal to be played. In this way, by combining the attenuation effects of device attitude, surrounding environment, and signal transmission distance on the audio, audio calibration is performed, balancing the cost and accuracy of audio calibration. Attached Figure Description
[0076] To more clearly illustrate the technical solutions in the specific embodiments of this application or the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0077] Figure 1 This is a schematic diagram of an audio processing scenario in an embodiment of this application.
[0078] Figure 2 This is a flowchart of an audio processing method according to an embodiment of this application.
[0079] Figure 3 This is a schematic diagram of a device posture detection scenario in an embodiment of this application.
[0080] Figure 4 This is a flowchart of an audio playback method according to an embodiment of this application.
[0081] Figure 5 This is a structural block diagram of an audio processing apparatus according to an embodiment of this application.
[0082] Figure 6 This is a schematic diagram of the structure of an electronic device according to an embodiment of this application. Detailed Implementation
[0083] The technical solution of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application. Furthermore, the technical features involved in the different embodiments of this application described below can be combined with each other as long as they do not conflict with each other.
[0084] In the traditional way, some large audio equipment usually uses multiple professional test microphones for audio testing and audio calibration to improve the audio listening effect.
[0085] However, this usually requires the use of expensive, specialized test microphones for testing and calibration, which has high hardware requirements, high cost, and takes a lot of time. Many small mobile devices are not usually equipped with professional test microphones, and there are few audio devices that can perform audio testing and calibration. Moreover, the accuracy of audio testing is usually not high, which leads to low accuracy of audio calibration.
[0086] Furthermore, traditional technologies typically do not consider the impact of the surrounding environment of the audio device, the relative distance between the user and the audio device, or the device's orientation on the attenuation of the audio signal. They also fail to compensate for the audio signal accordingly, resulting in lower accuracy of audio calibration.
[0087] Based on the deficiencies of the aforementioned related technologies, this application provides an audio processing method, apparatus, electronic device, storage medium, and program product, aiming to balance the cost and accuracy of audio calibration during audio calibration.
[0088] This application provides an audio processing method that can be applied to audio devices, which can be any type of electronic device, such as terminal devices and servers, etc. This application will not elaborate further on this.
[0089] See Figure 1 The diagram illustrates a scenario for audio processing. Using a room as an example, an audio device is installed in the room. After the audio device plays an audio signal, the user can hear the audio. In this embodiment, considering the attenuation effects of the audio device's orientation, the surrounding environment, and signal transmission distance, the source audio signal to be played is compensated during audio playback to obtain and play the target audio signal, allowing the user to hear high-quality audio.
[0090] The following is combined Figure 1 and Figure 2 The audio processing methods are explained in the following document. Figure 2 The diagram shown is a flowchart of an audio processing method according to an embodiment of this application, applied to... Figure 1 The specific implementation process of this method for audio devices is as follows:
[0091] Step 201: Perform attitude detection on the audio device to obtain the current device attitude.
[0092] For example, the device posture is determined based on the placement and angle of the audio device, as well as the presence of any obstructions in the surrounding area; for instance, the audio device may be placed flat on a table. Optionally, the device posture can be indicated by the user through voice, text, or posture controls, or it can be a pre-set default setting, or it can be detected by ultrasonic frequency sweep signals; there are no restrictions on this.
[0093] In one implementation, when performing step 201, the following steps may be adopted:
[0094] S2011: Send an ultrasonic sweep signal in the specified direction.
[0095] In one embodiment, an ultrasonic sweep signal in a specified frequency band in a specified direction is emitted through the signal transmitter (e.g., a speaker) of an audio device.
[0096] The specified direction can be a specified angle range, and the specified frequency band can be a specified frequency range, such as 20kHz-30kHz. Ultrasonic sweep signals are inaudible to the human ear. In practical applications, both the specified direction and frequency band can be set according to the specific application scenario, and no restrictions are imposed here.
[0097] S2012: Detect whether an ultrasonic reflection signal based on the ultrasonic sweep frequency signal is received.
[0098] In one embodiment, the audio device is further provided with an ultrasonic sensor to receive ultrasonic reflected signals.
[0099] If there is an obstruction in the signal transmission direction (i.e., the specified direction) of the signal transmitter, the ultrasonic sweep signal will be reflected back, and the audio device can receive the reflected ultrasonic signal. Otherwise, the ultrasonic sweep signal will not be reflected back, and the audio device cannot receive the reflected ultrasonic signal.
[0100] S2013: If no ultrasonic reflection signal is received within the set time period, it is determined that the signal obstruction state of the audio device is not obstructed; the signal obstruction state indicates whether the signal transmitter of the audio device is obstructed; if an ultrasonic reflection signal is received within the set time period, it is determined that the signal obstruction state of the audio device is obstructed, and the distance to the obstacle is determined based on the interval time of the ultrasonic sweep signal and the ultrasonic reflection signal and the sound transmission speed.
[0101] For example, the duration can be set to 30 seconds. In actual applications, the duration can be set according to the actual application scenario, and there is no restriction here.
[0102] In one embodiment, the interval time t is obtained based on the difference between the transmission time of the ultrasonic sweep signal and the reception time of the ultrasonic reflection signal, and the obstacle distance L = V*t / 2 is determined based on the product of the sound propagation speed V and the interval time t.
[0103] For example, see Figure 3 The image shown is a schematic diagram of a device posture detection scenario. Figure 3 In this design, the audio device has a speaker and an ultrasonic sensor at its bottom, and is placed at an angle on the table via a stand. The speaker emits ultrasonic sweep signals, the ultrasonic sensor receives the reflected ultrasonic signals, and the distance between the audio device and the table (i.e., the obstructing object) can be determined based on the time interval between the two signals and the speed of sound transmission.
[0104] In this way, it is possible to determine whether the audio device is blocked based on whether the reflected ultrasonic signal is received, and to calculate the distance between the audio device and the obstructing object (e.g., a table) based on the time interval between the signal round trip.
[0105] S2014: Determine the device attitude based on the signal obstruction status and the distance to obstacles.
[0106] In one implementation, when performing step S2014, at least one of the following can be used:
[0107] Method 1: If the signal obstruction status is unobstructed, then the device attitude is determined to be the first attitude.
[0108] For example, if the mobile phone is standing upright on a table, the ultrasonic sweep signal emitted by the mobile phone is not blocked, so it is determined that the mobile phone is currently in the first posture.
[0109] Method 2: If the signal is blocked and the distance to the obstacle is less than the set distance, then the device attitude is determined to be the second attitude.
[0110] For example, if a mobile phone is placed flat on a table, the ultrasonic sweep signal emitted by the phone is blocked by the nearby table. This distance is lower than a set distance, so the phone is determined to be in a second posture.
[0111] In practical applications, the distance can be set according to the actual application scenario, such as 10cm, and there is no limit here.
[0112] Method 3: If the signal is blocked and the distance to the obstacle is not less than the set distance, then the device attitude is determined to be the third attitude.
[0113] For example, if a mobile phone is placed diagonally on a table using a phone stand, the ultrasonic sweep signal emitted by the phone is blocked by the table at a distance that is not less than a set distance. Therefore, it is determined that the phone is currently in a third posture.
[0114] This allows us to determine the device orientation of the audio equipment, which can then be used to perform audio compensation in subsequent steps.
[0115] Step 202: Obtain the audio attenuation coefficient between the target user's location and the audio device's location; the audio attenuation coefficient represents the impact of the surrounding environment of the audio device and the signal transmission distance on the attenuation of the audio signal.
[0116] It should be noted that if the audio device, audio device location, target user location, and surrounding environment remain unchanged, the audio attenuation coefficient will also remain fixed. Therefore, the audio attenuation coefficient only needs to be determined once during initialization, and it is not necessary to test and calculate the audio attenuation coefficient every time the audio is calibrated.
[0117] This allows us to determine the signal transmission distance and the impact of the surrounding environment on audio attenuation.
[0118] Furthermore, an audio attenuation test can be performed beforehand to obtain the audio attenuation coefficient. In one implementation, the following steps can be used to determine the audio attenuation coefficient:
[0119] S2021: Send audio test signal.
[0120] In one implementation, the audio device transmits an audio test signal via a signal transmitter (e.g., a speaker).
[0121] The audio test signal is a wideband signal (i.e., a signal with a wide frequency range). When testing audio devices, the device posture can be set according to the actual application scenario. For example, it can be the commonly used device angle, or different device postures can be tested separately.
[0122] S2022: Receive the audio reflection signal returned based on the audio test signal.
[0123] In one implementation, the audio device receives the reflected audio signal via its own signal receiver (e.g., a microphone installed within the audio device). In other words, the reflected audio signal is the signal reflected back from the audio test signal.
[0124] S2023: Receive the user-received signal corresponding to the audio test signal through the signal receiver at the target user's location.
[0125] In one embodiment, a signal receiver is placed at the target user's location, and the user's received signal is received through the receiver.
[0126] S2024: Determine the audio attenuation coefficient based on the audio test signal, the audio reflection signal, and the user received signal.
[0127] In this way, based on the audio test signal, the corresponding signals received at different locations can be obtained, so as to determine the impact of audio attenuation in subsequent steps.
[0128] In one implementation, when executing S2024, the following steps may be taken:
[0129] S2024-1: Determine the energy attenuation coefficient based on the audio test signal and the user received signal; the energy attenuation coefficient represents the effect of signal transmission distance on the attenuation of the audio signal; the energy attenuation coefficient is positively correlated with the user received signal and negatively correlated with the audio test signal.
[0130] In one embodiment, the audio test signal and the user received signal are subjected to Fourier transform to obtain a first transformed signal and a second transformed signal, and the ratio of the second transformed signal to the first transformed signal is calculated to obtain the energy attenuation coefficient H1, which can also be called the first transfer function.
[0131] Furthermore, to improve the accuracy of the energy attenuation coefficient, multiple tests can be conducted to obtain multiple sets of audio test signals and user received signals, thereby obtaining multiple energy attenuation coefficients. Then, cluster analysis or averaging processing can be performed on each energy attenuation coefficient to obtain a new energy attenuation coefficient.
[0132] During each test, the device orientation of the audio equipment can be the same or different.
[0133] In this way, the energy attenuation of sound from the audio device to the user can be determined simply by using the signal receiver at the audio device and the user's location.
[0134] S2024-2: Determine the environmental attenuation coefficient of the surrounding environment based on the audio test signal and the audio reflection signal; the environmental attenuation coefficient is positively correlated with the audio reflection signal and negatively correlated with the audio test signal.
[0135] In one embodiment, the audio reflection signal is subjected to Fourier transform to obtain a third transformed signal, and the ratio of the third transformed signal to the first transformed signal is calculated to obtain H2, which can also be called the second transfer function.
[0136] Furthermore, to improve the accuracy of the environmental attenuation coefficient, multiple tests can be conducted to obtain multiple sets of audio test signals and audio reflection signals, thereby obtaining multiple environmental attenuation coefficients. Then, cluster analysis or averaging processing can be performed on each environmental attenuation coefficient to obtain a new environmental attenuation coefficient.
[0137] During each test, the device orientation of the audio equipment can be the same or different.
[0138] For example, the audio device is a laptop, the signal receiver is the microphone in the laptop, the microphone is located in the center above the laptop screen, the laptop microphone and speaker are on the same plane, and the environmental attenuation coefficient within the range of microphone rotation can be obtained.
[0139] In this way, the attenuation effect of the surrounding environment on sound propagation can be determined using only the microphone and speaker in the audio device.
[0140] S2024-3: Determine the audio attenuation coefficient based on the energy attenuation coefficient and the environmental attenuation coefficient; the audio attenuation coefficient is positively correlated with both the energy attenuation coefficient and the environmental attenuation coefficient.
[0141] In one implementation, the energy attenuation coefficient H1 and the environmental attenuation coefficient H2 are calculated to obtain the audio attenuation coefficient H3 = H1 * H2, which can also be referred to as the third transfer function.
[0142] In this way, the impact of the surrounding environment and signal transmission distance on the sound quality heard by the user can be determined.
[0143] Step 203: Adjust the audio attenuation coefficient according to the device orientation to obtain the target attenuation coefficient.
[0144] In one implementation, an adjustment coefficient corresponding to the device posture is obtained, and the audio attenuation coefficient is adjusted using the adjustment coefficient to obtain the target attenuation coefficient.
[0145] Among them, the target attenuation coefficient is positively correlated with both the adjustment coefficient and the audio attenuation coefficient.
[0146] Furthermore, a first correspondence between the device posture and the adjustment coefficient can be preset, so as to determine the adjustment coefficient corresponding to the current device posture based on the first correspondence.
[0147] As an example, the product of the audio attenuation coefficient H3 and the adjustment coefficient U is calculated to obtain the target attenuation coefficient H4 = H3 * U.
[0148] This allows us to consider the impact of device orientation on audio attenuation.
[0149] Furthermore, the audio attenuation coefficient can be adjusted based on the movement status of the audio device. This movement status can include both moving and stationary states.
[0150] In one embodiment, the movement state of the audio device is detected; the device posture and the adjustment coefficient corresponding to the movement state are obtained; and a target attenuation coefficient is determined based on the adjustment coefficient and the audio attenuation coefficient; the target attenuation coefficient is positively correlated with both the adjustment coefficient and the audio attenuation coefficient.
[0151] Optionally, the movement status of the audio device can be detected using a status sensor such as a gyroscope built into the audio device.
[0152] Furthermore, a second correspondence between the movement state, the equipment state, and the adjustment coefficient can be preset, so that the adjustment coefficient can be determined based on the movement state and the equipment state according to the second correspondence.
[0153] This allows us to consider the impact of movement and device orientation on audio attenuation.
[0154] Step 204: Compensate the source audio signal according to the target attenuation coefficient to obtain the target audio signal to be played.
[0155] In one embodiment, the target audio signal is determined based on the source audio signal, the target attenuation coefficient, and a set target frequency response.
[0156] The source audio signal is the initial signal of the audio to be played by the audio device. The target audio signal is positively correlated with the source audio signal and negatively correlated with both the target attenuation coefficient and the set target frequency response. The set target frequency response represents the sound effect the user expects to hear. It can be set to 1 by default, meaning the energy of each frequency band is balanced. It can also be customized according to user instructions or application scenarios, allowing the target frequency response to be configured based on user preferences or actual needs, resulting in uneven energy distribution across frequency bands. Frequency response, also known as frequency change response, refers to the change in gain of the system to the input signal within a given frequency range.
[0157] As an example, the product of the target attenuation coefficient H4 and the set target frequency response V, i.e., H4*V, is determined, and the source audio signal is subjected to Fourier transform to obtain the fourth transformed signal N. The fifth transformed signal M = N / (H4*V) is obtained according to the ratio of the fourth transformed signal N to the product. The fifth transformed signal M is then subjected to inverse Fourier transform to obtain the target audio signal.
[0158] Optionally, audio compensation, i.e., audio calibration, can be performed using filters. In one implementation, the compensation gain is determined based on H4*V, filter parameters are configured based on the compensation gain, and audio compensation is performed according to the configured filter.
[0159] In this way, audio compensation can be performed on the source audio signal to obtain the calibrated target audio signal.
[0160] Furthermore, the audio device can play audio based on the target audio signal.
[0161] The following is combined Figure 4 This section provides an example illustrating the methods for audio playback. (See also...) Figure 4 The diagram shows a flowchart of an audio playback method, which includes the following steps:
[0162] Step 401: The audio device plays the first audio test signal through its built-in speaker.
[0163] Step 402: The audio device receives the audio reflection signal corresponding to the first audio test signal through its built-in microphone.
[0164] Step 403: The audio device determines the energy attenuation coefficient H1 based on the first audio test signal and the user received signal.
[0165] Step 404: The audio device plays multiple second audio test signals through its built-in speakers.
[0166] Step 405: The audio device receives the audio received signal corresponding to each of the second audio test signals through the signal receiver at the target user's location.
[0167] Step 406: The audio device determines the environmental attenuation coefficient H2 based on the second audio signal and the received audio signal of each group.
[0168] Step 407: The audio device determines the audio attenuation coefficient H3 based on the energy attenuation coefficient H1 and the environmental attenuation coefficient H2.
[0169] Step 408: The audio device adjusts the audio attenuation coefficient H3 according to the current device posture to obtain the target attenuation coefficient H4.
[0170] Step 409: The audio device compensates the source audio signal according to the target attenuation coefficient H4 and the set target frequency response V, and obtains and plays the target audio signal.
[0171] In one embodiment, the audio device determines the compensation gain based on the target attenuation coefficient H4 and the set target frequency response V, configures a filter through the compensation gain, and compensates the source audio signal to be played through the configured filter to obtain the target audio signal.
[0172] For steps 401-409, please refer to steps 201-204 above for specific steps, which will not be repeated here.
[0173] In this embodiment, the surrounding environment of the audio device, the distance between the user and the audio device, and the influence of device posture on the attenuation of the audio signal are considered to compensate for the audio, resulting in high accuracy of audio calibration. Furthermore, it does not require a professional, expensive, specific measuring microphone; only the device's built-in signal receiver (e.g., a microphone) is needed for testing, thus reducing the cost of audio calibration and broadening its application range. Moreover, the audio test signal can be any wideband signal, eliminating the need for frequency sweep signals. Users can complete the test under normal device usage to obtain the audio attenuation coefficient, making audio calibration simple and convenient. Finally, under the same environment, only one test is needed to obtain the audio attenuation coefficient. The calibration process is simplified by simply subtracting the coefficient, eliminating the need for testing the audio attenuation coefficient for each audio compensation. Furthermore, the adjustment coefficient can be switched at any time according to the user's device usage habits to fine-tune the audio attenuation coefficient, further improving the accuracy of audio calibration. Moreover, multiple sets of measurement data can be used to compensate for the user's listening position, ensuring audio quality within a certain listening range, further enhancing the accuracy of audio calibration and the user experience. Finally, it can be applied to any device, including mobile devices, making it more versatile and convenient, enabling high-fidelity sound in more environments and with more types of audio devices.
[0174] The user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, use and processing of the relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and corresponding operation entry points are provided for users to choose to authorize or refuse.
[0175] Based on the same inventive concept, this application also provides an audio processing apparatus. Since the principle of the above-described apparatus and device in solving the problem is similar to that of an audio processing method, the implementation of the above-described apparatus can refer to the implementation of the method, and repeated details will not be elaborated further. This apparatus can be applied to electronic devices. This application does not limit the type of electronic device; it can be any suitable type of device, such as terminal devices and servers, etc., which will not be elaborated further in this application.
[0176] See Figure 5 The diagram shown is a structural block diagram of an audio processing apparatus according to an embodiment of this application. In some embodiments, the audio processing apparatus exemplified in this application includes:
[0177] The detection unit 501 is used to perform attitude detection on the audio device and obtain the current device attitude of the audio device.
[0178] The acquisition unit 502 is used to acquire the audio attenuation coefficient between the target user's location and the audio device's location; the audio attenuation coefficient represents the influence of the surrounding environment of the audio device and the signal transmission distance on the attenuation of the audio signal;
[0179] The adjustment unit 503 is used to adjust the audio attenuation coefficient according to the device posture to obtain the target attenuation coefficient;
[0180] The compensation unit 504 is used to compensate the source audio signal according to the target attenuation coefficient to obtain the target audio signal to be played.
[0181] In one embodiment, the detection unit 501 is used for:
[0182] Send an ultrasonic sweep signal in a specified direction;
[0183] Detect whether an ultrasonic reflection signal based on the ultrasonic sweep frequency signal is received;
[0184] If no ultrasonic reflection signal is received within the set time period, it is determined that the signal blockage status of the audio device is not blocked; the signal blockage status indicates whether the signal transmitter of the audio device is blocked.
[0185] If an ultrasonic reflection signal is received within the set time period, it is determined that the signal of the audio device is blocked, and the distance to the obstacle is determined based on the interval between the ultrasonic sweep signal and the ultrasonic reflection signal and the speed of sound transmission.
[0186] The device's attitude is determined based on the signal obstruction status and the distance to obstacles.
[0187] In one embodiment, the detection unit 501 is used for:
[0188] Determine the device attitude using at least one of the following:
[0189] If the signal obstruction status is unobstructed, then the device attitude is determined to be the first attitude;
[0190] If the signal is blocked and the distance to the obstacle is less than the set distance, then the device attitude is determined to be the second attitude.
[0191] If the signal is blocked and the distance to the obstacle is not less than the set distance, then the device attitude is determined to be the third attitude.
[0192] In one embodiment, the acquisition unit 502 is further configured to:
[0193] Send an audio test signal;
[0194] Receive the audio reflection signal returned based on the audio test signal;
[0195] The user-received signal corresponding to the audio test signal is received through the signal receiver at the target user's location;
[0196] The audio attenuation coefficient is determined based on the audio test signal, the audio reflection signal, and the user's received signal.
[0197] In one embodiment, the acquisition unit 502 is further configured to:
[0198] The energy attenuation coefficient is determined based on the audio test signal and the user received signal. The energy attenuation coefficient represents the effect of signal transmission distance on the attenuation of the audio signal. The energy attenuation coefficient is positively correlated with the user received signal and negatively correlated with the audio test signal.
[0199] The environmental attenuation coefficient of the surrounding environment is determined based on the audio test signal and the audio reflection signal; the environmental attenuation coefficient is positively correlated with the audio reflection signal and negatively correlated with the audio test signal.
[0200] The audio attenuation coefficient is determined based on the energy attenuation coefficient and the environmental attenuation coefficient; the audio attenuation coefficient is positively correlated with both the energy attenuation coefficient and the environmental attenuation coefficient.
[0201] In one embodiment, the adjustment unit 503 is used to:
[0202] Detect the movement status of audio devices;
[0203] Obtain the adjustment coefficients corresponding to the device's attitude and movement state;
[0204] The target attenuation coefficient is determined based on the adjustment coefficient and the audio attenuation coefficient; the target attenuation coefficient is positively correlated with both the adjustment coefficient and the audio attenuation coefficient.
[0205] In one embodiment, the compensation unit 504 is used for:
[0206] The target audio signal is determined based on the source audio signal, the target attenuation coefficient, and the set target frequency response;
[0207] Among them, the target audio signal is positively correlated with the source audio signal, and negatively correlated with the target attenuation coefficient and the set target frequency response.
[0208] The audio processing method in this embodiment includes: performing attitude detection on the audio device to obtain its current device attitude; obtaining an audio attenuation coefficient between the target user's position and the audio device's position; the audio attenuation coefficient representing the attenuation effect of the surrounding environment and signal transmission distance on the audio signal; adjusting the audio attenuation coefficient according to the device attitude to obtain a target attenuation coefficient; and compensating the source audio signal according to the target attenuation coefficient to obtain the target audio signal to be played. In this way, by combining the attenuation effects of device attitude, surrounding environment, and signal transmission distance on the audio, audio calibration is performed, balancing the cost and accuracy of audio calibration.
[0209] In this embodiment of the application, an electronic device is provided, including:
[0210] Processor; and
[0211] The memory stores computer instructions that cause the processor to execute the methods of any of the above-described embodiments.
[0212] In this application embodiment, a computer-readable storage medium is provided, storing computer instructions for causing a computer to perform the methods of any of the above embodiments.
[0213] This application also provides a computer program product, including computer-readable code, or a non-volatile computer-readable storage medium carrying computer-readable code, wherein when the computer-readable code is run in the processor of an electronic device, the processor in the electronic device performs the method of any of the above-described embodiments.
[0214] Figure 6 A schematic diagram of the structure of an electronic device 6000 is shown. (See also...) Figure 6 As shown, the electronic device 6000 includes a processor 6010 and a memory 6020, and optionally may also include a power supply 6030, a display unit 6040, and an input unit 6050.
[0215] The processor 6010 is the control center of the electronic device 6000. It connects various components through various interfaces and lines, and performs various functions of the electronic device 6000 by running or executing software programs and / or data stored in the memory 6020, thereby performing overall monitoring of the electronic device 6000.
[0216] In this embodiment, when the processor 6010 calls the computer program stored in the memory 6020, it executes the steps in the above embodiments.
[0217] Optionally, the processor 6010 may include one or more processing units; preferably, the processor 6010 may integrate an application processor and a modem processor, wherein the application processor mainly handles the operating system, user interface, and applications, and the modem processor mainly handles wireless communication. It is understood that the modem processor may not be integrated into the processor 6010. In some embodiments, the processor and memory may be implemented on a single chip; in some embodiments, they may also be implemented separately on independent chips.
[0218] The memory 6020 may primarily include a program storage area and a data storage area. The program storage area may store the operating system, various applications, etc.; the data storage area may store data created based on the use of the electronic device 6000, etc. In addition, the memory 6020 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device, etc.
[0219] Electronic device 6000 also includes a power supply 6030 (such as a battery) that supplies power to various components. The power supply can be logically connected to processor 6010 through a power management system, thereby enabling the management of charging, discharging, and power consumption.
[0220] The display unit 6040 can be used to display information input by the user or information provided to the user, as well as various menus of the electronic device 6000. In this embodiment, it is mainly used to display the display interfaces of various applications in the electronic device 6000, as well as text, images, and other objects displayed on the display interfaces. The display unit 6040 may include a display panel 6041. The display panel 6041 may be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), or the like.
[0221] The input unit 6050 can be used to receive information such as numbers or characters input by the user. The input unit 6050 may include a touch panel 6051 and other input devices 6052. The touch panel 6051, also known as a touch screen, can collect touch operations on or near the touch panel 6051 by the user (such as operations performed by the user using a finger, stylus, or any suitable object or accessory on or near the touch panel 6051).
[0222] Specifically, the touch panel 6051 can detect user touch operations and the signals generated by these operations, convert them into touch point coordinates, send them to the processor 6010, and receive and execute commands from the processor 6010. Furthermore, the touch panel 6051 can be implemented using various types of touch technologies, including resistive, capacitive, infrared, and surface acoustic wave. Other input devices 6052 can include, but are not limited to, one or more of the following: physical keyboard, function keys (such as volume control buttons, power buttons, etc.), trackball, mouse, joystick, etc.
[0223] Of course, the touch panel 6051 can cover the display panel 6041. When the touch panel 6051 detects a touch operation on or near it, it transmits the information to the processor 6010 to determine the type of touch event. Subsequently, the processor 6010 provides corresponding visual output on the display panel 6041 based on the type of touch event. Although in Figure 6 In this embodiment, the touch panel 6051 and the display panel 6041 are two separate components to realize the input and output functions of the electronic device 6000. However, in some embodiments, the touch panel 6051 and the display panel 6041 can be integrated to realize the input and output functions of the electronic device 6000.
[0224] The electronic device 6000 may also include one or more sensors, such as a pressure sensor, a gravity acceleration sensor, a proximity sensor, etc. Of course, depending on the specific application, the electronic device 6000 may also include other components such as a camera. Since these components are not the focus of this application embodiment, therefore... Figure 6 It is not shown in the text and will not be described in detail here.
[0225] Those skilled in the art will understand that Figure 6 This is merely an example of an electronic device and does not constitute a limitation on the electronic device. It may include more or fewer components than shown, or a combination of certain components, or different components.
[0226] For ease of description, the above sections are divided into modules (or units) according to their functions and described separately. Of course, in implementing this application, the functions of each module (or unit) can be implemented in one or more software or hardware components.
Claims
1. An audio processing method, characterized in that, The method includes: Perform attitude detection on the audio device to obtain the current device attitude; Obtain the audio attenuation coefficient between the target user's location and the audio device's location; the audio attenuation coefficient represents the impact of the audio device's surrounding environment and signal transmission distance on the attenuation of the audio signal; Based on the device posture, the audio attenuation coefficient is adjusted to obtain the target attenuation coefficient; The source audio signal is compensated according to the target attenuation coefficient to obtain the target audio signal to be played.
2. The method according to claim 1, characterized in that, The step of performing attitude detection on the audio device to obtain the current device attitude includes: Send an ultrasonic sweep signal in a specified direction; Detect whether an ultrasonic reflection signal based on the ultrasonic sweep frequency signal is received; If no ultrasonic reflection signal is received within the set time period, it is determined that the signal blocking state of the audio device is not blocked; the signal blocking state indicates whether the signal transmitter of the audio device is blocked. If the ultrasonic reflection signal is received within the set time period, it is determined that the signal blockage state of the audio device is blocked, and the distance to the obstacle is determined according to the interval time of the ultrasonic sweep signal and the ultrasonic reflection signal and the sound transmission speed. The device attitude is determined based on the signal obstruction status and the distance to the obstacle.
3. The method according to claim 2, characterized in that, Determining the device attitude based on the signal obstruction state and the distance to the obstacle includes: The device attitude is determined using at least one of the following: If the signal blocking state is unblocked, then the device attitude is determined to be the first attitude; If the signal obstruction state is obstructed and the distance to the obstacle is less than a set distance, then the device posture is determined to be the second posture. If the signal is blocked and the distance to the obstacle is not less than a set distance, then the device posture is determined to be the third posture.
4. The method according to any one of claims 1-3, characterized in that, Before obtaining the audio attenuation coefficient between the target user's location and the audio device's location, the method further includes: Send an audio test signal; Receive the audio reflection signal returned based on the audio test signal; The user-received signal corresponding to the audio test signal is received through the signal receiver at the target user's location; The audio attenuation coefficient is determined based on the audio test signal, the audio reflection signal, and the user received signal.
5. The method according to claim 4, characterized in that, Determining the audio attenuation coefficient based on the audio test signal, the audio reflection signal, and the user received signal includes: Based on the audio test signal and the user received signal, an energy attenuation coefficient is determined; the energy attenuation coefficient represents the effect of signal transmission distance on the attenuation of the audio signal; the energy attenuation coefficient is positively correlated with the user received signal and negatively correlated with the audio test signal. The environmental attenuation coefficient of the surrounding environment is determined based on the audio test signal and the audio reflection signal; the environmental attenuation coefficient is positively correlated with the audio reflection signal and negatively correlated with the audio test signal. The audio attenuation coefficient is determined based on the energy attenuation coefficient and the environmental attenuation coefficient; the audio attenuation coefficient is positively correlated with both the energy attenuation coefficient and the environmental attenuation coefficient.
6. The method according to any one of claims 1-3, characterized in that, The step of adjusting the audio attenuation coefficient according to the device posture to obtain the target attenuation coefficient includes: Detect the movement status of the audio device; Obtain the device attitude and the adjustment coefficients corresponding to the movement state; The target attenuation coefficient is determined based on the adjustment coefficient and the audio attenuation coefficient; the target attenuation coefficient is positively correlated with both the adjustment coefficient and the audio attenuation coefficient.
7. The method according to any one of claims 1-3, characterized in that, The step of compensating the source audio signal according to the target attenuation coefficient to obtain the target audio signal includes: The target audio signal is determined based on the source audio signal, the target attenuation coefficient, and the set target frequency response; The target audio signal is positively correlated with the source audio signal and negatively correlated with the target attenuation coefficient and the set target frequency response.
8. An audio processing apparatus, characterized in that, The device includes: The detection unit is used to perform attitude detection on the audio device and obtain the current device attitude of the audio device. The acquisition unit is used to acquire the audio attenuation coefficient between the target user's location and the audio device's location; the audio attenuation coefficient represents the influence of the surrounding environment of the audio device and the signal transmission distance on the attenuation of the audio signal; An adjustment unit is used to adjust the audio attenuation coefficient according to the device posture to obtain a target attenuation coefficient; The compensation unit is used to compensate the source audio signal according to the target attenuation coefficient to obtain the target audio signal to be played.
9. An electronic device, characterized in that, include: processor; as well as A memory storing computer instructions for causing the processor to perform the method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, The computer contains computer instructions for causing the computer to perform the method according to any one of claims 1 to 7.
11. A computer program product, characterized in that, Includes computer-readable code, or a non-volatile computer-readable storage medium carrying computer-readable code, wherein when the computer-readable code is executed in a processor of an electronic device, the processor in the electronic device is the method according to any one of claims 1 to 7.