Sound image calibration method and apparatus
Embodiments of this application provide a sound image calibration method and apparatus. The method includes: A terminal device outputs a first target audio signal using a first play component, and a second target audio signal using a second play component, where a sound image is located at a first location. The terminal device receives a second operation on a second control; in response, it outputs a third target audio signal using the first play component, and a fourth target audio signal using the second play component, where the sound image is located at a second location. The distance between the second location and the central location of the terminal device is less than the distance between the first location and the central location. This allows the terminal device to turn on the control for sound image calibration, adjust the sound image closer to the central location, improve audio replay effect.
1 . A sound image calibration method, applied to a terminal device, wherein the terminal device comprises a first play component and a second play component that are asymmetrically disposed, and the method comprises:
obtaining a first target frequency response corresponding to the first play component and a second target frequency response corresponding to the second play component; and
playing, by the first play component, a first audio signal in a video by using the first target frequency response, and playing, by the second play component, a second audio signal in the video by using the second target frequency response, when the terminal device plays the video, wherein
a sound image generated after the first audio signal and the second audio signal are superposed is located at a first location, and a distance between the first location and a central location of the terminal device is less than a preset value.
2 . The method according to claim 1 , wherein the method further comprises:
obtaining, by the terminal device, a first initial frequency response of the first play component and a second initial frequency response of the second play component;
correcting, by the terminal device, the first initial frequency response to obtain the first target frequency response; and
correcting, by the terminal device, the second initial frequency response to obtain the second target frequency response.
3 . The method according to claim 2 , wherein the correcting, by the terminal device, the first initial frequency response to obtain the first target frequency response; and correcting, by the terminal device, the second initial frequency response to obtain the second target frequency response comprises:
obtaining, by the terminal device, a first frequency response compensation function corresponding to the first initial frequency response and a second frequency response compensation function corresponding to the second initial frequency response; and
correcting, by the terminal device, the first initial frequency response on a preset frequency band by using the first frequency response compensation function, to obtain the first target frequency response; and correcting the second initial frequency response on the preset frequency band by using the second frequency response compensation function, to obtain the second target frequency response.
4 . The method according to claim 3 , wherein the preset frequency band is a frequency band greater than a target cutoff frequency in a full frequency band; or the preset frequency band is a same frequency band between a first frequency band and a second frequency band, the first frequency band is a frequency band corresponding to a case in which a change rate of an interaural level difference ILD meets a first target range, and the second frequency band is a frequency band corresponding to a case in which a change rate of a sound pressure level SPL meets a second target range.
5 . The method according to claim 4 , wherein that the preset frequency band is a frequency band greater than a target cutoff frequency in a full frequency band comprises: when the first play component or the second play component comprises a target component, the preset frequency band is a frequency band greater than the target cutoff frequency in the full frequency band, wherein the target cutoff frequency is a cutoff frequency of the target component; or
that the preset frequency band is a same frequency band between a first frequency band and a second frequency band comprises: when the first play component or the second play component does not comprise the target component, the preset frequency band is a same frequency band between the first frequency band and the second frequency band.
6 . The method according to claim 1 , wherein the playing, by the first play component, a first audio signal in a video by using the first target frequency response, and playing, by the second play component, a second audio signal in the video by using the second target frequency response, when the terminal device plays the video comprises:
outputting, by the terminal device, a first target audio signal by using the first target frequency response, and outputting a second target audio signal by using the second target frequency response;
on a target frequency band, obtaining, by the terminal device, a first playback signal corresponding to a first sweep signal by using the first target frequency response, and obtaining a second playback signal corresponding to the first sweep signal by using the second target frequency response, wherein the target frequency band is a frequency band on which a similarity between the first target frequency response and the second target frequency response is greater than a preset threshold, the first sweep signal has a same amplitude, and a frequency band of the first sweep signal meets the target frequency band; and
processing, by the terminal device, the first target audio signal and/or the second target audio signal based on a difference between the first playback signal and the second playback signal, to obtain the first audio signal and the second audio signal.
7 . The method according to claim 6 , wherein the processing, by the terminal device, the first target audio signal and/or the second target audio signal based on a difference between the first playback signal and the second playback signal, to obtain the first audio signal and the second audio signal comprises:
processing, by the terminal device, the first target audio signal and/or the second target audio signal based on the difference between the first playback signal and the second playback signal, to obtain a third target audio signal and a fourth target audio signal; and
processing, by the terminal device, the third target audio signal by using a first head-related transfer function HRTF in a target HRTF, to obtain the first audio signal, and processing the fourth target audio signal by using a second HRTF in the HRTF, to obtain the second audio signal.
8 . The method according to claim 7 , wherein the processing, by the terminal device, the third target audio signal by using a first head-related transfer function HRTF in a target HRTF, to obtain the first audio signal, and processing the fourth target audio signal by using a second HRTF in the HRTF, to obtain the second audio signal comprises:
obtaining, by the terminal device, the target HRTF;
processing, by the terminal device, the third target audio signal by using the first HRTF in the target HRTF, to obtain a fifth target audio signal, and processing the fourth target audio signal by using the second HRTF corresponding to the first HRTF in the target HRTF, to obtain a sixth target audio signal; and
performing, by the terminal device, tone processing on the fifth target audio signal by using a target filtering parameter, to obtain the first audio signal, and performing tone processing on the sixth target audio signal by using the target filtering parameter, to obtain the second audio signal.
9 . The method according to claim 8 , wherein the second interface further comprises a control used to adjust a tone, and the method further comprises:
receiving, by the terminal device, an operation of selecting a target tone by a user; and
in response to the operation, performing, by the terminal device, tone processing on the fifth target audio signal by using a target filtering parameter corresponding to the target tone, to obtain the first audio signal, and performing tone processing on the sixth target audio signal by using the target filtering parameter, to obtain the second audio signal.
10 . The method according to claim 9 , wherein the performing, by the terminal device, tone processing on the fifth target audio signal by using a target filtering parameter, to obtain the first audio signal, and performing tone processing on the sixth target audio signal by using the target filtering parameter, to obtain the second audio signal comprises:
performing, by the terminal device, tone processing on the fifth target audio signal by using the target filtering parameter, to obtain a seventh target audio signal, and performing tone processing on the sixth target audio signal by using the target filtering parameter, to obtain an eighth target audio signal; and
performing, by the terminal device, volume adjustment on the seventh target audio signal based on a gain change between an initial audio signal corresponding to the first play component and an initial audio signal corresponding to the second play component and a gain change between the seventh target audio signal and the eighth target audio signal, to obtain the first audio signal, and performing, by the terminal device, volume adjustment on the eighth target audio signal based on the gain change between the initial audio signal corresponding to the first play component and the initial audio signal corresponding to the second play component and the gain change between the seventh target audio signal and the eighth target audio signal, to obtain the second audio signal.
11 . A terminal device, comprising a memory, a processor, and a computer program stored in the memory and capable of running on the processor, wherein the terminal device comprises a first play component and a second play component that are asymmetrically disposed, and when the processor executes the computer program, the terminal device is enabled to perform the following operations:
obtaining a first target frequency response corresponding to the first play component and a second target frequency response corresponding to the second play component; and
playing, by the first play component, a first audio signal in a video by using the first target frequency response, and playing, by the second play component, a second audio signal in the video by using the second target frequency response, when the terminal device plays the video, wherein
a sound image generated after the first audio signal and the second audio signal are superposed is located at a first location, and a distance between the first location and a central location of the terminal device is less than a preset value.
12 . The terminal device according to claim 11 , wherein the method further comprises:
obtaining, by the terminal device, a first initial frequency response of the first play component and a second initial frequency response of the second play component;
correcting, by the terminal device, the first initial frequency response to obtain the first target frequency response; and
correcting, by the terminal device, the second initial frequency response to obtain the second target frequency response.
13 . The terminal device according to claim 12 , wherein the correcting, by the terminal device, the first initial frequency response to obtain the first target frequency response; and correcting, by the terminal device, the second initial frequency response to obtain the second target frequency response comprises:
obtaining, by the terminal device, a first frequency response compensation function corresponding to the first initial frequency response and a second frequency response compensation function corresponding to the second initial frequency response; and
correcting, by the terminal device, the first initial frequency response on a preset frequency band by using the first frequency response compensation function, to obtain the first target frequency response; and correcting the second initial frequency response on the preset frequency band by using the second frequency response compensation function, to obtain the second target frequency response.
14 . The terminal device according to claim 13 , wherein the preset frequency band is a frequency band greater than a target cutoff frequency in a full frequency band; or the preset frequency band is a same frequency band between a first frequency band and a second frequency band, the first frequency band is a frequency band corresponding to a case in which a change rate of an interaural level difference ILD meets a first target range, and the second frequency band is a frequency band corresponding to a case in which a change rate of a sound pressure level SPL meets a second target range.
15 . The terminal device according to claim 14 , wherein that the preset frequency band is a frequency band greater than a target cutoff frequency in a full frequency band comprises: when the first play component or the second play component comprises a target component, the preset frequency band is a frequency band greater than the target cutoff frequency in the full frequency band, wherein the target cutoff frequency is a cutoff frequency of the target component; or
that the preset frequency band is a same frequency band between a first frequency band and a second frequency band comprises: when the first play component or the second play component does not comprise the target component, the preset frequency band is a same frequency band between the first frequency band and the second frequency band.
16 . The terminal device according to claim 15 , wherein the playing, by the first play component, a first audio signal in a video by using the first target frequency response, and playing, by the second play component, a second audio signal in the video by using the second target frequency response, when the terminal device plays the video comprises:
outputting, by the terminal device, a first target audio signal by using the first target frequency response, and outputting a second target audio signal by using the second target frequency response;
on a target frequency band, obtaining, by the terminal device, a first playback signal corresponding to a first sweep signal by using the first target frequency response, and obtaining a second playback signal corresponding to the first sweep signal by using the second target frequency response, wherein the target frequency band is a frequency band on which a similarity between the first target frequency response and the second target frequency response is greater than a preset threshold, the first sweep signal has a same amplitude, and a frequency band of the first sweep signal meets the target frequency band; and
processing, by the terminal device, the first target audio signal and/or the second target audio signal based on a difference between the first playback signal and the second playback signal, to obtain the first audio signal and the second audio signal.
17 . The terminal device according to claim 11 , wherein the terminal device further comprises a flexible screen.
18 . The terminal device according to claim 11 , wherein the first play component is a speaker or a receiver, and the second play component is a speaker or a receiver.
19 . The terminal device according to claim 11 , wherein the terminal device further comprises a third play component, and the first play component, the second play component, and the third play component are asymmetrically disposed.
20 . A non-transitory computer-readable storage medium, wherein the non-transitory computer-readable storage medium stores a computer program, and when the computer program is executed by a terminal device, the terminal device comprises a first play component and a second play component that are asymmetrically disposed, and is enabled to perform the following operations:
obtaining a first target frequency response corresponding to the first play component and a second target frequency response corresponding to the second play component; and
playing, by the first play component, a first audio signal in a video by using the first target frequency response, and playing, by the second play component, a second audio signal in the video by using the second target frequency response, when the terminal device plays the video, wherein
a sound image generated after the first audio signal and the second audio signal are superposed is located at a first location, and a distance between the first location and a central location of the terminal device is less than a preset value.