Sound channel switching method and device and electronic equipment

文档序号:1820169 发布日期:2021-11-09 浏览:18次 中文

阅读说明:本技术 声道切换方法、装置和电子设备 (Sound channel switching method and device and electronic equipment ) 是由 晏燕楠 游利文 于 2021-08-06 设计创作,主要内容包括:本申请公开了一种声道切换方法、装置和电子设备,属于通信技术领域。方法包括:在电子设备播放音频,且电子设备的目标状态发生变化的情况下,获取电子设备的状态变化参数,其中,状态变化参数包括折叠角度、旋转角度或伸缩幅度;根据状态变化参数,对第一声道信号和第二声道信号根据第一融合方式进行融合,得到第三声道信号,以及对第一声道信号和第二声道信号根据第二融合方式进行融合,得到第四声道信号;控制第一扬声器由播放第一声道信号切换为播放第三声道信号,以及控制第二扬声器由播放第二声道信号切换为播放第四声道信号,其中,在切换声道信号前,第一扬声器和第二扬声器播放的声道与所处的方位不匹配。(The application discloses a sound channel switching method and device and electronic equipment, and belongs to the technical field of communication. The method comprises the following steps: the method comprises the steps that under the condition that the electronic equipment plays audio and the target state of the electronic equipment changes, state change parameters of the electronic equipment are obtained, wherein the state change parameters comprise folding angles, rotation angles or stretching amplitudes; according to the state change parameters, the first sound channel signal and the second sound channel signal are fused according to a first fusion mode to obtain a third sound channel signal, and the first sound channel signal and the second sound channel signal are fused according to a second fusion mode to obtain a fourth sound channel signal; and controlling the first loudspeaker to switch from playing the first sound channel signal to playing the third sound channel signal, and controlling the second loudspeaker to switch from playing the second sound channel signal to playing the fourth sound channel signal, wherein before the sound channel signals are switched, the sound channels played by the first loudspeaker and the second loudspeaker are not matched with the direction of the first loudspeaker and the second loudspeaker.)

1. A method for switching sound channels is applied to an electronic device, and the method comprises the following steps:

the method comprises the steps that under the condition that audio is played by the electronic equipment and the target state of the electronic equipment is changed, state change parameters of the electronic equipment are obtained, wherein the state change parameters comprise a folding angle, a rotating angle or a stretching amplitude, and the stretching amplitude is the screen stretching amplitude of the electronic equipment;

according to the state change parameters, fusing the first channel signal and the second channel signal according to a first fusion mode to obtain a third channel signal, and fusing the first channel signal and the second channel signal according to a second fusion mode to obtain a fourth channel signal;

and controlling a first loudspeaker to switch from playing the first sound channel signal to playing the third sound channel signal, and controlling a second loudspeaker to switch from playing the second sound channel signal to playing the fourth sound channel signal, wherein before the sound channel signals are switched, the sound channels played by the first loudspeaker and the second loudspeaker are not matched with the direction of the first loudspeaker and the second loudspeaker.

2. The method according to claim 1, wherein the fusing the first channel signal and the second channel signal according to the state change parameter in a first fusion manner to obtain a third channel signal, and fusing the first channel signal and the second channel signal according to a second fusion manner to obtain a fourth channel signal, comprises:

respectively acquiring a first frequency spectrum amplitude of the first sound channel signal and a second frequency spectrum amplitude of the second sound channel signal;

determining a fusion component according to the state change parameter, the first spectrum amplitude and the second spectrum amplitude;

performing first operation processing on the first frequency spectrum amplitude and the fusion component to obtain a third frequency spectrum amplitude of the fused third sound channel signal;

and performing second operation processing on the second frequency spectrum amplitude and the fusion component to obtain a fourth frequency spectrum amplitude of the fourth sound channel signal after fusion.

3. The method of claim 2, wherein determining a fused component from the state change parameter, the first spectral magnitude, and the second spectral magnitude comprises:

determining a state coefficient according to the state change parameter and the maximum change value of the target state;

and calculating the product of the state coefficient and a first difference value to obtain the fusion component, wherein the first difference value is the difference value between the first spectrum amplitude and the second spectrum amplitude.

4. The method according to claim 3, wherein the performing the first operation on the first spectral amplitude and the fused component to obtain a third spectral amplitude of the fused third channel signal comprises:

subtracting the fused component from the first spectrum amplitude to obtain a third spectrum amplitude;

the second operation processing on the second frequency spectrum amplitude and the fusion component to obtain a fourth frequency spectrum amplitude of the fused fourth channel signal includes:

and adding the second frequency spectrum amplitude and the fusion component to obtain a fourth frequency spectrum amplitude.

5. The method according to claim 3, wherein when the state change parameter is a folding angle, the maximum change value of the target state is 180 degrees;

when the state change parameter is a rotation angle, the maximum change value of the target state is 90 degrees or 180 degrees;

and when the state change parameter is the expansion amplitude, the maximum change value of the target state is the maximum expansion amplitude of the screen of the electronic equipment.

6. The method according to claim 2, wherein the separately obtaining a first spectral amplitude of the first channel signal and a second spectral amplitude of the second channel signal comprises:

respectively acquiring a first amplitude characteristic of the first channel signal in a frequency domain and a second amplitude characteristic of the second channel signal in the frequency domain;

and respectively converting the first amplitude characteristic and the second amplitude characteristic into frequency spectrum amplitude values to obtain the first frequency spectrum amplitude value and the second frequency spectrum amplitude value.

7. The method of claim 1, wherein before controlling the first speaker to switch from playing the first channel signal to playing the third channel signal and controlling the second speaker to switch from playing the second channel signal to playing the fourth channel signal, the method further comprises:

predicting a position of each of a plurality of speakers of the electronic device after a target state of the electronic device has changed;

and under the condition that the currently played sound channel of a target loudspeaker in the loudspeakers is not matched with the predicted direction of the target loudspeaker, determining that the target loudspeaker is a loudspeaker to be switched, wherein the loudspeaker currently playing the first sound channel signal in the loudspeakers to be switched is the first loudspeaker, and the loudspeaker currently playing the second sound channel signal in the loudspeakers to be switched is the second loudspeaker.

8. A sound channel switching device applied to an electronic device, the sound channel switching device comprising:

the electronic equipment comprises an acquisition module, a display module and a display module, wherein the acquisition module is used for acquiring state change parameters of the electronic equipment under the condition that the electronic equipment plays audio and the target state of the electronic equipment changes, the state change parameters comprise folding angles, rotation angles or stretching amplitudes, and the stretching amplitudes are screen stretching amplitudes of the electronic equipment;

the processing module is used for fusing the first sound channel signal and the second sound channel signal according to a first fusion mode to obtain a third sound channel signal and fusing the first sound channel signal and the second sound channel signal according to a second fusion mode to obtain a fourth sound channel signal;

and the control module is used for controlling the first loudspeaker to switch from playing the first sound channel signal to playing the third sound channel signal and controlling the second loudspeaker to switch from playing the second sound channel signal to playing the fourth sound channel signal, wherein before the sound channel signals are switched, the sound channels played by the first loudspeaker and the second loudspeaker are not matched with the direction of the sound channels.

