Audio processing method, wireless earphone, and computer-readable medium
View Patent ↗An audio processing method, a wireless earphone, and a non-transitory computer-readable medium are provided. The method is performed by the wireless earphone. Based on a wireless signal transmitted from a sound source device, a spatial position parameter of the wireless earphone is determined, where the spatial position parameter is used to indicate a spatial position relationship between the wireless earphone and the sound source device. A target spatial audio parameter is determined by determining, based on the spatial position parameter, a spatial audio parameter of the wireless earphone. A to-be-played audio signal is determined, based on the target spatial audio parameter and an audio signal outputted by the sound source device.
1 . An audio processing method, wherein the method is performed by a wireless earphone, and the method comprises:
determining, based on a wireless signal transmitted from a sound source device, a spatial position parameter of the wireless earphone, wherein the spatial position parameter is used to indicate a spatial position relationship between the wireless earphone and the sound source device;
obtaining a target spatial audio parameter by determining, based on the spatial position parameter, a spatial audio parameter of the wireless earphone, comprising:
determining, based on the spatial position parameter, a specified gain parameter and a specified delay parameter;
taking the specified delay parameter as an audio parameter of direct sound;
obtaining, based on the specified gain parameter, a gain parameter of reflected sound and a gain parameter of reverberation sound; and
obtaining, based on the specified delay parameter, a delay duration of reflected sound and a delay duration of reverberation sound; and
determining a to-be-played audio signal, based on the target spatial audio parameter and an audio signal outputted by the sound source device, comprising:
determining, based on the audio parameter of direct sound, a direct sound signal of the audio signal;
outputting, based on the gain parameter of reflected sound and the delay duration of reflected sound, a reflected sound signal of the audio signal;
outputting, based on the gain parameter of reverberation sound and the delay duration of reverberation sound, a reverberation sound signal of the audio signal; and
mixing the direct sound signal, the reflected sound signal and the reverberation sound signal, and obtaining the to-be-played audio signal.
2 . The method as claimed in claim 1 , wherein the spatial position parameter comprises at least one of a distance parameter and an angle of arrival, and the spatial audio parameter comprises at least one of a gain parameter and a delay duration.
3 . The method as claimed in claim 2 , wherein the spatial position parameter comprises the distance parameter, and determining, based on the spatial position parameter, the specified gain parameter and the specified delay parameter comprises:
determining, based on a negative correlation between the distance parameter and the gain parameter, the specified gain parameter; and
determining, based on a positive correlation between the distance parameter and the delay duration, as the specified delay duration.
4 . The method as claimed in claim 2 , wherein the spatial position parameter comprises the angle of arrival, and determining, based on the spatial position parameter, the specified gain parameter and the specified delay parameter comprises:
determining, based on a negative correlation between the angle of arrival and the gain parameter, as the specified gain parameter.
5 . The method as claimed in claim 2 , wherein the spatial position parameter comprises the distance parameter and the angle of arrival, and determining, based on the spatial position parameter, the specified gain parameter and the specified delay parameter, comprises:
obtaining the specified gain parameter, based on a negative correlation between the distance parameter and the gain parameter and a negative correlation between the angle of arrival and the gain parameter; and
determining, based on a positive correlation between the distance parameter and the delay duration, the specified delay duration.
6 . The method as claimed in claim 5 , wherein obtaining the specified gain parameter based on the negative correlation between the distance parameter and the gain parameter and the negative correlation between the angle of arrival and the gain parameter, comprises:
determining, based on the negative correlation between the distance parameter and the gain parameter, a gain parameter corresponding to the distance parameter as a first gain parameter;
determining, based on the negative correlation between the angle of arrival and the gain parameter, a gain parameter corresponding to the angle of arrival as a second gain parameter; and
obtaining the specified gain parameter, based on the first gain parameter and the second gain parameter.
7 . The method as claimed in claim 6 , wherein obtaining the specified gain parameter based on the first gain parameter and the second gain parameter, comprises:
obtaining, as the specified gain parameter, an average gain parameter of the first gain parameter and the second gain parameter; or
setting a first weight and a second weight, obtaining a first product of the first weight and the first gain parameter, and obtaining a second product of the second weight and the second gain parameter; and obtaining, as the specified gain parameter, a sum of the first product and the second product.
8 . The method as claimed in claim 1 , wherein determining, based on the audio parameter of direct sound, the direct sound signal of the audio signal, comprises:
obtaining the direct sound signal, by delaying the audio signal based on the delay duration of direct sound.
9 . The method as claimed in claim 8 , wherein outputting, based on the gain parameter of reflected sound and the delay duration of reflected sound, the reflected sound signal of the audio signal, comprises:
obtaining the reflected sound signal, by performing, based on the gain parameter of reflected sound, volume adjustment on components of the direct sound signal in a whole frequency band range, and by performing, based on the delay duration of reflected sound, delay processing on the components of the direct sound signal in the whole frequency band range.
10 . The method as claimed in claim 9 , wherein obtaining the reflected sound signal by performing, based on the gain parameter of reflected sound, the volume adjustment on the components of the direct sound signal in the whole frequency band range, and by performing, based on the delay duration of reflected sound, the delay processing on the components of the direct sound signal in the whole frequency band range, comprises:
setting, based on the gain parameter of reflected sound and the delay duration of reflected sound, a gain parameter and a delay parameter for each of N first all-pass filters;
obtaining a reflected sound sub-signal by performing, with each of the first all-pass filters, the volume adjustment and the delay processing on the components of the direct sound signal in the whole frequency band range; and
obtaining the reflected sound signal by mixing the reflected sound sub-signals obtained by the N first all-pass filters.
11 . The method as claimed in claim 9 , wherein outputting, based on the gain parameter of reverberation sound and the delay duration of reverberation sound, the reverberation sound signal of the audio signal, comprises:
obtaining the reverberation sound signal, by performing, based on the gain parameter of reverberation sound, volume adjustment on a component at a specified frequency band of the reflected sound signal, and by performing, based on the delay duration of reverberation sound, delay processing on the component at the specified frequency band of the reflected sound signal.
12 . The method as claimed in claim 11 , wherein obtaining the reverberation sound signal by performing, based on the gain parameter of reverberation sound, the volume adjustment on the component at the specified frequency band of the reflected sound signal, and by performing, based on the delay duration of reverberation sound, the delay processing on the component at the specified frequency band of the reflected sound signal, comprises:
setting, based on the gain parameter of reverberation sound and the delay duration of reverberation sound, a gain parameter and a delay parameter for each of M second all-pass filters;
filtering out, through a low-pass filter, a component of the reflected sound signal outside of the specified frequency band; and
obtaining the reverberation sound signal by performing, through the M second all-pass filters successively, the volume adjustment and the delay processing on the component at the specified frequency band of the reflected sound signal.
13 . A wireless earphone, comprising: an audio processing circuit, a loudspeaker, and a wireless signal receiver connected to the audio processing circuit,
wherein the wireless signal receiver is configured to obtain a wireless signal transmitted from a sound source device; and
wherein the audio processing circuit comprises an audio regulator and a processor connected to the audio regulator;
the processor is configured to: determine a spatial position parameter of the wireless earphone, based on the wireless signal that is transmitted from the sound source device and received by the wireless signal receiver; and obtain a target spatial audio parameter by determining, based on the spatial position parameter, a spatial audio parameter of the wireless earphone; and
the audio regulator is configured to obtain a to-be-played audio signal by regulating, based on the target spatial audio parameter, an audio signal outputted by the sound source device;
wherein the spatial position parameter comprises a distance parameter and an angle of arrival, and the spatial audio parameter comprises a gain parameter and a delay duration, and the processor is specifically configured to:
determine, based on a negative correlation between the distance parameter and the gain parameter, a gain parameter corresponding to the distance parameter as a first gain parameter;
determine, based on a negative correlation between the angle of arrival and the gain parameter, a gain parameter corresponding to the angle of arrival as a second gain parameter;
obtain a target gain parameter, based on the first gain parameter and the second gain parameter; and
determine a target delay duration, based on a positive correlation between the distance parameter and the delay duration.
14 . The wireless earphone as claimed in claim 13 , wherein the audio processing circuit further comprises: a first mixer, a direct sound circuit, a reflected sound circuit, and a reverberation sound circuit, wherein each of the direct sound circuit, the reflected sound circuit, and the reverberation sound circuit are connected to the processor and the first mixer, and the first mixer is connected to the loudspeaker; and the spatial audio parameter comprises a spatial audio parameter of direct sound, a spatial audio parameter of reflected sound, and a spatial audio parameter of reverberation sound;
the direct sound circuit is configured to output, based on the spatial audio parameter of direct sound, a direct sound signal of the audio signal;
the reflected sound circuit is configured to output, based on the spatial audio parameter of reflected sound, a reflected sound signal of the audio signal;
the reverberation sound circuit is configured to output, based on the spatial audio parameter of reverberation sound, a reverberation sound signal of the audio signal; and
the first mixer is configured to mix the direct sound signal, the reflected sound signal and the reverberation sound signal, and obtain the to-be-played audio signal.
15 . The wireless earphone as claimed in claim 14 , wherein the direct sound circuit comprises a delayer, and the delayer is connected to each of an input of the reflected sound circuit and a first input of the first mixer,
the delayer is configured to obtain the direct sound signal by delaying the audio signal based on the spatial audio parameter of direct sound;
the reflected sound circuit is further configured to obtain the reflected sound signal by performing, based on the spatial audio parameter of reflected sound, volume adjustment and delay processing on components of the direct sound signal in a whole frequency band range; and
the reverberation sound circuit is further configured to obtain the reverberation sound signal by performing, based on the spatial audio parameter of reverberation sound, volume adjustment and delay processing on a component at a specified frequency band of the reflected sound signal.
16 . The wireless earphone as claimed in claim 15 , wherein the reflected sound circuit comprises a first filter bank and a second mixer, the first filter bank is connected to the delayer, the first filter bank comprises N first all-pass filters connected in parallel, and each of the first all-pass filters is connected to one input of the second mixer, an output of the second mixer is connected to each of an input of the reverberation sound delayer and a second input of the first mixer, where N is a positive integer;
each of the first all-pass filters is configured to obtain a reflected sound sub-signal by performing, based on the spatial audio parameter of reflected sound, the volume adjustment and the delay processing on the components of the direct sound signal in the whole frequency band range; and
the second mixer is configured to obtain the reflected signal by mixing the reflected sound sub-signals output by the individual first all-pass filters.
17 . The wireless earphone as claimed in claim 16 , wherein the component at the specified frequency band is a low-frequency component, the reverberation sound circuit comprises a low-pass filter and a second filter bank, the second filter bank comprises M second all-pass filters connected in series, an output of the reflected sound circuit is connected to an input of the second filter bank through the low-pass filter, and an output of the second filter bank is connected to a third input of the first mixer, where Mis a positive integer;
the low-pass filter is configured to filter out a high-frequency component of the reflected sound signal; and
the second all-pass filters are configured to perform, based on the spatial audio parameter of reverberation sound, volume adjustment and delay processing on the low-frequency component of the reflected sound signal, thereby obtaining the reverberation sound signal;
wherein the audio processing circuit further comprises an amplitude modulation circuit, an output of the first mixer is connected to an input of the amplitude modulation circuit, and an output of the amplitude modulation circuit is connected to the loudspeaker.
18 . A non-transitory computer-readable storage medium, storing thereon program codes executable by a processor, wherein the program codes, when being executed by the processor, cause the processor to implement an audio processing method, comprising:
determining, based on a wireless signal transmitted from a sound source device, a spatial position parameter of a wireless earphone, wherein the spatial position parameter is used to indicate a spatial position relationship between the wireless earphone and the sound source device;
obtaining, based on the spatial position parameter, a target spatial audio parameter of the wireless earphone, wherein the target spatial audio parameter comprises an audio parameter of direct sound, an audio parameter of reflected sound, and an audio parameter of reverberation sound, the audio parameter of direct sound comprises a delay duration of direct sound, and the audio parameter of reflected sound comprises a gain parameter of reflected sound and a delay duration of reflected sound; and
determining a to-be-played audio signal, based on the target spatial audio parameter and an audio signal outputted by the sound source device, comprising:
obtaining a direct sound signal, by delaying the audio signal based on the delay duration of direct sound;
setting, based on the audio parameter of reflected sound, a gain parameter and a delay parameter for each of N first all-pass filters; obtaining a reflected sound sub-signal by performing, with each of the first all-pass filters, volume adjustment and delay processing on components of the direct sound signal in a whole frequency band range; and obtaining a reflected sound signal by mixing the reflected sound sub-signals obtained by the N first all-pass filters;
obtaining, based on the audio parameter of reverberation sound, a reverberation sound signal of the audio signal; and
mixing the direct sound signal, the reflected sound signal and the reverberation sound signal, and obtaining the to-be-played audio signal.