Volume control method and electronic device
Through the automatic volume control method, electronic devices dynamically update the volume range, solving the problem of inconsistent volume outputs of different audios and improving the user experience.
Patent Information
- Application Number
- CN202210310062.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-28
- Publication Date
- 2025-07-11
- Estimated Expiration
- 2042-03-28
AI Technical Summary
In terminal devices, due to the different input volumes of different audios, the output volume is inconsistent. Users need to manually adjust the volume to keep it within the appropriate range, which affects the user experience.
Through the automatic volume control method, the electronic device obtains the volume parameters of the audio data, corrects the audio data, keeps it within the preset output volume range, and dynamically updates the output volume range to adapt to the user's auditory habits.
It effectively avoids the problem of excessive or too small volume, improves the user's auditory experience, and does not require manual adjustment of the volume.
Smart Images

Figure CN116866472B_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present application relate to the field of terminal devices, and in particular, to a volume control method and an electronic device. Background Art
[0002] With the development of terminal device technology, the application scenarios of media services on terminals are becoming more and more extensive. Users can use terminal devices to listen to music, watch videos, etc. However, during the process of users using terminal devices to play audio (which can be music or audio in a video), since the input volumes of different audio may be different, the output volume of the audio may also be different. Then, users need to manually adjust the volume to make the output volume of the audio within a suitable volume range, which affects the user experience. Summary of the Invention
[0003] Embodiments of the present application provide a volume control method and an electronic device. In this method, the electronic device can automatically adjust the volume of audio data so that the volume of the audio data is maintained within a suitable volume range, effectively improving the user's auditory experience.
[0004] In a first aspect, embodiments of the present application provide a volume control method. The method includes: The electronic device obtains first audio data. Then, when the electronic device detects that the first volume of the first audio data does not meet the first output volume range, the electronic device obtains a first volume parameter corresponding to the first audio data based on the first volume and the first output volume range. Wherein, the first volume is the average volume of the audio data within a preset duration of the first audio data, and the first output volume range is obtained in advance. The electronic device corrects the first audio data based on the first volume parameter to obtain second audio data. Wherein, the average volume of the second audio data is the second volume, and the second volume is within the first output volume range. Then, the electronic device plays the second audio data. In this way, the electronic device can correct the audio data based on the volume parameter so that the volume of the audio data is adjusted to within the output volume range, thereby avoiding the problem of too large or too small volume caused by different audio data when played on the electronic device, and effectively improving the user's auditory experience.
[0005] Exemplarily, the audio data can be music or the audio corresponding to a video.
[0006] Exemplarily, the volume not meeting the output volume range can optionally be that the volume is greater than the maximum value of the output volume range, or the volume is less than the minimum value of the output volume range.
[0007] Exemplarily, the volume of the second audio data is different from that of the first audio data.
[0008] Exemplarily, the preset duration can be set according to actual needs, and the present application does not make any limitations.
[0009] Exemplarily, the electronic device plays the second audio data, and the played volume is within the output volume range.
[0010] According to the first aspect, the method further includes: when the electronic device plays the second audio data, a regulation operation is received, and the regulation operation is used to regulate the volume of the second audio data. During the process from the start to the end of the regulation operation, the electronic device collects the volume of the second audio data at a first cycle duration. The electronic device obtains a second output volume range based on the collected volume of the second audio data. In this way, when the user regulates the volume, the electronic device can densely collect the volume of the audio data, and update the output volume range according to the collected volume. That is to say, during the process of playing the audio data, the electronic device can update the volume output range by detecting the user behavior, so that the output volume range always meets the user's auditory habit.
[0011] According to the first aspect, or any implementation manner of the above first aspect, the electronic device obtains a second output volume range based on the collected volume of the second audio data, including: obtaining the average volume of the volume of the second audio data collected during the process from the start to the end of the regulation operation; in the case that the regulation operation is used to indicate increasing the volume of the second audio data, if the average volume of the volume of the second audio data collected is greater than the minimum value of the first output volume range, the minimum value of the second output volume range is the average volume of the volume of the second audio data collected, and the maximum value of the second output volume range is the maximum value of the first output volume range; if the average volume of the volume of the second audio data collected is less than the minimum value of the first output volume range, the second output volume range is equal to the first output volume range; or, in the case that the regulation operation is used to indicate decreasing the volume of the second audio data, if the average volume of the volume of the second audio data collected is less than the maximum value of the first output volume range, the maximum value of the second output volume range is the average volume of the volume of the second audio data collected, and the minimum value of the second output volume range is the minimum value of the first output volume range; if the average volume of the volume of the second audio data collected is greater than the maximum value of the first output volume range, the second output volume range is equal to the first output volume range. In this way, the electronic device can dynamically update the output volume range based on different regulation scenarios, so that the output volume range always meets the user requirements, that is, meets the user's auditory habit.
[0012] According to the first aspect, or any implementation of the above first aspect, the method further includes: when the electronic device plays the second audio data, the electronic device collects the volume of the second audio data according to the second cycle duration; the second cycle duration is greater than the first cycle duration. The electronic device obtains a second output volume range based on the collected volume of the second audio data. In this way, the electronic device can collect the volume in a sparse manner, dynamically update the output volume range based on the volume, and reduce the power consumption caused by volume collection.
[0013] According to the first aspect, or any implementation of the above first aspect, if the volume of the collected second audio data is greater than the maximum value of the first output volume range, the minimum value of the second output volume range is the minimum value of the first output volume range, and the maximum value of the second output volume range is the volume of the collected second audio data; or, if the volume of the collected second audio data is less than the minimum value of the first output volume range, the maximum value of the second output volume range is the maximum value of the first output volume range, and the minimum value of the second output volume range is the volume of the collected second audio data; or, if the volume of the collected second audio data is greater than or equal to the minimum value of the first output volume range and less than or equal to the maximum value of the first output volume range, the second output volume range is equal to the first output volume range. In this way, the electronic device can dynamically update the output volume range based on the collected volume.
[0014] According to the first aspect, or any implementation of the above first aspect, the method further includes: the electronic device obtains third audio data, where the average volume of the audio data within the preset duration of the third audio data is the third volume; the electronic device detects that the third volume does not meet the second output volume range, and obtains a second volume parameter corresponding to the third audio data based on the third volume and the second output volume range; the electronic device corrects the third audio data based on the second volume parameter to obtain fourth audio data; where the average volume of the fourth audio data is the fourth volume, and the fourth volume is within the second output volume range; the electronic device plays the fourth audio data. In this way, the electronic device can obtain the volume parameter corresponding to the audio based on the updated output volume range, and correct the audio based on the volume parameter, so that the volume of the audio always remains within the volume range that the user is accustomed to, to meet the user's auditory experience.
[0015] According to the first aspect, or any implementation of the above first aspect, when the electronic device detects that the first volume does not meet the first output volume range, based on the first volume and the first output volume range, the electronic device obtains a first volume parameter corresponding to the first audio data, including: if the first volume is greater than the maximum value of the first output volume range, the electronic device obtains the first volume parameter based on the first volume and the maximum value of the first output volume range; or, if the first volume is less than the minimum value of the first output volume range, the electronic device obtains the first volume parameter based on the first volume and the minimum value of the first output volume range. In this way, the electronic device can obtain the volume parameter of the audio based on different corresponding relationships between the volume and the output volume range. Exemplarily, when the input volume is large, the output volume can be adjusted downwards through the volume parameter so that the output volume is within the output volume range. When the input volume is small, the output volume is adjusted upwards through the volume parameter so that the output volume is within the output volume range.
[0016] According to the first aspect, or any implementation of the above first aspect, the electronic device corrects the first audio data based on the first volume parameter to obtain second audio data, including: the electronic device obtains the second audio data based on the first audio data, the first volume parameter, and the output volume parameter; the output volume parameter includes at least one of the following: the track volume parameter, the stream volume parameter, and the master volume; the track volume parameter is used to indicate the set volume of the application that plays the second audio data; the stream volume parameter is used to indicate the set volume of the audio stream corresponding to the first audio data; the master volume is used to indicate the set volume of the electronic device. In this way, the electronic device can obtain the output volume corresponding to the input volume of the audio data based on at least one set volume (i.e., the output volume parameter) of the electronic device itself, and correct the output volume of the audio based on the volume parameter so that the output volume of the audio remains within the output volume range.
[0017] According to the first aspect, or any implementation of the above first aspect, the method further includes: The electronic device obtains fifth audio data, wherein the average volume of the audio data within the preset duration of the fifth audio data is the fifth volume; The electronic device detects that the fifth volume does not meet the first output volume range, and based on the fifth volume and the first output volume range, obtains a third volume parameter corresponding to the fifth audio data; The electronic device corrects the fifth audio data based on the third volume parameter to obtain sixth audio data; wherein, the average volume of the sixth audio data is the sixth volume, and the sixth volume is within the first output volume range; The electronic device sends the sixth audio data to another electronic device; The electronic device and another electronic device perform data interaction through a wireless connection; The electronic device detects that the connection with another electronic device is disconnected, and the electronic device obtains the audio data to be played in the fifth audio data, wherein the average volume of the audio data within the preset duration of the audio data to be played is the seventh volume; The electronic device detects that the seventh volume does not meet the first output volume range, and based on the seventh volume and the first output volume range, obtains a fourth volume parameter corresponding to the audio data to be played; The electronic device corrects the audio data to be played based on the fourth volume parameter to obtain seventh audio data; wherein, the average volume of the seventh audio data is the eighth volume, and the eighth volume is within the first output volume range; The electronic device plays the seventh audio data. In this way, in the scenario of multi-device collaborative playback of audio data, each electronic device can obtain the volume parameter corresponding to the audio data based on the output volume range of the electronic device. In the case where the electronic device stops collaborating with other electronic devices, the electronic device can still obtain the volume parameter of the audio data based on the output volume range of the electronic device, and correct the audio data through the volume parameter, so that the volume of the audio data remains within the output volume range of the electronic device. Thus, it prevents the problem that after adjusting the device volume in the multi-device collaborative scenario, when switching to a single device, the volume of the audio played by the single device is too large or too small.
[0018] According to the first aspect, or any implementation manner of the above first aspect, the method further includes: The electronic device obtains eighth audio data, where the average volume of the audio data within the preset duration of the eighth audio data is the ninth volume; the eighth audio data is different from the first audio data; the ninth volume is different from the first volume; the electronic device detects that the ninth volume does not meet the first output volume range, and based on the ninth volume and the first output volume range, obtains a fifth volume parameter corresponding to the eighth audio data; the fifth volume parameter is different from the first volume parameter; the electronic device corrects the eighth audio data based on the fifth volume parameter to obtain ninth audio data; where the average volume of the ninth audio data is the tenth volume, and the tenth volume is within the first output volume range; the electronic device plays the tenth audio data. In this way, in the scenario of source switching, the electronic device can obtain the corresponding volume parameter according to different sound sources, so that when different audio data is played on the electronic device, the electronic device can automatically adjust the volume of the audio data through the volume parameter, so that the user does not need to manually adjust, and the playing volume of the audio data can be kept within the volume range that the user is used to, thus effectively improving the user experience.
[0019] According to the first aspect, or any implementation manner of the above first aspect, for the electronic device to obtain the first audio data, it includes: The electronic device obtains the first audio data from the target application; or, the electronic device receives the first audio data sent by the second electronic device. In this way, the electronic device can automatically adjust the volume of the audio data of the applications in this device. The electronic device can also automatically adjust the audio data sent by other electronic devices, so that the audio played by the electronic device is within the output volume range of this electronic device.
[0020] According to the first aspect, or any implementation manner of the above first aspect, for the electronic device to play the second audio data, it includes: The electronic device plays the second audio data through the speaker; or, the electronic device plays the second audio data through the earphone connected to the electronic device. In this way, the embodiments of the present application can be applied to the local playing scenario and the earphone playing scenario.
[0021] Second aspect, an embodiment of the present application provides an electronic device. The electronic device includes: one or more processors, a memory; and one or more computer programs, wherein the one or more computer programs are stored on the memory, and when the computer programs are executed by the one or more processors, the electronic device is caused to perform the following steps: obtaining first audio data; detecting that a first volume of the first audio data does not satisfy a first output volume range, and obtaining a first volume parameter corresponding to the first audio data based on the first volume and the first output volume range; wherein the first volume is an average volume of audio data within a preset duration of the first audio data, and the first output volume range is obtained in advance; correcting the first audio data based on the first volume parameter to obtain second audio data; wherein an average volume of the second audio data is a second volume, and the second volume is within the first output volume range; playing the second audio data.
[0022] According to the second aspect, when the computer programs are executed by the one or more processors, the electronic device is caused to perform the following steps: when playing the second audio data, receiving an adjustment operation for adjusting the volume of the second audio data; during the process from the start to the end of the adjustment operation, collecting the volume of the second audio data at a first cycle duration; obtaining a second output volume range based on the collected volume of the second audio data.
[0023] According to the second aspect, or any one of the above implementation manners of the second aspect, when the computer programs are executed by the one or more processors, the electronic device is caused to perform the following steps: obtaining an average volume of the volume of the second audio data collected during the process from the start to the end of the adjustment operation; in the case where the adjustment operation is used to indicate increasing the volume of the second audio data, if the average volume of the collected volume of the second audio data is greater than the minimum value of the first output volume range, the minimum value of the second output volume range is the average volume of the collected volume of the second audio data, and the maximum value of the second output volume range is the maximum value of the first output volume range; if the average volume of the collected volume of the second audio data is less than the minimum value of the first output volume range, the second output volume range is equal to the first output volume range; or, in the case where the adjustment operation is used to indicate decreasing the volume of the second audio data, if the average volume of the collected volume of the second audio data is less than the maximum value of the first output volume range, the maximum value of the second output volume range is the average volume of the collected volume of the second audio data, and the minimum value of the second output volume range is the minimum value of the first output volume range; if the average volume of the collected volume of the second audio data is greater than the maximum value of the first output volume range, the second output volume range is equal to the first output volume range.
[0024] According to the second aspect, or any implementation manner of the above second aspect, when the computer program is executed by one or more processors, the electronic device is caused to perform the following steps: when the electronic device plays the second audio data, collect the volume of the second audio data according to the second cycle duration; the second cycle duration is greater than the first cycle duration; based on the collected volume of the second audio data, obtain the second output volume range.
[0025] According to the second aspect, or any implementation manner of the above second aspect, if the volume of the collected second audio data is greater than the maximum value of the first output volume range, the minimum value of the second output volume range is the minimum value of the first output volume range, and the maximum value of the second output volume range is the volume of the collected second audio data; or, if the volume of the collected second audio data is less than the minimum value of the first output volume range, the maximum value of the second output volume range is the maximum value of the first output volume range, and the minimum value of the second output volume range is the volume of the collected second audio data; or, if the volume of the collected second audio data is greater than or equal to the minimum value of the first output volume range and less than or equal to the maximum value of the first output volume range, the second output volume range is equal to the first output volume range.
[0026] According to the second aspect, or any implementation manner of the above second aspect, when the computer program is executed by one or more processors, the electronic device is caused to perform the following steps: obtain third audio data, where the average volume of the audio data within the preset duration of the third audio data is the third volume; when it is detected that the third volume does not satisfy the second output volume range, based on the third volume and the second output volume range, obtain the second volume parameter corresponding to the third audio data; correct the third audio data based on the second volume parameter to obtain fourth audio data; where the average volume of the fourth audio data is the fourth volume, and the fourth volume is within the second output volume range; play the fourth audio data.
[0027] According to the second aspect, or any implementation manner of the above second aspect, when the computer program is executed by one or more processors, the electronic device is caused to perform the following steps: if the first volume is greater than the maximum value of the first output volume range, obtain the first volume parameter based on the first volume and the maximum value of the first output volume range; or, if the first volume is less than the minimum value of the first output volume range, obtain the first volume parameter based on the first volume and the minimum value of the first output volume range.
[0028] According to a second aspect, or any implementation of the above second aspect, when the computer program is executed by one or more processors, the electronic device is caused to perform the following steps: obtaining second audio data based on first audio data, a first volume parameter, and an output volume parameter; the output volume parameter includes at least one of the following: a track volume parameter, a stream volume parameter, and a master volume; the track volume parameter is used to indicate the set volume of the application that plays the second audio data; the stream volume parameter is used to indicate the set volume of the audio stream corresponding to the first audio data; the master volume is used to indicate the set volume of the electronic device.
[0029] According to a second aspect, or any implementation of the above second aspect, when the computer program is executed by one or more processors, the electronic device is caused to perform the following steps: obtaining fifth audio data, wherein the average volume of the audio data within a preset duration of the fifth audio data is a fifth volume; detecting that the fifth volume does not meet a first output volume range, obtaining a third volume parameter corresponding to the fifth audio data based on the fifth volume and the first output volume range; correcting the fifth audio data based on the third volume parameter to obtain sixth audio data; wherein the average volume of the sixth audio data is a sixth volume, and the sixth volume is within the first output volume range; sending the sixth audio data to another electronic device; the electronic device and the other electronic device perform data interaction through a wireless connection; detecting that the connection with the other electronic device is disconnected, the electronic device obtains the audio data to be played in the fifth audio data, wherein the average volume of the audio data within a preset duration of the audio data to be played is a seventh volume; detecting that the seventh volume does not meet the first output volume range, obtaining a fourth volume parameter corresponding to the audio data to be played based on the seventh volume and the first output volume range; correcting the audio data to be played based on the fourth volume parameter to obtain seventh audio data; wherein the average volume of the seventh audio data is an eighth volume, and the eighth volume is within the first output volume range; playing the seventh audio data.
[0030] According to a second aspect, or any implementation of the above second aspect, when the computer program is executed by one or more processors, the electronic device is caused to perform the following steps: obtaining eighth audio data, wherein the average volume of the audio data within a preset duration of the eighth audio data is a ninth volume; the eighth audio data is different from the first audio data; the ninth volume is different from the first volume; detecting that the ninth volume does not meet the first output volume range, obtaining a fifth volume parameter corresponding to the eighth audio data based on the ninth volume and the first output volume range; the fifth volume parameter is different from the first volume parameter; correcting the eighth audio data based on the fifth volume parameter to obtain ninth audio data; wherein the average volume of the ninth audio data is a tenth volume, and the tenth volume is within the first output volume range; playing the tenth audio data.
[0031] According to a second aspect, or any implementation manner of the above second aspect, when the computer program is executed by one or more processors, the electronic device is caused to perform the following steps: obtaining first audio data from a target application; or receiving first audio data sent by a second electronic device.
[0032] According to a second aspect, or any implementation manner of the above second aspect, when the computer program is executed by one or more processors, the electronic device is caused to perform the following steps: playing second audio data through a speaker; or playing second audio data through headphones connected to the electronic device.
[0033] The second aspect and any implementation manner of the second aspect respectively correspond to the first aspect and any implementation manner of the first aspect. For the technical effects corresponding to the second aspect and any implementation manner of the second aspect, reference may be made to the technical effects corresponding to the first aspect and any implementation manner of the first aspect above, which will not be elaborated herein.
[0034] In a third aspect, an embodiment of the present application provides an audio processing method. The method includes: a first electronic device obtains first sub-audio data and first orientation information, where the first orientation information is used to indicate the relative position between the first electronic device and the headphones; data interaction is performed between the first electronic device and the headphones through a wireless connection; the first electronic device receives second sub-audio data and second orientation information sent by a second electronic device, where the second orientation information is used to indicate the relative position between the second electronic device and the headphones; the first electronic device mixes the first sub-audio data and the second sub-audio data based on the first orientation information and the second orientation information to obtain first audio data; the first electronic device sends the first audio data to the headphones to play the first audio data through the headphones. In this way, the electronic device can mix the audio data of multiple electronic devices through the orientation information to achieve stereo playback of the headphones, so that when the user uses the headphones, they can hear the stereo effect of multi-device audio.
[0035] Exemplarily, the wireless connection may be maintained based on the Bluetooth protocol or based on the Wi-Fi protocol.
[0036] According to a third aspect, the first electronic device mixes the first sub-audio data and the second sub-audio data based on the first orientation information and the second orientation information, including: the first electronic device obtains third sub-audio data corresponding to the first channel of the headset for the first sub-audio data and fourth sub-audio data corresponding to the second channel of the headset for the first sub-audio data based on the first orientation information; there are differences in phase, timbre, sound level, and / or audio start position between the third sub-audio data and the fourth sub-audio data; the first electronic device obtains fifth sub-audio data corresponding to the first channel of the headset for the second sub-audio data and sixth sub-audio data corresponding to the second channel of the headset for the first sub-audio data based on the second orientation information; there are differences in phase, timbre, sound level, and / or audio start position between the fifth sub-audio data and the sixth sub-audio data; the first electronic device obtains seventh sub-audio data based on the third sub-audio data and the fifth sub-audio data; the first electronic device obtains eighth sub-audio data based on the fourth sub-audio data and the sixth sub-audio data; the first audio data includes the seventh sub-audio data and the eighth sub-audio data; the first electronic device sends the seventh sub-audio data and the eighth sub-audio data to the headset, plays the seventh sub-audio data through the first channel of the headset, and plays the eighth sub-audio data through the second channel of the headset. In this way, the electronic device can determine the phase difference, timbre difference, sound level difference, and time difference of the audio of the two channels of the headset based on the orientation information, so as to achieve the stereo effect of the two channels of the headset.
[0037] Exemplarily, the audio start position is the playback time of the audio in the mono channel of the headset.
[0038] According to a third aspect, or any one of the implementation manners of the above third aspect, the first orientation information includes the distance information and the direction information between the first electronic device and the headset, and the second orientation information includes the distance information and the direction information between the second electronic device and the headset. In this way, the electronic device can adjust the audio of each electronic device in the mixed audio based on the distance and direction between each device and the headset to achieve the stereo effect.
[0039] According to a third aspect, or any one of the implementation manners of the above third aspect, the distance between the first electronic device and the headset is less than the distance between the second electronic device and the headset. Exemplarily, the first electronic device is the master device in the embodiments of the present application, and the second electronic device is the slave device in the embodiments of the present application. The communication quality between the master device and the headset is better than the communication quality between the slave device and the headset.
[0040] According to a third aspect, or any implementation manner of the above third aspect, the method further includes: the first electronic device obtains third azimuth information, where the third azimuth information is used to indicate the relative position between the first electronic device and the earphone; the third azimuth information is different from the first azimuth information; the first electronic device receives fourth azimuth information sent by the second electronic device, where the fourth azimuth information is used to indicate the relative position between the second electronic device and the earphone; the fourth azimuth information is different from the second azimuth information; the first electronic device mixes the first sub-audio data and the second sub-audio data based on the third azimuth information and the fourth azimuth information to obtain second audio data; the first electronic device sends the second audio data to the earphone to play the second audio data through the earphone. In this way, the electronic device can also adjust the mixing effect based on the real-time positions of each electronic device and the earphone to achieve a more realistic stereo effect.
[0041] According to a third aspect, or any implementation manner of the above third aspect, before the first electronic device sends the first audio data to the earphone, it further includes: the electronic device detects that the first volume does not meet the first output volume range, and obtains a first volume parameter corresponding to the first audio data based on the first volume and the first output volume range; the first output volume range is pre-obtained; the first volume is the average volume of the audio data within a preset duration of the first audio data.
[0042] The electronic device corrects the first audio data based on the first volume parameter to obtain the corrected first audio data; where the average volume of the corrected first audio data is the second volume, and the second volume is within the first output volume range. In this way, the electronic device can correct the mixed audio so that the output volume of the mixed audio remains within the output volume range, thereby realizing the automatic adjustment of the volume of the audio data and effectively improving the user experience.
[0043] According to a third aspect, or any implementation manner of the above third aspect, the method further includes: the first electronic device receives a first operation, where the first operation is used to indicate switching the mixing mode of the first electronic device and the second electronic device to the single-device mode; the first electronic device responds to the first operation and sends a first indication information to the second electronic device, where the first indication information is used to indicate the second electronic device to stop sending the second sub-audio data; the first electronic device sends the first sub-audio data to the earphone to play the first sub-audio data through the earphone. In this way, the electronic device can switch between the mixing mode and the single-device playback mode in the mixing mode.
[0044] Exemplarily, in a single-device playback scenario, the electronic device can also correct the audio data to be played so that the volume of the audio data remains within the output volume range.
[0045] Fourth aspect, an embodiment of the present application provides an electronic device. The electronic device includes: one or more processors, a memory; and one or more computer programs, where one or more computer programs are stored on the memory, and when the computer programs are executed by one or more processors, the electronic device is caused to execute the instructions of the method in the third aspect or any possible implementation manner of the third aspect.
[0046] Fifth aspect, the present application provides a computer-readable medium for storing a computer program, the computer program including instructions for executing the method in the first aspect or any possible implementation manner of the first aspect.
[0047] Sixth aspect, the present application provides a computer-readable medium for storing a computer program, the computer program including instructions for executing the method in the third aspect or any possible implementation manner of the third aspect.
[0048] Seventh aspect, the present application provides a computer program, the computer program including instructions for executing the method in the first aspect or any possible implementation manner of the first aspect.
[0049] Eighth aspect, the present application provides a computer program, the computer program including instructions for executing the method in the third aspect or any possible implementation manner of the third aspect.
[0050] Ninth aspect, the present application provides a chip, the chip including a processing circuit and transceiver pins. Wherein, the transceiver pins and the processing circuit communicate with each other through an internal connection path, and the processing circuit executes the method in the first aspect or any possible implementation manner of the first aspect to control the receiving pin to receive a signal and to control the sending pin to send a signal.
[0051] Tenth aspect, the present application provides a chip, the chip including a processing circuit and transceiver pins. Wherein, the transceiver pins and the processing circuit communicate with each other through an internal connection path, and the processing circuit executes the method in the third aspect or any possible implementation manner of the third aspect to control the receiving pin to receive a signal and to control the sending pin to send a signal. Description of the Drawings
[0052] Figure 1 Shows a schematic hardware structure diagram of an electronic device;
[0053] Figure 2 Shows a schematic software structure diagram of an electronic device;
[0054] Figure 3 Is an exemplary schematic diagram of module interaction;
[0055] Figure 4Schematic diagram of a user interface shown exemplarily;
[0056] Figure 5 Schematic diagram of output volume adjustment shown exemplarily;
[0057] Figure 6 Schematic diagram of a user interface shown exemplarily;
[0058] Figure 7 Schematic diagram of a volume control method shown exemplarily;
[0059] Figure 8 Schematic diagram of a method for obtaining an output volume range shown exemplarily;
[0060] Figures 9a to 9b Schematic diagram of module interaction of a volume control method shown exemplarily;
[0061] Figure 9c Schematic diagram of output volume adjustment shown exemplarily;
[0062] Figure 10 Multi-device collaboration scenario shown exemplarily;
[0063] Figures 11a to 11b Schematic diagram of module interaction of a volume control method shown exemplarily;
[0064] Figures 12a to 12b Schematic diagram of output volume adjustment shown exemplarily;
[0065] Figures 13a to 13b Schematic diagram of the principle of a mixing scenario shown exemplarily;
[0066] Figure 14 Schematic diagram of an application scenario shown exemplarily;
[0067] Figure 15 Schematic diagram of a voting election shown exemplarily;
[0068] Figure 16 Schematic diagram of an application scenario shown exemplarily;
[0069] Figure 17 Schematic diagram of a user interface shown exemplarily;
[0070] Figure 18 Schematic diagram of module interaction of a mixing scenario shown exemplarily;
[0071] Figure 19 Schematic diagram of a mixing process shown exemplarily;
[0072] Figure 20 Schematic diagram of audio data processing in a mixing scenario shown exemplarily;
[0073] Figure 21a Schematic diagram of audio data processing for an exemplary mixing scenario;
[0074] Figure 21b Effect schematic diagram for an exemplary mixing scenario;
[0075] Figure 22 Schematic diagram of audio data processing for an exemplary mixing scenario;
[0076] Figure 23 Schematic diagram of audio data processing for an exemplary mixing scenario;
[0077] Figure 24 Schematic diagram of the control method flow in an exemplary switching mode scenario;
[0078] Figure 25 Schematic diagram of the control method flow in an exemplary switching mode scenario;
[0079] Figure 26 Schematic diagram of the control method flow in an exemplary switching mode scenario;
[0080] Figure 27 Schematic diagram of fade - in and fade - out processing for an example;
[0081] Figure 28 Schematic diagram of the structure of an exemplary device. Detailed implementation manners
[0082] Next, the technical solutions in the embodiments of the present application will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are a part rather than all of the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts fall within the protection scope of the present application.
[0083] The term "and / or" in this article is merely a description of the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B may represent: A exists alone, A and B exist simultaneously, and B exists alone.
[0084] The terms "first" and "second" etc. in the description and claims of the embodiments of the present application are used to distinguish different objects, rather than to describe the specific order of the objects. For example, the first target object and the second target object etc. are used to distinguish different target objects, rather than to describe the specific order of the target objects.
[0085] In the embodiments of the present application, words such as "exemplary" or "for example" are used to represent examples, illustrations, or explanations. Any embodiment or design solution described as "exemplary" or "for example" in the embodiments of the present application should not be construed as being more preferred or having more advantages than other embodiments or design solutions. Rather, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific manner.
[0086] In the description of the embodiments of the present application, unless otherwise specified, "a plurality of" means two or more. For example, a plurality of processing units means two or more processing units; a plurality of systems means two or more systems.
[0087] Figure 1 A schematic structural diagram of the electronic device 100 is shown. It should be understood that Figure 1 The illustrated electronic device 100 is only an example of an electronic device, and the electronic device 100 may have more or fewer components than those shown in the figure, may combine two or more components, or may have different component configurations. Figure 1 The various components shown in may be implemented in hardware, software, or a combination of hardware and software including one or more signal processing and / or application specific integrated circuits. It should be noted that in the embodiments of the present application, the electronic device is taken as an example of a mobile phone for illustration. In other embodiments, the electronic device may also be a device such as a tablet, a speaker, a wearable device, a smart home device, etc., which is not limited in the present application.
[0088] The electronic device 100 may include: a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, a headphone interface 170D, a sensor module 180, a key 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. Among them, the sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, a barometric pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.
[0089] The processor 110 may include one or more processing units. For example, the processor 110 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Among them, different processing units may be independent devices or integrated in one or more processors.
[0090] Among them, the controller may be the nerve center and command center of the electronic device 100. The controller may generate operation control signals according to the instruction operation code and timing signal to complete the control of fetching and executing instructions.
[0091] A memory may also be provided in the processor 110 for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. This memory may save the instructions or data that the processor 110 has just used or recycled. If the processor 110 needs to use the instruction or data again, it can be directly called from the memory. This avoids repeated accesses, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.
[0092] The charging management module 140 is used to receive a charging input from a charger. Among them, the charger may be a wireless charger or a wired charger. In some embodiments of wired charging, the charging management module 140 may receive the charging input of the wired charger through the USB interface 130.
[0093] The power management module 141 is used to connect the battery 142, the charging management module 140, and the processor 110. The power management module 141 receives the inputs of the battery 142 and / or the charging management module 140 and supplies power to the processor 110, the internal memory 121, the external memory, the display screen 194, the camera 193, and the wireless communication module 160, etc.
[0094] The wireless communication function of the electronic device 100 may be implemented by the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor, and the baseband processor, etc.
[0095] Antenna 1 and Antenna 2 are used for transmitting and receiving electromagnetic wave signals. Each antenna in the electronic device 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be multiplexed to improve the utilization rate of the antennas. For example, Antenna 1 can be multiplexed as a diversity antenna for a wireless local area network. In some other embodiments, the antenna can be used in combination with a tuning switch.
[0096] The mobile communication module 150 can provide solutions for wireless communications including 2G / 3G / 4G / 5G, etc. applied to the electronic device 100. The mobile communication module 150 can include at least one filter, switch, power amplifier, low noise amplifier (LNA), etc.
[0097] The wireless communication module 160 can provide solutions for wireless communications including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared technology (IR), etc. applied to the electronic device 100.
[0098] In some embodiments, antenna 1 of electronic device 100 is coupled to mobile communication module 150, and antenna 2 is coupled to wireless communication module 160, such that electronic device 100 can communicate with a network and other devices through wireless communication technologies. The wireless communication technologies may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), wideband code division multiple access (WCDMA), time-division code division multiple access (TD-SCDMA), long term evolution (LTE), BT, GNSS, WLAN, NFC, FM, and / or IR technologies, etc. The GNSS may include global positioning system (GPS), global navigation satellite system (GLONASS), beidou navigation satellite system (BDS), quasi-zenith satellite system (QZSS), and / or satellite based augmentation systems (SBAS).
[0099] Electronic device 100 implements a display function through a GPU, display screen 194, and an application processor, etc. The GPU is a microprocessor for image processing, and is connected to display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. Processor 110 may include one or more GPUs, which execute program instructions to generate or change display information.
[0100] The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a Miniled, a MicroLed, a Micro-oLed, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the electronic device 100 may include one or N display screens 194, where N is a positive integer greater than 1.
[0101] The camera 193 is used to capture still images or videos. An object generates an optical image through a lens and projects it onto a photosensitive element.
[0102] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 110 through the external memory interface 120 to implement the data storage function. For example, files such as music and videos are saved in the external memory card.
[0103] The internal memory 121 can be used to store computer-executable program code, and the executable program code includes instructions. The processor 110 executes various functional applications and data processing of the electronic device 100 by running the instructions stored in the internal memory 121. The internal memory 121 may include a program storage area and a data storage area. Among them, the program storage area can store an operating system, application programs required for at least one function (such as a sound playback function, an image playback function, etc.). The data storage area can store data created during the use of the electronic device 100 (such as audio data, a phone book, etc.).
[0104] The electronic device 100 can implement audio functions through an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, a headphone jack 170D, and an application processor, etc. For example, music playback, recording, etc.
[0105] The audio module 170 is used to convert digital audio information into an analog audio signal for output, and is also used to convert an analog audio input into a digital audio signal. The audio module 170 can also be used for encoding and decoding audio signals. In some embodiments, the audio module 170 can be disposed in the processor 110, or some functional modules of the audio module 170 can be disposed in the processor 110.
[0106] The speaker 170A, also known as a "loudspeaker", is used to convert an audio electrical signal into a sound signal. The electronic device 100 can listen to music or hands-free calls through the speaker 170A.
[0107] The receiver 170B, also known as an "earpiece", is used to convert an audio electrical signal into a sound signal. When the electronic device 100 answers a call or a voice message, the user can listen to the voice by holding the receiver 170B close to the ear.
[0108] The microphone 170C, also known as a "microphone" or "transmitter", is used to convert a sound signal into an electrical signal. When making a call or sending a voice message, the user can speak by bringing the mouth close to the microphone 170C to input the sound signal into the microphone 170C. The electronic device 100 can be provided with at least one microphone 170C. In some other embodiments, the electronic device 100 can be provided with two microphones 170C, which can not only collect sound signals but also implement a noise reduction function. In some other embodiments, the electronic device 100 can also be provided with three, four or more microphones 170C to implement functions such as collecting sound signals, noise reduction, identifying the sound source, and implementing a directional recording function.
[0109] The headphone jack 170D is used to connect a wired headphone. The headphone jack 170D can be a USB interface 130, or a 3.5mm open mobile terminal platform (OMTP) standard interface, or a cellular telecommunications industry association of the USA (CTIA) standard interface.
[0110] The keys 190 include a power-on key, volume keys, etc. The keys 190 can be mechanical keys or touch keys. The electronic device 100 can receive key inputs to generate key signal inputs related to the user settings and function controls of the electronic device 100.
[0111] The software system of the electronic device 100 can adopt a layered architecture, an event-driven architecture, a microkernel architecture, a microservices architecture, or a cloud architecture. In the embodiments of this application, the Android system with a layered architecture is taken as an example to exemplarily illustrate the software structure of the electronic device 100.
[0112] Figure 2 It is a software structure block diagram of the electronic device 100 according to an embodiment of the present application.
[0113] The layered architecture of the electronic device 100 divides the software into several layers, and each layer has a clear role and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers, from top to bottom, namely the application layer, the application framework layer, the Android runtime, and the system library, and the kernel layer.
[0114] The application layer may include a series of application packages.
[0115] Such as Figure 2 shown, the application packages may include applications such as camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, short message, etc.
[0116] The application framework layer provides application programming interfaces (APIs) and programming frameworks for the applications in the application layer. The application framework layer includes some predefined functions.
[0117] Such as Figure 2 shown, the application framework layer may include a window manager, a content provider, a media manager, a phone manager, a resource manager, a notification manager, etc.
[0118] The window manager is used to manage window programs. The window manager can obtain the display screen size, determine whether there is a status bar, lock the screen, capture the screen, etc.
[0119] The content provider is used to store and obtain data, and make this data accessible to applications. The data may include video, image, audio, incoming and outgoing calls, browsing history and bookmarks, phone book, etc.
[0120] The view system includes visual controls, such as controls for displaying text, controls for displaying pictures, etc. The view system can be used to build applications. The display interface can be composed of one or more views. For example, a display interface including a short message notification icon may include a view for displaying text and a view for displaying pictures.
[0121] The phone manager is used to provide the communication function of the electronic device 100. For example, the management of call status (including answering, hanging up, etc.).
[0122] The resource manager provides various resources for applications, such as localized strings, icons, pictures, layout files, video files, etc.
[0123] The notification manager enables an application to display notification information in the status bar. It can be used to convey messages of the notification type, which can automatically disappear after a short stay without user interaction. For example, the notification manager is used to inform that a download is completed, message reminders, etc. The notification manager can also be a notification that appears in the system top status bar in the form of a chart or scroll bar text, such as a notification of a background-running application, or a notification that appears on the screen in the form of a dialogue window. For example, it can prompt text information in the status bar, emit a prompt tone, vibrate the electronic device, and blink the indicator light, etc.
[0124] The media manager, which can also be called media service, is used to manage audio data and image data, such as controlling the data flow of audio data and image data and processing such as writing audio streams and image streams into an MP4 file. In the embodiments of the present application, the media manager can be used to adjust the output volume of audio data and for audio data mixing in a multi-device audio output scenario, etc.
[0125] The system library can include multiple functional modules. For example: surface manager, Media Libraries, 3D graphics processing library (such as: OpenGL ES), 2D graphics engine (such as: SGL), etc.
[0126] The surface manager is used to manage the display subsystem and provides the fusion of 2D and 3D layers for multiple applications.
[0127] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, synthesis, and layer processing, etc.
[0128] The 2D graphics engine is a drawing engine for 2D drawing.
[0129] The kernel layer is the layer between hardware and software. The kernel layer at least includes a display driver, a Wi-Fi driver, a Bluetooth driver, a camera driver, an audio driver, a sensor driver, etc.
[0130] It can be understood that Figure 2 The components shown do not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown, or combine certain components, or split certain components, or have different component arrangements.
[0131] Combined with Figure 2 , Figure 3 is a schematic diagram of module interaction shown for illustration. Please refer to Figure 3, taking the audio A of the video application played on the mobile phone as an example for illustration. Exemplarily, the video application outputs the audio data of audio A (which can also be referred to as audio data A) to the media manager. In the embodiments of the present application, when the media manager receives the audio data input by other applications, it can be called the input audio data (represented as data_in in the present application). It should be noted that the size of the audio data can also be understood as the amplitude corresponding to the audio data, that is, the volume of the audio. Therefore, in the embodiments of the present application, data_in can be used to represent the input audio data or the input volume of the audio.
[0132] The media manager can obtain the output volume of audio A (which can also be referred to as the audio output volume) based on the input volume of audio A. It should be noted that the audio data output by the media manager to other modules or applications can be called the output audio data, which is represented as data_out in the embodiments of the present application. Similar to the input audio data, the amplitude of the output audio data is the output volume of the audio. Therefore, in the embodiments of the present application, data_out can be used to represent the output audio data or the output volume of the audio. Further, it should be noted that the solution in the embodiments of the present application mainly describes the control of the volume. Therefore, in the embodiments of the present application, data_in is mainly used to represent the input volume of the audio, and data_out is mainly used to represent the output volume of the audio, which will not be repeated hereinafter.
[0133] Exemplarily, the media manager can obtain the output volume (data_out) of audio A based on formula (1):
[0134] data_out = data_in * master_volume * stream_volume * track_volume (1)
[0135] Among them, data_in is the input volume of audio A. For example, the volume corresponding to the audio data generated by the video application is the input volume.
[0136] track_volume (track volume) represents the volume of the application. For example, the volume adjustment option in the music application can be used to adjust the output volume of the music being played by the music application, but this volume does not affect the volume of other media and is only valid for the audio played by the music application.
[0137] stream_volume (stream volume) represents the volume of a certain stream. Exemplarily, taking the Android system as an example, the Android system includes 10 types of streams, such as including but not limited to: media stream, call stream, etc. For example, Figure 4As shown, the sound and vibration option interface 401 in the settings options of the mobile phone includes a volume option 402. The volume option 402 includes but is not limited to: the "call, message, notification" option 4021, the "alarm" option 4022, the "music, video, game" option 4023, the "call" option 4024, and the "intelligent voice" option 4025, etc. Among them, the "call" option 4024 corresponds to the call stream and is used to adjust the output volume of the call. The "alarm" option 4022 corresponds to the alarm stream and is used to adjust the output volume of the alarm. Exemplarily, the "call, message, notification" option 4021 corresponds to the call, message, notification stream voloum alias. The stream voloum alias is used to set the volume of the same group of streams. For example, by adjusting the slider of the "call, message, notification" option 4021, the volume of the "call, message, notification" stream voloum alias can be set, which can be understood as setting the volume of the call stream (i.e., the call prompt volume), the message stream (i.e., the message prompt volume), and the notification stream (i.e., the notification prompt volume). That is to say, the call prompt volume, the message prompt volume, and the notification prompt volume will be adjusted accordingly, but other streams, such as the alarm and call volume, will not be adjusted. Another example is that the "music, video, game" option 4023 corresponds to the "music, video, game" stream voloum alias, which can also be called the media stream voloum alias. By adjusting the slider of the "music, video, game" option 4023, the volume of each stream (including the music stream, the video stream, and the game stream) in the media, that is, the "music, video, game" stream voloum alias, can be set.
[0138] The master_volume (main volume) is used to set all stream_volume and track_volume. This value can be written into the device file (i.e., the sound card file) corresponding to the audio device to control the volume of all objects. This value can also not be written into the sound card file, but be used as a multiplier factor to affect the volume of all objects.
[0139] As can be seen from formula (1), the factors affecting the output volume include but are not limited to at least one of the following: input volume, stream volume, track volume, and master volume. In the embodiments of the present application, the factors other than the input volume (including stream volume, track volume, and master volume) can also be called output volume parameters, and the user can adjust the output volume by adjusting any one of the output volume parameters.
[0140] Still referring toFigure 3 Exemplarily, the media manager outputs the data_out of Audio A (i.e., the output audio data of Audio A) to the audio driver, and the audio driver can play Audio A through a playback device (such as a speaker), and the played volume is the volume corresponding to the data_out, which can also be understood as the amplitude corresponding to the audio data of Audio A. It should be noted that the media manager can perform corresponding encoding and other processing on Audio A. The specific processing method can refer to the embodiments of the prior art, and this application will not be described in detail and will not be repeated hereinafter.
[0141] Please refer to Figure 5 , taking the mobile phone playing the audio A of the video application as an example, the video application responds to the user operation and switches Audio A to Audio B. Specifically, the video application outputs the input audio data of Audio B (denoted as data_in(B)) to the media manager, and the media manager obtains the output audio data of Audio B based on formula (1), which can also be understood as obtaining the output volume of Audio B (denoted as data_out(B)). Among them, before the user adjusts the output volume parameters (i.e., stream volume, track volume, master volume), the output volume of Audio B depends on the magnitude of the input volume of Audio B. Assuming that the input volume of Audio B is much smaller than the input volume of Audio A (data_in(A)), that is, data_in(B) < data_in(A), then in the case of the same output volume parameters (i.e., the parameters in the dashed box), the output volume of Audio B is much smaller than the output volume of Audio A. The user can adjust the output volume parameters to increase the output volume of Audio B. For example, the user can adjust the volume of the media streamvoloum alias (including music stream, video stream, game stream) through the volume keys to increase the output volume of Audio B. For example, as Figure 6 shown, when the user clicks the volume key, the volume adjustment box 602 is displayed on the interface of the video application interface 601, and the volume adjustment box 602 includes a volume bar for indicating the media volume size. It should be noted that in the embodiments of this application, the volume keys are set as an example for adjusting the media volume. In other embodiments, the volume can also be adjusted by any other means, and this application does not make a limitation.
[0142] Still refer to Figure 5, Exemplarily, in response to the received user operation, the media manager increases the value of stream_volume in the output volume parameter, so that the output volume of Audio B, that is, data_out(B), increases. When the video application switches back to Audio A in response to the received user operation, correspondingly, the video application outputs the audio data of Audio A (i.e., the input audio data) to the media manager. The media manager obtains the output volume of Audio A based on the current, that is, the adjusted output volume parameter (where the value of stream_volume has been increased). Then, the output volume of Audio A will become very large, and this phenomenon can be called popping sound, which will affect the user experience.
[0143] To solve the volume control problem in the audio playback scenario, an embodiment of the present application provides a volume control method, which can control the output volume of the audio within a preset range, and this preset range is set according to user needs, so as to solve the popping sound problem during audio switching and effectively improve the user experience.
[0144] Figure 7 For the schematic diagram of the volume control method shown exemplarily, please refer to Figure 7 , specifically including:
[0145] S701, the mobile phone subscribes to the output volume.
[0146] Exemplarily, in the scenario where the mobile phone plays or outputs audio data to other devices, the mobile phone can subscribe to the output volume to obtain the output volume. As described above, the output volume in the embodiment of the present application is represented as "data_out", and the media manager in the mobile phone can obtain the output volume corresponding to the output audio data based on the input volume corresponding to the audio (i.e., the input audio data) input by the application.
[0147] The media manager can output the audio data to the audio driver to play through devices such as speakers. The media manager can also output the audio data to Wi-Fi drivers or Bluetooth drivers, etc., to transmit to other devices for playing. That is to say, the output volume in the embodiment of the present application can be understood as the volume when the mobile phone plays audio, or the output volume corresponding to the mobile phone outputting audio data to other devices.
[0148] Exemplarily, the mobile phone can obtain the output volume based on formula (2):
[0149] data_out = data_in * master_volume * stream_volume * track_volume * volume_coefficient (2)
[0150] The volume_coefficient is used to affect the output volume. In the embodiments of the present application, by setting a suitable volume parameter, the output volume is controlled within the range required by the user. Optionally, in the embodiments of the present application, the volume parameter can be obtained and saved by the media manager, for example, it can be saved in the memory (it can also be other locations, which are not limited in the present application). The specific obtaining method of the audio parameter will be described in detail in the following embodiments. Optionally, the media manager can be set with a default volume parameter. For example, the volume parameter can be 0.5. This default volume parameter can be used by the media manager to process the audio before obtaining the volume parameter based on the method described below. For example, when the mobile phone is powered on for the first time and plays audio for the first time, the media manager can obtain the output volume based on the default volume parameter to avoid popping sounds during the first play. Optionally, if the media controller is not set with a default volume parameter, when the media controller plays audio for the first time, it can obtain the output volume based on formula (1), which is not limited in the present application.
[0151] Exemplarily, as can be seen from formula (2), in the embodiments of the present application, the factors affecting the output volume include but are not limited to at least one of the following: input volume, stream volume, track volume, master volume, and volume parameter. In the embodiments of the present application, as described above, the stream_volume, track_volume, and master_volume can be referred to as output volume parameters, and the user can adjust the output volume by adjusting any one of the output volume parameters.
[0152] In the embodiments of the present application, the mobile phone subscribes to the output volume and can sample the output volume at a preset sampling period to obtain the output volume. Optionally, the mobile phone can set two types of sampling periods, including the first sampling period and the second sampling period. Among them, the first sampling period can also be referred to as the sparse sampling period, and the second sampling period can also be referred to as the dense sampling period. The sampling period duration of the first sampling period is greater than that of the second sampling period. For example, the period duration of the first sampling period can be in seconds, and the period duration of the second sampling period can be in milliseconds.
[0153] For example, taking the scenario of a mobile phone playing audio data as an example, when the mobile phone plays audio data, the mobile phone can detect the user's behavior to detect whether there is a behavior of adjusting the output volume, which can also be understood as detecting whether there is a behavior of adjusting the output volume parameter described above.
[0154] In one example, when the mobile phone plays audio data and no user adjustment of the output volume is detected, the mobile phone collects the output volume at a first sampling period. In another example, when the mobile phone plays audio data and user adjustment of the output volume is detected, the mobile phone collects the output volume at a second sampling period.
[0155] Exemplarily, the above-mentioned user adjustment of the output volume may include, but is not limited to, at least one of the following: clicking the volume keys; clicking or dragging each volume option in the setting interface (such as Figure 4 each slider bar in); clicking the volume keys of the remote control; adjusting the volume through voice commands or gestures, etc., which are not limited in this application.
[0156] It should be noted that a volume control intelligent adjustment option can be set in the mobile phone, and the user can use this volume control intelligent adjustment option to instruct the mobile phone to execute the volume control scheme in the embodiments of this application during the process of playing audio. Optionally, the volume control intelligent adjustment option can be set in at least one of the drop-down menu, the control center, the negative first screen, and the sound and vibration setting interface, which are not limited in this application.
[0157] S702, the mobile phone obtains and saves the output volume range.
[0158] In the embodiments of this application, during the process of the mobile phone collecting the output volume at a first sampling period, the mobile phone can obtain the output volume range. The output volume range includes the maximum output volume and the minimum output volume. The mobile phone can respectively obtain the maximum output volume (represented as data_out_max in this application) and the minimum output volume (represented as data_out_min in this application) based on formula (3) and formula (4) to obtain the output volume range.
[0159] data_out_max = Math.max(data_out_max, data_out) (3)
[0160] data_out_min = Math.min(data_out_min, data_out) (4)
[0161] That is to say, after the mobile phone collects the output volume, it compares the output volume with the maximum and minimum values of the already saved output volume range respectively.
[0162] In one example, if the collected output volume is greater than the maximum value of the saved output volume range, then the collected output volume is the maximum value of the new output volume range, and the minimum value of the output volume range remains unchanged. That is, the mobile phone updates the saved output volume range, and the maximum value of the updated output volume range is the collected output volume, and the minimum value is still the minimum value of the previously saved output volume range.
[0163] In another example, if the collected output volume is less than the maximum value of the saved output volume range and greater than the minimum value of the saved output volume range, then the updated output volume range is the same as the previous output volume range. That is, the maximum value of the updated output volume range is still the maximum value of the previous output volume range, and the minimum value of the updated output volume range is still the minimum value of the previous output volume range.
[0164] In yet another example, if the collected output volume is less than the minimum value of the saved output volume range, then the collected output volume is the minimum value of the new output volume range, and the maximum value of the output volume range remains unchanged. That is, the mobile phone updates the saved output volume range, the maximum value of the updated output volume range is the maximum value of the previously saved output volume range, and the minimum value of the updated output volume range is the collected output volume.
[0165] It can be understood that in the embodiments of the present application, after each sparse collection (i.e., collection according to the first sampling period) by the mobile phone, the output volume range is updated according to the collected output volume, and the updated output volume range may be the same as or different from the previous output volume range.
[0166] In the embodiments of the present application, during the process of the mobile phone collecting the output volume at the second sampling period, the mobile phone can also obtain the output volume range. In one example, if the mobile phone (specifically, the media manager) detects that the user increases the output volume, for example, the user clicks the volume key to increase the media stream parameter (i.e., stream_volume), then during the process of the user adjusting the volume, the mobile phone (specifically, the media manager, which will not be repeated hereinafter) collects the output volume at the second sampling period and obtains the minimum output volume (denoted as data_out_min in the present application) of the output volume range based on formulas (5) and (6). Among them, the maximum output volume of the output volume range is still the maximum value of the previously obtained output volume range.
[0167] data_out = Math.average(data_out1, data_out2, …) (5)
[0168] data_out_min = Math.max(data_out_min, data_out) (6)
[0169] Please refer to formula (5). As described above, when the mobile phone detects that the user adjusts the output volume (i.e., adjusts the output volume parameter described above), during the process of the user increasing the output volume (i.e., from detecting that the user starts to adjust the volume to the end of the adjustment), the mobile phone collects the output volume with the second sampling period. From the start to the end of the user's volume adjustment, the mobile phone collects n output volumes with the second sampling period, including data_out1, data_out2..., and the mobile phone obtains the average output volume based on the n collected output volumes. Then, based on formula (6), the mobile phone obtains the minimum value of the output volume range. Specifically, the mobile phone compares the minimum value of the previously saved output volume range with the average output volume obtained this time. In one example, if the average output volume is greater than the minimum value of the previously saved output volume range, the average output volume is used as the new minimum value of the output volume range, and the maximum value remains the maximum value of the output volume range obtained previously. In another example, if the average output volume is less than the minimum value of the previously saved output volume range, the minimum value of the previously saved output volume range is used as the new minimum value of the output volume range, and the maximum value remains the maximum value of the output volume range obtained previously. That is to say, the new output volume range is the same as the previously saved output volume range.
[0170] In another example, if the mobile phone (specifically the media manager) detects that the user decreases the output volume, for example, the user clicks the volume button to decrease the media stream parameter (i.e., stream_volume), then during the process of the user adjusting the volume, the mobile phone collects the output volume with the second sampling period and obtains the maximum value of the output volume range (denoted as data_out_max in this application) based on formula (7) and formula (8). Among them, the minimum value of the output volume range remains the minimum value of the output volume range obtained previously.
[0171] data_out = Math.average(data_out1, data_out2,...) (7)
[0172] data_out_max = Math.min(data_out_max, data_out) (8)
[0173] Please refer to Formula (7). When the mobile phone detects that the user is increasing the output volume (i.e., from the start of detecting the user's volume adjustment to the end of the adjustment), the mobile phone collects the output volume with the second sampling period. From the start to the end of the user's volume adjustment, the mobile phone collects n output volumes with the second sampling period, including data_out1, data_out2... The mobile phone obtains the average output volume based on the n collected output volumes. Then, the mobile phone obtains the maximum value of the output volume range based on Formula (8). Specifically, the mobile phone compares the maximum value of the previously saved output volume range with the average output volume obtained this time. In one example, if the average output volume is less than the maximum value of the previously saved output volume range, the average output volume is used as the maximum value of the new output volume range, and the minimum value remains the minimum value of the output volume range obtained previously. In another example, if the average output volume is greater than the maximum value of the previously saved output volume range, the maximum value of the previously saved output volume range is used as the maximum value of the new output volume range, and the minimum value remains the minimum value of the output volume range obtained previously. That is to say, the new output volume range is the same as the previously saved output volume range.
[0174] For example, please refer to Figure 8, during the process of playing audio on a mobile phone, a media sensor collects the output volume generated by the media sensor. At time t1, assuming that the media sensor does not currently store an output volume range, that is, the media sensor may be performing the acquisition step of the output volume range for the first time. Exemplarily, the media sensor collects at a sparse acquisition period and collects an output volume of data_out1, which value can be regarded as the minimum value or the maximum value. At time t2, the media sensor detects the arrival of the acquisition period, and the media sensor collects the output volume. For example, the collected output volume is data_out2. The media sensor compares data_out2 with data_out1. Assuming that data_out2 is greater than data_out1, the media sensor determines that the maximum value of the output volume range is data_out2 and the minimum value is data_out1, that is, (data_out1, data_out2). Exemplarily, at time t3, the media sensor detects the arrival of the acquisition period, and the media sensor collects the output volume. For example, the collected output volume is data_out3. The media sensor determines, based on formula (3) and formula (4), that data_out3 is greater than the maximum value (data_out2) of the currently stored output volume range, and the media sensor updates the output volume range. The maximum value of the updated output volume range is data_out3, and the minimum value remains data_out1, that is, (data_out1, data_out3). At time t4, the media manager detects that the user turns down the output volume. Then, between time t4 and the end of the user's adjustment (for example, time t7), the media manager collects at a dense acquisition period and takes the average of the multiple collected output volumes. For example, the obtained average value is data_out4. The media manager obtains the maximum value of the output volume range based on formula (7) and formula (8). Assuming that data_out4 is greater than the maximum value (data_out3) of the currently stored output volume range, the maximum value of the updated output volume range remains data_out3, that is, the updated output volume range is (data_out1, data_out3). It should be noted that Figure 8 the acquisition interval and volume in are only illustrative examples, and this application does not make any limitations. Further, it should be noted that Figure 8 is not shown in the figure. Exemplarily, after the dense acquisition (that is, after time t7), the media manager will continue to collect at a sparse acquisition period and update the output volume range.
[0175] Exemplarily, each time the media manager obtains a new output volume range, it saves the new output volume range. Optionally, the media manager can overwrite the previous output volume range to save memory usage, and this application does not make any limitations.
[0176] S703. The mobile phone detects an audio change and obtains a volume parameter based on the input volume and output volume range of the new audio.
[0177] Exemplarily, in the embodiments of the present application, the audio change may include but is not limited to: sound source file switching, sound source device switching, output device switching, etc. Among them, the sound source file switching is optionally the switching of the audio file received by the media manager. For example, the mobile phone is playing song A. Correspondingly, the audio output by the music application to the media manager is the audio data of song A. The mobile phone responds to the user operation and switches to play song B. Correspondingly, the audio output by the music application to the media manager is switched to the audio data of song B, which is the sound source switching. Exemplarily, the sound source device switching is optionally the switching of the sound source device in the audio casting service in a multi-device scenario. For example, the mobile phone casts song A to the in-vehicle device through a wireless connection (which can be a Wi-Fi connection or a Bluetooth connection, which is not limited in the present application and will not be repeated hereinafter). The in-vehicle device receives and plays song A. The user connects the tablet to the in-vehicle device and uses tablet A to cast song A to the in-vehicle device. Then, for the in-vehicle device, its sound source device switches from the mobile phone to the tablet. Exemplarily, the output device switching is optionally the switching of the output device in the audio casting service in a multi-device scenario. For example, the mobile phone casts song A to the in-vehicle device through a wireless connection. The mobile phone responds to the received user operation and casts song A to the tablet through the wireless connection with the tablet. Correspondingly, for the mobile phone, its output device switches from the in-vehicle device to the tablet device, which is the output device switching.
[0178] In the embodiments of the present application, when the mobile phone detects any of the above situations, that is, after determining the audio change, the mobile phone executes the volume parameter acquisition step. That is to say, after the audio change, the mobile phone obtains the volume parameter corresponding to the audio based on the method described below. Before this audio change, the mobile phone does not need to obtain the volume parameter of this audio anymore.
[0179] In the embodiments of the present application, after the mobile phone (specifically the media manager) detects the audio change, it obtains the input volume of the changed audio (the concept can be referred to above and will not be elaborated here). The mobile phone can obtain the corresponding volume parameter based on the relationship between the input volume and the output volume range. Among them, the volume parameter can be used to adjust the output volume of the audio. In the embodiments of the present application, the output volume of the audio can be adjusted to the output volume range by setting corresponding volume parameters for different audios (i.e., different input volumes). The specific method is as follows:
[0180] 1) The mobile phone obtains the average input volume of the audio.
[0181] Exemplarily, still taking the scenario of a mobile phone playing audio as an example, after the mobile phone (specifically, the media manager) detects an audio change, before playing the changed audio, it can obtain the input volume corresponding to the audio data of a preset length of the audio (i.e., the changed audio). The preset length can be, for example, 5 seconds, which can be set based on actual needs and is not limited in this application. The mobile phone can take the average value of the input volumes of the audio data of the preset length obtained to get the average input volume.
[0182] 2) The mobile phone obtains the volume parameter of the audio based on the relationship between the average input volume of the audio and the output volume range.
[0183] In one example, if the mobile phone detects that the average input volume of the audio exceeds the output volume range and is greater than the maximum value of the output volume range, then the mobile phone obtains the volume parameter of the audio (denoted as volume_coefficient in this application, the concept can be referred to above and will not be elaborated here) based on formula (9):
[0184]
[0185] Among them, data_out_max is the maximum value of the output volume range described above. data_in_average is the average input volume of the obtained audio. G_max is a system constant, which can be set according to actual needs. For example, in the embodiments of this application, G_max is 0.5, and this application is not limited.
[0186] In another example, if the mobile phone detects that the average input volume of the audio exceeds the output volume range and is less than the minimum value of the output volume range, then the mobile phone obtains the volume parameter of the audio based on formula (10):
[0187]
[0188] Among them, data_out_min is the minimum value of the output volume range described above. data_in_average is the average input volume of the obtained audio. G_min is a system constant, which can be set according to actual needs. For example, in the embodiments of this application, G_min is 0.5, and this application is not limited.
[0189] In yet another example, if the mobile phone detects that the average input volume of the audio does not exceed the output volume range, that is, the average input volume of the audio is greater than or equal to the minimum value of the output volume range and less than or equal to the maximum value of the output volume range, then the volume parameter of this audio is equal to 1.
[0190] S704, the mobile phone obtains the output volume of the new audio based on the volume parameter, the input volume, and the output volume parameter.
[0191] Exemplarily, after the mobile phone obtains the audio parameters of the changed audio (i.e., the new audio), it can obtain the changed output volume based on formula (2). For specific descriptions, reference can be made to the relevant descriptions of formula (2), which will not be elaborated here. It should be noted that in the source change scenario, the "new audio" described in the embodiments of this application refers to audio data that is different from the audio before the switch. In the source device switch and output device switch scenarios, the "new audio" may be audio data that is different from that before the switch or may be the same as that before the switch. For the media manager, both are considered new audio. For example, in the output device switch scenario, the mobile phone detects the output device switch. After the output device switch, the music application may output audio data to the media manager again, and this audio data may be the same as or different from the audio data before the switch, which is not limited in this application.
[0192] After the mobile phone obtains the output volume of the audio, it can output the audio and the output volume of the audio to the audio driver for playback, or output the audio and the output volume of the audio to other devices for playback through the communication module.
[0193] To enable those skilled in the art to better understand the audio control method in the embodiments of this application, the following specific examples will be used to Figure 7 describe the audio control method in detail.
[0194] In this scenario, the example of the mobile phone playing audio will be used for illustration. Please refer to Figure 9a , the video application plays audio A in response to the received user operation. Specifically, the video application outputs the input audio data of audio A to the media manager, and the corresponding input volume can be expressed as data_in(A). Optionally, the video application can divide audio A into segments and transmit them to the media manager segment by segment. The media manager receives and caches the received audio A. The specific transmission method can refer to the embodiments of the prior art, which is not limited in this application.
[0195] The media manager receives the input audio data of audio A. The media manager can obtain the volume parameters of audio A based on the input volume parameters corresponding to the input audio data and the currently saved (i.e., the most recently saved) output volume range. Specifically, the media manager obtains the average input volume (data_in_average(A)) of the audio data with a preset length (such as the first 5 seconds) at the beginning of audio A.
[0196] The media manager compares the average input volume of audio A with the output volume range. In this example, the output volume range currently saved by the media manager is (data_out_min1, data_out_max1) as an example. Assuming that the media manager detects that the average input volume of audio A (data_in_average(A)) is within the output volume range, that is, data_out_min1≤data_in_average(A)≤data_out_max1, the media manager determines that the volume parameter corresponding to audio A (referred to as volume_coefficient(A)) is 1.
[0197] The media manager obtains the output volume (denoted as data_out (A)) corresponding to the output audio data of audio A based on formula (2). Figure 9a After the media manager obtains data_out(A), the media manager outputs the output audio data of audio A to the audio driver. The audio driver plays the output audio data of audio A through the speaker of the mobile phone, and the playback volume is the value corresponding to data_out(A).
[0198] Still refer to Figure 9a , when the mobile phone plays audio A, the media manager collects the output volume of audio A (i.e., the output volume generated by the media manager) in the first sampling period (i.e., the sparse sampling period described above), and updates the output volume range based on the collected output volume. The specific collection and acquisition methods can be referred to the description in S701 and S702, which will not be repeated here.
[0199] Please refer to Figure 9b , exemplarily, in response to the received user operation, the video application changes the played audio and switches audio A to audio B. The video application outputs the input audio data of audio B to the media manager, and the corresponding input volume is represented as data_in(B).
[0200] The media manager determines that the audio source has changed in response to receiving the input audio data of audio B. Accordingly, after the media manager determines that the audio source has changed, it will re-execute the volume parameter acquisition process, that is, the media manager acquires the volume parameter of audio B. Specifically, the media manager acquires the average input volume (data_in_average(B)) of the audio data of the beginning of audio B with a preset length (e.g., the beginning 5 seconds).
[0201] The media manager compares the average input volume of Audio B with the output volume range. In this example, still taking the output volume range currently saved by the media manager as (data_out_min1, data_out_max1) for illustration. That is to say, the output volume range obtained by the media player during the playback of Audio A has not changed.
[0202] In this example, assume that the media manager detects that the average input volume of Audio B (data_in_average(B)) exceeds the output volume range and is less than the minimum value data_out_min1 of the output volume range. The media manager can obtain the volume parameter of Audio B (denoted as volume_coefficient(B)) based on formula (10).
[0203] Next, the media manager can obtain the output volume corresponding to the audio data of Audio B (denoted as data_out(B)) based on formula (2). Please refer to Figure 9b , after the media manager obtains data_out(B), the media manager outputs the audio data of Audio B to the audio driver. The audio driver plays the output audio data of Audio B through the speaker of the mobile phone, and the playback volume is the value corresponding to data_out(B).
[0204] It should be noted that in the above text, only the case where the average input volume of Audio B is greater than the maximum value of the output volume range is taken as an example for illustration. If the average input volume of Audio B is less than the minimum value of the output volume range, the media manager can obtain the volume parameter of Audio B based on formula (10), and the steps of other parts are the same, so no repeated example is given here.
[0205] Furthermore, it should be noted that as Figure 9b shown, during the playback of Audio B on the mobile phone, the media manager collects the output volume of Audio B at the first sampling period (i.e., the sparse sampling period mentioned above), and updates the output volume range based on the collected output volume. The specific collection and acquisition methods can refer to the descriptions in S701 and S702, which will not be elaborated here. It should be noted that as mentioned above, the media manager will only execute the process of obtaining the volume parameter after detecting an audio change. Therefore, the output volume range obtained during the audio playback will not affect the currently playing audio. Before the end of the audio playback or switching to other audio, the output volume is calculated based on the obtained volume parameter. And the updated output volume range during the playback will be used in the steps of obtaining the volume parameter after the audio change.
[0206] In this example, the video application responds to the received user operation and switches Audio B back to Audio A. Then the media player follows Figure 9aThe process in is repeated. Specifically, the video application outputs the input audio data of Audio A to the media manager, where the input volume corresponding to the input audio data of Audio A is data_in(A). In response to receiving the input audio data of Audio A, the media manager determines a sound source change. The media manager will re-execute the volume parameter acquisition process. Exemplarily, the media manager obtains the average input volume of Audio A (data_in_average(A)). The media manager compares the average input volume of Audio A with the output volume range. In this example, still taking the currently saved output volume range as (data_out_min1, data_out_max1) as an example for illustration. The media manager detects that the average input volume of Audio A is within the output volume range, and the media manager can determine that the volume parameter (volume_coefficient(A)) corresponding to Audio A is 1, and based on the volume parameter of Audio A, the input volume of Audio A, and the output volume parameter, obtains the output volume of Audio A. Details not described can be referred to Figure 9a , which will not be elaborated here.
[0207] Please refer to Figure 9c , in the embodiment of the present application, during the playback of Audio A, its corresponding volume parameter is volume_coefficient(A). After Audio A is switched to Audio B, that is, when the sound source changes, the mobile phone can obtain the volume parameter corresponding to Audio B based on the input volume of Audio B, so that when the output volume parameter (that is, the parameters in the dotted box, including stream_volume, track_volume, master_volume) remains unchanged, that is, the same as the output volume parameter before switching to Audio B, the mobile phone can adjust the output volume of Audio B to within the output volume range through the volume parameter (it should be noted that since the input volume of Audio B may fluctuate, correspondingly, the output volume of some audio may not be within the output range, but the difference between its output volume and the output volume range is small and can be ignored). That is to say, when the input volume of Audio B is less than the input volume of Audio A (it can also be that the input volume of Audio B is greater than the input volume of Audio A, and the principle is similar, which will not be repeated here), the user does not need to manually adjust the volume. That is, as Figure 9c shown, when the output volume parameter is the same, the mobile phone can obtain an appropriate volume parameter so that the output volume of Audio B falls within the output volume range obtained according to the user's auditory habit. Still referring to Figure 9c, when the mobile phone switches the audio back to Audio A again, the media manager can re-obtain the corresponding volume parameter based on the switched audio. When the output volume parameters are the same, by setting appropriate volume parameters, the output volume of Audio A can also fall within the output volume range obtained according to the user's auditory habit. That is to say, in the embodiments of the present application, even if the input volume of the switched audio is less than the input volume of the audio before switching, by setting the corresponding volume parameter, the user does not need to turn up the volume. Correspondingly, when the audio switches back to the previous audio, since the output volume parameter does not change, there will be no problem of popping sound. Through the volume control method in the embodiments of the present application, the user does not need to repeatedly adjust the volume, and there will be no popping sound phenomenon after adjusting the volume, effectively improving the user experience. It should be noted that the output volume of the audio in the embodiments of the present application within the output volume range can be understood as the average volume of the audio within the output volume range, or it can be understood that most of the volume of the audio data is within the output volume range. That is to say, due to the high and low frequency transformation of the audio data, there may be a small part of the audio volume greater than or less than the output volume range. Further, as described above, during the playback of the audio, the electronic device can update the output volume range. Correspondingly, if the output volume corresponding to all the audio data of the audio data is within the output volume range, during the playback of the audio data, the output volume always remains within the output volume range. Exemplarily, if the output volume corresponding to some of the audio data of the audio data is not within the output volume range, the electronic device can update the output volume range when it collects the volume that does not meet the output volume range.
[0208] It should be noted that the above scenarios are described with the output volume range remaining unchanged. In one possible implementation, if the user adjusts the volume (such as turning up the volume) while the mobile phone is playing Audio A, the media manager will collect the output volume at the second sampling period (i.e., the dense sampling period) during the process of the user turning up the volume after detecting the volume adjustment by the user. Moreover, the media manager can update the output volume range based on the collected output volume. The specific acquisition method can refer to the above text and will not be elaborated here. In other embodiments, the output volume range may also change during the sparse sampling period, and specific examples will not be given one by one in this application. Optionally, the updated output volume range may be the same as or different from the previous output volume range, which is not limited in this application. Correspondingly, after the mobile phone switches to Audio B, the media manager can obtain the volume parameter corresponding to Audio B based on the updated output volume range. Of course, if the user adjusts the volume while the mobile phone is playing Audio B, the media manager will collect data at the dense sampling period and update the output volume range in the manner described above. After the mobile phone switches back to Audio A, the media manager can obtain the volume parameter corresponding to Audio A based on the currently saved (i.e., the most recently updated) output volume range, that is, the most recently updated output volume range.
[0209] Furthermore, it should be noted that the above scenarios are described with the example of switching back from Audio B to Audio A. In another possible implementation, in response to the received user operation, the video application can also switch to other audio, and the specific method is the same as switching to Audio A, and specific examples will not be given one by one in this application. It should also be noted that the audio switched back to in the above text is optionally the same as the audio before switching to Audio B. In other embodiments, the video application can also adopt the method of resuming playback from the breakpoint. For example, if Audio A1 was being played before switching to Audio B, the media manager can obtain the volume parameter corresponding to Audio A1 and the corresponding output volume. After the video application switches back from Audio B to Audio A, optionally Audio A2 in Audio A is played. The data of Audio A2 is different from that of Audio A1, and the input volume can be the same or different. The media manager can obtain the corresponding volume parameter based on the input volume of Audio A2 and obtain the output volume of Audio A2. The specific implementation method is similar to that in Figure 9a and Figure 9b and will not be elaborated here.
[0210] Furthermore, it should be noted that the audio switching (or change) described in the embodiments of this application may be switching the currently playing Audio A to Audio B in response to the received user operation during the process of playing Audio A. In other embodiments, it can also be playing Audio B after Audio A finishes playing (for example, after an interval), which is not limited in this application.
[0211] Further, it should be noted that during the process where the user adjusts the output volume parameter to adjust the output volume of the audio, when the media manager obtains the output volume range, it can take the average of the maximum value of the newly obtained output volume range and the maximum value of the output volume range obtained last time as the maximum value of the updated output volume range. Correspondingly, the media manager takes the average of the minimum value of the newly obtained output volume range and the minimum value of the output volume range obtained last time as the minimum value of the updated output volume range, thereby preventing the output volume range from fluctuating too much due to the user adjusting the volume.
[0212] The volume control method in the embodiments of the present application can be applied not only to the scenario where a mobile phone plays audio as described above (which can also be understood as a single-device scenario), but also to a multi-device collaboration scenario. Figure 10 For an exemplary multi-device collaboration scenario, please refer to Figure 10 , where the mobile phone outputs the audio data of audio A to the TV through a wireless connection between the mobile phone and the TV, and the TV receives and plays the audio data of audio A. It should be noted that Figure 10 The device types and the number of devices in are only illustrative examples. For example, in other embodiments, the scenario can be that mobile phone A is wirelessly connected to the TV and the tablet respectively, and outputs the audio data of audio A to the TV and the tablet respectively, and both the TV and the tablet can play the audio data of audio A. The processing methods of each device in the scenario are the same as those in the scenario of Figure 10 , and the present application will not give examples one by one. Further, it should be noted that the wireless connection described in the embodiments of the present application can be maintained based on protocols such as the Bluetooth protocol or the Wi-Fi protocol, and the present application does not make any limitations. In this example, the wireless connection is taken as a Wi-Fi connection for illustration. The specific establishment process of the wireless connection can refer to the embodiments of the existing technology, and the present application will not elaborate.
[0213] Please refer to Figure 11a , for example, the video application of the mobile phone determines to play audio A in response to the received user operation. The video application of the mobile phone outputs the input audio data A1 of audio A to the media manager of the mobile phone, and the corresponding input volume is denoted as data_in(A1).
[0214] The media manager of the mobile phone receives the input audio data of audio A and obtains the volume parameter of audio A. Specifically, the media manager of the mobile phone obtains the average input volume of audio A (data_in_average(A1)). The media manager compares the average input volume of audio A with the currently saved output volume range and obtains the corresponding volume parameter (volume_coefficient(A1)). For specific details, please refer to Figure 9a the relevant content in , and details will not be elaborated here.
[0215] The media manager of the mobile phone can obtain the output volume data_out(A1) of Audio A based on the input volume of Audio A, the volume parameter, and the current output volume parameters (including stream_volume, track_volume, and master_volume).
[0216] Still referring to Figure 11a The media manager of the mobile phone can collect the output volume of Audio A and update the output volume range based on the collected output volume. The specific method can refer to the above, and will not be elaborated here.
[0217] Exemplarily, the media manager of the mobile phone outputs the output audio data A1 of Audio A to the Wi-Fi driver. Among them, the output volume corresponding to the output audio data A1 is data_out(A1). The Wi-Fi driver of the mobile phone outputs the output audio data A1 of Audio A to the Wi-Fi driver of the TV. The Wi-Fi driver of the TV optionally outputs the output audio data A1 of Audio A to the screen mirroring application of the TV (it can also be other collaborative applications, which are not limited in this application).
[0218] Exemplarily, the screen mirroring application outputs the output audio data A1 of Audio A to the media manager of the TV. It should be noted that in the embodiments of this application, for the media manager, the audio data it receives are all recorded as input audio data. Then, the audio data of Audio A received by the media manager is represented as the input audio data A2 of Audio A, and the corresponding input volume is data_in(A2). Among them, data_in(A2) is equal to data_out(A1).
[0219] Exemplarily, the media manager of the TV obtains the volume parameter of Audio A on the TV side based on the input volume data_in(A2) of Audio A received. The media manager of the TV can obtain the average input volume (data_in_average(A2)) of Audio A based on the input volume data_in(A2) of Audio A. It should be noted that this average input volume is based on the input volume of Audio A on the TV side, that is, obtained from the output volume of Audio A on the mobile phone side. Whether data_in_average(A2) is the same as or different from data_in_average(A1) is not limited in this application.
[0220] Exemplarily, the media manager of the TV compares the average input volume (data_in_average(A2)) of Audio A with the output volume range currently saved on the TV side. Among them, whether the output volume range on the TV side is the same as or different from the output volume range on the mobile phone side is not limited in this application.
[0221] Based on the comparison result, the media manager of the TV can obtain the volume parameter of Audio A on the TV side (volume_coefficient(A2)). Whether the volume parameter (volume_coefficient(A2)) is the same as or different from the volume parameter (volume_coefficient(A1)) is not limited in this application.
[0222] Exemplarily, based on the input volume data_in(A2) of Audio A, the volume parameter (volume_coefficient(A1)), and the output volume parameter on the TV side (the same as or different from that on the mobile phone side), the media manager of the TV can obtain the output volume data_out(A2) of Audio A on the TV side. It should be noted that the specific details of obtaining each parameter can refer to the relevant content in the above embodiments and will not be repeated here.
[0223] The media manager of the TV can output the audio data A2 of Audio A to the audio driver, and the corresponding output volume is data_out(A2). The audio driver controls the speaker (or other playback devices) to play the audio data of Audio A, and the played volume is data_out(A2).
[0224] It should be noted that as Figure 11a shown, the media manager of the TV can also collect the output volume of Audio A and update the output volume range. The specific implementation method can refer to the relevant content in the above embodiments and will not be elaborated here.
[0225] In the embodiment of this application, in a multi-device collaboration scenario, the TV can adjust the output volume of the audio to the audition volume range that the user is accustomed to on the TV side, that is, the output volume range on the TV side, through the volume parameter corresponding to the audio. When the input volume of the audio obtained by the TV (i.e., the output volume on the mobile phone side) is relatively large or small, the appropriate volume parameter can be obtained to adjust the output volume of the audio on the TV side to within the output volume range.
[0226] In the embodiment of this application, during the process of the TV playing Audio A, the user can adjust the output volume of the TV through the remote control of the TV. For example, in response to the received user operation, the media manager of the TV increases the output volume parameters on the TV side (including stream_volume, track_volume, master_volume). Then, what is correspondingly changed is the output volume on the TV side and the output volume range on the TV side, rather than the output volume and output volume range on the mobile phone side. Therefore, as Figure 11bAs shown, when the mobile phone cancels the audio transmission with the TV (the wireless connection may or may not be disconnected, which is not limited in this application), if the mobile phone continues to play audio A on the mobile phone side, the mobile phone can obtain the output volume of audio A based on the Figure 9a process. After the mobile phone cancels the audio transmission with the TV, the media manager on the mobile phone side detects an audio change (i.e., a change in the output device). When the mobile phone obtains the output volume of audio A, it needs to re-obtain the volume parameter of audio A based on the Figure 9a method and obtain the output volume of audio A based on the new volume parameter (i.e., volume parameter A3). The volume parameter A3 may be the same as or different from the volume parameter A1. The mobile phone can play audio A through the audio driver of the mobile phone, and the played volume is the output volume obtained by the mobile phone based on the output volume range on the mobile phone side and the volume parameter. For the TV side, after it cancels the audio transmission with the mobile phone, if the TV plays audio (such as audio B), the output volume of the audio B played on the TV side is obtained based on the updated output volume range on the TV side and the corresponding volume parameter.
[0227] Next, take Figure 12a and Figure 12b as an example to specifically analyze the effect of the volume control solution of this application in a multi-device scenario. Refer to Figure 12a . For a multi-device scenario without introducing the volume control solution in the embodiments of this application, after device A obtains the output audio data of audio A based on formula (1) (where the corresponding output volume is data_out(A)), it transmits the audio data of audio A to device B. Device B obtains the output volume of audio A on the device B side (data_out(B)) based on the received output volume of audio A (data_out(A)) and the output volume parameter on the device B side according to formula (1). Exemplarily, assuming that the output volume on the device B side is small, in the prior art, it is usually to increase the output volume on the device A side, that is, to increase the output volume parameter on the device A side, that is, to increase the volume of the input device B to increase the output volume on the device B side. When device A and device B are disconnected (it can also be to cancel the cooperation between devices, which is not limited in this application), device A continues to play audio A. Since the output volume parameter on the device A side has been increased, when device A plays audio A, it will obtain the output volume of audio A with the increased output volume parameter, which may cause popping when device A plays audio A.
[0228] Please refer to Figure 12b, for the multi-device scenario of the volume control solution in the embodiments of the present application, when device A and device B obtain the output volume, they are both obtained based on their respective output volume ranges, output volume parameters, and the obtained volume parameters. That is to say, even if the volume output from device A to device B is large or small, device B can also obtain appropriate volume parameters to adjust the output volume of audio A on the device B side to within the output volume range of device B through the volume parameters. That is to say, the user does not need to adjust the output volume parameters on the device A or device B side. The device B side can adjust the output volume of audio A on the device B side to within the output volume range through the volume parameters to meet the user's auditory habits. Moreover, the output volume parameters and volume parameters of device A and device B, that is, the factors affecting their respective output volumes, are independent of each other and do not affect each other. Therefore, after device A and device B are disconnected, when device A or device B plays other audio, device A or device B will both re-obtain the corresponding volume parameters for the played audio to adjust the output volume of the new audio to within the output volume range of their respective devices, and there will be no problem of popping sounds, effectively improving the user experience.
[0229] In addition, in the embodiments of the present application, the user can adjust the output volume on the device B side through device A and / or device B. In one example, the user can adjust the output volume parameter on the device A side to adjust the output volume of audio A on the device B side (the principle can be referred to above and will not be elaborated here). After device A and device B are disconnected, when device A plays audio, device A can obtain the corresponding volume parameters based on the output volume range obtained after adjusting the volume, and further obtain the output volume. For device B, its output volume parameter is not affected. After being disconnected from device A, it can still obtain the corresponding volume parameters and the output volume according to the saved output volume parameter and output volume range. In another example, the user can adjust the output volume parameter on the device B side to adjust the output volume of audio A on the device B side. Please refer to Figure 12b , after device A and device B are disconnected, for the device A side, when it plays audio, since its output volume parameter and output volume range are not affected (that is, the parameters in the dotted box are the same), therefore, when device A plays audio, its played output volume is still within the output volume range, effectively avoiding the problem of popping sounds after device switching.
[0230] The volume control solution in the embodiments of the present application can also be applied to the mixing scenario of multi-device playback to achieve volume adaptive adjustment in the mixing scenario. Figure 13a And Figure 13b For the principle schematic diagram shown by way of example, please refer to Figure 13a , the scenario includes devices such as mobile phones, headphones, tablets, and TVs. It should be noted that Figure 13aThe number and types of devices in it are only illustrative examples, and this application is not limited thereto. Exemplarily, taking a mobile phone as the central device, it can obtain the audio data sent by each slave device. For example, the mobile phone can receive the audio data of audio A sent by the tablet and the audio data of audio B sent by the TV through a wireless connection (such as a Wi-Fi connection, or it can also be other connection methods, which are not limited in this application) between the tablet and the TV. Among them, the input volume corresponding to the audio data of audio A is data_in(A), and the input volume corresponding to the audio data of audio B is data_in(B). The mobile phone, as the central device, can mix the audio of the mobile phone (such as audio C), the audio of the TV (audio B), and the audio of the tablet (audio C) to obtain mixed audio data, and the output volume corresponding to the mixed audio is data_out(X). The mobile phone can output the audio data of the mixed audio to the headphones to play the mixed audio through the headphones, and the playing volume is data_out(X). In this scenario, the input volumes of the audio sent by each device are the volumes adjusted based on the volume control method described above. Moreover, during the mixing process, the mobile phone also adjusts the output volume of the mixed audio based on the volume control method in this application, so as to control the output volume of the mixed audio within the output volume range on the mobile phone side.
[0231] Please refer to Figure 13b , during the mixing process, the central device in the embodiment of this application can obtain the mixed audio based on the relative positions (including distance and / or angle) between each device and the headphones, so as to achieve a stereo effect on the headphone side. It can be understood that in the embodiment of this application, the user can hear the audio of each device (including the mobile phone, the tablet, and the TV) in the network through the headphones, and the sound effects of each audio are similar to the auditory effects when the user does not use the headphones. That is, the sound played in the headphones can achieve the spatial auditory effects of the distance and direction of the sound.
[0232] Exemplarily, the central device is optionally used to connect to the slave devices and perform data interaction to issue instructions to each slave device and obtain the audio data of the slave devices. The central device is also used to connect to the headphones and perform data interaction to obtain instructions from the headphones and transmit audio data to the headphones. The slave devices are the devices other than the central device in the network. It should be noted that the network can be a Wi-Fi network, a Bluetooth network, or a hybrid network of Wi-Fi and Bluetooth. For example, the connection between the mobile phone and the TV can be a Wi-Fi connection, and the connection between the mobile phone and the tablet can be a Bluetooth connection, which is not limited in this application. Optionally, each device in the network in the embodiment of this application has the same account. The specific determination method of the central device and the slave devices will be described in detail in the following embodiments.
[0233] The following uses specific embodiments to Figure 13a andFigure 13b The mixing scenario in Figure 14 is an exemplary schematic diagram of the scenario. Please refer to Figure 14 , in the embodiments of the present application, a Wi-Fi network formed among a mobile phone, a television, and a tablet is taken as an example for illustration, that is, the wireless connections of the devices in the network are maintained based on the Wi-Fi protocol. For example, after the television and the tablet at the user's home are powered on, they can automatically discover and connect (or can also be manually connected, which will not be elaborated here) to form a home network. Of course, other devices can also be included in the home network, such as other smart home devices like a Bluetooth speaker, etc., which are not limited in the present application. Still referring to Figure 14 , exemplarily, after the user brings the mobile phone home, the mobile phone executes the Wi-Fi discovery process, and after discovering the devices (including the television and the tablet) in the Wi-Fi network, it automatically connects to each device to join the Wi-Fi network. In the embodiments of the present application, only the structure and establishment process of the network are simply described, and the specific connection process can refer to the embodiments of the existing technology, which are not limited in the present application.
[0234] Please continue to refer to Figure 14 , after the user opens the earphone case, the earphone can automatically connect to the electronic device. In the embodiments of the present application, the example that the earphone automatically connects to the device connected last time (such as the tablet) is taken for illustration. In other embodiments, the earphone can also select the device with the shortest distance for connection, which is not limited in the present application.
[0235] Exemplarily, a Bluetooth connection is established between the earphone and the tablet. The specific establishment process can refer to the embodiments of the existing technology, which will not be elaborated in the present application. In the embodiments of the present application, after the earphone is connected to the tablet, that is, after the earphone is connected to the device in the network, each device in the network can initiate a voting selection process to select a central device and a slave device. Figure 15 is an exemplary schematic diagram of the voting election. Please refer to Figure 15 , each device (including the mobile phone, the tablet, and the television) in the network sends (such as sending a broadcast message) ballot information to other devices in the network. The ballot information includes device information, the capability information of the device, and location information. Among them, the device information includes but is not limited to: device model, device name, device address, etc. The capability information of the device includes but is not limited to: the communication types supported by the device, whether it supports the mixing function, etc. The location information is optionally the distance information between the device and the earphone. Optionally, the distance information can be measured by means of Bluetooth ranging, Ultra WideBand (UWB), etc., which is not limited in the present application. Optionally, in the embodiments of the present application, the device in the election stage can also be called a candidate device or an alternative device, which is not limited in the present application.
[0236] Exemplarily, each device in the network can receive the ballot information sent by other devices. Taking a mobile phone as an example, the mobile phone sends ballot information to a TV and a tablet, and the ballot information includes the relevant information of the mobile phone. The mobile phone also receives the ballot information sent by the TV and the ballot information sent by the tablet. The ballot information sent by the TV includes the relevant information of the TV, and the ballot information sent by the tablet includes the relevant information of the tablet.
[0237] Exemplarily, each device in the network can preset a voting rule, and the voting rule can be set according to actual needs. For example, it can be based on the location information in each ballot to select the device closest to the earphone. The present application does not make any limitations. In this example, taking each device selecting the mobile phone as the central device according to the preset voting rule as an example for illustration. Still taking the mobile phone as an example, based on its own device information, location information, etc., and the ballot information of the TV and the tablet received, according to the preset voting rule, the mobile phone selects itself as the central device. For other devices, such as the tablet, its preset rule is the same as that of the mobile phone, and the obtained ballot information is also the same. Therefore, the central devices selected by each device in the network are the same. For example, they all select the mobile phone as the central device. Exemplarily, other candidate devices of non-central devices in the network are used as slave devices.
[0238] In the embodiment of the present application, after the central device is selected, the earphone can switch to the central device, that is, disconnect the connection with the tablet and establish a Bluetooth connection with the mobile phone (i.e., the central device).
[0239] It should be noted that in the embodiment of the present application, taking the tablet as a non-central device as an example for illustration. In other embodiments, the device currently connected to the earphone may or may not be the central device. The present application does not make any limitations.
[0240] Furthermore, it should be noted that after the central device is selected, a handshake process is periodically executed between the central device and each device, that is, the central device and each slave device perform detection information interaction at the trigger moment of each period (for example, it can be 5s, which can be set according to actual needs. The present application does not make any limitations) to detect whether the status of the central device is normal. If the status of the central device is abnormal, for example, the central device is offline, then the slave device does not receive the detection information of the central device (or the detection response information replied by the central device) at the period trigger moment. The slave device can determine that the status of the central device is abnormal, and each device in the network re-executes the voting process. The central device after re-voting is different from the previous central device.
[0241] Furthermore, it should be noted that after the central device is switched, the earphone will be connected to the new central device, and the new central device will continue to execute each step described in the following embodiments, such as the mixing step, etc.
[0242] Exemplarily, after the voting process ends, i.e., the central device is selected, each device can obtain the relative position information with respect to the earphone. Optionally, the relative position information includes the distance information and / or the angle information with respect to the earphone. For illustration, please refer to Figure 16 , the mobile phone obtains the relative position with respect to the earphone through measurement as: distance A, angle A. The TV obtains the relative position with respect to the earphone through measurement as: distance B, angle B. The tablet obtains the relative position with respect to the earphone through measurement as: distance C, angle C. Optionally, each device can obtain the angle information based on the Angle of Arrival (AOA) algorithm or the Angle of Departure (AOD) algorithm, measurement methods such as UWB, etc., which is not limited in this application. The specific measurement method can refer to the existing technical embodiments, and will not be elaborated in this application.
[0243] Exemplarily, each slave device (such as the TV and the tablet) in the network sends the obtained relative position information to the central device. Optionally, each device can obtain the relative position information periodically, and each slave device sends the relative position information obtained in each period to the central device.
[0244] Figure 17 For the schematic diagram of the user interface shown exemplarily, please refer to Figure 17 in (1), the sound and vibration setting interface 1701 includes a mixing setting option box 1702, and the user can click on this option to activate the mixing function of the mobile phone. It should be noted that the tablet or the TV can also have the mixing function. After the central device is elected, the mixing function in the TV or the tablet can prompt that the central device is the mobile phone to prompt the user to operate on the mobile phone. Of course, in other embodiments, the central device can also synchronize relevant information to the slave devices so that the operations that the user performs on the mobile phone can also be implemented on the slave devices, and send an instruction generated in response to the received user operation to the central device, so that the central device issues relevant control instructions within the network.
[0245] Still referring to Figure 17 in (1), the mobile phone activates the mixing function in response to the received user operation. The mobile phone can calculate the relative orientation between all devices in the network and the earphone based on the relative position information between the mobile phone and the earphone obtained most recently, and the relative position information between the earphone and other each slave device obtained most recently. Optionally, the mobile phone can use the orientation of the focused device that the user is operating as the user's due front, or can use the due facing orientation of the earphone as the user's due front, which is not limited in this application.
[0246] Please refer to Figure 17(2), exemplarily, the mobile phone displays the relative orientation between all the acquired devices and the headset in the mixing setting option box 1702. It should be noted that Figure 17 In (2) above, it is only a schematic example. In other embodiments, the distance and orientation between each device and the headset can be marked in the figure, and information such as the icons of each device can also be displayed. The present application does not make any limitations.
[0247] Optionally, the user can Figure 17 through the interface provided in (2) above to manually adjust the relative positions between each device and the headset. For example, due to measurement errors or other problems, the relative positions displayed in the interface may not be accurate. The user can drag the corresponding device icon to adjust the relative position with the headset. Taking the tablet as an example, the user can drag the icon of the tablet to increase the angle between the tablet and the headset. In response to the received user operation, the mobile phone calculates the angle between the dragged tablet icon and the headset icon and saves the new relative position information of the tablet, that is, the distance information sent by the tablet before and the updated angle information. The mobile phone can send the new relative position information of the tablet to the tablet.
[0248] In a possible implementation manner, the user can Figure 17 remove a device through the interface in (2) above. For example, during the mixing playback process (it can also be at any time before the mixing playback), if the user drags the icon of the tablet and slides the icon of the tablet out of the screen. In other embodiments, it can also be other operations. For example, it can be a long press. In response to the received long press operation by the mobile phone, an option box is displayed. The option box may include a delete option, and the user can click the delete option to delete the tablet. Exemplarily, in response to the received operation, the mobile phone determines to remove the tablet from the mixing scenario, and the mobile phone cancels the display of the tablet icon in the mixing setting option box 1702. Moreover, during the subsequent mixing process, the mobile phone will not receive the audio sent by the tablet. Optionally, it can also be that the mobile phone sends an indication message to the tablet to instruct the tablet to stop sending relative position, audio, etc. information, and the tablet stops sending audio and other information to the mobile phone. That is to say, the mixed audio does not include the audio corresponding to the tablet. It should be noted that this removal solution only excludes the audio of the tablet from the mixing, and the tablet is still in the network. Optionally, if the user needs to add the audio of the tablet back to the mixed audio, the user can trigger each device to re-execute the relative position acquisition process described above by restarting the mixing function.
[0249] In a possible implementation, after the mobile phone (which can also be other devices such as a tablet) receives the operation of the user clicking the mixing setting option, it can send trigger information to each device in the network to trigger each device in the network to execute the voting process described above. After the voting process ends, the earphone is connected to the central device. Then, each device in the network executes the relative position acquisition process described above.
[0250] In another possible implementation, after the central device is selected, no other processing is required. After the mobile phone (which can also be other devices such as a tablet) receives the operation of the user clicking the mixing setting option, it can send trigger information to each slave device to trigger each slave device to obtain the relative position with the earphone. Each slave device feeds back the obtained relative position information to the mobile phone. The mobile phone calculates the relative positions of each device in the network based on the relative position information between itself and the earphone and the received relative position information, and displays them in the mixing setting option box. This can effectively save the computing burden of each device and reduce data interaction. However, this method has lower real-time performance than the method described above, and it may take several seconds to display the relative positions of each device in the display box.
[0251] In yet another possible implementation, after the central device is selected, the earphone can continue to be connected to the tablet. After the mobile phone receives the operation of the user clicking the mixing option, the mobile phone establishes a connection with the earphone. Optionally, the connection between the earphone and the tablet can be maintained or disconnected, which is not limited in this application.
[0252] Exemplarily, after the central device determines the orientations of each device, it can execute the mixing process during the audio playback of the devices in the network, so as to achieve Figure 13b the shown effect.
[0253] Exemplarily, take the example that the user plays a game on the mobile phone (i.e., the game audio is played on the mobile phone), a video is played on the tablet, and music is played on the TV. Before the user wears the earphone, the user's ears can hear the game audio of the mobile phone, the video audio of the tablet, and the music audio of the TV. When the user wears the earphone, the earphone can send a wearing indication message to the mobile phone. The mobile phone (i.e., the central device) responds to the received wearing indication message, determines that the user wears the earphone, and the mobile phone sends a mixing trigger indication message to the slave devices (the tablet and the TV) to instruct each device to stop playing the audio and output the audio data to the mobile phone for mixing through the mobile phone and then output to the earphone for playback, that is, as Figure 13a shown in.
[0254] Specifically, in the embodiments of the present application, the mobile phone and each slave device can perform soft clock synchronization. Optionally, the soft clock synchronization is to synchronize the system time between the mobile phone and each slave device to avoid the problem of audio asynchronization caused by network latency. After the mobile phone performs soft clock synchronization with the tablet and the TV, the system time among the devices is consistent. It should be noted that in the embodiments of the present application, only the example of soft clock synchronization of the system time is used for illustration, and the present application is not limited thereto. Further, it should be noted that this soft clock synchronization step can be executed at any time after the central device election and before the mobile phone performs mixing, and the present application is not limited thereto.
[0255] The following takes the interaction process between the tablet and the mobile phone as an example for illustration. The processing process and interaction process on the TV side and the mobile phone are the same and will not be elaborated here. Please refer to Figure 18 , Exemplarily, before the tablet receives the mixing trigger indication information, the tablet plays audio A through its own audio device (such as a speaker). During the process of playing audio A, its internal processing process follows the volume control method described above, that is, the media manager in the tablet adjusts the output volume through the volume parameter. For specific details, refer to the above, which will not be elaborated here. After the tablet receives the mixing trigger indication information, it determines the audio change, that is, the output device is switched, which means the output device changes from the audio device of the tablet to the mobile phone.
[0256] Continue to refer to Figure 18 , Exemplarily, the video application in the tablet outputs the input audio data of audio A to the media manager, and the corresponding input volume is data_in(A). As described above, after the media manager determines the audio change, it will re-execute the volume parameter acquisition process. Exemplarily, the media manager can determine the volume parameter of audio A based on the input volume of audio A and the currently saved output volume range of the tablet. Then, the media manager obtains the output volume (data_out(A)) of audio A based on the input volume, volume parameter, and output volume parameter of audio A. For specific details, refer to the above embodiments, which will not be elaborated here.
[0257] Next, in the mixing scenario, the media manager of the tablet adds soft clock information to the output audio data of audio A. Among them, the soft clock information is the time information after the soft clock synchronization described above. The specific addition method of the soft clock information can refer to the embodiments of the existing technology, and the present application will not be elaborated here.
[0258] Exemplarily, the media manager of the tablet outputs the output audio data of Audio A with the soft clock information added to the Wi-Fi driver. Among them, the output volume corresponding to the output audio data of Audio A is (data_out(A)). The Wi-Fi driver of the tablet transmits the output audio data of Audio A (with the clock information added, which will not be repeated hereinafter) to the mobile phone.
[0259] Still referring to Figure 18 , exemplarily, the Wi-Fi driver of the mobile phone receives the output audio data of Audio A. The Wi-Fi driver of the mobile phone outputs the output audio data of Audio A to the media manager. It should be noted that, similar to the above, for the media manager, the audio data of Audio A received by the media manager is the input audio data of Audio A. For the convenience of description, hereinafter, the output audio data of Audio A will still be used for description and will not be replaced with the input audio data of Audio A.
[0260] Exemplarily, on the mobile phone side, before sending the mixing trigger indication information, the mobile phone side plays game audio through the speaker. After the mobile phone side detects that the user wears headphones, it can determine that the output device is switched to the headphones, that is, the audio changes. The mobile phone side also re-executes the above-mentioned output volume acquisition process for the audio that the mobile phone side needs to play. Specifically, please refer to Figure 18 , the game application outputs the input audio data of Audio C to the media manager of the mobile phone, where the input volume corresponding to the input audio data of Audio C is data_in(C).
[0261] Exemplarily, the media manager of the mobile phone can obtain the output volume of Audio C. Specifically, the media manager of the mobile phone can determine the volume parameter of Audio C based on the input volume of Audio C (data_in(C)) and the output volume range currently saved by the mobile phone. Then, the media manager obtains the output volume of Audio C (data_out(C)) based on the input volume of Audio C, the volume parameter, and the output volume parameter. For specific details, please refer to the above embodiments and will not be elaborated here.
[0262] Then, the mobile phone can execute a mixing process based on the output audio data of Audio C of the mobile phone, the output audio data of Audio A sent by the tablet received, and the output audio data of Audio B sent by the TV to obtain the audio data of the mixed audio.
[0263] Figure 19 For the schematic diagram of the mixing process shown exemplarily, please refer to Figure 19 , which specifically includes:
[0264] S1901, audio soft clock alignment.
[0265] Exemplarily, the mobile phone can align Audio A, Audio B, and Audio C based on its own soft clock, the soft clock received in Audio A, and the soft clock in Audio B, so that the audio start points of Audio A, Audio B, and Audio C are synchronized. The specific alignment method can refer to the embodiments of the prior art and will not be elaborated in this application.
[0266] S1902. Calculate the stereo audio data respectively according to the device orientation.
[0267] In the embodiments of this application, the media manager of the mobile phone can calculate the time difference, sound level difference, phase difference, and timbre difference, etc. between each audio based on the relative position information of each device (including the mobile phone, TV, and tablet), so as to achieve the stereo effect after mixing the audio of different devices.
[0268] Exemplarily, the time difference can optionally be the time difference between the sound reaching the user's two ears (which can also be played by two earphones). Among them, when the time difference reaches about 0.6 ms, the user can feel that the sound completely comes from one side. That is to say, by adjusting the time difference between the audio output by the two earphones, the user can perceive that the sound source of the audio shifts to a certain direction.
[0269] Exemplarily, the sound level difference can optionally be that the sound level on the side close to the sound source is larger, while the other side is smaller. Among them, when the sound source is on one side of the user, the sound level difference between the audio heard by the user's two ears (or played by two earphones) can reach about 25 dB. In the embodiments of this application, the sound level difference of the audio in the two earphones can be adjusted. For example, the sound level of the audio in one channel of the earphone can be increased, and the sound level of the other audio remains unchanged or decreased, so that the user can perceive that the sound source of the audio shifts to a certain direction.
[0270] Exemplarily, the phase difference can optionally be the phase difference between the audio received by the two earphones. It should be noted that even if the sound levels and times of the sounds received by the two earphones are the same, if the phase of the audio received by the two earphones is adjusted, the user can also perceive that the sound source of the audio shifts to a certain direction.
[0271] Exemplarily, the timbre difference can optionally be the difference in timbre (i.e., frequency) between the audio received by the two earphones. Among them, the higher the frequency of the audio, the greater the attenuation when it bypasses the head and reaches the other ear. Correspondingly, in the embodiments of this application, the timbre of the audio received by the two earphones can be adjusted so that the user can perceive that the sound source of the audio shifts to a certain direction.
[0272] The following takes the direction information in the relative position as an example, and details the mixing process in the embodiments of this application by adjusting the time difference of the audio output to the left and right channels of the earphone. Please refer to Figure 20, Exemplarily, the output audio data of Audio A, the output audio data of Audio B, and the output audio data of Audio C obtained by the media manager of the mobile phone are as Figure 20 shown, where each digit is 4 bits, that is, 4 bits (bit). Each sampling period is 16 bits, that is Figure 20 it occupies two grid lengths in Figure 20 , that is, 16 bits. It should be noted that
[0273] The media manager of the mobile phone can obtain the time difference between each audio in the left and right channels of the headset based on the orientation between the mobile phone and the headset (that is, the angle information in the relative position information), and by adjusting the time difference between the audio in the left and right channels, virtualize the relative position of the sound source in the user's hearing. The virtual sound source shifts in a certain direction to approach the relative position between the actual sound source (such as a tablet) and the mobile phone.
[0274] Illustrate with an example. Taking Figure 16 the orientation between each device and the headset in Figure 21a as an example, the tablet is in the upper right front of the headset, and the included angle between it and the headset is Angle C. Please refer to Figure 21b in (1). For Audio A of the tablet, the audio output to the left channel can be delayed by the duration of 3 sampling periods. That is to say, the starting point of the audio in the right channel is different from the starting point of the audio in the left channel by the duration of 3 sampling periods. It can be understood that the right channel of the headset plays Audio A first, and after 3 sampling periods, the left channel plays Audio A, thus realizing the time difference between the left and right channels of the headset for Audio A. As Figure 21b shown, due to the time difference in the audio received by the left and right channels, the adjustment of the sound source can be realized, so that the user perceives the sound source of Audio A in hearing, that is, the virtual sound source is in the upper right front of the user, approaching the actual orientation between the tablet and the headset. The principle of time difference adjustment for the audio of the TV and the mobile phone can also be referred to
[0275] Refer to Figure 21a in (2). Exemplarily, still taking Figure 16 the orientation in
[0276] as an example, the TV is directly in front of the headset, that is, the included angle between it and the headset (that is, Angle B) is 90 degrees. Correspondingly, the audio output to the left channel of the headset for Audio B is the same as the audio output to the right channel of the headset, so that the virtual sound source is directly in front of the user's hearing perception. Figure 21a Refer to Figure 16Taking the orientation in [description] as an example, the mobile phone is in the front left of the earphone, and the included angle between the mobile phone and the earphone is angle A. The media manager of the mobile phone can delay the audio output to the right channel by 3 sampling periods. That is to say, the starting point of the audio in the left channel is 3 sampling periods different from the starting point of the audio in the right channel. It can be understood that the left channel of the earphone plays audio C first, and after 3 sampling periods, the left channel plays audio C, so as to realize the time difference of audio C between the left channel and the right channel of the earphone. Since there is a time difference in the audio received by the left and right channels, the adjustment of the sound source can be realized, so that the user can perceive the sound source of audio C aurally, that is, the virtual sound source is in the front left of the user.
[0277] It should be noted that in this example, only the adjustment of the time difference is based on the orientation information. That is to say, taking the media manager adjusting the time delay of the audio in the left and right channels to realize the offset of the virtual sound source direction as an example. In a possible implementation manner, as described above, the relative position information corresponding to each device in the network can include distance information and / or angle information. In the scenario where the relative position information includes distance information and angle information, the media manager of the central device (i.e., the mobile phone) can further adjust each audio based on the distance information. Exemplarily, still taking the Figure 16 scenario shown in [description] as an example, the media manager of the mobile phone can obtain the distance attenuation value of audio C of the mobile phone based on the distance information between the mobile phone and the earphone (i.e., distance A). The media manager can obtain the distance attenuation value of audio C of the TV based on the distance information received between the TV and the earphone (i.e., distance B). And, the media manager obtains the distance attenuation value of audio A of the tablet based on the distance information received between the tablet and the earphone (i.e., distance C). Exemplarily, the media manager can obtain the distance attenuation value based on formula (11):
[0278] Lp = 20lg(D / D_min) (11)
[0279] Where D is the distance value between the device and the earphone, and D_min is the minimum distance value among the distance values between each device and the earphone. That is to say, in the embodiments of the present application, the media manager calculates the volume attenuation value of other devices based on the distance to the device with the smallest distance. This calculation method is only for illustrative purposes and is not limited in the present application.
[0280] Exemplarily, the media manager can Figure 21a before performing the steps shown in [description], or Figure 21a after performing the steps shown in [description], add the attenuation value corresponding to the distance information to the audio data of each audio. For example, before performing the Figure 21a steps shown in [description], the media manager can Figure 20The audio data of audio A shown in Figure 21a is added with the distance attenuation value corresponding to audio A, the media manager adds the audio data of audio B with the distance attenuation value corresponding to audio B, and the media manager adds the audio data of audio C with the distance attenuation value corresponding to audio C. Among them, since the distance information corresponding to the TV is the smallest in the device distance information, correspondingly, as described above, the distance attenuation value corresponding to audio B is optionally 0. The media manager can continue to execute
[0281] In another example, the media manager can execute Figure 21a After that, that is, after obtaining the audio data of the left and right channels corresponding to each audio, the media manager can add attenuation values to the audio data of the left and right channels of each audio respectively. Taking audio A as an example, the media manager can add the distance attenuation value corresponding to audio A to the audio data of the left channel to obtain the output audio data of the left channel, and the media manager adds the distance attenuation value corresponding to audio A to the audio data of the right channel to obtain the output audio data of the right channel. The media manager processes the audio data of the left and right channels of each audio in sequence, and continues to execute Figure 22 in the process of
[0282] S1903, linearly mix the dual-channel audio data of multiple devices respectively.
[0283] Exemplarily, please refer to Figure 22 , the media manager of the mobile phone superimposes the output audio data of audio A corresponding to the right channel, the audio data of audio B, and the output audio data of audio C to obtain the mixed audio of the right channel. And the media manager superimposes the output audio data of audio A corresponding to the left channel, the output audio data of audio B, and the output audio data of audio C to obtain the mixed audio of the left channel. Optionally, in order to prevent the overflow of the superimposed audio data, the media manager can take the average value of the audio data superimposed on the left and right channels to obtain the output audio data of the mixed audio of each of the left and right channels, and the corresponding output volume is data_out(X1).
[0284] It should be noted that in the embodiments of the present application, only the time difference between the left and right channels is adjusted to achieve the virtual sound source azimuth transformation. In other embodiments, the media manager can also achieve stereo effects by adjusting timbre difference, phase difference, and / or sound level difference, etc., and the present application will not give examples one by one.
[0285] It should be further noted that the method of using delayed sampling points to achieve time difference in the embodiments of the present application is only a schematic example. In other embodiments, the media manager may also obtain stereo sound effects based on the HRTF (Head-Related Transfer Function) algorithm, and the present application does not make any limitations.
[0286] Please continue to refer to Figure 18 , for example, after the media manager of the mobile phone obtains the output audio data of the mixed audio of the left and right channels, the media manager can adjust the volume parameter of the output volume (data_out(X1)) of the mixed audio to adjust the output volume (data_out(X1)) of the mixed audio within the output volume range of the mobile phone.
[0287] Optionally, as Figure 23 shown, the media manager can Figure 22 obtain the volume parameter of the audio of the left channel based on the output volume of the audio of the left channel obtained and the output volume range. The specific obtaining method can refer to the volume parameter obtaining method above, and will not be elaborated here. The media manager multiplies the audio data of the left channel by the output volume parameter and the volume parameter (as shown in formula (2) above), to obtain the output audio data of the left channel, and the corresponding output volume is data_out(X2). To achieve the optimization of the output volume and adjust the output volume of the audio output from the left channel within the output volume range. For example, since the relationship between the audio data of the left and right channels is delayed, but their actual output volumes are the same, therefore, the volume parameter corresponding to the audio of the right channel is the same as that of the left channel. The media manager can multiply the output volume of the right channel by the output volume parameter and the volume parameter to obtain the output audio data of the right channel, and the corresponding output volume is data_out(X2), to achieve the optimization of the output volume and adjust the output volume of the audio output from the right channel within the output volume range. It should be noted that in other embodiments, it is also possible to only multiply the audio data of the left and right channels by the volume parameter to adjust the output volume, and the present application does not make any limitations.
[0288] Please continue to refer to Figure 18 , for example, the media manager outputs the obtained output audio data of the mixed audio (including the output audio data of the left and right channels) to the Bluetooth driver. Among them, the output volume of the mixed audio is data_out(X2). The Bluetooth driver can output the output audio data of the mixed audio to the headset through a Bluetooth connection. Specifically, the left channel of the headset plays the output audio data of the mixed audio corresponding to the left channel above ( Figure 23The audio data of the left channel shown in , and the corresponding playback volume is data_out(X2). The right channel of the headset plays the output audio data of the mixed audio corresponding to the right channel in the above text ( Figure 23 The audio data of the right channel shown in , and the corresponding playback volume is data_out(X2).
[0289] It should be noted that in the above embodiments, when the mobile phone performs audio mixing processing based on the obtained relative position information, the mobile phone always calculates based on the obtained relative position. That is to say, in this scenario, the position of the sound source reflected by the stereo played by the headset can be optionally as Figure 16 shown in , that is, the position of the sound source remains unchanged. In a possible implementation manner, during the process of each device in the network interacting with audio data, the relative position with the headset can be periodically obtained, and the slave device can periodically (which can be set according to actual needs, and this application does not make any limitations) send the relative position information to the central device. After obtaining the relative position information, the mobile phone can mix the audio of each device based on the newly obtained relative position information, and the specific mixing method is the same as above, which will not be elaborated here. In this way, in the embodiments of this application, the central device can adjust the mixing effect of the mixed audio based on the real-time obtained relative position information to adjust the relative position between each virtual sound source and the headset. For example, when the user wears the headset and walks in the room, the mobile phone can adjust the attenuation value and time difference (it can also be the timbre difference, etc., and this application does not make any limitations) corresponding to the left and right channels of the headset for each audio based on the conversion of the relative position between each device and the headset, so as to realize the virtual sound source position transformation and obtain a more realistic stereo effect, improving the user experience.
[0290] In the embodiments of this application, a control method is also provided to support the audio change scenario in the mixing scenario of multi-device playback. In the mixing scenario of multi-device playback, audio changes include but are not limited to: switching modes, switching devices, and switching sound sources. Exemplarily, the switching mode can optionally be the switching between the multi-device mixing mode and the single-device mode. The switching of devices can optionally be the switching of the sound source device in the single-device mode. The switching of the sound source can optionally be to switch the sound source played by at least one device in the multi-device mixing mode or the sound source device in the single-device mode.
[0291] The following uses specific embodiments to illustrate the above switching scenarios one by one. Figure 24 For the schematic flowchart of the control method in the switching mode scenario shown exemplarily, please refer to Figure 24 , which specifically includes:
[0292] S2401, the headset sends switching mode indication information to the mobile phone.
[0293] Exemplarily, the earphones in the embodiments of the present application can provide control solutions corresponding to the various switching functions described above. For example, the user can pinch the earphones to indicate the switching mode. Optionally, the user operation described in the embodiments of the present application can also be the user's voice input. For example, the user speaks a specified voice command towards the sound pickup device (such as a microphone) of the earphones, and the earphones can detect the user command and output the command to the mobile phone, which can recognize the voice command. It should be noted that the various user operations in the embodiments of the present application are only illustrative examples, and the present application does not make any limitations, and will not be repeated hereinafter.
[0294] Exemplarily, when the earphones receive a user operation, they can send switching mode indication information to the central device (i.e., the mobile phone). In this embodiment, it is assumed that the current mode of the network is the mixing mode, that is Figure 13a and Figure 13b taking the mode shown in as an example for illustration. Correspondingly, when the mobile phone receives the switching mode indication information, it can determine to switch the current mode, that is, the mixing mode, to the single device mode. Of course, if the current mode in the network is the single device mode, then when the mobile phone receives the switching mode indication information, it can determine to switch the current mode, that is, the single device mode, to the mixing mode. The specific solution will be described in the steps of S2404 - S2407.
[0295] It should be noted that the user operations and gestures described in the present application are only illustrative examples. For example, the user can tap the earphones to indicate the switching mode, and the present application does not make any limitations.
[0296] S2402a, the mobile phone sends a pause play indication information to the TV.
[0297] S2402b, the mobile phone sends a pause play indication information to the tablet.
[0298] Exemplarily, after the mobile phone determines to switch the current mode, that is, the mixing mode, to the single device mode in response to the received switching mode indication information, the mobile phone can respectively send pause play indication information to the TV and the tablet to instruct the TV and the tablet to pause playing the audio. In response to the received pause play indication information, the TV and the tablet stop transmitting audio data to the central device (i.e., the mobile phone), and moreover, the TV and the tablet do not play the audio on their own devices.
[0299] S2403, the mobile phone outputs audio C to the earphones.
[0300] Exemplarily, the mobile phone outputs the output audio data of audio C to the earphone. In one example, the mobile phone can still adjust the audio of audio C on the mobile phone, such as the time difference adjustment of the audio of the left and right channels described above, to simulate the real sound source orientation. Specifically, the media manager of the mobile phone can adjust the output volume of audio C based on the volume parameter corresponding to audio C (the acquisition of the volume parameter can refer to the above, and will not be elaborated here). The media manager then adjusts the time difference (which can also be the timbre difference, etc., not limited in this application) of the audio of audio C in the left and right channels and the output volume attenuation based on the relative position information between the mobile phone and the earphone. In another example, in the single-device mode, the mobile phone can also not perform the adjustment of the sound source orientation, that is, directly output the audio data according to the Figure 9a process, that is, the audio data of the left and right channels played by the earphone and their corresponding output volumes are the same, not limited in this application.
[0301] It should be noted that in the embodiments of this application, after the mixing mode is switched to the single-device mode, it is defaulted that the switched single-device mode is the central device. In other embodiments, the user can also control the switching of the sound source device in the single-device mode through the earphone or the central device (i.e., the mobile phone). The specific implementation will be described in Figure 25 below.
[0302] S2404. The earphone outputs switching mode indication information to the mobile phone.
[0303] Exemplarily, the user can pinch the earphone again (it can also be other operations, not limited in this application) to indicate the switching of the mode. The earphone responds to the received user operation and sends switching mode indication information to the central device (i.e., the mobile phone). The mobile phone receives the switching mode indication information and determines to switch the current mode, that is, the single-device mode, to the mixing mode. It should be noted that in this example, it is assumed that the user controls through the earphone. In other embodiments, the user can also control on the central device, not limited in this application.
[0304] S2405a. The mobile phone sends a continue-playing indication information to the TV.
[0305] S2405b. The mobile phone sends a continue-playing indication information to the tablet.
[0306] Exemplarily, after the mobile phone determines to switch the single-device mode to the mixing mode, it sends continue-playing indication information to the TV and the tablet respectively to indicate the TV and the tablet to continue transmitting the corresponding audio to the mobile phone.
[0307] S2406a. The TV outputs audio B to the mobile phone.
[0308] S2406b. The tablet outputs audio A to the mobile phone.
[0309] Exemplarily, in response to the continue-playing instruction information sent by the mobile phone, the TV performs breakpoint resumption, that is, the TV continues to send the audio after the paused playback to the mobile phone. The same applies to the tablet and will not be elaborated here.
[0310] S2407, the mobile phone outputs the mixed audio to the earphone.
[0311] Exemplarily, based on the audio data of audio A corresponding to the mobile phone itself, the audio data of audio B of the TV received, and the audio data of audio C of the tablet, the mobile phone performs the above-mentioned mixing process. For the specific implementation, reference can be made to the above, and it will not be elaborated here.
[0312] Figure 25 For the schematic diagram of the control method process in the exemplary switching mode scenario, please refer to Figure 25 , specifically including:
[0313] S2501, the earphone sends switching device instruction information to the mobile phone.
[0314] Exemplarily, in the single-device mode, in response to the received user operation (such as tapping three times, etc., which is not limited in this application), the earphone sends switching device instruction information to the mobile phone to indicate switching the sound source device.
[0315] It should be noted that Figure 25 the process in Figure 25 is implemented in the single-device mode. That is to say, networking needs to first switch the mode to the single-device mode to implement the process in
[0316] S2502, the mobile phone sends continue-playing instruction information to the TV.
[0317] Exemplarily, in response to the received switching device instruction information, the mobile phone determines to switch the sound source device to the TV. It should be noted that if the user controls through the earphone, the mobile phone can, in response to the received switching device instruction information, sequentially switch the sound source device. The order can be based on the distance from the earphone or set according to other rules, which is not limited in this application. For example, after receiving the switching device instruction information, the mobile phone can switch the sound source device to the TV in sequence. If the mobile phone receives the switching device instruction information again, it can switch the sound source device to the tablet in sequence. Of course, the user can also control the switching of the sound source device to a specified device in the mobile phone, which is not limited in this application and will not be repeated hereinafter.
[0318] Exemplarily, in this embodiment, the mobile phone stops transmitting the audio of the mobile phone to the earphone in response to the received device switching instruction. Moreover, the tablet is still in the paused playback state. As described above, after the mixing mode is converted to the single-device mode, both the TV and the tablet pause playing audio. Exemplarily, the mobile phone may send a continue-playing instruction to the TV to instruct the TV to play audio.
[0319] S2503, the TV outputs audio B to the mobile phone.
[0320] Exemplarily, in response to the received continue-playing instruction information, the TV continues to send audio B to the mobile phone. It should be noted that the audio B that the TV can output can be the audio after the paused playback moment, that is, resuming playback after power-off. It can also be re-outputting audio B, which is not limited in this application.
[0321] S2504, the mobile phone outputs audio B to the earphone.
[0322] Exemplarily, the mobile phone receives the audio data of audio B sent by the earphone, processes the audio data, and then outputs the output audio data corresponding to audio B to the earphone. In one example, the mobile phone can perform processing based on the Figure 17 cross-device transmission scheme therein, and the specific implementation can refer to the description in Figure 17 herein, which will not be elaborated further. In another example, the mobile phone can process audio B based on the mixing scheme, and the processing method is similar to the description in S2403, which will not be elaborated further.
[0323] S2505, the earphone sends device switching instruction information to the mobile phone.
[0324] Exemplarily, as described above, the user can control the earphone multiple times to sequentially switch the sound source device in the single-device mode. The earphone sends device switching instruction information to the mobile phone in response to the received user operation.
[0325] S2506, the mobile phone sends pause-playing instruction information to the TV.
[0326] S2507, the mobile phone sends continue-playing instruction information to the tablet.
[0327] S2508, the tablet outputs audio A to the mobile phone.
[0328] Exemplarily, in response to the received device switching instruction information, the mobile phone determines that it is necessary to switch the sound source device from TV B to the tablet. Correspondingly, the mobile phone sends pause-playing instruction information to the TV to instruct TV B to pause playing audio. Moreover, the mobile phone sends continue-playing instruction information to the tablet to instruct the tablet to continue playing audio.
[0329] Exemplarily, in response to the received pause play instruction information, the TV pauses playing the audio, that is, it no longer transmits audio data to the mobile phone. In response to the received resume play instruction information, the tablet sends the audio data after pause to the mobile phone.
[0330] S2509, the mobile phone outputs audio A to the earphone.
[0331] The specific description is similar to S2504 and will not be elaborated here.
[0332] It should be noted that although not described in Figures 24 to 26 , in each solution, before each device outputs audio data, it is necessary to process the audio data according to the volume control solution in the embodiments of the present application to adjust the output volume of the audio data. The specific implementation method can refer to the above, and will not be elaborated here.
[0333] Figure 26 For the control method flow schematic diagram in the exemplary switching mode scenario, please refer to Figure 26 , which specifically includes:
[0334] S2601, the earphone sends switching sound source instruction information to the mobile phone.
[0335] Exemplarily, the earphone receives a user operation (the user operation can be set according to actual needs and is not limited in the present application), and this user operation is used to indicate switching the sound source. In response to the received user operation, the earphone sends the sound source switching instruction information to the mobile phone.
[0336] S2602, the mobile phone sends switching sound source instruction information to the TV.
[0337] Exemplarily, in response to the received sound source switching instruction information, the mobile phone sends switching sound source instruction information to the TV.
[0338] S2603a, the TV outputs audio D to the mobile phone.
[0339] Exemplarily, in response to the received switching sound source instruction information, the TV switches the output sound source. For example, it switches audio A to audio D and outputs the audio data corresponding to audio D to the mobile phone. It should be noted that for the TV, after the TV detects the audio change (i.e., sound source switching), the TV side will re - execute the volume parameter acquisition process and adjust the output volume of audio D to obtain the output volume of audio D. The specific details can refer to the above and will not be elaborated here.
[0340] S2603b, the tablet outputs audio A to the mobile phone.
[0341] Exemplarily, in this example, the TV switches the sound source, and the tablet does not receive the instruction to switch the sound source. Correspondingly, the tablet continues to output the audio data corresponding to audio A to the mobile phone.
[0342] S2604, the mobile phone outputs the mixed audio to the earphone.
[0343] Exemplarily, the mobile phone will execute the mixing process described above. It should be noted that for the mobile phone, it also detects the audio source switching, that is, the audio source input by the TV has switched. Correspondingly, when mixing on the mobile phone side, it is also necessary to re-execute the volume parameter acquisition process. After the mobile phone obtains the audio data of the mixed audio, it outputs the audio data to the earphone, and the earphone plays the audio data of the mixed audio.
[0344] In a possible implementation manner, in the single-device mode, audio source switching can also be implemented, and its principle is the same as that in Figure 26 which is similar. It is also the central device that sends the audio source switching indication information to the current audio source device. It can be understood that the control information in the networking in the embodiments of the present application is all sent by the central device to each slave device. For the specific implementation, reference can be made to the above, and details will not be described here.
[0345] In another possible implementation manner, in the mixing mode, in response to the received audio source switching indication information, the mobile phone can send the audio source switching indication information to each device in the networking. Each slave device and the mobile phone in the networking switch the audio source, and its specific implementation is similar to that in Figure 26 which will not be described here in detail.
[0346] It should be noted that Figures 24 to 26 For the un-described parts in , reference can be made to the relevant content in the above embodiments, and details will not be repeated here.
[0347] In a possible implementation manner, the audio change scenarios in the embodiments of the present application include audio source switching, output device switching, audio source device switching (including audio source device switching in the multi-device collaboration scenario and audio source device switching in the mixing scenario), etc. Exemplarily, after the audio changes, there will be a transition time of several seconds for the audio played by the device, resulting in discontinuous audio and affecting the user's audio-visual experience. The embodiments of the present application also provide an audio change transition solution, which can make the audio smoothly transition after the audio change and avoid the breakpoint problem caused by the audio change. Specifically, still taking the mobile phone as the audio output device as an example for description, after the mobile phone (specifically, the media manager) detects the audio change, it can use the Hanning window to achieve the fade-in and fade-out of the audio switch. For example, as Figure 27As shown, the example in which the audio played before the mobile phone switches the audio source is audio A, and the audio played after the switch is audio B is used for explanation. The media manager takes the audio data of the preset duration (e.g. 3s) before the switching time point of audio A (i.e. the fade-out part shown in the figure), and takes the audio data of the preset duration (i.e. 3s) at the beginning of audio B (i.e. the fade-in part shown in the figure). The media manager sets the Hanning window, and the length of the Hanning window is the preset duration, e.g. 3s. Figure 27 As shown, the Hanning window may include a first sub-window (i.e., the first half) and a second sub-window (i.e., the second half). The length of the first sub-window is the same as the length of the second sub-window. The media manager processes the audio data of the preset duration of the audio after switching, i.e., audio B, based on the first sub-window, so that the output volume of the audio data of the fade-in part gradually increases. The media manager processes the audio data of the preset duration of the audio before switching, i.e., audio A, based on the second sub-window, so that the output volume of the audio data of the fade-out part gradually decreases. Specifically, the media manager can obtain the audio data of the fade-in effect and the audio data of the fade-out effect based on the following formula:
[0348] Fade-in audio data = fade-in audio data * first sub-window window function (12)
[0349] Fade out audio data = fade out audio data * second sub-window window function (13)
[0350] According to formula (12) and formula (13), the media manager can multiply the audio data corresponding to the fade-in part of audio B by the first subwindow of the Hanning window (i.e., the first half of the window function) to obtain the audio data of the fade-in part (referred to as fade-in audio data). Also, the media manager multiplies the audio data corresponding to the fade-out part of audio A by the second subwindow of the Hanning window (i.e., the second half of the window function) to obtain the audio data of the fade-out part.
[0351] The media manager can superimpose the obtained fade-in audio data with the fade-out audio data to obtain the audio data played when the audio changes. For example, refer to Figure 27 For example, the example of switching to audio B during the process of playing audio A on a mobile phone is used for explanation. The media manager obtains the fade-out audio data of audio A and the fade-in audio data of audio B in the manner described above. The media manager can superimpose the fade-in audio data with the fade-out audio data to obtain fade-in and fade-out audio data, thereby achieving a smooth transition of the audio while maintaining the original audio length. Correspondingly, the audio data transmitted by the media manager to the audio driver is Figure 27The superimposed audio shown in , during the audio switching process, the part played in the earphone is the fade-in and fade-out part. Correspondingly, the audio heard by the user is that in the fade-in and fade-out part, the audio data of Audio A gradually decreases and the audio data of Audio B gradually increases. And after the fade-in and fade-out part finishes playing, the audio data of Audio B continues to be played.
[0352] It can be understood that in order for the electronic device to implement the above functions, it includes the corresponding hardware and / or software modules for executing each function. Combining the algorithm steps of each example described in the embodiments disclosed in this article, this application can be implemented in the form of hardware or a combination of hardware and computer software.
[0353] In one example, Figure 28 shows a schematic block diagram of a device 2800 according to an embodiment of the present application. The device 2800 may include: a processor 2801 and a transceiver / transceiver pin 2802. Optionally, it further includes a memory 2803.
[0354] The various components of the device 2800 are coupled together through a bus 2804. Among them, the bus 2804 includes not only a data bus but also a power bus, a control bus, and a status signal bus. However, for the sake of clear illustration, all kinds of buses are referred to as the bus 2804 in the figure.
[0355] Optionally, the memory 2803 can be used for the instructions in the foregoing method embodiments. The processor 2801 can be used to execute the instructions in the memory 2803, control the receiving pin to receive signals, and control the sending pin to send signals.
[0356] The device 2800 can be the electronic device or the chip of the electronic device in the above method embodiments.
[0357] Among them, all the relevant contents of the steps involved in the above method embodiments can be cited in the function descriptions of the corresponding functional modules, and will not be repeated here.
[0358] This embodiment also provides a computer storage medium. Computer instructions are stored in the computer storage medium. When the computer instructions run on the electronic device, the electronic device is made to execute the above relevant method steps to implement the method in the above embodiments.
[0359] This embodiment also provides a computer program product. When the computer program product runs on a computer, the computer is made to execute the above relevant steps to implement the method in the above embodiments.
[0360] In addition, an embodiment of the present application further provides a device, which may specifically be a chip, a component or a module. The device may include a processor and a memory connected to each other. The memory is used to store computer-executable instructions. When the device runs, the processor may execute the computer-executable instructions stored in the memory, so that the chip executes the methods in the above method embodiments.
[0361] Among them, the electronic device, computer storage medium, computer program product or chip provided in this embodiment are all used to execute the corresponding methods provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding methods provided above, and will not be elaborated here.
[0362] The embodiments of the present application have been described above in conjunction with the accompanying drawings. However, the present application is not limited to the above specific embodiments. The above specific embodiments are merely illustrative and not restrictive. Under the inspiration of the present application, those of ordinary skill in the art can also make many forms without departing from the purpose of the present application and the scope protected by the claims, and all of them belong to the protection scope of the present application.
Claims
1. A volume control method, characterized in that, Including: The electronic device obtains first audio data; The electronic device detects that the first volume of the first audio data does not meet the first output volume range, and based on the first volume and the first output volume range, obtains a first volume parameter corresponding to the first audio data; wherein, the first volume is the average volume of the audio data within a preset duration of the first audio data, and the first output volume range is obtained in advance; The electronic device corrects the first audio data based on the first volume parameter to obtain second audio data; wherein, the average volume of the second audio data is the second volume, and the second volume is within the first output volume range; The electronic device plays the second audio data; Wherein, when the electronic device plays the second audio data, an adjustment operation is received, and the adjustment operation is used to adjust the volume of the second audio data; During the process from the start to the end of the adjustment operation, the volume of the second audio data is collected; The electronic device obtains a second output volume range based on the collected volume of the second audio data.
2. The method according to claim 1, characterized in that The collecting the volume of the second audio data during the process from the start to the end of the adjustment operation includes: During the process from the start to the end of the adjustment operation, the electronic device collects the volume of the second audio data at a first cycle duration.
3. The method according to claim 2, wherein The electronic device obtaining a second output volume range based on the collected volume of the second audio data includes: Obtaining the average volume of the volume of the second audio data collected during the process from the start to the end of the adjustment operation; In the case where the adjustment operation is used to indicate increasing the volume of the second audio data, if the average volume of the collected volume of the second audio data is greater than the minimum value of the first output volume range, the minimum value of the second output volume range is the average volume of the collected volume of the second audio data, and the maximum value of the second output volume range is the maximum value of the first output volume range; if the average volume of the collected volume of the second audio data is less than the minimum value of the first output volume range, the second output volume range is equal to the first output volume range; Or, In the case where the adjustment operation is used to indicate decreasing the volume of the second audio data, if the average volume of the collected volume of the second audio data is less than the maximum value of the first output volume range, the maximum value of the second output volume range is the average volume of the collected volume of the second audio data, and the minimum value of the second output volume range is the minimum value of the first output volume range; if the average volume of the collected volume of the second audio data is greater than the maximum value of the first output volume range, the second output volume range is equal to the first output volume range.
4. The method according to claim 2, wherein The method further includes: When the electronic device plays the second audio data, the electronic device collects the volume of the second audio data at a second cycle duration; the second cycle duration is greater than the first cycle duration; The electronic device obtains a second output volume range based on the volume of the second audio data collected.
5. The method according to claim 4, wherein if the volume of the second audio data collected is greater than the maximum value of the first output volume range, the minimum value of the second output volume range is the minimum value of the first output volume range, and the maximum value of the second output volume range is the volume of the second audio data collected; or if the volume of the second audio data collected is less than the minimum value of the first output volume range, the maximum value of the second output volume range is the maximum value of the first output volume range, and the minimum value of the second output volume range is the volume of the second audio data collected; or if the volume of the second audio data collected is greater than or equal to the minimum value of the first output volume range and less than or equal to the maximum value of the first output volume range, the second output volume range is equal to the first output volume range.
6. The method according to any one of claims 2 to 5, characterized in that, The method further includes: The electronic device obtains third audio data, wherein the average volume of the audio data within a preset duration of the third audio data is the third volume; The electronic device detects that the third volume does not satisfy the second output volume range, and based on the third volume and the second output volume range, obtains a second volume parameter corresponding to the third audio data; The electronic device corrects the third audio data based on the second volume parameter to obtain fourth audio data; wherein the average volume of the fourth audio data is the fourth volume, and the fourth volume is within the second output volume range; The electronic device plays the fourth audio data.
7. The method according to claim 1, wherein The electronic device detects that the first volume does not satisfy the first output volume range, and based on the first volume and the first output volume range, obtains a first volume parameter corresponding to the first audio data, including: if the first volume is greater than the maximum value of the first output volume range, the electronic device obtains the first volume parameter based on the first volume and the maximum value of the first output volume range; or if the first volume is less than the minimum value of the first output volume range, the electronic device obtains the first volume parameter based on the first volume and the minimum value of the first output volume range.
8. The method according to claim 1, wherein The electronic device corrects the first audio data based on the first volume parameter to obtain second audio data, including: The electronic device obtains the second audio data based on the first audio data, the first volume parameter, and an output volume parameter; The output volume parameter includes at least one of the following: a track volume parameter, a stream volume parameter, and a master volume; The track volume parameter is used to indicate the set volume of the application that plays the second audio data; The stream volume parameter is used to indicate the set volume of the audio stream corresponding to the first audio data; The master volume is used to indicate the set volume of the electronic device.
9. The method according to claim 1, characterized in that The method further includes: The electronic device obtains fifth audio data, where the average volume of the audio data within a preset duration of the fifth audio data is the fifth volume; The electronic device detects that the fifth volume does not meet the first output volume range, and based on the fifth volume and the first output volume range, obtains a third volume parameter corresponding to the fifth audio data; The electronic device corrects the fifth audio data based on the third volume parameter to obtain sixth audio data; where the average volume of the sixth audio data is the sixth volume, and the sixth volume is within the first output volume range; The electronic device sends the sixth audio data to another electronic device; the electronic device and the other electronic device perform data interaction through a wireless connection; The electronic device detects that the connection with the other electronic device is disconnected, and the electronic device obtains the audio data to be played in the fifth audio data, where the average volume of the audio data within a preset duration of the audio data to be played is the seventh volume; The electronic device detects that the seventh volume does not meet the first output volume range, and based on the seventh volume and the first output volume range, obtains a fourth volume parameter corresponding to the audio data to be played; The electronic device corrects the audio data to be played based on the fourth volume parameter to obtain seventh audio data; where the average volume of the seventh audio data is the eighth volume, and the eighth volume is within the first output volume range; The electronic device plays the seventh audio data.
10. The method according to claim 1, wherein The method further includes: The electronic device obtains eighth audio data, where the average volume of the audio data within a preset duration of the eighth audio data is the ninth volume; the eighth audio data is different from the first audio data; the ninth volume is different from the first volume; The electronic device detects that the ninth volume does not meet the first output volume range, and based on the ninth volume and the first output volume range, obtains a fifth volume parameter corresponding to the eighth audio data; the fifth volume parameter is different from the first volume parameter; The electronic device corrects the eighth audio data based on the fifth volume parameter to obtain ninth audio data; where the average volume of the ninth audio data is the tenth volume, and the tenth volume is within the first output volume range; The electronic device plays the tenth audio data.
11. The method according to claim 1, characterized in that, The electronic device obtains the first audio data, including: The electronic device obtains the first audio data from a target application; or, The electronic device receives the first audio data sent by a second electronic device.
12. The method according to claim 1, wherein The electronic device plays the second audio data, including: The electronic device plays the second audio data through a speaker; or, The electronic device plays the second audio data through headphones connected to the electronic device.
13. An electronic device, characterized in that, Includes: One or more processors, a memory; and one or more computer programs, wherein the one or more computer programs are stored in the memory, and when the computer programs are executed by the one or more processors, cause the electronic device to perform the following steps: Obtain first audio data; Detect that a first volume of the first audio data does not satisfy a first output volume range, and based on the first volume and the first output volume range, obtain a first volume parameter corresponding to the first audio data; wherein, the first volume is an average volume of audio data within a preset duration of the first audio data, and the first output volume range is obtained in advance; Correct the first audio data based on the first volume parameter to obtain second audio data; wherein, an average volume of the second audio data is a second volume, and the second volume is within the first output volume range; Play the second audio data; Wherein, when the computer programs are executed by the one or more processors, cause the electronic device to perform the following steps: When playing the second audio data on the electronic device, receive an adjustment operation for adjusting the volume of the second audio data; During the process from the start to the end of the adjustment operation, collect the volume of the second audio data; Based on the collected volume of the second audio data, obtain a second output volume range.
14. The electronic device according to claim 13, wherein When the computer programs are executed by the one or more processors, cause the electronic device to perform the following steps: During the process from the start to the end of the adjustment operation, collect the volume of the second audio data at a first cycle duration.
15. The electronic device according to claim 13, wherein When the computer programs are executed by the one or more processors, cause the electronic device to perform the following steps: Obtain an average volume of the volume of the second audio data collected during the process from the start to the end of the adjustment operation; In a case where the adjustment operation is used to indicate increasing the volume of the second audio data, if the average volume of the collected volume of the second audio data is greater than a minimum value of the first output volume range, the minimum value of the second output volume range is the average volume of the collected volume of the second audio data, and the maximum value of the second output volume range is the maximum value of the first output volume range; if the average volume of the collected volume of the second audio data is less than the minimum value of the first output volume range, the second output volume range is equal to the first output volume range; Or, In a case where the adjustment operation is used to indicate decreasing the volume of the second audio data, if the average volume of the collected volume of the second audio data is less than a maximum value of the first output volume range, the maximum value of the second output volume range is the average volume of the collected volume of the second audio data, and the minimum value of the second output volume range is the minimum value of the first output volume range; If the average volume of the collected volume of the second audio data is greater than the maximum value of the first output volume range, the second output volume range is equal to the first output volume range.
16. The electronic device according to claim 14, characterized in that, When the computer program is executed by the one or more processors, the electronic device is caused to perform the following steps: When playing the second audio data on the electronic device, collect the volume of the second audio data according to a second period duration; the second period duration is greater than the first period duration; Based on the volume of the second audio data collected, obtain a second output volume range.
17. The electronic device according to claim 16, wherein if the volume of the second audio data collected is greater than the maximum value of the first output volume range, the minimum value of the second output volume range is the minimum value of the first output volume range, and the maximum value of the second output volume range is the volume of the second audio data collected; or if the volume of the second audio data collected is less than the minimum value of the first output volume range, the maximum value of the second output volume range is the maximum value of the first output volume range, and the minimum value of the second output volume range is the volume of the second audio data collected; or if the volume of the second audio data collected is greater than or equal to the minimum value of the first output volume range and less than or equal to the maximum value of the first output volume range, the second output volume range is equal to the first output volume range.
18. The electronic device according to any one of claims 14 to 17, characterized in that, When the computer program is executed by the one or more processors, the electronic device is caused to perform the following steps: Obtain third audio data, wherein the average volume of the audio data within a preset duration of the third audio data is a third volume; When it is detected that the third volume does not satisfy the second output volume range, based on the third volume and the second output volume range, obtain a second volume parameter corresponding to the third audio data; Based on the second volume parameter, correct the third audio data to obtain fourth audio data; wherein the average volume of the fourth audio data is a fourth volume, and the fourth volume is within the second output volume range; Play the fourth audio data.
19. The electronic device according to claim 13, wherein When the computer program is executed by the one or more processors, the electronic device is caused to perform the following steps: If the first volume is greater than the maximum value of the first output volume range, based on the first volume and the maximum value of the first output volume range, obtain the first volume parameter; or If the first volume is less than the minimum value of the first output volume range, based on the first volume and the minimum value of the first output volume range, obtain the first volume parameter.
20. The electronic device according to claim 13, characterized in that, When the computer program is executed by the one or more processors, the electronic device is caused to perform the following steps: Based on the first audio data, the first volume parameter, and the output volume parameter, obtain the second audio data; The output volume parameter includes at least one of the following: a track volume parameter, a stream volume parameter, a master volume; The track volume parameter is used to indicate the set volume of the application that plays the second audio data; The stream volume parameter is used to indicate the set volume of the audio stream corresponding to the first audio data; The master volume is used to indicate the set volume of the electronic device.
21. The electronic device according to claim 13, wherein When the computer program is executed by the one or more processors, the electronic device is caused to perform the following steps: Obtain fifth audio data, wherein an average volume of audio data within a preset duration of the fifth audio data is a fifth volume; Detect that the fifth volume does not satisfy the first output volume range, and based on the fifth volume and the first output volume range, obtain a third volume parameter corresponding to the fifth audio data; Correct the fifth audio data based on the third volume parameter to obtain sixth audio data; wherein an average volume of the sixth audio data is a sixth volume, and the sixth volume is within the first output volume range; Send the sixth audio data to another electronic device; data interaction is performed between the electronic device and the another electronic device through a wireless connection; Detect that the connection with the another electronic device is disconnected, and the electronic device obtains audio data to be played in the fifth audio data, wherein an average volume of audio data within a preset duration of the audio data to be played is a seventh volume; Detect that the seventh volume does not satisfy the first output volume range, and based on the seventh volume and the first output volume range, obtain a fourth volume parameter corresponding to the audio data to be played; Correct the audio data to be played based on the fourth volume parameter to obtain seventh audio data; wherein an average volume of the seventh audio data is an eighth volume, and the eighth volume is within the first output volume range; Play the seventh audio data.
22. The electronic device according to claim 13, characterized in that, When the computer program is executed by the one or more processors, the electronic device is caused to perform the following steps: Obtain eighth audio data, wherein an average volume of audio data within a preset duration of the eighth audio data is a ninth volume; the eighth audio data is different from the first audio data; the ninth volume is different from the first volume; Detect that the ninth volume does not satisfy the first output volume range, and based on the ninth volume and the first output volume range, obtain a fifth volume parameter corresponding to the eighth audio data; the fifth volume parameter is different from the first volume parameter; Correct the eighth audio data based on the fifth volume parameter to obtain ninth audio data; wherein an average volume of the ninth audio data is a tenth volume, and the tenth volume is within the first output volume range; Play the tenth audio data.
23. The electronic device according to claim 13, wherein When the computer program is executed by the one or more processors, the electronic device is caused to perform the following steps: Obtain the first audio data from a target application; or, Receive the first audio data sent by a second electronic device.
24. The electronic device according to claim 13, wherein When the computer program is executed by the one or more processors, the electronic device is caused to perform the following steps: Play the second audio data through a speaker; or, Play the second audio data through headphones connected to the electronic device.
25. A computer storage medium, characterized in that, Comprising computer instructions which, when run on an electronic device, cause the electronic device to perform the method according to any one of claims 1-12.
26. A computer program product, characterized in that, When the computer program product runs on a computer, it causes the computer to perform the method according to any one of claims 1-12.
27. A chip, characterized in that, Comprising one or more interface circuits and one or more processors; the interface circuit is configured to receive a signal from the memory of the electronic device and send the signal to the processor, the signal comprising computer instructions stored in the memory; when the processor executes the computer instructions, it causes the electronic device to perform the method according to any one of claims 1-12.
Citation Information
Patent Citations
Volume adjustment method, terminal equipment and computer readable storage medium
CN113676595A