9. An electronic device comprising a processor, a memory, and a program or instructions stored on the memory and executable on the processor, the program or instructions when executed by the processor implementing the steps of the channel switching method according to any of claims 1-7.

10. A readable storage medium, on which a program or instructions are stored, which when executed by a processor implement the steps of the channel switching method according to any of claims 1-7.

Technical Field

The application belongs to the technical field of communication, and particularly relates to a method and a device for switching a sound channel and electronic equipment.

Background

At present, many electronic devices are equipped with a plurality of speakers, and the speakers in different directions play audio of different channels to achieve a stereo playing effect. Taking an electronic device with four speakers as an example, the left channel audio is usually played through two speakers at the top of the electronic device, and the right channel audio is played through two speakers at the bottom of the electronic device, so as to achieve a stereo effect. However, when the electronic device switches the posture, for example, when the electronic device is rotated or folded, the orientation of the speakers may change, and at this time, the sound channel signals played by some speakers may not match with the human ears, thereby affecting the stereo playing effect.

Disclosure of Invention

The embodiment of the application aims to provide a sound channel switching method and device and electronic equipment, and can solve the problem that the stereo playing effect is poor when the posture of the existing electronic equipment is switched.

In a first aspect, an embodiment of the present application provides a channel switching method, which is applied to an electronic device, and the method includes:

the method comprises the steps that under the condition that audio is played by the electronic equipment and the target state of the electronic equipment is changed, state change parameters of the electronic equipment are obtained, wherein the state change parameters comprise a folding angle, a rotating angle or a stretching amplitude, and the stretching amplitude is the screen stretching amplitude of the electronic equipment;

according to the state change parameters, fusing the first channel signal and the second channel signal according to a first fusion mode to obtain a third channel signal, and fusing the first channel signal and the second channel signal according to a second fusion mode to obtain a fourth channel signal;

and controlling a first loudspeaker to switch from playing the first sound channel signal to playing the third sound channel signal, and controlling a second loudspeaker to switch from playing the second sound channel signal to playing the fourth sound channel signal, wherein before the sound channel signals are switched, the sound channels played by the first loudspeaker and the second loudspeaker are not matched with the direction of the first loudspeaker and the second loudspeaker.

In a second aspect, an embodiment of the present application provides a sound channel switching apparatus, which is applied to an electronic device, and includes:

the electronic equipment comprises an acquisition module, a display module and a display module, wherein the acquisition module is used for acquiring state change parameters of the electronic equipment under the condition that the electronic equipment plays audio and the target state of the electronic equipment changes, the state change parameters comprise folding angles, rotation angles or stretching amplitudes, and the stretching amplitudes are screen stretching amplitudes of the electronic equipment;

the processing module is used for fusing the first sound channel signal and the second sound channel signal according to a first fusion mode to obtain a third sound channel signal and fusing the first sound channel signal and the second sound channel signal according to a second fusion mode to obtain a fourth sound channel signal;

and the control module is used for controlling the first loudspeaker to switch from playing the first sound channel signal to playing the third sound channel signal and controlling the second loudspeaker to switch from playing the second sound channel signal to playing the fourth sound channel signal, wherein before the sound channel signals are switched, the sound channels played by the first loudspeaker and the second loudspeaker are not matched with the direction of the sound channels.

In a third aspect, an embodiment of the present application provides an electronic device, which includes a processor, a memory, and a program or an instruction stored on the memory and executable on the processor, and when executed by the processor, the program or the instruction implements the steps of the channel switching method according to the first aspect.

In a fourth aspect, the present application provides a readable storage medium, on which a program or instructions are stored, which when executed by a processor implement the steps of the channel switching method according to the first aspect.

In a fifth aspect, an embodiment of the present application provides a chip, where the chip includes a processor and a communication interface, where the communication interface is coupled to the processor, and the processor is configured to execute a program or an instruction to implement the channel switching method according to the first aspect.

In the embodiment of the application, under the condition that the electronic equipment plays audio and the target state of the electronic equipment changes, state change parameters of the electronic equipment are obtained, wherein the state change parameters comprise a folding angle, a rotating angle or a stretching amplitude, and the stretching amplitude is the screen stretching amplitude of the electronic equipment; according to the state change parameters, fusing the first channel signal and the second channel signal according to a first fusion mode to obtain a third channel signal, and fusing the first channel signal and the second channel signal according to a second fusion mode to obtain a fourth channel signal; and controlling a first loudspeaker to switch from playing the first sound channel signal to playing the third sound channel signal, and controlling a second loudspeaker to switch from playing the second sound channel signal to playing the fourth sound channel signal, wherein before the sound channel signals are switched, the sound channels played by the first loudspeaker and the second loudspeaker are not matched with the direction of the first loudspeaker and the second loudspeaker. Therefore, when the target state of the electronic equipment changes, the sound channel signals of the loudspeakers with changed positions are fused according to the state change parameters, so that the sound channel signals played by the loudspeakers can be matched with the positions, smooth sound channel switching is realized, and the electronic equipment can obtain a good stereo playing effect in the process of the target state change.

Drawings

Fig. 1 is a flowchart of a channel switching method provided in an embodiment of the present application;

fig. 2a is a schematic view of a first folded state of an electronic device provided in an embodiment of the present application;

fig. 2b is a schematic view of a second folded state of the electronic device according to the embodiment of the present application;

fig. 3a is a schematic view of an electronic device provided in an embodiment of the present application in an unfolded state;

fig. 3b is a schematic view of the electronic device provided in the embodiment of the present application after rotating clockwise by 90 degrees in the unfolded state;

fig. 3c is a schematic view of the electronic device provided in the embodiment of the present application after rotating clockwise by 180 degrees in the unfolded state;

fig. 3d is a schematic view of the electronic device provided in the embodiment of the present application after rotating 270 degrees clockwise in the unfolded state;

fig. 4a is a schematic view of an electronic device provided in an embodiment of the present application in a landscape state;

fig. 4b is a schematic view of an electronic device provided in an embodiment of the present application being rotated clockwise by 180 degrees in a landscape state;

fig. 5 is a schematic structural diagram of a channel switching apparatus according to an embodiment of the present application;

fig. 6 is a schematic structural diagram of an electronic device provided in an embodiment of the present application;

fig. 7 is a schematic hardware structure diagram of an electronic device according to an embodiment of the present application.

Detailed Description

The technical solutions in the embodiments of the present application will be described clearly below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some, but not all, embodiments of the present application. All other embodiments that can be derived by one of ordinary skill in the art from the embodiments given herein are intended to be within the scope of the present disclosure.

The terms first, second and the like in the description and in the claims of the present application are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It will be appreciated that the data so used may be interchanged under appropriate circumstances such that embodiments of the application may be practiced in sequences other than those illustrated or described herein, and that the terms "first," "second," and the like are generally used herein in a generic sense and do not limit the number of terms, e.g., the first term can be one or more than one. In addition, "and/or" in the specification and claims means at least one of connected objects, a character "/" generally means that a preceding and succeeding related objects are in an "or" relationship.

The following describes the channel switching method provided by the embodiments of the present application in detail through specific embodiments and application scenarios thereof with reference to the accompanying drawings.

Referring to fig. 1, fig. 1 is a flowchart of a channel switching method provided in an embodiment of the present application, applied to an electronic device, as shown in fig. 1, the method includes the following steps:

step 101, acquiring a state change parameter of the electronic device when the electronic device plays audio and the target state of the electronic device changes.

The state change parameters comprise folding angles, rotation angles or stretching amplitudes, and the stretching amplitudes are screen stretching amplitudes of the electronic equipment.

The embodiment of the application is applicable to folding screen electronic equipment, scroll screen electronic equipment or common electronic equipment and the like, and is applicable to electronic equipment with a plurality of speakers, for example, electronic equipment with four speakers, wherein two speakers are arranged at the top of the electronic equipment, and two speakers are arranged at the bottom of the electronic equipment. For a folding screen or a scroll screen electronic device, when the electronic device is in an unfolded state, one speaker of each of the top and bottom is located on the left side of the electronic device and the other speaker of the top and bottom is located on the right side of the electronic device. When the electronic device is switched from the portrait screen state to the landscape screen state, the top two speakers are located on the left side or the right side of the electronic device, and correspondingly, the bottom two speakers are located on the right side or the left side of the electronic device.

The target state may be a folded state, a rotated state, a telescopic state, or the like, and accordingly, the state change parameter may be a folding angle, a rotation angle, a telescopic amplitude, or the like.

For the folding screen electronic device, the folding angle of the electronic device can be obtained when the folding state of the folding screen electronic device changes, such as when the folding screen electronic device is folded or unfolded, and the folding angle can be obtained by detecting the folding angle in real time.

The rotation angle of the electronic device may be obtained when the rotation state of the electronic device changes, for example, the electronic device is rotated clockwise or counterclockwise to switch between landscape screen use and portrait screen use, and may specifically be obtained by detecting the rotation angle in real time.

For the scroll screen electronic device, the expansion and contraction amplitude of the electronic device can be obtained when the expansion and contraction state of the scroll screen changes, for example, when the scroll screen is stretched or contracted, and the expansion and contraction amplitude can be obtained by detecting the expansion and contraction amplitude in real time.

In the related art, when the electronic device is in a normal vertical screen state, the left channel audio is usually played through the top speaker, and the right channel audio is played through the bottom speaker, but when the electronic device rotates, folds or stretches, the orientation of some speakers of the electronic device changes, for example, as shown in fig. 2a and 2b, when the folding screen electronic device 20 is gradually unfolded from the folding state, the top speaker 21 and the bottom speaker 22 are located on the left side of the electronic device 20, and the top speaker 23 and the bottom speaker 24 are located on the right side of the electronic device 20; as shown in fig. 3a and 3b, when the folded-screen electronic device 20 in the unfolded state is rotated clockwise by 90 degrees from the vertical-screen state, the top speaker 21 is switched from the left side of the electronic device 20 to the right side of the electronic device 20, and the bottom speaker 24 is switched from the right side of the electronic device 20 to the left side of the electronic device 20; as shown in fig. 4a and 4b, when the electronic device 20 is rotated clockwise by 180 degrees from the landscape state, the top speaker 21 and the top speaker 23 are switched from the left side of the electronic device 20 to the right side of the electronic device 20, and the bottom speaker 22 and the bottom speaker 24 are switched from the right side of the electronic device 20 to the left side of the electronic device 20; for the scroll screen electronic device, when the scroll screen electronic device is stretched outward from the contracted state, one speaker of each of the top and bottom switches to the left side of the electronic device, and the other speaker of the top and bottom switches to the right side of the electronic device.

In the embodiment of the present application, considering that when the target state of the electronic device changes, the orientation of some speakers of the electronic device changes, and if each speaker still keeps the existing playing sound channel unchanged, some left speakers may play right sound channel audio, and some right speakers play left sound channel audio, which are not matched with the hearing of human ears, and may affect the hearing sense of human beings, that is, the stereo playing effect may be degraded, therefore, to obtain a better stereo playing effect, the sound channels may be switched for the speakers whose orientations change and playing sound channels are not matched with the current orientation, to ensure that the sound channel audio played by each speaker after the target state of the electronic device changes keeps matching with human ears, and to ensure the audio playing effect during the target state change, to avoid the problems of stumbling or silence, etc., according to the real-time state change parameters of the electronic device, the sound channel signals of the speakers are fused, for example, for a speaker which originally plays a left sound channel signal, parameters can be changed along with the current state, and the left sound channel signal and the right sound channel signal are fused according to a corresponding proportion, so that the speaker plays the fused sound channel signal.

And step 102, according to the state change parameter, fusing the first channel signal and the second channel signal according to a first fusion mode to obtain a third channel signal, and fusing the first channel signal and the second channel signal according to a second fusion mode to obtain a fourth channel signal.

Therefore, in this step, a first channel Signal and a second channel Signal in the audio currently played by the electronic device may be obtained, specifically, different channel signals may be obtained in real time from an audio Digital Signal processor (dsp), where the first channel Signal and the second channel Signal may respectively refer to a left channel Signal and a right channel Signal, and of course, for a scene with more channels, such as a front channel and a rear channel, the first channel Signal and the second channel Signal may also be other channel signals except the left channel Signal and the right channel Signal.

Then, the first channel signal and the second channel signal may be fused according to a first fusion method according to the current state change parameter of the electronic device to obtain a fused third channel signal, and the first channel signal and the second channel signal may be fused according to a second fusion method to obtain a fused fourth channel signal, specifically, a fusion scaling factor may be determined based on the state change parameter, and then a channel signal is fused into another channel signal according to the scaling factor, for example, when it is determined that the fusion scaling factor is 0.3, the first fusion method may be to fuse the second channel signal multiplied by 0.3 into the first channel signal, and the second fusion method may be to fuse the first channel signal multiplied by 0.3 into the second channel signal, or may be to fuse the first channel signal and the second channel signal according to a ratio of 7:3, and obtaining a third sound channel signal, and fusing the first sound channel signal and the second sound channel signal according to the proportion of 3:7 to obtain a fourth sound channel signal.

It should be noted that, after the target state of the electronic device is changed in place, for example, after the screen is completely unfolded, or after the vertical screen is switched to the horizontal screen, the first fusion manner may be to switch the first channel signal to the second channel signal, and the second fusion manner may be to switch the second channel signal to the first channel signal, that is, in this case, the third channel signal is the second channel signal, and the fourth channel signal is the first channel signal.

Optionally, the step 102 includes:

respectively acquiring a first frequency spectrum amplitude of the first sound channel signal and a second frequency spectrum amplitude of the second sound channel signal;

determining a fusion component according to the state change parameter, the first spectrum amplitude and the second spectrum amplitude;

performing first operation processing on the first frequency spectrum amplitude and the fusion component to obtain a third frequency spectrum amplitude of the fused third sound channel signal;

and performing second operation processing on the second frequency spectrum amplitude and the fusion component to obtain a fourth frequency spectrum amplitude of the fourth sound channel signal after fusion.

That is, in an embodiment, when the first channel signal and the second channel signal are fused, the spectral amplitudes of the first channel signal and the second channel signal in the frequency domain may be obtained first, so as to obtain the first spectral amplitude and the second spectral amplitude; determining a fusion component according to the state change parameter, the first spectrum amplitude and the second spectrum amplitude, specifically, determining a change proportion of the target state based on the state change parameter, and using a corresponding proportion of a difference value between the first spectrum amplitude and the second spectrum amplitude as a fusion component of the channel signal; then, a first operation, for example, a simple addition/subtraction or weighting operation may be performed on the first spectral amplitude and the fused component to obtain a third spectral amplitude, a second operation, for example, a simple addition/subtraction or weighting operation may be performed on the second spectral amplitude and the fused component to obtain a fourth spectral amplitude, where the third spectral amplitude is a spectral amplitude of a fused third channel signal, and the fourth spectral amplitude is a spectral amplitude of a fused fourth channel signal, and the third spectral amplitude and the fourth spectral amplitude may be converted into channel signals in a time domain, respectively, to obtain the third channel signal and the fourth channel signal.

Thus, according to the embodiment, the first channel signal and the second channel signal can be fused correspondingly according to the state variation of the electronic equipment, and the channel switching effect is ensured.

When obtaining the spectral amplitude of the first channel signal and the second channel signal, the amplitude characteristic in the frequency domain may be obtained by obtaining a time domain signal characteristic of the signals and then transforming the time domain signal characteristic. That is, the separately obtaining a first spectral amplitude of the first channel signal and a second spectral amplitude of the second channel signal may include:

respectively acquiring a first amplitude characteristic of the first channel signal in a frequency domain and a second amplitude characteristic of the second channel signal in the frequency domain;

and respectively converting the first amplitude characteristic and the second amplitude characteristic into frequency spectrum amplitude values to obtain the first frequency spectrum amplitude value and the second frequency spectrum amplitude value.

That is, amplitude characteristics of the first channel signal and the second channel signal in the frequency domain may be obtained first, then fourier transform may be performed on the amplitude characteristics of the first channel signal and the second channel signal in the frequency domain, and finally the transformed amplitude characteristics are converted into spectrum amplitudes, so that a first spectrum amplitude of the first channel signal and a second spectrum amplitude of the second channel signal may be obtained.

For example, the left channel signal x can be obtained from the aDSP in real time1In the frequency domainAmplitude feature X of1And a right channel signal x2Amplitude feature X in the frequency domain2And performing fast Fourier transform on the left and right channel signals, the transform formula is,wherein, ω isN=e(-2πi)/N(ii) a Converting the amplitude characteristic of the converted left and right channel signals into a frequency spectrum amplitude value, wherein the frequency spectrum amplitude value of the left channel signal can be represented as X1(k)′=|20×log10X1(k) The spectral magnitude of the right channel signal may be represented as X2(k)′=|20×log10X2(k)|。

Thus, with this embodiment, the spectral amplitudes of the first channel signal and the second channel signal can be quickly acquired.

Optionally, the determining a fusion component according to the state change parameter, the first spectral amplitude and the second spectral amplitude includes:

determining a state coefficient according to the state change parameter and the maximum change value of the target state;

and calculating the product of the state coefficient and a first difference value to obtain the fusion component, wherein the first difference value is the difference value between the first spectrum amplitude and the second spectrum amplitude.

That is, in one embodiment, the state coefficient may be determined according to the state change parameter and the maximum change value of the target state, for example, the state coefficient may be determined according to a ratio of the state change parameter to the maximum change value of the target state, and then a product of a difference between the first spectral amplitude and the second spectral amplitude and the state coefficient is used as the fusion component.

In an embodiment, when the state change parameter is a folding angle, the maximum change value of the target state is 180 degrees;

when the state change parameter is a rotation angle, the maximum change value of the target state is 90 degrees or 180 degrees;

and when the state change parameter is the expansion amplitude, the maximum change value of the target state is the maximum expansion amplitude of the screen of the electronic equipment.

For example, for the folded state, since the maximum folding angle is 180 degrees, the maximum variation value of the folded state may be 180 degrees; for the rotation state, considering that the orientation of the speaker changes every time the folding screen electronic device rotates 90 degrees in the unfolded state, the maximum value of the rotation state can be determined as 90 degrees, and for another case, for the ordinary electronic device, also considering the situation that the electronic device is turned left and right in the horizontal screen state, at this time, the maximum rotation of 180 degrees every time can be the maximum value of the rotation state; for the telescopic state, the maximum telescopic amplitude of the screen of the electronic device, such as the scroll screen, is the maximum value of the telescopic state, and the maximum telescopic amplitude is the difference between the screen length of the scroll screen when the scroll screen is completely unfolded and the screen length when the scroll screen is completely contracted.

Taking the maximum folding angle of 180 degrees as an example, assuming that the current folding angle is α, the state coefficient σ may be α/180 °, and the expected fused component delta may be obtained by multiplying the difference between the spectral magnitudes of the left and right channels (i.e., the frequency domain feature difference between the two channels) by the state coefficient σ, i.e., delta σ · [ X · difference between the left and right and left and right and left and right and left and right-left and1(k)′-X2(k)′]wherein, sigma is more than or equal to 0 and less than or equal to 1.

Therefore, by the implementation mode, the fusion component consistent with the target state variation can be obtained through fast calculation, and the subsequent sound channel fusion effect is further ensured.

Optionally, the performing a first operation on the first spectral amplitude and the fused component to obtain a third spectral amplitude of the fused third channel signal includes:

subtracting the fused component from the first spectrum amplitude to obtain a third spectrum amplitude;

the second operation processing on the second frequency spectrum amplitude and the fusion component to obtain a fourth frequency spectrum amplitude of the fused fourth channel signal includes:

and adding the second frequency spectrum amplitude and the fusion component to obtain a fourth frequency spectrum amplitude.

After the fused component is determined according to the foregoing manner, the spectrum amplitudes of the first channel signal and the second channel signal may be added or subtracted with the fused component to obtain the spectrum amplitude of the fused channel signal, specifically, the third spectrum amplitude of the fused third channel signal may be obtained by subtracting the fused component from the first spectrum amplitude, and the fourth spectrum amplitude of the fused fourth channel signal may be obtained by adding the fused component to the second spectrum amplitude.

For example, in the fused component delta σ · [ X ═ X1(k)′-X2(k)′]Then, the new left channel spectrum amplitude after fusion can be X1(k) ' -delta, the new merged right channel spectral magnitude may be X2(k)′+delta。

When the fused component is calculated in the foregoing manner, the fused component may be obtained by multiplying a difference between the second spectral amplitude and the first spectral amplitude by a state coefficient, that is, delta σ · [ X ·2(k)′-X1(k)′]In this calculation manner, the fused component may be correspondingly added to the first spectral amplitude to obtain a fused third spectral amplitude, and the fused component may be subtracted from the second spectral amplitude to obtain a fused fourth spectral amplitude.

After the fused vocal tract spectrum amplitude is obtained through calculation, the fused vocal tract spectrum amplitude can be restored to a time domain signal, that is, the third frequency spectrum amplitude and the fourth frequency spectrum amplitude can be subjected to inverse fast fourier transform to obtain a third vocal tract signal and a fourth vocal tract signal in the time domain, wherein a calculation formula of the inverse fast fourier transform can be thatWherein, ω isN=e(-2πi)/N

Thus, according to the embodiment, the fusion switching of the two-channel signals can be completed by simply calculating the spectral amplitude of the two-channel signals and combining the state coefficient, and the smooth channel fusion effect can be ensured by the proportional fusion mode of the two-channel signals according to the state variable quantity.

Step 103, controlling the first speaker to switch from playing the first channel signal to playing the third channel signal, and controlling the second speaker to switch from playing the second channel signal to playing the fourth channel signal, wherein before the channel signals are switched, the channels played by the first speaker and the second speaker are located at the same direction.

After the first channel signal and the second channel signal are fused, the direction of the speaker which is currently changed along with the change of the target state so that the original playing channel is switched to the speaker whose direction is not matched with the current direction, specifically, the playing channel of the speaker which is the first channel signal and whose channel signal is not matched with the current direction before the change of the target state is switched to the third channel signal, and the playing channel of the speaker which is the second channel signal and whose channel signal is not matched with the current direction before the change of the target state is switched to the fourth channel signal, so that the following switching of the speaker playing channel along with the target state is completed.

The first speaker may be a speaker whose original playing channel is the first channel signal and whose position is about to change or is no longer suitable for the first channel signal after being changed with the target state, and the second speaker may be a speaker whose original playing channel is the second channel signal and whose position is about to change or is no longer suitable for the second channel signal after being changed with the target state.

For example, when the electronic device 20 is switched from the folded state shown in FIG. 2a to the unfolded state shown in FIG. 2b, the orientation of the top speaker 21 and the bottom speaker 22 becomes the left side, the orientation of the top speaker 23 and the bottom speaker 24 becomes the right side, so that the bottom speaker 22, which originally played the right channel, will no longer match the current position, and the top speaker 23, which originally played the left channel, will also no longer match the current position, in which case, the top speaker 23 and the bottom speaker 22 are the first speaker and the second speaker that need to switch the channels, so the left channel signal and the right channel signal can be merged according to step 102, and controls the playback channel of the top speaker 23 to be gradually switched from the left channel signal to the right channel signal, and controls the playback channel of the bottom speaker 22 to be gradually switched from the right channel signal to the left channel signal.

Optionally, before the step 103, the method further includes:

predicting a position of each of a plurality of speakers of the electronic device after a target state of the electronic device has changed;

and under the condition that the currently played sound channel of a target loudspeaker in the loudspeakers is not matched with the predicted direction of the target loudspeaker, determining that the target loudspeaker is a loudspeaker to be switched, wherein the loudspeaker currently playing the first sound channel signal in the loudspeakers to be switched is the first loudspeaker, and the loudspeaker currently playing the second sound channel signal in the loudspeakers to be switched is the second loudspeaker.

In other words, in one embodiment, the orientation of each speaker of the electronic device after the target state of the electronic device is changed may be predicted when the target state of the electronic device is detected to be changed, for example, for a folding screen electronic device, the orientation of each speaker at the top and bottom may be predicted after the electronic device is unfolded gradually from a folded state, or when the electronic device is switched from a portrait screen to a landscape screen, the orientation of each speaker after the electronic device is switched may be predicted.

And can judge whether the channel currently played by each speaker matches with the changed rear direction according to the predicted direction, for example, as shown in fig. 2a and 2b, for the top speaker 23, it can judge that the left channel signal currently played by it does not match with the right direction where it is unfolded, and judge that the right channel signal currently played by the bottom speaker 22 does not match with the left direction where it is unfolded, or, as shown in fig. 3a and 3b, the top speaker 21 will be switched from left to right after rotating clockwise by 90 degrees, so that the left channel signal originally played is not matched with the current direction, and the bottom speaker 24 will be switched from right to left after rotating clockwise by 90 degrees, so that the right channel signal originally played is not matched with the current direction.

Therefore, the loudspeaker needing to switch the sound channel can be determined according to the position of each loudspeaker after the target state changes and the current playing sound channel signal, and the first loudspeaker and the second loudspeaker are further determined according to the playing sound channel of the loudspeaker needing to switch the sound channel. The embodiment can accurately and quickly determine the loudspeaker of the sound channel to be switched.

The following describes a specific implementation of the embodiment of the present application with reference to fig. 2a to 4 b:

fig. 2a and 2b show two states of the folding screen electronic device 20, as can be seen the folding screen electronic device 20 comprises a top loudspeaker 21 and a top loudspeaker 23, and a bottom loudspeaker 22 and a bottom loudspeaker 24.

When the folding-screen electronic device 20 plays music or video in the folded state, the top speaker 21 and the top speaker 23 (or the bottom speaker 22 and the bottom speaker 24) play left channel audio, and the bottom speaker 22 and the bottom speaker 24 (or the top speaker 21 and the top speaker 23) play right channel audio.

When the folding-screen electronic device 20 plays music or video in the unfolded state, the top speaker 21 and the bottom speaker 22 (or the top speaker 23 and the bottom speaker 24) play the left channel audio, and the top speaker 23 and the bottom speaker 24 (or the top speaker 21 and the bottom speaker 22) play the right channel audio.

When the folding-screen electronic device 20 changes between the two states of folding to unfolding or unfolding to folding, the playback channels of the top speaker 21 and the bottom speaker 24 (or the bottom speaker 22 and the top speaker 23) are not changed, and the bottom speaker 22 and the top speaker 23 (or the top speaker 21 and the bottom speaker 24) perform channel fusion switching as the folding state changes. When the state coefficient σ transitions from 0 to 1 (or from 1 to 0), the channel switching is completed and ended, i.e., when the change between the two states of the folding screen electronic device 20 from folded to unfolded (or unfolded to folded) is completed, the entire switching between the left and right channels is realized.

As shown in fig. 3a to fig. 3d, the channel fusion switching method in the embodiment of the present application can also be applied to screen flipping of the folding screen electronic device in the fully unfolded state.

Fig. 3a is an expanded state of the folding screen electronic device 20, in which music or video is played, and the top speaker 21 and the bottom speaker 22 are located on the left side of the folding screen electronic device 20, and play left channel audio; a top speaker 23 and a bottom speaker 24 are located on the right side of the folding screen electronic device 20 to play right channel audio.

FIG. 3b shows the folding screen electronic device 20 rotated 90 degrees clockwise to play music or video, with the bottom speaker 22 and the bottom speaker 24 positioned on the left side of the folding screen electronic device 20 to play the left channel audio; a top speaker 21 and a top speaker 23 are located on the right side of the folding screen electronic device 20 to play right channel audio.

Fig. 3c shows the folding screen electronic device 20 rotated clockwise by 180 degrees, in this state, playing music/video, with the top speaker 23 and the bottom speaker 24 located on the left side of the folding screen electronic device 20, playing left channel audio; a top speaker 21 and a bottom speaker 22 are located on the right side of the folding screen electronic device 20, playing right channel audio.

Fig. 3d shows the folding screen electronic device 20 rotated clockwise 270 degrees, in which music/video is played, and the top speaker 21 and the top speaker 23 are located on the left side of the folding screen electronic device 20, playing left channel audio; a bottom speaker 22 and a bottom speaker 24 are located on the right side of the folding screen electronic device 20 to play right channel audio.

The sound channel fusion switching principle can follow the device state coefficient sigma to approach the frequency domain, respectively process the left and right sound channel signals, and perform sound channel fusion switching, wherein sigma is the angle duty ratio of screen turning, like beta in fig. 3a is the angle of turning, sigma is beta/90 degrees, every turning of the screen is 90 degrees, and the speaker completes one sound channel fusion switching according to the turning state.

Starting from fig. 3a, in the original state of the screen, β is 0 °, and the channels of the top speaker 21, the bottom speaker 22, the top speaker 23, and the bottom speaker 24 are switched as follows during the clockwise rotation, i.e. the rotation of β from 0 ° to 90 ° to 180 ° to 270 ° to 360 °:

the top loudspeaker 21 carries out sound channel fusion switching from a left sound channel, a right sound channel and a right sound channel to a left sound channel in sequence;

the bottom speaker 22 performs channel fusion switching from the left channel, the right channel to the right channel in sequence;

the top speaker 23 performs channel fusion switching from the right channel, the left channel to the left channel in sequence;

the bottom speaker 24 performs channel fusion switching from the right channel, the left channel, and the left channel to the right channel in sequence;

therefore, when the folding screen electronic device 20 is unfolded to play music or video, no matter how to switch the placing state, the sound channel fusion switching can be smoothly performed, and the phenomenon of pause in the sound switching process can not occur.

For example, in the process of rotating the folding-screen electronic device 20 from fig. 3a to fig. 3d in the unfolded state, the playback channels of the top speaker 21, the bottom speaker 22, the top speaker 23, and the bottom speaker 24 are the left channel, the right channel, and the right channel in order in the initial state (when the rotation angle is 0); at a certain angle, the channel signals of the top speaker 21 and the bottom speaker 24 are at X 'respectively'1(k) -delta and X'2(k) + delta; when the rotation reaches 90 degrees, the playing sound channels of the top loudspeaker 21, the bottom loudspeaker 22, the top loudspeaker 23 and the bottom loudspeaker 24 are respectively fused and switched into a right sound channel, a left sound channel, a right sound channel and a left sound channel; when the rotation reaches 180 degrees, the playing sound channels of the top loudspeaker 21, the bottom loudspeaker 22, the top loudspeaker 23 and the bottom loudspeaker 24 are respectively fused and switched into a right sound channel, a left sound channel and a left sound channel; when rotated up to 270 degrees, the top speaker 21, the bottom speaker 22, the top speaker 23, and the bottom speakerThe playing sound channels of the speakers 24 are respectively fused and switched into a left sound channel, a right sound channel, a left sound channel and a right sound channel. When a certain speaker is still located on the same side (left side or right side) every 90 degrees of rotation, the playing sound channel of the speaker is not changed.

Through the sound channel fusion switching technology in the embodiment of the application, above-mentioned four kinds of states of putting can all realize two speakers in the left side and play left sound channel audio frequency, and two speakers in the right side play right sound channel audio frequency, no matter which kind of state of putting is in, the phase place that all can keep sound is synchronous with the video picture, moreover in the sound channel switching process, can realize the smooth fusion switching, makes the user obtain the user's sense of hearing experience that science and technology feels ten-footed.

As shown in fig. 4a and 4b, the method for switching fusion of sound channels in the embodiment of the present application may also be applied to sound channel switching in a situation where a mobile phone transverse screen plays a video when a folding screen electronic device or a common electronic device is in a fully folded state and the screen is turned over.

Fig. 4a shows a folded and horizontal state of the folding screen electronic device 20 (or a general electronic device), in which the electronic device 20 plays video horizontally, the top speaker 21 and the top speaker 23 are located on the left side of the folding screen electronic device 20, and plays audio of a left channel, and the bottom speaker 22 and the bottom speaker 24 are located on the right side of the folding screen electronic device 20, and plays audio of a right channel.

Fig. 4b shows that after the folding-screen electronic device 20 is rotated clockwise or counterclockwise by 180 degrees, the folding-screen electronic device 20 plays a video across the screen, and the bottom speaker 22 and the bottom speaker 24 are located on the left side of the folding-screen electronic device 20, playing a left channel audio; a top speaker 21 and a top speaker 23 are located to the right of the folding screen electronic device 20 to play the right channel audio.

The sound channel fusion switching principle is similar to the above mode, frequency domain approximation is carried out along with the equipment state coefficient sigma, left and right sound channel signals are respectively processed, sound channel fusion switching is carried out, wherein sigma is the angle duty ratio of screen turning, gamma in fig. 4b is the turning angle, sigma is gamma/180 degrees, the screen is turned by 180 degrees clockwise or anticlockwise, and the loudspeaker completes one-time sound channel fusion switching according to the turning state.

Like this, electronic equipment switches two kinds of horizontal screens and puts the state, and the phase place that all can keep sound is synchronous with the video picture, and left channel audio is broadcast to left speaker, and right channel audio is broadcast to the speaker on right side, switches the in-process at the sound channel moreover, and the card pause can not appear interrupting, realizes the smooth integration switching, makes the user obtain the user's sense of hearing that science and technology feels the ten-legged.

The method for switching the sound channel fusion can also be applied to electronic equipment with a scroll screen of four speakers, and the sound channel fusion switching of the speakers can be realized according to the telescopic state of the scroll screen. For example, in the rolled-up state, i.e., the collapsed state, the top two speakers play the left channel audio and the bottom two speakers play the right channel audio; and under the stretching state, two left side speakers are switched into left channel audio, and two right side speakers are switched into right channel audio, so that large-screen stereo sound effect is realized. In the process of stretching or rolling, the sound channel fusion switching method can be used for realizing the smooth switching effect without blocking and improving the auditory experience of a user.

In the method for switching the sound channel in the embodiment of the application, under the condition that the electronic equipment plays audio and the target state of the electronic equipment changes, state change parameters of the electronic equipment are obtained, wherein the state change parameters comprise a folding angle, a rotation angle or a stretching amplitude, and the stretching amplitude is the screen stretching amplitude of the electronic equipment; according to the state change parameters, fusing the first channel signal and the second channel signal according to a first fusion mode to obtain a third channel signal, and fusing the first channel signal and the second channel signal according to a second fusion mode to obtain a fourth channel signal; and controlling a first loudspeaker to switch from playing the first sound channel signal to playing the third sound channel signal, and controlling a second loudspeaker to switch from playing the second sound channel signal to playing the fourth sound channel signal, wherein before the sound channel signals are switched, the sound channels played by the first loudspeaker and the second loudspeaker are not matched with the direction of the first loudspeaker and the second loudspeaker. Therefore, when the target state of the electronic equipment changes, the sound channel signals of the loudspeakers with changed positions are fused according to the state change parameters, so that the sound channel signals played by the loudspeakers can be matched with the positions, smooth sound channel switching is realized, and the electronic equipment can obtain a good stereo playing effect in the process of the target state change.

It should be noted that, in the channel switching method provided in the embodiment of the present application, the execution main body may be a channel switching apparatus, or a control module in the channel switching apparatus for executing the channel switching method. In the embodiment of the present application, a method for performing channel switching by a channel switching device is taken as an example to describe the channel switching device provided in the embodiment of the present application.

Referring to fig. 5, fig. 5 is a schematic structural diagram of a channel switching apparatus according to an embodiment of the present application, applied to an electronic device, as shown in fig. 5, a channel switching apparatus 500 includes:

an obtaining module 501, configured to obtain a state change parameter of the electronic device when the electronic device plays an audio and a target state of the electronic device changes, where the state change parameter includes a folding angle, a rotation angle, or a stretching amplitude, and the stretching amplitude is a screen stretching amplitude of the electronic device;

a processing module 502, configured to fuse, according to the state change parameter, the first channel signal and the second channel signal according to a first fusion manner to obtain a third channel signal, and fuse, according to a second fusion manner, the first channel signal and the second channel signal to obtain a fourth channel signal;

the control module 503 is configured to control the first speaker to switch from playing the first channel signal to playing the third channel signal, and control the second speaker to switch from playing the second channel signal to playing the fourth channel signal, where before the channel signals are switched, the channels played by the first speaker and the second speaker are not matched with the position where the first speaker and the second speaker are located.

Optionally, the processing module 502 comprises:

an obtaining unit, configured to obtain a first spectral amplitude of the first channel signal and a second spectral amplitude of the second channel signal, respectively;

a determining unit, configured to determine a fusion component according to the state change parameter, the first spectrum amplitude, and the second spectrum amplitude;

the first processing unit is used for performing first operation processing on the first frequency spectrum amplitude and the fusion component to obtain a third frequency spectrum amplitude of the fused third sound channel signal;

and the second processing unit is used for performing second operation processing on the second frequency spectrum amplitude and the fusion component to obtain a fourth frequency spectrum amplitude of the fourth sound channel signal after fusion.

Optionally, the determining unit includes:

the determining subunit is used for determining a state coefficient according to the state change parameter and the maximum change value of the target state;

and the calculating subunit is configured to calculate a product of the state coefficient and a first difference value to obtain the fused component, where the first difference value is a difference value between the first spectral amplitude and the second spectral amplitude.

Optionally, the first processing unit is configured to subtract the fused component from the first spectral amplitude to obtain the third spectral amplitude;

the second processing unit is configured to add the second spectral amplitude to the fused component to obtain the fourth spectral amplitude.

Optionally, when the state change parameter is a folding angle, the maximum change value of the target state is 180 degrees;

when the state change parameter is a rotation angle, the maximum change value of the target state is 90 degrees or 180 degrees;

and when the state change parameter is the expansion amplitude, the maximum change value of the target state is the maximum expansion amplitude of the screen of the electronic equipment.

Optionally, the obtaining unit includes:

an obtaining subunit, configured to obtain a first amplitude characteristic of the first channel signal in a frequency domain and a second amplitude characteristic of the second channel signal in the frequency domain, respectively;

and the processing subunit is configured to convert the first amplitude characteristic and the second amplitude characteristic into a spectrum amplitude respectively, so as to obtain the first spectrum amplitude and the second spectrum amplitude.

Optionally, the channel switching apparatus 500 further includes:

a prediction module, configured to predict a position of each of a plurality of speakers of the electronic device after a target state of the electronic device changes;

a determining module, configured to determine that a target speaker among the multiple speakers is a speaker to be switched when a currently played sound channel of the target speaker is not matched with the predicted location of the target speaker, where a speaker currently playing the first sound channel signal among the speakers to be switched is the first speaker, and a speaker currently playing the second sound channel signal among the speakers to be switched is the second speaker.

The sound channel switching device in the embodiment of the application acquires a state change parameter of an electronic device under the condition that the electronic device plays audio and a target state of the electronic device changes, wherein the state change parameter comprises a folding angle, a rotation angle or a stretching amplitude, and the stretching amplitude is a screen stretching amplitude of the electronic device; according to the state change parameters, fusing the first channel signal and the second channel signal according to a first fusion mode to obtain a third channel signal, and fusing the first channel signal and the second channel signal according to a second fusion mode to obtain a fourth channel signal; and controlling a first loudspeaker to switch from playing the first sound channel signal to playing the third sound channel signal, and controlling a second loudspeaker to switch from playing the second sound channel signal to playing the fourth sound channel signal, wherein before the sound channel signals are switched, the sound channels played by the first loudspeaker and the second loudspeaker are not matched with the direction of the first loudspeaker and the second loudspeaker. Therefore, when the target state of the electronic equipment changes, the sound channel signals of the loudspeakers with changed positions are fused according to the state change parameters, so that the sound channel signals played by the loudspeakers can be matched with the positions, smooth sound channel switching is realized, and the electronic equipment can obtain a good stereo playing effect in the process of the target state change.

The channel switching device in the embodiment of the present application may be a device, or may be a component, an integrated circuit, or a chip in a terminal. The device can be mobile electronic equipment or non-mobile electronic equipment. By way of example, the mobile electronic device may be a mobile phone, a tablet computer, a notebook computer, a palm top computer, a vehicle-mounted electronic device, a wearable device, an ultra-mobile personal computer (UMPC), a netbook or a Personal Digital Assistant (PDA), and the like, and the non-mobile electronic device may be a server, a Network Attached Storage (NAS), a Personal Computer (PC), a Television (TV), a teller machine or a self-service machine, and the like, and the embodiments of the present application are not particularly limited.

The channel switching device in the embodiment of the present application may be a device having an operating system. The operating system may be an Android (Android) operating system, an ios operating system, or other possible operating systems, and embodiments of the present application are not limited specifically.

The sound channel switching device provided in the embodiment of the present application can implement each process implemented by the method embodiments of fig. 1 to fig. 4b, and is not described herein again to avoid repetition.

Optionally, as shown in fig. 6, an electronic device 600 is further provided in an embodiment of the present application, and includes a processor 601, a memory 602, and a program or an instruction stored in the memory 602 and executable on the processor 601, where the program or the instruction is executed by the processor 601 to implement each process of the above embodiment of the channel switching method, and can achieve the same technical effect, and no further description is provided here to avoid repetition.

It should be noted that the electronic device in the embodiment of the present application includes the mobile electronic device and the non-mobile electronic device described above.

Fig. 7 is a schematic diagram of a hardware structure of an electronic device implementing an embodiment of the present application.

The electronic device 700 includes, but is not limited to: a radio frequency unit 701, a network module 702, an audio output unit 703, an input unit 704, a sensor 705, a display unit 706, a user input unit 707, an interface unit 708, a memory 709, and a processor 710.

Those skilled in the art will appreciate that the electronic device 700 may also include a power supply (e.g., a battery) for powering the various components, and the power supply may be logically coupled to the processor 710 via a power management system, such that the functions of managing charging, discharging, and power consumption may be performed via the power management system. The electronic device structure shown in fig. 7 does not constitute a limitation of the electronic device, and the electronic device may include more or less components than those shown, or combine some components, or arrange different components, and thus, the description is omitted here.

The processor 710 is configured to acquire a state change parameter of an electronic device when the electronic device plays an audio and a target state of the electronic device changes, where the state change parameter includes a folding angle, a rotation angle, or a stretching amplitude, and the stretching amplitude is a screen stretching amplitude of the electronic device;

according to the state change parameters, fusing the first channel signal and the second channel signal according to a first fusion mode to obtain a third channel signal, and fusing the first channel signal and the second channel signal according to a second fusion mode to obtain a fourth channel signal;

and controlling a first loudspeaker to switch from playing the first channel signal to playing the third channel signal, and controlling a second loudspeaker to switch from playing the second channel signal to playing the fourth channel signal, wherein the channels played by the first loudspeaker and the second loudspeaker are not matched with the direction.

Optionally, the processor 710 is further configured to obtain a first spectral amplitude of the first channel signal and a second spectral amplitude of the second channel signal, respectively;

determining a fusion component according to the state change parameter, the first spectrum amplitude and the second spectrum amplitude;

performing first operation processing on the first frequency spectrum amplitude and the fusion component to obtain a third frequency spectrum amplitude of the fused third sound channel signal;

and performing second operation processing on the second frequency spectrum amplitude and the fusion component to obtain a fourth frequency spectrum amplitude of the fourth sound channel signal after fusion.

Optionally, the processor 710 is further configured to determine a state coefficient according to the state change parameter and the maximum change value of the target state;

and calculating the product of the state coefficient and a first difference value to obtain the fusion component, wherein the first difference value is the difference value between the first spectrum amplitude and the second spectrum amplitude.

Optionally, the processor 710 is further configured to subtract the fused component from the first spectral amplitude to obtain the third spectral amplitude;

and adding the second frequency spectrum amplitude and the fusion component to obtain a fourth frequency spectrum amplitude.

Optionally, when the state change parameter is a folding angle, the maximum change value of the target state is 180 degrees;

when the state change parameter is a rotation angle, the maximum change value of the target state is 90 degrees or 180 degrees;

and when the state change parameter is the expansion amplitude, the maximum change value of the target state is the maximum expansion amplitude of the screen of the electronic equipment.

Optionally, the processor 710 is further configured to obtain a first amplitude characteristic of the first channel signal in a frequency domain and a second amplitude characteristic of the second channel signal in the frequency domain, respectively;

and respectively converting the first amplitude characteristic and the second amplitude characteristic into frequency spectrum amplitude values to obtain the first frequency spectrum amplitude value and the second frequency spectrum amplitude value.

Optionally, the processor 710 is further configured to predict a position of each of the plurality of speakers of the electronic device after the target state of the electronic device is changed;

and under the condition that the currently played sound channel of a target loudspeaker in the loudspeakers is not matched with the predicted direction of the target loudspeaker, determining that the target loudspeaker is a loudspeaker to be switched, wherein the loudspeaker currently playing the first sound channel signal in the loudspeakers to be switched is the first loudspeaker, and the loudspeaker currently playing the second sound channel signal in the loudspeakers to be switched is the second loudspeaker.

The electronic equipment in the embodiment of the application acquires the state change parameters of the electronic equipment under the condition that audio is played and the target state of the electronic equipment is changed, wherein the state change parameters comprise a folding angle, a rotating angle or a stretching amplitude, and the stretching amplitude is the screen stretching amplitude of the electronic equipment; according to the state change parameters, fusing the first channel signal and the second channel signal according to a first fusion mode to obtain a third channel signal, and fusing the first channel signal and the second channel signal according to a second fusion mode to obtain a fourth channel signal; and controlling a first loudspeaker to switch from playing the first sound channel signal to playing the third sound channel signal, and controlling a second loudspeaker to switch from playing the second sound channel signal to playing the fourth sound channel signal, wherein before the sound channel signals are switched, the sound channels played by the first loudspeaker and the second loudspeaker are not matched with the direction of the first loudspeaker and the second loudspeaker. Therefore, when the target state of the electronic equipment changes, the sound channel signals of the loudspeakers with changed positions are fused according to the state change parameters, so that the sound channel signals played by the loudspeakers can be matched with the positions, smooth sound channel switching is realized, and the electronic equipment can obtain a good stereo playing effect in the process of the target state change.

It should be understood that, in the embodiment of the present application, the audio output unit 703 may be a speaker. The input Unit 704 may include a Graphics Processing Unit (GPU) 7041 and a microphone 7042, and the Graphics processor 7041 processes image data of a still picture or video obtained by an image capturing device (e.g., a camera) in a video capturing mode or an image capturing mode. The display unit 706 may include a display panel 7061, and the display panel 7061 may be configured in the form of a liquid crystal display, an organic light emitting diode, or the like. The user input unit 707 includes a touch panel 7071 and other input devices 7072. The touch panel 7071 is also referred to as a touch screen. The touch panel 7071 may include two parts of a touch detection device and a touch controller. Other input devices 7072 may include, but are not limited to, a physical keyboard, function keys (e.g., volume control keys, switch keys, etc.), a trackball, a mouse, and a joystick, which are not described in detail herein. Memory 709 may be used to store software programs as well as various data, including but not limited to applications and operating systems. Processor 710 may integrate an application processor, which primarily handles operating systems, user interfaces, applications, etc., and a modem processor, which primarily handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into processor 710.

The embodiment of the present application further provides a readable storage medium, where a program or an instruction is stored on the readable storage medium, and when the program or the instruction is executed by a processor, the program or the instruction implements each process of the embodiment of the channel switching method, and can achieve the same technical effect, and in order to avoid repetition, details are not repeated here.

The processor is the processor in the electronic device described in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and so on.

The embodiment of the present application further provides a chip, where the chip includes a processor and a communication interface, the communication interface is coupled to the processor, and the processor is configured to run a program or an instruction to implement each process of the embodiment of the sound channel switching method, and can achieve the same technical effect, and is not described herein again to avoid repetition.

It should be understood that the chips mentioned in the embodiments of the present application may also be referred to as system-on-chip, system-on-chip or system-on-chip, etc.

It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element. Further, it should be noted that the scope of the methods and apparatus of the embodiments of the present application is not limited to performing the functions in the order illustrated or discussed, but may include performing the functions in a substantially simultaneous manner or in a reverse order based on the functions involved, e.g., the methods described may be performed in an order different than that described, and various steps may be added, omitted, or combined. In addition, features described with reference to certain examples may be combined in other examples.

Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solutions of the present application may be embodied in the form of a computer software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal (such as a mobile phone, a computer, a server, or a network device) to execute the method according to the embodiments of the present application.

While the present embodiments have been described with reference to the accompanying drawings, it is to be understood that the invention is not limited to the precise embodiments described above, which are meant to be illustrative and not restrictive, and that various changes may be made therein by those skilled in the art without departing from the spirit and scope of the invention as defined by the appended claims.

26页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:能防止音圈碰撞的微型扬声器

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!