WO2023185589A1 - Procédé de contrôle de volume et dispositif électronique - Google Patents

Procédé de contrôle de volume et dispositif électronique Download PDF

Info

Publication number
WO2023185589A1
WO2023185589A1 PCT/CN2023/083111 CN2023083111W WO2023185589A1 WO 2023185589 A1 WO2023185589 A1 WO 2023185589A1 CN 2023083111 W CN2023083111 W CN 2023083111W WO 2023185589 A1 WO2023185589 A1 WO 2023185589A1
Authority
WO
WIPO (PCT)
Prior art keywords
volume
audio data
audio
electronic device
output
Prior art date
Application number
PCT/CN2023/083111
Other languages
English (en)
Chinese (zh)
Inventor
陈刚
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2023185589A1 publication Critical patent/WO2023185589A1/fr

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/16Sound input; Sound output
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04MTELEPHONIC COMMUNICATION
    • H04M1/00Substation equipment, e.g. for use by subscribers
    • H04M1/72Mobile telephones; Cordless telephones, i.e. devices for establishing wireless links to base stations without route selection
    • H04M1/724User interfaces specially adapted for cordless or mobile telephones
    • H04M1/72403User interfaces specially adapted for cordless or mobile telephones with means for local support of applications that increase the functionality
    • H04M1/72442User interfaces specially adapted for cordless or mobile telephones with means for local support of applications that increase the functionality for playing music files
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04MTELEPHONIC COMMUNICATION
    • H04M1/00Substation equipment, e.g. for use by subscribers
    • H04M1/72Mobile telephones; Cordless telephones, i.e. devices for establishing wireless links to base stations without route selection
    • H04M1/724User interfaces specially adapted for cordless or mobile telephones
    • H04M1/72448User interfaces specially adapted for cordless or mobile telephones with means for adapting the functionality of the device according to specific conditions
    • H04M1/72454User interfaces specially adapted for cordless or mobile telephones with means for adapting the functionality of the device according to specific conditions according to context-related or environment-related conditions

Definitions

  • Embodiments of the present application relate to the field of terminal equipment, and in particular, to a volume control method and electronic equipment.
  • Embodiments of the present application provide a volume control method and electronic device.
  • the electronic device can automatically adjust the volume of the audio data to keep the volume of the audio data within an appropriate volume range, effectively improving the user's listening experience.
  • embodiments of the present application provide a volume control method.
  • the method includes: 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, the electronic device obtains the first volume corresponding to the first audio data based on the first volume and the first output volume range. parameter.
  • the first volume is the average volume of audio data within a preset duration of the first audio data, and the first output volume range is acquired in advance.
  • the electronic device corrects the first audio data based on the first volume parameter to obtain the second audio data.
  • 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.
  • the electronic device can correct the audio data based on the volume parameter so that the volume of the audio data is adjusted to the output volume range, thereby avoiding the problem of too high or too low volume caused by different audio data when played by the electronic device, so as to effectively Improve user listening experience.
  • the audio data may be music or audio corresponding to a video.
  • the volume may be greater than the maximum value of the output volume range, or the volume may be less than the minimum value of the output volume range.
  • the volume of the second audio data is different from that of the first audio data.
  • the preset duration can be set according to actual needs, and is not limited in this application.
  • the electronic device plays the second audio data, and the playing volume is within the output volume range.
  • the method further includes: receiving an adjustment operation when the electronic device plays the second audio data, and the adjustment operation is used to adjust the volume of the second audio data.
  • the electronic equipment follows the One cycle is used to collect the volume of the second audio data.
  • the electronic device obtains the second output volume range based on the collected volume of the second audio data.
  • the electronic device can intensively collect the volume of the audio data when the user adjusts the volume, so as to update the output volume range based on the collected volume. That is to say, during the process of playing audio data, the electronic device can detect the user's behavior and update the volume output range, so that the output volume range always meets the user's listening habits.
  • the electronic device obtains the second output volume range based on the collected volume of the second audio data, including: obtaining the second output volume range collected from the beginning to the end of the adjustment operation.
  • the average volume of the volume of the second audio data when the adjustment operation is used to indicate increasing the volume of the second audio data, if the average volume of the collected 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 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 collected second audio data
  • the average volume of the volume is less than the minimum value of the first output volume range, and 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 turning down the volume of the second audio data, if the collected The average 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 second audio data.
  • 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 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. In this way, the electronic device can dynamically update the output volume range based on different adjustment scenarios, so that the output volume range always meets the user's needs, that is, the user's listening habits.
  • 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 duration of the second cycle; the second cycle The duration is longer than the first cycle duration.
  • the electronic device obtains the second output volume range based on the collected volume of the second audio data. In this way, the electronic device can collect the volume through sparse collection, dynamically update the output volume range based on the volume, and reduce the power consumption caused by volume collection.
  • the minimum value of the second output volume range is the first output volume
  • the minimum value of the range, 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 second output volume
  • the maximum value of the 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 first
  • the minimum value of the output volume range is less than or equal to the maximum value of the first output volume range, and the second output volume range is equal to the first output volume range.
  • the method further includes: the electronic device obtains third audio data, wherein 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 satisfy the second output volume range, and obtains the second volume parameter corresponding to the third audio data based on the third volume and the second output volume range; the electronic device detects the third volume parameter based on the second volume parameter.
  • the audio data is corrected to obtain fourth audio data; 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.
  • the electronic device can obtain the volume parameters corresponding to the audio based on the updated output volume range, and correct the audio based on the volume parameters, so that the audio
  • the consistent volume is always maintained within the volume range that the user is accustomed to to satisfy the user's listening experience.
  • the electronic device detects that the first volume does not satisfy the first output volume range, and obtains the corresponding first audio data based on the first volume and the first output volume range.
  • the first volume parameter includes: 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.
  • the electronic device can obtain the volume parameters of the audio based on different correspondences between the volume and the output volume range. For example, when the input volume is large, the output volume can be reduced through the volume parameter so that the output volume is within the output volume range. If the input volume is small, use the volume parameter to increase the output volume so that the output volume is within the output volume range.
  • the electronic device corrects the first audio data based on the first volume parameter to obtain the second audio data, including: the electronic device corrects the first audio data based on the first audio data, the first The volume parameter and the output volume parameter are used to obtain the second audio data; 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 settings of an application that plays the second audio data. Volume; 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.
  • the electronic device can obtain the output volume corresponding to the input volume of the audio data based on at least one setting volume of the electronic device itself (ie, the output volume parameter), and correct the output volume of the audio based on the volume parameter, so that the audio The output volume remains within the output volume range.
  • 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 satisfy the first output volume range, and obtains the third volume parameter corresponding to the fifth audio data based on the fifth volume and the first output volume range; the electronic device detects the fifth volume parameter based on the third volume parameter.
  • the audio data is corrected 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; electronic The device performs data interaction with another electronic device 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, wherein the preset of the audio data to be played is Suppose the average volume of the audio data within the duration is the seventh volume; the electronic device detects that the seventh volume does not meet the first output volume range, and obtains the third volume corresponding to the audio data to be played based on the seventh volume and the first output volume range.
  • each electronic device can obtain the volume parameter corresponding to the audio data based on the output volume range of the electronic device.
  • the electronic device stops cooperating with other electronic devices the electronic device can still obtain the volume parameters of the audio data based on the output volume range of the electronic device, and correct the audio data through the volume parameters so that the volume of the audio data remains within the electronic range. within the output volume range of the device. This prevents the problem of the audio volume played by a single device being too loud or too small after multiple devices are switched to a single device when the device volume is adjusted in a collaborative scene.
  • the method further includes: the electronic device obtains eighth audio data, wherein 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 the same value as the eighth
  • the fifth volume parameter corresponding to the 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 the ninth audio data; wherein, 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.
  • the electronic device can obtain the corresponding volume parameters according to different sound sources, so that when different audio data is played in the electronic device, the electronic device can automatically adjust the volume of the audio data through the volume parameters, so that Users can keep the playback volume of audio data within the user's accustomed volume range without manual adjustment, thereby effectively improving the user experience.
  • the electronic device obtains the first audio data, including: 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. an audio data.
  • the electronic device can automatically adjust the volume of the audio data of the application in the 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 remains within the output volume range of the electronic device.
  • the electronic device plays the second audio data, including: 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. 2. Audio data.
  • the embodiments of the present application can be applied to local playback scenarios and headphone playback scenarios.
  • inventions of the present application provide an electronic device.
  • the electronic device includes: one or more processors, memory; and one or more computer programs, wherein the one or more computer programs are stored on the memory, and when the computer program is executed by the one or more processors, the electronic device Execute the following steps: obtain the first audio data; detect that the first volume of the first audio data does not meet the first output volume range, and obtain the first volume corresponding to the first audio data based on the first volume and the first output volume range.
  • the first volume is the average volume of the audio data within the preset duration of the first audio data, and the first output volume range is obtained in advance; the first audio data is corrected based on the first volume parameter to obtain the first Two 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; and the second audio data is played.
  • the electronic device 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, an adjustment operation is received, and the adjustment operation is used to adjust the second audio data. Volume; during the process from the beginning to the end of the adjustment operation, the volume of the second audio data is collected according to the duration of the first cycle; based on the collected volume of the second audio data, the second output volume range is obtained.
  • the electronic device when the computer program is executed by one or more processors, the electronic device is caused to perform the following steps: obtain the second value collected from the beginning to the end of the adjustment operation.
  • the average volume of the volume of the audio data when the adjustment operation is used to indicate increasing the volume of the second audio data, if the average volume of the collected second audio data is greater than the minimum value of the first output volume range, the The minimum value of the second output volume range is the average volume of the collected 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 volume of the collected second audio data is The average volume is less than the minimum value of the first output volume range, and 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 turning down the volume of the second audio data, if the collected second Volume of audio data The average volume 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
  • the electronic device when the computer program is executed by one or more processors, the electronic device performs the following steps: when the electronic device plays the second audio data, according to the second The cycle duration is to collect the volume of the second audio data; the second cycle duration is greater than the first cycle duration; based on the collected volume of the second audio data, the second output volume range is obtained.
  • the minimum value of the second output volume range is the first output volume
  • the minimum value of the range, 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 second output volume
  • the maximum value of the 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 first
  • the minimum value of the output volume range is less than or equal to the maximum value of the first output volume range, and the second output volume range is equal to the first output volume range.
  • the electronic device 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, wherein the third audio data The average volume of the audio data within the preset duration is the third volume; it is detected that the third volume does not meet the second output volume range, and based on the third volume and the second output volume range, the second volume corresponding to the third audio data is obtained parameter; correct 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; play the fourth audio data.
  • the electronic device 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 , 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.
  • the electronic device when the computer program is executed by 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 parameters to obtain the second audio data; the output volume parameters include at least one of the following: track volume parameters, stream volume parameters, and master volume; the track volume parameters are used to indicate the set volume of the application that plays the second audio data; the stream volume parameters It 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.
  • the electronic device when the computer program is executed by one or more processors, the electronic device is caused to perform the following steps: obtain fifth audio data, wherein the fifth audio data The average volume of the audio data within the preset duration is the fifth volume; it is detected that the fifth volume does not meet the first output volume range, and based on the fifth volume and the first output volume range, the third volume corresponding to the fifth audio data is obtained parameter; correct 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; to another electronic The device sends a sixth tone audio data; the electronic device performs data interaction with another electronic device 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 audio data to be played The average volume of the audio data within the preset duration is the seventh volume; it is detected that the seventh volume does not meet the first output
  • the electronic device when the computer program is executed by one or more processors, the electronic device is caused to perform the following steps: obtain the eighth audio data, wherein the eighth audio data
  • the average volume of the audio data within the preset duration is the ninth volume; the eighth audio data is different from the first audio data; the ninth volume is different from the first volume; it is detected that the ninth volume does not satisfy the first output volume range, based on the The ninth volume and the first output volume range are used to obtain the fifth volume parameter corresponding to the eighth audio data; the fifth volume parameter is different from the first volume parameter; the eighth audio data is corrected based on the fifth volume parameter to obtain the ninth audio data; wherein the average volume of the ninth audio data is the tenth volume, and the tenth volume is within the first output volume range; the tenth audio data is played.
  • the electronic device when the computer program is executed by one or more processors, the electronic device is caused to perform the following steps: obtain the first audio data from the target application; or, receive the second audio data.
  • the second electronic device sends the first audio data.
  • the electronic device when the computer program is executed by one or more processors, the electronic device is caused to perform the following steps: playing the second audio data through the speaker; or, by communicating with the electronic device The device connects the headphones to play the second audio data.
  • 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.
  • the technical effects corresponding to the second aspect and any implementation manner of the second aspect may be referred to the technical effects corresponding to the above-mentioned first aspect and any implementation manner of the first aspect, which will not be described again here.
  • embodiments of the present application provide an audio processing method.
  • the method includes: the first electronic device obtains first sub-audio data and first orientation information, and the first orientation information is used to indicate the relative position between the first electronic device and the earphone; the first electronic device and the earphone are connected through a wireless connection Perform data interaction; the first electronic device receives the second sub-audio data and the second orientation information sent by the second electronic device, and the second orientation information is used to indicate the relative position between the second electronic device and the earphone; the first electronic device is based on The first orientation information and the second orientation information mix the first sub-audio data and the second sub-audio data to obtain the first audio data; the first electronic device sends the first audio data to the earphone to play the first audio data through the earphone. audio data.
  • the electronic device can mix the audio data of multiple electronic devices through the orientation information to achieve stereo playback of the earphones, so that the user can hear the stereo effect of audio from multiple devices when using the earphones.
  • the wireless connection may be maintained based on the Bluetooth protocol or the Wi-Fi protocol.
  • 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 the first sub-audio data based on the first orientation information.
  • One sub-audio data corresponds to the third sub-audio data of the first channel of the earphone, and the first sub-audio data corresponds to the fourth sub-audio data of the second channel of the earphone; the third sub-audio data and the fourth sub-audio data
  • the phase, timbre, sound level and/or audio starting position between the data are different; based on the second orientation information, the first electronic device obtains the second sub-audio data corresponding to The fifth sub-audio data of the first channel of the earphone, and the first sub-audio data corresponds to the sixth sub-audio data of the second channel of the earphone; the phase between the fifth sub-audio data and the sixth sub-audio data,
  • the timbre, sound level and/or audio starting position are different; the first electronic device obtains the seventh sub-audio data
  • the electronic device sends the seventh sub-audio data and the eighth sub-audio data to the earphone, through the earphone.
  • the first channel plays the seventh sub-audio data
  • the second channel of the earphone plays the eighth sub-audio data.
  • the electronic device can determine the phase difference, timbre difference, sound level difference and time difference of the two-channel audio of the earphone based on the orientation information, thereby achieving a two-channel stereo sound effect of the earphone.
  • the starting position of the audio is the playback time of the audio played in the mono channel of the headset.
  • the first orientation information includes distance information and direction information between the first electronic device and the earphone
  • the second orientation information includes the distance information between the second electronic device and the earphone. distance information and direction information.
  • 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 earphones to achieve a stereo effect.
  • the distance between the first electronic device and the earphone is smaller than the distance between the second electronic device and the earphone.
  • the first electronic device is the master device in the embodiment of the present application
  • the second electronic device is the slave device in the embodiment of the present application.
  • the quality of communication between the master device and the headset is better than the communication quality between the slave device and the headset.
  • the method further includes: the first electronic device obtains third position information, and the third position information is used to indicate the relative position between the first electronic device and the headset; The third position information is different from the first position information; the first electronic device receives the fourth position information sent by the second electronic device, and the fourth position information is used to indicate the relative position between the second electronic device and the earphone; the fourth position information Different from the second position information; the first electronic device mixes the first sub-audio data and the second sub-audio data based on the third position information and the fourth position information to obtain the second audio data; the first electronic device transmits data to the earphones Second audio data is sent to play the second audio data through the headphones.
  • the electronic device can also adjust the mixing effect based on the real-time position between each electronic device and the headphones to achieve a more realistic stereo effect.
  • the method before the first electronic device sends the first audio data to the earphone, the method further includes: the electronic device detects that the first volume does not meet the first output volume range, based on the first A volume and a first output volume range, obtaining a first volume parameter corresponding to the first audio data; the first output volume range is obtained in advance; the first volume is the audio data within the preset duration of the first audio data average volume;
  • the electronic device corrects the first audio data based on the first volume parameter to obtain the corrected first audio data; wherein the average volume of the corrected first audio data is the second volume, and the second volume is within the first output volume range. Inside. In this way, the electronic device can correct the mixed audio to keep the output volume of the mixed audio within the output volume range, thereby realizing automatic adjustment of the volume of the audio data to effectively improve the user experience.
  • the method further includes: the first electronic device receives a first operation, and the first operation is used to instruct the mixing mode of the first electronic device and the second electronic device. Switch to single device mode; in response to the first operation, the first electronic device sends first instruction information to the second electronic device, and the first instruction information is used to instruct the second electronic device to stop sending the second sub-audio data; the first electronic device The first sub-audio data is sent to the earphone to play the first sub-audio data through the earphone. In this way, the electronic device can achieve Switching between mixing mode and single-device playback mode.
  • 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.
  • inventions of the present application provide an electronic device.
  • the electronic device includes: one or more processors, memory; and one or more computer programs, wherein the one or more computer programs are stored on the memory, and when the computer program is executed by the one or more processors, the electronic device Instructions to perform a method of the third aspect or any possible implementation of the third aspect.
  • the present application provides a computer-readable medium for storing a computer program, the computer program comprising instructions for performing the method in the first aspect or any possible implementation of the first 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 of the third aspect.
  • the present application provides a computer program, the computer program comprising instructions for performing a method in the first aspect or any possible implementation of the first aspect.
  • the present application provides a computer program, which includes instructions for executing the method in the third aspect or any possible implementation of the third aspect.
  • this application provides a chip, which includes a processing circuit and transceiver pins.
  • the transceiver pin 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 of the first aspect to control the receiving pin to receive the signal, so as to Control the sending pin to send signals.
  • this application provides a chip, which includes a processing circuit and transceiver pins.
  • the transceiver pin and the processing circuit communicate with each other through an internal connection path, and the processing circuit performs the method in the third aspect or any possible implementation of the third aspect to control the receiving pin to receive the signal, so as to Control the sending pin to send signals.
  • Figure 1 shows a schematic diagram of the hardware structure of the electronic device
  • Figure 2 shows a schematic diagram of the software structure of the electronic device
  • Figure 3 is an exemplary module interaction diagram
  • Figure 4 is a schematic diagram of an exemplary user interface
  • Figure 5 is an exemplary output volume adjustment schematic diagram
  • Figure 6 is a schematic diagram of an exemplary user interface
  • Figure 7 is a schematic diagram of an exemplary volume control method
  • Figure 8 is a schematic diagram illustrating an exemplary output volume range acquisition method
  • Figures 9a to 9b are schematic diagrams of module interaction of an exemplary volume control method
  • Figure 9c is an exemplary output volume adjustment schematic diagram
  • Figure 10 is an exemplary multi-device collaboration scenario
  • Figures 11a to 11b are schematic diagrams of module interaction of an exemplary volume control method
  • Figures 12a to 12b are exemplary output volume adjustment schematic diagrams
  • Figures 13a to 13b are schematic diagrams of the principles of an exemplary mixing scene
  • Figure 14 is a schematic diagram of an exemplary application scenario
  • Figure 15 is an exemplary voting schematic diagram
  • Figure 16 is a schematic diagram of an exemplary application scenario
  • Figure 17 is a schematic diagram of an exemplary user interface
  • Figure 18 is a schematic diagram of module interaction of an exemplary mixing scene
  • Figure 19 is a schematic diagram of an exemplary mixing process
  • Figure 20 is a schematic diagram of audio data processing of an exemplary audio mixing scenario
  • Figure 21a is a schematic diagram of audio data processing of an exemplary audio mixing scenario
  • Figure 21b is a schematic diagram of the effect of an exemplary mixing scene
  • Figure 22 is a schematic diagram of audio data processing of an exemplary audio mixing scenario
  • Figure 23 is a schematic diagram of audio data processing of an exemplary audio mixing scenario
  • Figure 24 is a schematic flowchart of a control method in an exemplary switching mode scenario
  • Figure 25 is a schematic flowchart of a control method in an exemplary switching mode scenario
  • Figure 26 is a schematic flowchart of a control method in an exemplary switching mode scenario
  • Figure 27 is a schematic diagram of an exemplary fade-in and fade-out process
  • Figure 28 is a schematic structural diagram of an exemplary device.
  • a and/or B can mean: A exists alone, A and B exist simultaneously, and they exist alone. B these three situations.
  • first and second in the description and claims of the embodiments of this application are used to distinguish different objects, rather than to describe a specific order of objects.
  • first target object, the second target object, etc. are used to distinguish different target objects, rather than to describe a specific order of the target objects.
  • multiple processing units refer to two or more processing units; multiple systems refer to two or more systems.
  • FIG. 1 shows a schematic structural diagram of an electronic device 100 .
  • the electronic device 100 shown in FIG. 1 is only an example of an electronic device, and the electronic device 100 may have more or fewer components than shown in the figure, and two or more components may be combined. , or can have different component configurations.
  • the various Components may be implemented in hardware including one or more signal processing and/or application specific integrated circuits, software, or a combination of hardware and software.
  • the electronic device is a mobile phone as an example for explanation. In other embodiments, the electronic device may also be a tablet, a speaker, a wearable device, a smart home device, and other devices, which are not limited in this application.
  • 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.
  • Mobile communication module 150 wireless communication module 160, audio module 170, speaker 170A, receiver 170B, microphone 170C, headphone interface 170D, sensor module 180, button 190, motor 191, indicator 192, camera 193, display screen 194, And subscriber identification module (subscriber identification module, SIM) card interface 195, etc.
  • SIM subscriber identification module
  • the sensor module 180 may include a pressure sensor 180A, a gyro sensor 180B, an air 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, and ambient light. Sensor 180L, bone conduction sensor 180M, etc.
  • the processor 110 may include one or more processing units.
  • the processor 110 may include an application processor (application processor, AP), a modem processor, a graphics processing unit (GPU), and an image signal processor. (image signal processor, ISP), controller, memory, video codec, digital signal processor (digital signal processor, DSP), baseband processor, and/or neural-network processing unit (NPU) wait.
  • application processor application processor, AP
  • modem processor graphics processing unit
  • GPU graphics processing unit
  • image signal processor image signal processor
  • ISP image signal processor
  • controller memory
  • video codec digital signal processor
  • DSP digital signal processor
  • baseband processor baseband processor
  • NPU neural-network processing unit
  • different processing units can be independent devices or integrated in one or more processors.
  • the controller may be the nerve center and command center of the electronic device 100 .
  • the controller can generate operation control signals based on the instruction operation code and timing signals to complete the control of fetching and executing instructions.
  • the processor 110 may also be provided with a memory for storing instructions and data.
  • the memory in processor 110 is cache memory. This memory may hold instructions or data that have been recently used or recycled by processor 110 . If the processor 110 needs to use the instructions or data again, it can be called directly from the memory. Repeated access is avoided and the waiting time of the processor 110 is reduced, thus improving the efficiency of the system.
  • the charging management module 140 is used to receive charging input from the charger.
  • the charger can be a wireless charger or a wired charger.
  • the charging management module 140 may receive charging input from the wired charger through the USB interface 130 .
  • 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 input from the battery 142 and/or the charging management module 140, and supplies power to the processor 110, internal memory 121, external memory, display screen 194, camera 193, wireless communication module 160, etc.
  • the wireless communication function of the electronic device 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor.
  • Antenna 1 and Antenna 2 are used to transmit and receive electromagnetic wave signals.
  • Each antenna in electronic device 100 may be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve antenna utilization. For example: Antenna 1 can be reused as a diversity antenna for a wireless LAN. In other embodiments, antennas may be used in conjunction with tuning switches.
  • the mobile communication module 150 can provide wireless communication including 2G/3G/4G/5G applied to the electronic device 100. s solution.
  • the mobile communication module 150 may include at least one filter, switch, power amplifier, low noise amplifier (LNA), etc.
  • the wireless communication module 160 can provide applications on the electronic device 100 including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) network), Bluetooth (bluetooth, BT), and global navigation satellites.
  • WLAN wireless local area networks
  • Wi-Fi wireless fidelity
  • Bluetooth bluetooth, BT
  • global navigation satellites Global navigation satellite system, GNSS
  • frequency modulation frequency modulation, FM
  • NFC near field communication technology
  • infrared technology infrared, IR
  • the antenna 1 of the electronic device 100 is coupled to the mobile communication module 150, and the antenna 2 is coupled to the wireless communication module 160, so that the electronic device 100 can communicate with the network and other devices through wireless communication technology.
  • the wireless communication technology may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), broadband Code division multiple access (wideband code division multiple access, WCDMA), time division code division multiple access (time-division code division multiple access, TD-SCDMA), long term evolution (long term evolution, LTE), BT, GNSS, WLAN, NFC , FM, and/or IR technology, etc.
  • the GNSS may include global positioning system (GPS), global navigation satellite system (GLONASS), Beidou navigation satellite system (BDS), quasi-zenith satellite system (quasi) -zenith satellite system (QZSS) and/or satellite based augmentation systems (SBAS).
  • GPS global positioning system
  • GLONASS global navigation satellite system
  • BDS Beidou navigation satellite system
  • QZSS quasi-zenith satellite system
  • SBAS satellite based augmentation systems
  • the electronic device 100 implements display functions through a GPU, a display screen 194, an application processor, and the like.
  • the GPU is an image processing microprocessor and is connected to the display screen 194 and the application processor. GPUs are used to perform mathematical and geometric calculations for graphics rendering.
  • Processor 110 may include one or more GPUs that execute program instructions to generate or alter display information.
  • the display screen 194 is used to display images, videos, etc.
  • Display 194 includes a display panel.
  • the display panel can use a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active matrix organic light emitting diode or an active matrix organic light emitting diode (active-matrix organic light emitting diode).
  • LCD liquid crystal display
  • OLED organic light-emitting diode
  • AMOLED organic light-emitting diode
  • FLED flexible light-emitting diode
  • Miniled MicroLed, Micro-oLed, quantum dot light emitting diode (QLED), etc.
  • the electronic device 100 may include 1 or N display screens 194, where N is a positive integer greater than 1.
  • Camera 193 is used to capture still images or video.
  • the object passes through the lens to produce an optical image that is projected onto the photosensitive element.
  • 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. Such as saving music, videos, etc. files in external memory card.
  • Internal memory 121 may be used to store computer executable program code, which includes instructions.
  • the processor 110 executes instructions stored in the internal memory 121 to execute various functional applications and data processing of the electronic device 100 .
  • the internal memory 121 may include a program storage area and a data storage area. Among them, the stored program area can store an operating system, at least one application program required for a function (such as a sound playback function, an image playback function, etc.).
  • the storage data area may store data created during use of the electronic device 100 (such as audio data, phone book, etc.).
  • the electronic device 100 can implement audio functions through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone interface 170D, and the application processor. Such as music playback, recording, etc.
  • the audio module 170 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signals. Audio module 170 may also be used to encode and decode audio signals. In some embodiments, the audio module 170 may be provided in the processor 110 , or some functional modules of the audio module 170 may be provided in the processor 110 .
  • Speaker 170A also called “speaker” is used to convert audio electrical signals into sound signals.
  • the electronic device 100 can listen to music through the speaker 170A, or listen to hands-free calls.
  • Receiver 170B also called “earpiece” is used to convert audio electrical signals into sound signals.
  • the electronic device 100 answers a call or a voice message, the voice can be heard by bringing the receiver 170B close to the human ear.
  • Microphone 170C also called “microphone” or “microphone” is used to convert sound signals into electrical signals. When making a call or sending a voice message, the user can speak close to the microphone 170C with the human mouth and input the sound signal to the microphone 170C.
  • the electronic device 100 may be provided with at least one microphone 170C. In other embodiments, the electronic device 100 may be provided with two microphones 170C, which in addition to collecting sound signals, may also implement a noise reduction function. In other embodiments, the electronic device 100 can also be provided with three, four or more microphones 170C to collect sound signals, reduce noise, identify sound sources, and implement directional recording functions, etc.
  • the headphone interface 170D is used to connect wired headphones.
  • the headphone interface 170D may be a USB interface 130, or may be a 3.5mm open mobile terminal platform (OMTP) standard interface, or a Cellular Telecommunications Industry Association of the USA (CTIA) standard interface.
  • OMTP open mobile terminal platform
  • CTIA Cellular Telecommunications Industry Association of the USA
  • the buttons 190 include a power button, a volume button, etc.
  • Key 190 may be a mechanical key. It can also be a touch button.
  • the electronic device 100 may receive key inputs and generate key signal inputs related to user settings and function control of the electronic device 100 .
  • the software system of the electronic device 100 may adopt a layered architecture, an event-driven architecture, a microkernel architecture, a microservice architecture, or a cloud architecture.
  • the embodiment of this application takes the Android system with a layered architecture as an example to illustrate the software structure of the electronic device 100 .
  • FIG. 2 is a software structure block diagram of the electronic device 100 according to the embodiment of the present application.
  • the layered architecture of the electronic device 100 divides the software into several layers, and each layer has clear roles and division of labor.
  • the layers communicate through software interfaces.
  • the Android system is divided into four layers, from top to bottom: application layer, application framework layer, Android runtime and system libraries, and kernel layer.
  • the application layer can include a series of application packages.
  • the application package can include camera, gallery, calendar, calling, map, navigation, WLAN, Bluetooth, music, video, short message and other applications.
  • the application framework layer provides an application programming interface (API) and programming framework for applications in the application layer.
  • API application programming interface
  • the application framework layer includes some predefined functions.
  • the application framework layer can include window manager, content provider, media manager, phone manager, resource manager, notification manager, etc.
  • a window manager is used to manage window programs.
  • the window manager can obtain the display size, determine whether there is a status bar, lock the screen, capture the screen, etc.
  • Content providers are used to store and retrieve data and make this data accessible to applications.
  • Said data can include videos, images, audio, calls made and received, browsing history and bookmarks, phone books, etc.
  • the view system includes visual controls, such as controls that display text, controls that display pictures, etc.
  • a view system can be used to build applications.
  • the display interface can be composed of one or more views.
  • a display interface including a text message notification icon may include a view for displaying text and a view for displaying pictures.
  • the phone manager is used to provide communication functions of the electronic device 100 .
  • call status management including connected, hung up, etc.
  • the resource manager provides various resources to applications, such as localized strings, icons, pictures, layout files, video files, etc.
  • the notification manager allows applications to display notification information in the status bar, which can be used to convey notification-type messages and can automatically disappear after a short stay without user interaction.
  • the notification manager is used to notify download completion, message reminders, etc.
  • the notification manager can also be notifications that appear in the status bar at the top of the system in the form of charts or scroll bar text, such as notifications for applications running in the background, or notifications that appear on the screen in the form of conversation windows. For example, text information is prompted in the status bar, a beep sounds, the electronic device vibrates, the indicator light flashes, etc.
  • the media manager which can also be called a media service, is used to manage audio data and image data, such as controlling the data flow direction of audio data and image data and writing audio streams and image streams to MP4 files.
  • the media manager can be used to adjust the output volume of audio data, mix audio data for multi-device audio output scenarios, etc.
  • System libraries can include multiple functional modules. For example: surface manager (surface manager), media libraries (Media Libraries), 3D graphics processing libraries (for example: OpenGL ES), 2D graphics engines (for example: SGL), etc.
  • the surface manager is used to manage the display subsystem and provides the fusion of 2D and 3D layers for multiple applications.
  • the 3D graphics processing library is used to implement 3D graphics drawing, image rendering, composition, and layer processing.
  • 2D Graphics Engine is a drawing engine for 2D drawing.
  • the kernel layer is the layer between hardware and software.
  • the kernel layer at least includes display driver, Wi-Fi driver, Bluetooth driver, camera driver, audio driver, sensor driver, etc.
  • the components shown in FIG. 2 do not constitute specific limitations on the electronic device 100 .
  • the electronic device 100 may include more or fewer components than shown in the figures, or some components may be combined, some components may be separated, or some components may be arranged differently.
  • Figure 3 is an exemplary module interaction schematic diagram.
  • the video application outputs the audio data of audio A (which may also be called audio data A) to the media manager.
  • the media manager receives audio data input by other applications, which may be called input audio data (denoted as data_in in this application).
  • input audio data denoted as data_in in this application.
  • 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 this embodiment of the present application, data_in can be used to represent input audio data, and can also be used to represent the input volume of audio.
  • the media manager can obtain the output volume of audio A (which may also be called the audio output volume) based on the input volume of audio A.
  • the audio data output by the media manager to other modules or applications can be called output audio data, which is represented as data_out in the embodiment of this application. Similar to the input audio data, the amplitude of the output audio data is the volume of the output audio. Therefore, in this embodiment of the present application, data_out can be used to represent output audio data, or can also be used to represent the output volume of audio.
  • the solution in the embodiment of the present application mainly describes the control of the volume. Therefore, in the embodiment 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. , the description will not be repeated below.
  • data_in is the input volume of audio A.
  • the volume corresponding to the audio data generated by the video application is the input volume.
  • track_volume (track volume) represents the volume of the application.
  • 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.
  • this volume does not affect the volume of other media and is only effective for the audio played by the music application.
  • stream_volume represents the volume of a certain stream.
  • the Android system includes 10 types of streams, including but not limited to: media streams, call streams, etc.
  • the sound and vibration option interface 401 in the setting options of the mobile phone includes a volume option 402.
  • the volume options 402 include but are not limited to: "Incoming calls, messages, notifications" options 4021, "Alarm clock” options 4022, "Music, videos, games” options 4023, “Calls” options 4024, and “Smart voice” options 4025, etc.
  • the "call” option 4024 corresponds to the call stream and is used to adjust the output volume of the call.
  • Alarm clock option 4022 corresponds to the alarm clock stream, which is used to adjust the output volume of the alarm clock.
  • the "incoming call, message, notification” option 4021 corresponds to the incoming call, message, and notification stream volume alias (stream volume alias). stream volume alias is used to set the volume of the same group of streams.
  • the slider of the "Incoming Call, Message, Notification” option 4021 to set the volume of the "Incoming Call, Message, Notification” stream voloum alias, it can be understood as being used to set the volume of the incoming call stream (i.e., the volume of the incoming call prompt), the information stream The volume (that is, the information prompt volume) and the volume of the notification stream (that is, the notification prompt volume).
  • the volume of incoming call alerts, message alerts, and notification alerts will be adjusted accordingly, but other streams, such as alarm clocks and call volumes will not be adjusted.
  • 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.
  • the media can be set , that is, the volume of each stream (including music stream, video stream, game stream) in the "music, video, game” stream volume alias.
  • master_volume (master volume) is used to set all stream_volume and track_volume. This value can be written into the device file corresponding to the audio device (ie, the sound card file) to control the volume of all objects. This value can also not be written to the sound card file, but used as a multiplier factor to affect the volume of all objects.
  • the factors that affect the output volume include but are not limited to at least one of the following: input volume, stream volume, track volume, and master volume.
  • factors other than input volume can also be called output volume parameters.
  • the user can adjust the output volume by adjusting any of the output volume parameters. .
  • the media manager outputs the data_out of audio A (that is, the output audio data of audio A) to the audio driver.
  • the audio driver can play audio A through the playback device (such as a speaker), and the playback volume is is the volume corresponding to data_out, which can also be understood as the amplitude corresponding to the audio data of audio A.
  • the media manager can perform corresponding encoding and other processing on the audio A.
  • the specific processing method can refer to the existing technical embodiments. This application will not provide a detailed description, and the description will not be repeated below.
  • the video application switches audio A to audio B in response to user operations.
  • the video application outputs the input audio data of audio B (expressed as data_in(B)) to the media manager.
  • the media manager obtains the output audio data of audio B based on formula (1), which can also be understood as obtaining audio B.
  • the output volume (denoted as data_out(B)).
  • the output volume of audio B depends on the input volume of audio B.
  • the audio The output volume of audio B is much smaller than the output volume of audio A.
  • the user can adjust the volume of media stream volume alias (including music stream, video stream, and game stream) through the volume keys to increase the output volume of audio B.
  • the volume adjustment box 602 includes a volume bar for indicating the media volume. It should be noted that in the embodiment of this application, the volume key is set to adjust the media volume as an example for explanation. In other embodiments, the volume can also be adjusted in any other way, which is not limited in this application.
  • 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.
  • the video application switches back to audio A in response to the received user operation, correspondingly, the video application outputs audio data of audio A to the media manager (ie, input audio data).
  • the media manager obtains the output volume of audio A based on the current, that is, adjusted output volume parameter (where the value of stream_volume has been increased). Then, the output volume of audio A will become very loud. This phenomenon can be called popping sound, which will affect the user experience.
  • embodiments of the present application provide a volume control method that can control the audio output volume within a preset range, and the preset range is set according to user needs, so that It can solve the problem of popping sound when switching audio and effectively improve the user experience.
  • Figure 7 is a schematic diagram of an exemplary volume control method. Please refer to Figure 7 , which specifically includes:
  • the mobile phone when the mobile phone is playing or outputting audio data to other devices, the mobile phone can subscribe to the output volume to obtain the output volume.
  • the output volume in the embodiment of the present application is represented as "data_out”.
  • 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 input by the application (ie, the input audio data). .
  • the media manager can output audio data to the audio driver for playback through speakers and other devices.
  • the media manager can also output audio data to a Wi-Fi driver or Bluetooth driver to transfer it to other devices for playback. 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.
  • volume_coefficient volume parameter
  • appropriate volume parameters are set to control the output volume within the range required by the user.
  • the volume parameters can be obtained and saved by the media manager, for example, they can be saved in the memory (or other locations, which are not limited by this application).
  • the specific acquisition method of the audio parameters will be as follows. Detailed description is given in the examples.
  • the media manager may be set with a default volume parameter, for example the volume parameter may be 0.5.
  • This default volume parameter can be used by the media manager to process audio before obtaining the volume parameter based on the method described below. For example, when the phone is turned on for the first time and audio is played for the first time, the media manager can obtain the output volume based on the default volume parameters to avoid popping sounds during the first playback. Optionally, if the media controller does not set a default volume parameter, the media controller can obtain the output volume based on formula (1) when playing audio for the first time, which is not limited in this application.
  • factors that affect 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 parameters.
  • stream volume (stream_volume), track volume (track_volume), and master volume (master_volume) can be called output volume parameters.
  • the user can adjust any of the output volume parameters. to adjust the output volume.
  • the mobile phone subscribes to the output volume and can sample the output volume at a preset sampling period to obtain the output volume.
  • the mobile phone can set two types of sampling periods, including a first sampling period and a second sampling period.
  • the first sampling period can also be called a sparse sampling period
  • the second sampling period can also be called a dense sampling period.
  • the sampling period duration of the first sampling period is longer than the period duration of the second sampling period.
  • the period duration of the first sampling period may be on the second level, and the period duration of the second sampling period may be on the millisecond level.
  • the mobile phone can detect the user's behavior to detect whether the output volume adjustment behavior occurs. It can also be understood as detecting whether the adjustment described above occurs. The behavior of the output volume parameter.
  • the mobile phone when the mobile phone plays audio data and does not detect that the user adjusts the output volume, the mobile phone collects the output volume in the first sampling period. In another example, when the mobile phone plays audio data and detects that the user adjusts the output volume, the mobile phone collects the output volume in the second sampling period.
  • the above-described user adjustment of the output volume may include but is not limited to at least one of the following: clicking the volume key; clicking or dragging each volume option in the setting interface (such as each slide bar in Figure 4); clicking The volume keys of the remote control; adjusting the volume through voice commands or gestures, etc. are not limited in this application.
  • a smart volume control adjustment option can be set in the mobile phone, and the user can use the volume control function adjustment option to instruct the mobile phone to execute the volume control scheme in the embodiment of the present application during audio playback.
  • the volume control function adjustment option can be set in at least one of the drop-down menu, the control center, the negative screen, and the sound and vibration setting interface, which is not limited in this application.
  • the mobile phone obtains and saves the output volume range.
  • 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 be based on formula (3) and formula (4) respectively obtain the maximum value of the output volume (expressed as data_out_max in this application) and the minimum value of the output volume (expressed as data_out_min in this application) to obtain the output volume range.
  • data_out_max Math.max(data_out_max,data_out)
  • data_out_min Math.min(data_out_min,data_out) (4)
  • the mobile phone After the mobile phone collects the output volume, it compares the output volume with the maximum and minimum values of the saved output volume range.
  • the collected output volume is greater than the maximum value of the saved output volume range, 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.
  • 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.
  • 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.
  • the collected output volume is less than the minimum value of the saved output volume range, 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.
  • the minimum value of the updated output volume range is the collected output volume. .
  • the mobile phone after each sparse collection (that is, collection according to the first sampling cycle), the mobile phone updates the output volume range according to the collected output volume, and the updated output volume range is the same as the previous output.
  • the volume ranges can be the same or different.
  • the mobile phone when the mobile phone collects the output volume in the second sampling period, the mobile phone can also obtain the output volume range.
  • the mobile phone specifically, the media manager
  • detects that the user has increased the output volume for example, the user clicks the volume key to increase the media stream parameter (i.e., stream_volume)
  • the mobile phone specifically, the media manager
  • Media Manager which will not be described again below
  • the maximum output volume value of the output volume range is still the maximum value of the output volume range obtained last time.
  • data_out Math.average(data_out1,data_out2, etc.
  • data_out_min Math.max(data_out_min,data_out) (6)
  • the mobile phone detects that the user adjusts the output volume (i.e., adjusts the output volume parameters mentioned above), during the process of the user increasing the output volume (i.e., starting from the detection of the user Adjust the volume to the end of the adjustment), and the mobile phone collects the output volume in the second sampling period. From the time the user starts adjusting the volume to the end of the adjustment, the mobile phone collects n output volumes in 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, the mobile phone obtains the minimum value of the output volume range based on formula (6).
  • the mobile phone compares the minimum value of the output volume range saved last time with the average output volume obtained this time. Quantity comparison. 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 minimum value of the new output volume range, and the maximum value is still the maximum value of the previously obtained output volume range. 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 minimum value of the new output volume range, and the maximum value is still the previously obtained value. The maximum value of the output volume range, that is to say, the new output volume range is consistent with the previously saved output volume range.
  • the mobile phone specifically, the media manager
  • the media manager detects that the user has turned down the output volume, for example, the user clicks the volume button to turn down the media stream parameter (ie, stream_volume)
  • the phone will The output volume is collected in the second sampling period, and the maximum output volume value of the output volume range is obtained based on formula (7) and formula (8) (expressed as data_out_max in this application).
  • the minimum output volume value of the output volume range is still the minimum value of the output volume range obtained last time.
  • data_out Math.average(data_out1,data_out2, etc.
  • data_out_max Math.min(data_out_max,data_out) (8)
  • the mobile phone detects that the user has increased the output volume (that is, from the time when the user begins to adjust the volume to the end of the adjustment), the mobile phone collects the output volume in the second sampling period. From the time the user starts adjusting the volume to the end of the adjustment, the mobile phone collects n output volumes in 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, 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 output volume range saved last time with the average output volume obtained this time.
  • the average output volume is used as the maximum value of the new output volume range, and the minimum value is still the minimum value of the previously obtained 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 is still the previously obtained maximum value. The minimum value of the output volume range. That is to say, the new output volume range is consistent with the previously saved output volume range.
  • the media sensor collects the output volume generated by the media sensor.
  • the media sensor may be the first time Execute the steps to obtain the output volume range.
  • the media sensor collects in a sparse collection cycle, and the collected output volume is data_out1. This value can be regarded as the minimum value or the maximum value.
  • the media sensor detects that the collection period has arrived, 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.
  • 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). For example, at time t3, the media sensor detects that the collection period has arrived, and the media sensor collects the output volume. For example, the collected output volume is data_out3. Based on formula (3) and formula (4), the media sensor determines that data_out3 is greater than the maximum value of the currently saved output volume range (data_out2). The media sensor updates the output volume range. The maximum value of the updated output volume range is data_out3, and the minimum value is Still data_out1, that is (data_out1, data_out3).
  • the media manager detects that the user has turned down the output volume, and then the media manager performs an intensive collection cycle from time t4 to the end of the user adjustment (for example, time t7). Collect in a row and average the collected output volumes. For example, the average value obtained 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 of the currently saved output volume range (data_out3), the maximum value of the updated output volume range is still data_out3, that is, the updated output volume range is (data_out1, data_out3).
  • the collection interval and volume in Figure 8 are only illustrative examples and are not limited in this application. It should be further noted that, not shown in Figure 8 , for example, after intensive collection (that is, after time t7), the media manager will continue collection in a sparse collection cycle and update the output volume range.
  • each time the media manager obtains a new output volume range it saves the new output volume range.
  • the media manager can overwrite the previous output volume range to save memory usage, which is not limited in this application.
  • the mobile phone detects the audio change and obtains the volume parameters based on the new audio input volume and output volume range.
  • audio changes in the embodiment of this application may include but are not limited to: switching audio source files, switching audio source devices, switching output devices, etc.
  • the audio source file switching is optionally the audio file switching received by the media manager.
  • the mobile phone is playing song A.
  • the audio output by the music application to the media manager is the audio data of song A.
  • the mobile phone switches to play song B in response to the user operation.
  • the audio output by the music application to the media manager is switched to the audio data of audio B, which is the audio source switching.
  • the switching of audio source devices may be the switching of audio source devices during the audio delivery service in a multi-device scenario.
  • the mobile phone transmits song A to the vehicle-mounted device through a wireless connection (which can be a Wi-Fi connection or a Bluetooth connection, which is not limited in this application and will not be repeated below), and the vehicle-mounted device receives and plays song A.
  • a wireless connection which can be a Wi-Fi connection or a Bluetooth connection, which is not limited in this application and will not be repeated below
  • the user uses a tablet to connect to the vehicle-mounted device, and uses tablet A to play song A to the vehicle-mounted device.
  • the audio source device is switched from the mobile phone to the tablet.
  • output device switching may be switching of output devices during audio delivery services in a multi-device scenario.
  • the mobile phone plays song A to the car-mounted device through a wireless connection, and in response to the received user operation, the mobile phone plays song A to the tablet through a wireless connection with the tablet.
  • switching its output device from a car-mounted device to a tablet device is an output device switching.
  • the mobile phone detects any of the above situations, that is, after determining that the audio has changed, the mobile phone executes the volume parameter acquisition step. That is to say, after the audio is changed, the mobile phone obtains the volume parameters corresponding to the audio based on the method described below. Before the audio is changed, the mobile phone no longer needs to obtain the volume parameters of the audio.
  • the mobile phone after detecting the audio change, the mobile phone (specifically, the media manager) obtains the input volume of the changed audio (the concept can be referred to the above, and will not be described again here).
  • the mobile phone can obtain the corresponding volume parameters based on the relationship between the input volume and the output volume range.
  • the volume parameter can be used to adjust the output volume of the audio.
  • the output volume of the audio can be adjusted to within the output volume range by setting corresponding volume parameters for different audios (ie, different input volumes).
  • the specific method is as follows:
  • the mobile phone obtains the average input volume of the audio.
  • the mobile phone For example, still taking the scene of playing audio on a mobile phone as an example, after the mobile phone (specifically, the media manager) detects the audio change, it can obtain the preset length of the audio (that is, the changed audio) before playing the changed audio.
  • the audio data corresponds to the input volume.
  • 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 average the input volume of the obtained audio data of a preset length to obtain the average input volume.
  • the mobile phone obtains the audio volume parameters based on the relationship between the average audio input volume and the output volume range.
  • the mobile phone obtains the volume parameter of the audio based on formula (9) (in this application, it is expressed as volume_coefficient, concept Please refer to the above and will not go into details here):
  • data_out_max is the maximum value of the output volume range mentioned above.
  • data_in_average is the average input volume of the obtained audio.
  • G_max is a system constant and can be set according to actual needs. For example, in the embodiment of this application, G_max is 0.5, which is not limited in this application.
  • the mobile phone obtains the volume parameter of the audio based on formula (10):
  • data_out_min is the minimum value of the output volume range mentioned above.
  • data_in_average is the average input volume of the obtained audio.
  • G_min is a system constant and can be set according to actual needs. For example, in the embodiment of this application, G_min is 0.5, which is not limited in this application.
  • 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 audio's The volume parameter is equal to 1.
  • S704 The mobile phone obtains the new audio output volume based on the volume parameters, input volume and output volume parameters.
  • the mobile phone after the mobile phone obtains the audio parameters of the changed audio (ie, new audio), it can obtain the changed output volume based on formula (2).
  • the "new audio” described in the embodiment of the present application in the audio source change scenario is audio data that is different from the audio before switching.
  • the "new audio” may be different audio data from before the switch, or it may be the same audio data as before the switch.
  • the media manager both are considered new. Audio.
  • the mobile phone detects the output device switching. After the output device is switched, the music application may re-output audio data to the media manager.
  • the audio data may be the same as or different from the audio data before the switch, which is not limited by this application.
  • the mobile phone After the mobile phone obtains the audio output volume, it can output the audio and audio output volume to the audio driver for playback, or it can output the audio and audio output volume to other devices through the communication module for playback.
  • the video application plays audio A in response to the received user operation.
  • 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).
  • the video application can divide the 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 may refer to the existing technical embodiments and is not covered in this application. limited.
  • the media manager receives input audio data for audio A.
  • the media manager can be based on the input audio data corresponding to Enter the volume parameters and the currently saved (that is, the most recently saved) output volume range to obtain the volume parameters of audio A.
  • the media manager obtains the average input volume (data_in_average(A)) of the audio data of the preset length (for example, the first 5 seconds) of the beginning of audio A.
  • the Media Manager compares Audio A's average input volume to the output volume range.
  • the output volume range currently saved by the media manager is (data_out_min1, data_out_max1) as an example.
  • the media manager detects that the average input volume (data_in_average(A)) of audio A is within the output volume range, that is, data_out_min1 ⁇ data_in_average(A) ⁇ data_out_max1, then the media manager determines the volume parameter corresponding to audio A (denoted as volume_coefficient (A)) is 1.
  • the media manager obtains the output volume corresponding to the output audio data of audio A (denoted as data_out(A)) based on formula (2). Please refer to 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).
  • the media manager performs the first sampling period (i.e., the sparse sampling period mentioned above) on the output volume of audio A (i.e., the output volume generated by the media manager). Collect, and update the output volume range based on the collected output volume.
  • the first sampling period i.e., the sparse sampling period mentioned above
  • the output volume of audio A i.e., the output volume generated by the media manager.
  • the video application responds to the received user operation, 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).
  • the media manager determines the audio source change in response to receiving input audio data for Audio B.
  • 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 parameters of audio B.
  • the media manager obtains the average input volume (data_in_average(B)) of the audio data of the preset length (for example, the first 5 seconds) at the beginning of audio B.
  • the media manager compares Audio B's average input volume to the output volume range.
  • the output volume range currently saved by the media manager is (data_out_min1, data_out_max1) as an example. In other words, the output volume range obtained by the media player during playing audio A has not changed.
  • the media manager detects that the average input volume (data_in_average(B)) of audio B exceeds the output volume range and is less than the minimum value data_out_min1 of the output volume range.
  • the media manager may obtain the volume parameter of audio B (denoted as volume_coefficient(B)) based on formula (10).
  • the media manager can obtain the output volume (denoted as data_out(B)) corresponding to the audio data of audio B based on formula (2). Please refer to Figure 9b.
  • the media manager 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).
  • the above example only takes the average input volume of audio B to be greater than the maximum value of the output volume range as an example. If the average input volume of audio B is less than the minimum value of the output volume range, the media manager can use the formula ( 10) Obtain the volume parameters of audio B. The steps for other parts are the same and the examples will not be repeated here.
  • the media manager collects the output volume of audio B in the first sampling period (i.e., the sparse sampling period mentioned above), and Based on collection reaches the output volume, and updates the output volume range.
  • the media manager will only execute the volume parameter acquisition process after detecting audio changes. Therefore, the output volume range obtained during audio playback will not affect the currently played audio. Before the audio playback ends or other audio is switched, the output volume is calculated based on the volume parameter obtained. The output volume range updated during playback will be used in the step of obtaining volume parameters after the audio is changed.
  • the video application switches Audio B back to Audio A in response to the received user action.
  • the media player repeats the process in Figure 9a.
  • 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).
  • the media manager determines the audio source change in response to receiving input audio data for audio A.
  • the media manager will re-execute the volume parameter acquisition process. For example, the media manager obtains the average input volume of audio A (data_in_average(A)).
  • Media Manager compares Audio A's average input volume to the output volume range.
  • the currently saved output volume range is (data_out_min1, data_out_max1) as an example.
  • the media manager detects that the average input volume of audio A is within the output volume range.
  • 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 and the input volume of audio A and the output volume parameter to obtain the output volume of audio A.
  • volume_coefficient(A) volume parameter
  • volume_coefficient(A) its corresponding volume parameter is volume_coefficient(A).
  • the mobile phone can obtain the volume parameters corresponding to audio B based on the input volume of audio B, so as to output the volume parameters (i.e., the parameters in the dotted box, including stream volume (stream_volume) , track volume (track_volume), master volume (master_volume)) remain unchanged, that is, when the output volume parameters are the same as 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 parameters.
  • the media manager can re-obtain the corresponding volume parameters based on the switched audio.
  • 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 based on the user's listening habits. That is to say, in this embodiment of the present application, even if the input volume of the audio after switching is smaller than the input volume of the audio before switching, by setting the corresponding volume parameter, the user does not need to increase the volume.
  • the audio is switched back to the previous audio, since the output volume parameter has not changed, there will be no popping problem.
  • the audio output volume described in the embodiment of the present application is within the output volume range can be understood to mean that the average audio volume is within the output volume range, or it can be understood that most of the audio data volume is within the output volume range.
  • the volume of a small part of the audio may be greater or less than the output volume range.
  • the output volume corresponding to all the audio data of the audio data is within the output volume range, then during the process of playing the audio data, The output volume is always maintained within the output volume range. For example, if the output volume corresponding to part of the audio data is not within the output volume range, the electronic device can update the output volume range when a volume that does not meet the output volume range is collected.
  • the above scenario is based on a scenario where the output volume range remains unchanged.
  • the media manager collects the output volume in the second sampling period (that is, the intensive sampling period) during the process of the user increasing the volume.
  • the media manager can update the output volume range based on the collected output volume.
  • the specific acquisition method can be referred to above and will not be repeated here.
  • the output volume range may also change during the sparse collection period, and this application will not give examples one by one.
  • 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.
  • the media manager can obtain the volume parameters corresponding to audio B based on the updated output volume range.
  • the media manager will collect the audio in an intensive collection cycle in the manner described above, and update the output volume range.
  • the media manager can obtain the volume parameters corresponding to audio A based on the currently saved (ie, the most recently updated) output volume range, that is, the most recently updated output volume range.
  • the video application may also switch to other audio in response to the received user operation.
  • the specific method is consistent with switching to audio A, and this application will not give examples one by one.
  • the audio played when switching back to audio A is the same as the audio played before switching to audio B.
  • the video application may also adopt a method of resuming playback at a break point. For example, if audio A1 was played before switching to audio B, the media manager can obtain the volume parameter corresponding to audio A1 and obtain the corresponding output volume. After the video application switches audio B back to audio A, it can optionally play audio A2 in audio A.
  • the data of audio A2 and audio A1 are different, 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 is similar to that in Figure 9a and Figure 9b and will not be described again here.
  • audio switching may be to switch the currently playing audio A to audio B in response to a received user operation during the playing of audio A.
  • audio B may be played after the audio A is played (for example, after a period of time), which is not limited in this application.
  • the media manager when the user adjusts the output volume parameter to adjust the audio output volume, when the media manager obtains the output volume range, it can compare the newly obtained maximum value of the output volume range with the previously obtained maximum value.
  • the maximum value of the output volume range is averaged to serve as the updated maximum value of the output volume range. Accordingly, the media manager averages the newly obtained minimum value of the output volume range and the previously obtained minimum value of the output volume range as the updated minimum value of the output volume range, thus preventing the user from adjusting the volume. This causes the output volume range to fluctuate excessively.
  • the volume control method in the embodiment of the present application is not only applied in the scenario where the mobile phone plays audio as mentioned above (which can also be understood as a single-device scenario), but can also be applied in a multi-device collaboration scenario.
  • Figure 10 is an exemplary multi-device collaboration scenario. Please refer to Figure 10.
  • the mobile phone outputs audio data of audio A to the TV through a wireless connection with the TV.
  • the TV receives and plays the audio data of audio A.
  • the device types and device quantities in Figure 10 are only illustrative examples.
  • the scenario may be that mobile phone A is wirelessly connected to a TV and a tablet respectively, and outputs the audio data of audio A to the TV and the tablet respectively.
  • Both the TV and the tablet can play the audio data of audio A.
  • the processing method The processing method of each device in the scenario in Figure 10 is the same, and this application will not give examples one by one.
  • the wireless connection described in the embodiments of this application may be maintained based on Bluetooth protocol or Wi-Fi protocol, which is not limited by this application.
  • the wireless connection is a Wi-Fi connection as an example for explanation.
  • the specific establishment process of the wireless connection may refer to existing technical embodiments, and will not be described in detail in this application.
  • 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 recorded as data_in(A1).
  • the media manager of the mobile phone receives the input audio data of audio A and obtains the volume parameters 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 the relevant content in Figure 9a and will not be described again here.
  • the media manager of the mobile phone can obtain the output volume data_out of audio A based on the input volume, volume parameters and current output volume parameters of audio A (including stream volume (stream_volume), track volume (track_volume), and master volume (master_volume)). (A1).
  • 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 be referred to above and will not be described again here.
  • the media manager of the mobile phone outputs the output audio data A1 of audio A to the Wi-Fi driver, where 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 TV's Wi-Fi driver optionally outputs the output audio data A1 of the audio A to the TV's screen projection application (it can also be other collaborative applications, which is not limited in this application).
  • the screen projection application outputs the output audio data A1 of audio A to the media manager of the TV.
  • the audio data received by it are all recorded as input audio data, then the audio data of audio A received by the media manager is represented as the input of audio A.
  • Audio data A2 the corresponding input volume is data_in(A2). Among them, data_in(A2) is equal to data_out(A1).
  • the media manager of the TV obtains the volume parameter of audio A on the TV side based on the received input volume data_in(A2) of audio A.
  • the TV's media manager can obtain the average input volume of audio A (data_in_average(A2)) based on the input volume of audio A, data_in(A2).
  • data_in_average(A2) is the same as or different from data_in_average(A1). There are no restrictions on application.
  • the media manager of the TV compares the average input volume of audio A (data_in_average(A2)) with the output volume range currently saved on the TV side.
  • the output volume range on the TV side is the same as or different from the output volume range on the mobile phone side, which is not limited in this application.
  • the media manager of the TV can obtain the volume parameter (volume_coefficient(A2)) of audio A on the TV side based on the comparison result.
  • the volume parameter (volume_coefficient(A2)) is the same as or different from the volume parameter (volume_coefficient(A1)), which is not limited in this application.
  • the media manager of the TV can obtain audio A based on the input volume data_in (A2), volume parameter (volume_coefficient (A1)) of audio A, and the output volume parameter of the TV side (the same as or different from the mobile phone side).
  • the output volume data_out(A2) on the TV side can be noted that for the specific details of obtaining each parameter, please refer to the relevant content in the above embodiments, and the description will not be repeated here.
  • the media manager of the TV can output 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 device) to play the audio data of audio A, and the playback volume is data_out(A2).
  • the media manager of the TV can also collect the output volume of audio A and update the output volume range.
  • the media manager of the TV can also collect the output volume of audio A and update the output volume range.
  • the TV in a multi-device collaboration scenario, can adjust the output volume of the audio to the listening volume range that the user is accustomed to on the TV side, that is, the output volume range of the TV side, through the volume parameter corresponding to the audio.
  • the audio input volume obtained by the TV i.e., the output volume on the mobile phone side
  • the audio output volume on the TV side can be adjusted to within the output volume range by obtaining appropriate volume parameters. .
  • the user can adjust the output volume of the TV through the TV's remote control.
  • the media manager of the TV increases the output volume parameters (including stream volume (stream_volume), track volume (track_volume), and master volume (master_volume)) on the TV side in response to the received user operation.
  • the corresponding changes are the output volume on the TV side and the output volume range on the TV side, but the output volume and output volume range on the mobile phone side will not be changed.
  • the mobile phone when the mobile phone cancels the audio transmission with the TV (the wireless connection may be maintained or disconnected, which is not limited by this application), if the mobile phone continues to play audio A on the mobile phone side, the mobile phone can The process in 9a obtains the output volume of audio A.
  • the media manager on the mobile phone detects the audio change (ie, the output device changes).
  • the mobile phone obtains the output volume of audio A, it needs to obtain the output volume of audio A again based on the method in Figure 9a.
  • Volume parameter and based on the new volume parameter (ie, volume parameter A3), the output volume of audio A is obtained.
  • the volume parameter A3 is 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.
  • the playback volume is the output volume obtained by the mobile phone based on the output volume range and volume parameters on the mobile phone side.
  • the TV side after the audio transmission with the mobile phone is cancelled, if the TV side plays audio (such as audio B), the output volume of audio B played by the TV side is obtained based on the output volume range updated by the TV side and the corresponding volume parameters. Arrived.
  • the output volume of device A side is usually increased, that is, the output volume parameter of device A side is increased, that is, the input volume of device B is increased. of Volume up to increase the output volume on side B of the device.
  • device A and device B are disconnected (the collaboration between devices may also be canceled, which is not limited in this application)
  • device A continues to play audio A. Since the output volume parameter on the side of device A has been increased, when device A plays audio A, it will continue to use the increased output volume parameter to obtain the output volume of audio A, which may cause popping sound when device A plays audio A. .
  • device A and device B obtain the output volume, they obtain the output volume based on their respective output volume ranges, output volume parameters, and obtained volume parameters. of. That is to say, even if the volume output by device A to device B is larger or smaller, device B can also obtain the appropriate volume parameters to adjust the output volume of audio A on the side of device B to device B through the volume parameters. within the output volume range of the side. In other words, the user does not need to adjust the output volume parameters of device A or device B. Through the volume parameters, device B can adjust the output volume of audio A on device B to within the output volume range to meet the user's listening habits. .
  • the output volume parameters and volume parameters of device A and device B 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 , both device A or device B will re-obtain the corresponding volume parameters for the played audio to adjust the output volume of the new audio to the output volume range of the respective devices, without causing the problem of popping sound, effectively improving the user experience. .
  • the user can adjust the output volume of device B through device A and/or device B.
  • the user can adjust the output volume of audio A on the device B side by adjusting the output volume parameter on the device A side (for the principle, please refer to the above and will not be repeated here).
  • 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.
  • the corresponding volume parameters can still be obtained according to the saved output volume parameters and output volume range, and the output volume can be obtained.
  • the user can adjust the output volume of audio A on the device B side by adjusting the output volume parameter on the device B side.
  • the output volume parameter on the device B side can be adjusted.
  • device A is disconnected from device B, when device A is playing audio, its output volume parameters and output volume range are not affected (that is, the parameters in the dotted box are the same). Therefore, When device A plays audio, the output volume it plays is still within the output volume range, which can effectively avoid the popping problem that occurs after device switching.
  • FIGs 13a and 13b are exemplary schematic diagrams of the principles. Please refer to Figure 13a.
  • the scene includes devices such as mobile phones, headphones, tablets, and televisions. It should be noted that the number and type of devices in Figure 13a are only illustrative examples and are not limited in this application.
  • a mobile phone as a central device, can obtain the audio data sent by each slave device.
  • the mobile phone can connect to a tablet and a TV through a wireless connection (such as a Wi-Fi connection, or other connection methods.
  • This application does not cover (Limited)
  • the audio data of audio A sent by the tablet and the audio data of audio B sent by the TV are received.
  • the input volume corresponding to the audio data of audio A is data_in(A)
  • the input volume corresponding to the audio data of audio B is data_in(B).
  • the mobile phone 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 the mixed audio data.
  • 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 headset to play the mixed audio through the headset, and the playback volume is data_out(X).
  • each device sends The audio input volume is the volume adjusted based on the volume control method described above.
  • the mobile phone also adjusts the output volume of the mixed audio based on the volume control method in this application, so that the output volume of the mixed audio is controlled within the output volume range of the mobile phone.
  • the central device in the embodiment of the present application can obtain the mixed audio based on the relative position (including distance and/or angle) between each device and the earphones, so that the central device can obtain the mixed audio on the earphone side. Achieve stereo effect.
  • the user can hear the audio of each device in the network (including mobile phones, tablets and TVs) through earphones, and the sound effect of each audio is the same as the auditory effect when the user does not use earphones.
  • Proximity that is, the sound played in the headphones can achieve the spatial hearing effect of the distance and direction of the sound.
  • the central device is optionally used to connect and interact with slave devices, to issue instructions to each slave device, and to obtain audio data from the slave devices.
  • the central device is also used to connect and interact with the headset to obtain instructions from the headset and transmit audio data to the headset.
  • Slave devices are devices in the network other than the central device.
  • the networking can be Wi-Fi networking, Bluetooth networking, or a hybrid networking of Wi-Fi and Bluetooth.
  • the connection between the mobile phone and the TV can be a Wi-Fi connection.
  • the connection between the mobile phone and the tablet may be a Bluetooth connection, which is not limited in this application.
  • each device in the network in this embodiment of the present application has the same account. The specific determination method of the central device and the slave device will be described in detail in the following embodiments.
  • Figure 14 is a schematic diagram of an exemplary scene. Please refer to Figure 14.
  • a Wi-Fi network formed between a mobile phone, a TV, and a tablet is used as an example for explanation. That is, the wireless connections of each device in the network are maintained based on the Wi-Fi protocol. For example, after the TV and tablet in the user's home are turned on, they can be automatically discovered and connected (or manually connected, which will not be described here) to form a home network.
  • the home network may also include other devices, such as Bluetooth speakers and other smart home devices, which are not limited in this application.
  • the mobile phone executes the Wi-Fi discovery process, and after discovering each device (including TV and tablet) in the Wi-Fi network, automatically connects to each device. to join the Wi-Fi network.
  • the embodiments of this application only briefly describe the structure and establishment process of the network. For the specific connection process, reference can be made to existing technical embodiments, which are not limited in this application.
  • the earphones can automatically connect to the electronic device.
  • the headset automatically connects to the last connected device (such as a tablet) as an example for explanation.
  • the earphones can also select the nearest device for connection, which is not limited in this application.
  • the headset establishes a Bluetooth connection with the tablet.
  • the specific establishment process may refer to existing technical embodiments, and will not be described in detail in this application.
  • each device in the network can initiate a voting process to select the central device and slave devices.
  • Figure 15 is an exemplary voting schematic diagram. Please refer to Figure 15.
  • Each device in the network (including mobile phones, tablets, and TVs) sends (for example, broadcast messages) voting information to other devices in the network.
  • Ballot information includes device information, device capability information and location information. Among them, the device information includes but is not limited to: device model, device name, device address and other information.
  • the capability information of the device includes but is not limited to: the communication type supported by the device, whether it supports the mixing function, etc.
  • the location information is optionally distance information between the device and the headset.
  • the distance information can be measured through Bluetooth ranging, Ultra Wide Band (UWB), etc., which is not limited in this application.
  • the device may also be called a candidate device or an alternative device during the election phase, which is not limited by this application.
  • each device in the network can receive voting information sent by other devices. Take the mobile phone as an example.
  • the mobile phone sends voting information to the TV and tablet.
  • the voting information includes relevant information of the mobile phone.
  • the mobile phone will also receive the voting information sent by the TV and the voting information sent by the tablet.
  • the voting information sent by the TV includes the relevant information of the TV
  • the voting information sent by the tablet includes the relevant information of the tablet.
  • each device in the network can have preset voting rules, and the voting rules can be set according to actual needs.
  • the device closest to the headset can be selected based on the location information in each ballot, which is not limited in this application.
  • each device selects a mobile phone as the central device according to the preset voting rules.
  • the mobile phone selects the mobile phone itself as the central device according to the preset voting rules based on its own device information, location information, etc., as well as the received voting information from the TV and the voting information from the tablet.
  • the preset rules are the same as those of mobile phones, and the obtained voting information is also the same. Therefore, the central device selected by each device in the network is consistent.
  • mobile phones are all selected as the central device.
  • other candidate devices that are not the central device in the network serve as slave devices.
  • the headset after selecting the central device, the headset can be switched to the central device, that is, disconnecting from the tablet, and establishing a Bluetooth connection with the mobile phone (ie, the central device).
  • a tablet non-central device is used as an example for explanation.
  • the device currently connected to the headset may or may not be a central device, which is not limited in this application.
  • a handshake process is periodically executed between the central device and each device, that is, the central device and each slave device perform a handshake process in each cycle (for example, it can be 5s, which can be set according to actual needs.
  • This application (not limited) at the triggering time, the detection information is exchanged to detect whether the status of the central device is normal.
  • the slave device can determine that the status of the central device is abnormal and the network Each device in the system re-executes the voting process, and the central device after re-voting is different from the previous central device.
  • the headphones will be connected to the new central device, and the new central device will continue to perform the steps described in the embodiments below, such as the mixing step.
  • each device can obtain relative position information with the headset.
  • the relative position information includes distance information and/or angle information from the earphone.
  • the relative position between the mobile phone and the earphone is obtained: distance A and angle A.
  • the relative position between the TV and the headphones is obtained: distance B and angle B.
  • the relative position between the tablet and the earphones is obtained: distance C, angle C.
  • each device can obtain angle information based on the Angle of Arrival (AOA) algorithm or the Angle of Departure (AOD) algorithm, UWB and other measurement methods, which are not limited in this application.
  • AOA Angle of Arrival
  • AOD Angle of Departure
  • each slave device in the network (such as a TV and a tablet) sends the obtained relative position information to the central device.
  • each device can periodically acquire relative position information, and each slave device sends the relative position information acquired in each cycle to the central device.
  • FIG 17 is a schematic diagram of an exemplary user interface. Please refer to (1) of Figure 17.
  • the sound and vibration setting interface 1701 includes a mixing setting option box 1702. The user can click this option to start the mixing function of the mobile phone.
  • a flat panel or TV can also have a mixing function.
  • the mixing function in the TV or tablet can prompt the central device to be a mobile phone to prompt the user to perform operations on the mobile phone.
  • the central device can also synchronize relevant information to the slave device, so that the slave device can also implement the user's operation on the mobile phone, and send instructions generated in response to the received user operation to the central device, so that the central device Issue relevant control instructions within the network.
  • the mobile phone starts the mixing function in response to the received user operation.
  • the mobile phone can calculate the relative position between all devices in the network and the headset based on the most recently obtained relative position information between the mobile phone and the headset, as well as the most recently obtained relative position information between the other slave devices and the headset. position.
  • the mobile phone may use the direction of the focus device that the user is operating as the direction directly in front of the user, or may use the direction in which the earphones are facing as the direction directly in front of the user, which is not limited in this application.
  • the mobile phone displays the obtained relative orientations between all devices and the earphones in the mixing setting option box 1702 .
  • (2) of Figure 17 is only a schematic example.
  • the distance and orientation between each device and the headset can be identified in the figure, and information such as icons of each device can also be displayed. This application is not limited.
  • the user can manually adjust the relative position between each device and the headset through the interface provided in (2) of Figure 17 .
  • the relative position displayed in the interface may be inaccurate due to measurement errors and other issues.
  • the user can adjust the relative position to the headset by dragging the corresponding device icon. 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.
  • the mobile phone responds to the received user operation and calculates the angle between the dragged tablet icon and the headset icon. And save the new relative position information of the tablet, which is the distance information previously sent by the tablet and the updated angle information.
  • the mobile phone can send the new relative position information of the tablet to the tablet.
  • the user can remove the device through the interface in (2) of Figure 17 .
  • the phone responds to the received user's long press operation and displays an option box.
  • the option box can include a delete option, and the user can click the delete option to delete the tablet.
  • the mobile phone determines to remove the tablet from the mixing scene, and the mobile phone cancels the display of the tablet icon in the mixing setting option box 1702. Moreover, the mobile phone will not receive the audio sent by the tablet during the subsequent mixing process.
  • the mobile phone can also send instruction information to the tablet to instruct the tablet to stop sending relative position, audio and other information, and the tablet stops sending audio and other information to the mobile phone.
  • the audio mix does not include the audio corresponding to the tablet. It should be noted that this removal solution only removes the tablet's audio from the mix, and the tablet is still in the network.
  • the user can re-enable the mix function to trigger each device to re-execute the relative position acquisition process described above.
  • the mobile phone (or other devices such as tablets) can send trigger information to each device in the network after receiving the user's click on the mixing setting option to trigger the
  • Each device performs the voting process described above, and after the voting process is completed, the headset is connected to the central device.
  • each device in the network performs the relative position acquisition process described above.
  • the mobile phone (or other devices such as tablets) can send trigger information to each slave device to trigger each slave device to obtain the relative position to the headset.
  • Each slave device feeds back the obtained relative position information to the mobile phone.
  • the mobile phone calculates the group based on the relative position information between itself and the headset and the received relative position information.
  • the relative position of each device in the network is displayed in the mixing setting option box, which can effectively save the calculation burden of each device and reduce data interaction.
  • this method is less real-time than the method described above, and it may take a few seconds before the relative position of each device is displayed in the display box.
  • the headset can continue to connect to the tablet.
  • the mobile phone receives the user's click on the mixing option, the mobile phone establishes a connection with the headset.
  • the connection between the earphones and the tablet can be maintained or disconnected, which is not limited in this application.
  • the central device determines the orientation of each device, it can perform a mixing process while the devices in the network are playing audio, thereby achieving the effect shown in Figure 13b.
  • the user plays games on the mobile phone (that is, the game audio is played on the mobile phone), the video is played on the tablet, and the music is played on the TV.
  • the user's human ears can hear the game audio from the mobile phone, the video audio from the tablet, and the music audio from the TV.
  • the earphones can send wearing instruction information to the mobile phone.
  • the mobile phone i.e., the central device
  • the mobile phone sends mixing trigger instruction information to the slave devices (tablet and TV) to instruct each device to stop playing audio and output the audio data. to the mobile phone for mixing through the mobile phone, and output to the headphones for playback, as shown in Figure 13a.
  • the mobile phone and each slave device can perform soft clock synchronization.
  • the soft clock synchronization optionally synchronizes the system time between the mobile phone and each slave device to avoid audio inconsistency caused by network delay. Synchronization problem. After soft clock synchronization is performed on the mobile phone, tablet, and TV, the system time between the devices is consistent. It should be noted that in the embodiment of this application, only the system time that is synchronized by the soft clock is used as an example for explanation, and this application does not make a limitation. It should be further noted that this soft clock synchronization step can be executed at any time after the central device is elected and before the mobile phone performs mixing, which is not limited by this application.
  • the tablet plays audio A through its own audio device (such as a speaker).
  • its internal processing flow follows the volume control method described above, that is, the media manager in the tablet adjusts the output volume through the volume parameters. For specific details, please refer to the above and will not be discussed here. Repeat.
  • the tablet determines the audio change, that is, the output device is switched, which means that the output device is changed from the audio device of the tablet to the mobile phone.
  • 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).
  • the media manager will re-execute the volume parameter acquisition process after determining that the audio has changed. For example, the media manager may determine the volume parameter of audio A based on the input volume of audio A and the output volume range currently saved by the tablet. Next, the media manager obtains the output volume (data_out(A)) of audio A based on the input volume, volume parameters, and output volume parameters of audio A.
  • data_out(A) the output volume parameters of audio A.
  • the media manager of the tablet adds soft clock information to the output audio data of audio A.
  • the soft clock information is the time information after soft clock synchronization as described above.
  • the specific method of adding soft clock information may refer to existing technical embodiments, and will not be described in detail in this application.
  • the media manager of the tablet outputs the output audio data of audio A after adding the soft clock information to the Wi-Fi driver.
  • the output volume corresponding to the output audio data of audio A is (data_out(A)).
  • the Wi-Fi driver transmits the output audio data of audio A (clock information has been added and will not be repeated below) to the mobile phone.
  • the Wi-Fi driver of the mobile phone receives the output audio data of audio A.
  • the mobile phone's Wi-Fi driver outputs the output audio data of audio A to the media manager.
  • the audio data of audio A received by the media manager is the input audio data of audio A for the media manager.
  • the output audio data of audio A will still be described below and will not be replaced by the input audio data of audio A.
  • the mobile phone side plays the game audio through the speaker. After the mobile phone detects that the user is wearing headphones, it can be determined that the output device is switched to headphones, that is, the audio changes.
  • the mobile phone side also re-executes the output volume acquisition process described above for the audio that needs to be played on the mobile phone side. 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).
  • the media manager of the mobile phone can obtain the output volume of audio C.
  • the media manager of the mobile phone can determine the volume parameters 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.
  • the media manager obtains the output volume (data_out(C)) of audio C based on the input volume, volume parameters, and output volume parameters of audio C.
  • the mobile phone can perform 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 received tablet, and the output audio data of audio B sent by the TV to obtain the audio of the mixed audio. data.
  • Figure 19 is a schematic diagram of an exemplary mixing process. Please refer to Figure 19, which specifically includes:
  • the mobile phone can align audio A, audio B and audio C based on its own soft clock, as well as the received soft clock in audio A and the soft clock in audio B, so that audio A, audio B and The audio starting point of audio C is synchronized.
  • audio A, audio B and The audio starting point of audio C is synchronized.
  • the media manager of the mobile phone can calculate the time difference, sound level difference, phase difference and timbre difference between each audio based on the relative position information of each device (including mobile phone, TV and tablet), thereby realizing different devices The stereo effect of the audio mix.
  • the time difference may be the time difference between the sound reaching the user's two ears (it may also be played by two earphones).
  • the time difference reaches about 0.6ms, the user can feel that the sound comes entirely from one side. That is to say, by adjusting the time difference between the audio output by the two headphones, the user can perceive that the audio source is shifted in a certain direction.
  • the sound level difference is optionally such that the sound level on the side close to the sound source is larger and the sound level on the other side is smaller.
  • the sound level difference between the audio heard by the user's two ears can reach about 25dB.
  • the sound level difference between the two earphones can be adjusted, for example, the sound level of the audio in one channel of the earphones can be increased, while the sound level of the other audio channel remains unchanged or reduced, thereby This allows the user to perceive that the audio source is shifted in a certain direction.
  • the phase difference may be the phase difference between the audio signals received by the two earphones. It should be noted, Even if the sound level and time received by the two earphones are the same, adjusting the phase between the audio received by the two earphones can also make the user perceive that the audio source is shifted in a certain direction.
  • the timbre difference may be the difference in timbre (ie, frequency) between audio signals received by the two earphones.
  • timbre ie, frequency
  • the higher the frequency of the audio the greater the attenuation when it goes around the head and reaches the other ear.
  • the timbre of the audio received by the two earphones can be adjusted so that the user perceives that the source of the audio is shifted in a certain direction.
  • FIG. 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 shown in Figure 20, where each number is 4 bit, that is, 4 bits. Each sampling period is 16 bits, which occupies two grid lengths in Figure 20, that is, 16 bits. It should be noted that the audio data shown in Figure 20 is only a schematic example and is not limited in this application.
  • the media manager of the mobile phone can obtain the time difference of 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 adjust the time difference of the audio in the left and right channels to virtually
  • the relative position of the sound source in the user's hearing is determined, and the virtual sound source is shifted in a certain direction to approximate the relative position between the actual sound source (such as a tablet) and the mobile phone.
  • the tablet is in front and right of the earphones, and the angle between the tablet and the earphones is angle C.
  • the audio output to the left channel can be delayed by 3 sampling periods. That is to say, the starting point of the audio of the right channel differs from the starting point of the audio of the left channel by 3 sampling periods.
  • the right channel of the headset plays audio A first, and after 3 sampling periods, the left channel plays audio A, thereby realizing the time difference between the left channel and the right channel of audio A in the headset.
  • the sound source can be adjusted so that the user can auditorily perceive the sound source of audio A, that is, the virtual sound source is in front of the user's right, close to the tablet and earphones. actual position between.
  • the time difference adjustment principle of the audio between the TV and the mobile phone can also be referred to Figure 21b, and the description will not be repeated below.
  • the TV is directly in front of the earphones, that is, the angle between it and the earphones (ie, angle B) is 90 degrees.
  • the audio output by audio B to the left channel of the earphone is consistent with the audio output to the right channel of the earphone, so that the virtual sound source is directly in front of the user's auditory perception.
  • the mobile phone is in the left front of the earphone, and the angle between the mobile phone and the earphone is angle A.
  • the phone's media manager can delay the audio output to the right channel by 3 sampling periods. That is to say, the starting point of the audio of the left channel differs from the starting point of the audio of the right channel by 3 sampling periods.
  • the left channel of the headset plays audio C first, and after 3 sampling periods, the left channel plays audio C, thereby realizing the time difference between the left channel and the right channel of the headset of audio C. Since there is a time difference between the audio received by the left and right channels, the sound source can be adjusted so that the user can auditorily perceive the sound source of audio C, that is, the virtual sound source is in front and left of the user.
  • the time difference is adjusted based on the orientation information.
  • the media manager adjusts the audio delay of the left and right channels to realize the offset of the direction of the virtual sound source.
  • the relative position information corresponding to each device in the network may include distance distance information and/or angle information. If the relative position information includes distance information and angle information, the media manager of the central device (ie, the mobile phone) can further adjust each audio based on the distance information. For example, still taking the scenario shown in Figure 16 as an example, the media manager of the mobile phone can obtain the distance attenuation value of the audio C of the mobile phone based on the distance information between the mobile phone and the headset (ie, distance A).
  • D is the distance value between the device and the headset
  • D_min is the minimum distance value among the distance values between each device and the headset.
  • the distance value of the device with the smallest media manager distance is The distance is used as a benchmark to calculate the volume attenuation value of other devices. This calculation method is only an illustrative example and is not limited by this application.
  • the media manager may add the attenuation value corresponding to the distance information to the audio data of each audio before performing the steps shown in Figure 21a, or after performing the steps shown in Figure 21a.
  • the media manager before performing the steps shown in Figure 21a, can add the audio data of audio A shown in Figure 20 to the distance attenuation value corresponding to audio A, and the media manager can add the audio data of audio B to the audio data of audio A shown in Figure 20.
  • the distance attenuation value corresponding to audio B, and the media manager adds the audio data of audio C to the distance attenuation value corresponding to audio C.
  • the distance attenuation value corresponding to audio B is optionally 0.
  • the media manager may continue to execute the process in Figure 21a based on the obtained results 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.
  • the media manager can add the audio data of the left channel to the distance attenuation value corresponding to audio A to obtain the output audio data of the left channel, and the media manager can add the audio data of the right channel to The distance attenuation value corresponding to audio A is used 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 based on the processed results, continues to execute the process in Figure 22.
  • S1903 performs linear mixing of the two-channel audio data from multiple devices.
  • the media manager of the mobile phone superimposes the output audio data of audio A, the audio data of audio B, and the output audio data of audio C corresponding to the right channel to obtain a mix of the right channel. Audio. Furthermore, the media manager superimposes the output audio data of audio A, the output audio data of audio B, and the output audio data of audio C corresponding to the left channel to obtain the mixed audio of the left channel. Optionally, in order to prevent the superimposed audio data from overflowing, the media manager can average the superimposed audio data of the left and right channels to obtain the output audio data of the mixed audio of the left and right channels.
  • the corresponding output volume is data_out(X1).
  • the media manager can also adjust the timbre difference, phase difference, and/or sound level difference to achieve stereo sound effects. This application will not give examples one by one.
  • the method of delaying the sampling point to achieve the time difference in the embodiment of the present application is only an illustrative example.
  • the media manager can also obtain stereo sound effects based on the HRTF (Head-Related Transfer Function) algorithm, which is not limited in this application.
  • HRTF Head-Related Transfer Function
  • the media manager of the mobile phone obtains the output of the mixed audio of the left and right channels. After receiving the audio data, the media manager can adjust the volume parameters of the output volume of the mixed audio (data_out(X1)) to adjust the output volume of the mixed audio (data_out(X1)) to within the output volume range of the mobile phone.
  • the media manager can obtain the volume parameter of the audio of the left channel based on the output volume and output volume range of the audio of the left channel obtained in Figure 22.
  • the media manager multiplies the audio data of the left channel by the output volume parameter and volume parameter (that is, 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 optimize the output volume, adjust the output volume of the audio output from the left channel to within the output volume range.
  • the volume parameter corresponding to the audio of the right channel is the same as that of the left channel, and 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.
  • the corresponding output volume is data_out(X2) to optimize the output volume.
  • the audio output of the right channel is Adjust the output volume to within the output volume range. It should be noted that in other embodiments, only the audio data of the left and right channels can be multiplied by the volume parameter to adjust the output volume, which is not limited in this application.
  • the media manager outputs the obtained output audio data of the mixed audio (including the output audio data of the left channel and the right channel) to the Bluetooth driver.
  • 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 headphones through the Bluetooth connection.
  • the left channel of the headset plays the output audio data of the mixed audio corresponding to the left channel above (the audio data of the left channel shown in Figure 23), 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 above (the audio data of the right channel shown in Figure 23), and the corresponding playback volume is data_out (X2).
  • the mobile phone when the mobile phone mixes audio based on the obtained relative position information, the mobile phone always performs calculations based on the obtained relative position. That is to say, in this scenario, the position of the sound source represented by the stereo sound played by the headphones is optionally as shown in Figure 16, that is, the position of the sound source remains unchanged.
  • the relative position with the earphones can be periodically obtained, and the slave device can periodically (can be set based on actual needs, this application does not Send relative position information to the central device in a limited manner. After obtaining the relative position information, the mobile phone can mix the audio of each device based on the newly obtained relative position information.
  • the central device can adjust the mixing effect of the mixed audio based on the relative position information obtained in real time to adjust the relative position between each virtual sound source and the earphones. For example, when the user wears headphones and walks in the room, the mobile phone can adjust the attenuation value and time difference (or the timbre difference, etc.) of each audio corresponding to the left and right channels of the headphones based on the relative position conversion between each device and the headphones.
  • This application does not limit), thereby realizing virtual sound source position transformation, obtaining a more realistic stereo sound effect, and improving the user experience.
  • a control method is also provided to support the audio changing scene in the mixing scene played by multiple devices.
  • audio changes include but are not limited to: switching modes, switching devices, and switching audio sources.
  • the switching mode is optionally switching between a multi-device mixing mode and a single-device mode.
  • the switching device is optionally a switching of the audio source device in single device mode. Switching the sound source may optionally be switching 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.
  • Figure 24 is a schematic flowchart of a control method in an exemplary switching mode scenario. Please refer to Figure 24. It specifically includes:
  • the headset sends switching mode instruction information to the mobile phone.
  • the earphones in the embodiments of the present application can provide control schemes corresponding to the various switching functions described above.
  • the user can pinch the earphones to indicate the switching mode.
  • the user operation described in the embodiment of the present application can also be the user's voice input.
  • the user speaks a specified voice instruction to the earphone pickup device (such as a microphone).
  • the earphone can detect the user instruction and send it to the user.
  • the command is output to the mobile phone, and the mobile phone can recognize the voice command.
  • each user operation in the embodiment of this application is only a schematic example, and this application does not limit it, and the description will not be repeated below.
  • the headset can send switching mode instruction information to the central device (i.e., the mobile phone).
  • the current mode of the network is the mixing mode, that is, the mode shown in Figure 13a and Figure 13b, as an example.
  • the mobile phone receives the switching mode indication information and can determine to change the current mode. , that is, the mixing mode switches to single device mode.
  • the mobile phone receives the switching mode indication information and can determine to switch the current mode, that is, the single-device mode to the mixing mode.
  • the specific solution will be in steps S2404 to S2407. illustrate.
  • the user operations and gestures described in this application are only illustrative examples.
  • the user can tap the earphone to indicate switching modes, which is not limited by this application.
  • S2402a The mobile phone sends pause playback instruction information to the TV.
  • S2402b The mobile phone sends pause playback instruction information to the tablet.
  • the mobile phone can send pause play instruction information to the TV and the tablet respectively to instruct the TV and the tablet. Pause audio.
  • the TV and tablet stop transmitting audio data to the central device (i.e., the mobile phone), and the TV and tablet will not play audio on their own devices.
  • the mobile phone outputs audio C to the headset.
  • the mobile phone outputs the output audio data of audio C to the earphone.
  • the mobile phone can still make audio adjustments to the audio C of the mobile phone, such as the time difference adjustment of the audio of the left and right channels mentioned above, in order to simulate the real sound source direction.
  • 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 volume parameters can be obtained as described above and will not be described again here).
  • the media manager then adjusts the time difference of audio C in the left and right channels (it may also be a difference in timbre, etc., which is not limited in this application) and the output volume attenuation, etc. based on the relative position information of the mobile phone and the earphones.
  • the mobile phone when the mobile phone is in single-device mode, it does not need to adjust the audio source direction, that is, it can directly output the audio data according to the process in Figure 9a, that is, the audio data of the left and right channels played by the headphones and their corresponding
  • the output volume is the same and is not limited in this application.
  • the switched single device mode is the central device by default.
  • the user can also control the switching of audio source devices in single device mode through headphones or a central device (i.e., mobile phone). The specific implementation will be explained in Figure 25.
  • the headset outputs switching mode instruction information to the mobile phone.
  • the user can pinch the earphones again (it may also be other operations, which are not limited in this application) to indicate switching modes.
  • the headset sends a switching mode instruction message to the central device (i.e., the mobile phone). interest.
  • the mobile phone receives the switching mode instruction information and determines to switch the current mode, that is, the single device mode to the mixing mode.
  • the user controls through the earphone as an example. In other embodiments, the user can also control on the central device, which is not limited in this application.
  • the mobile phone sends continue play instruction information to the TV.
  • the mobile phone sends continue playback instruction information to the tablet.
  • the mobile phone determines to switch the single device mode to the mixing mode, it sends continue playback instruction information to the TV and tablet respectively to instruct the TV and tablet to continue transmitting the corresponding audio to the mobile phone.
  • the TV outputs audio B to the mobile phone.
  • the tablet outputs audio A to the mobile phone.
  • the TV performs resumption of transmission, that is, the TV continues to send the audio after the paused playback to the mobile phone.
  • the TV continues to send the audio after the paused playback to the mobile phone.
  • the mobile phone outputs mixed audio to the headset.
  • the mobile phone performs the mixing process described above based on the audio data of audio A corresponding to the phone, the received audio data of audio B of the TV, and the audio data of audio C of the tablet.
  • the audio data of audio A corresponding to the phone
  • the received audio data of audio B of the TV the received audio data of audio B of the TV
  • the audio data of audio C of the tablet please refer to the above. We will not go into details here.
  • Figure 25 is a schematic flowchart of a control method in an exemplary switching mode scenario. Please refer to Figure 25, which specifically includes:
  • the headset sends switching device instruction information to the mobile phone.
  • the headset responds to a received user operation (for example, tapping three times, etc., which is not limited in this application), and sends switching device instruction information to the mobile phone to instruct the switching of the audio source device.
  • a received user operation for example, tapping three times, etc., which is not limited in this application
  • the process in Figure 25 is implemented in single device mode. That is to say, the networking mode needs to be switched to single device mode before the process in Figure 25 can be implemented.
  • the optional default audio source device is the central device (i.e. mobile phone). The user can instruct the central device to switch the current audio source device to the specified devices, such as televisions.
  • S2502 The mobile phone sends continue play instruction information to the TV.
  • the mobile phone determines to switch the audio source device to the television. It should be noted that if the user controls through the headset, the mobile phone can respond to the received switching device instruction information and switch the audio source devices in sequence. The order may be based on the distance from the earphones, or may be based on other rule settings, which is not limited in this application. For example, after receiving the switching device instruction message, the mobile phone can switch the audio source device to the TV in sequence. If the mobile phone receives the device switching instruction message again, it can switch the audio source device to the tablet according to the sequence. Of course, the user can also control the audio source device to switch to a specified device on the mobile phone. This application does not limit this, and the description will not be repeated below.
  • the mobile phone will stop transmitting the mobile phone's audio to the headset in response to the received switching device instruction.
  • the tablet is still in the paused playback state.
  • both the TV and tablet will pause audio playback.
  • the mobile phone can send a continue play instruction to the TV to instruct the TV to play audio.
  • the TV outputs audio B to the mobile phone.
  • the TV continues to send audio B to the mobile phone in response to the received continue playing instruction information.
  • the audio B that the TV can output can be the audio after the moment when the playback is paused, that is, the playback is resumed after power outage. It may also be to re-output audio B, which is not limited in this application.
  • the mobile phone outputs audio B to the headset.
  • the mobile phone receives the audio data of audio B sent by the earphone, processes the audio data, and outputs the output audio data corresponding to audio B to the earphone.
  • the mobile phone can perform processing based on the cross-device transmission scheme in Figure 17.
  • the mobile phone can process audio B based on the mixing scheme. The processing method is similar to the description in S2403 and will not be described again here.
  • S2505 The headset sends switching device instruction information to the mobile phone.
  • the user can control the earphones multiple times to sequentially switch audio source devices in single device mode.
  • the headset sends switching device instruction information to the mobile phone in response to the received user operation.
  • S2506 The mobile phone sends pause playback instruction information to the TV.
  • S2507 The mobile phone sends continue playback instruction information to the tablet.
  • the tablet outputs audio A to the mobile phone.
  • the mobile phone determines that the audio source device needs to be switched from TV B to the tablet.
  • the mobile phone sends a pause playback instruction message to the TV to instruct TV B to pause audio playback.
  • the mobile phone sends continue playback instruction information to the tablet to instruct the tablet to continue playing audio.
  • the TV pauses audio playback, that is, it no longer transmits audio data to the mobile phone.
  • the tablet sends the paused audio data to the mobile phone.
  • the mobile phone outputs audio A to the headset.
  • Figure 26 is a schematic flowchart of a control method in an exemplary switching mode scenario. Please refer to Figure 26, which specifically includes:
  • the headset sends switching audio source instruction information to the mobile phone.
  • the headset receives a user operation (the user operation can be set according to actual needs, and is not limited in this application), and the user operation is used to instruct switching of sound sources.
  • the headset responds to the received user operation and sends audio source switching instruction information to the mobile phone.
  • S2602 The mobile phone sends audio source switching instruction information to the TV.
  • the mobile phone in response to the received audio source switching instruction information, sends the audio source switching instruction information to the TV.
  • the TV outputs audio D to the mobile phone.
  • the TV switches the output audio source, for example, switches audio A to audio D, and outputs audio data corresponding to audio D to the mobile phone.
  • the TV after the TV detects an audio change (ie, audio 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. Specific details can be found above and will not be repeated here. narrate.
  • the tablet outputs audio A to the mobile phone.
  • the TV switches the audio source, but the tablet does not receive the instruction to switch the audio source. Accordingly, the tablet continues to output audio data corresponding to audio A to the mobile phone.
  • the mobile phone outputs mixed audio to the headset.
  • the mobile phone will perform the mixing process described above. It should be noted that for mobile phones, it also detects audio source switching, that is, the audio source input by the TV is switched. Correspondingly, when mixing on the mobile phone, the volume parameter acquisition process also needs to be re-executed. After the mobile phone obtains the audio data of the mixed audio, it outputs the audio data to the headset, and the headset plays the audio data of the mixed audio.
  • audio source switching can also be implemented.
  • the principle is similar to that in Figure 26.
  • the central device also sends audio source switching instruction information to the current audio source device. It can be understood that this
  • the control information in the network in the application embodiment is all delivered by the central device to each slave device. For specific implementation, please refer to the above and will not be described again here.
  • the mobile phone in response to the received audio source switching instruction information, can send the audio source switching instruction information to each device in the network.
  • the specific implementation of switching audio sources between slave devices and mobile phones in the network is similar to that in Figure 26, and will not be described again here.
  • the audio change scenarios in the embodiments of the present application include audio source switching, output device switching, and audio source device switching (including audio source device switching in a multi-device collaboration scenario and audio source switching in a mixing scenario). device switching), etc.
  • audio source device switching including audio source device switching in a multi-device collaboration scenario and audio source switching in a mixing scenario.
  • device switching etc.
  • the audio played by the device will have a transition time of several seconds, causing the audio to be incoherent and affecting the user's audio-visual experience.
  • the embodiment of the present application also provides an audio change transition solution, which can make the transition smooth after the audio change and avoid the breakpoint problem caused by the audio change.
  • the mobile phone is still used as an audio output device as an example.
  • the mobile phone can use the Hanning window to implement the fade-in and fade-out of the audio switching.
  • the audio played by the mobile phone before switching the audio source is audio A
  • the audio played after the switching is audio B
  • 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 portion shown in the image).
  • the media manager sets the Hanning window, and the length of the Hanning window is the preset duration, such as 3s.
  • the Hanning window may include a first sub-window (ie, the first half) and a second sub-window (ie, 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 switched audio, that is, the audio data of the preset duration of 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 before switching, that is, the audio data of the preset duration of audio A based on the second sub-window, so that the output volume of the audio data of the fade-out part gradually decreases.
  • the media manager can multiply the audio data corresponding to the fade-in part of audio B by the first sub-window 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). And, the media manager multiplies the audio data corresponding to the fade-out part of audio A by the second sub-window of the Hanning window (ie, the second half of the window function) to obtain the audio data of the fade-out part.
  • the media manager can overlay the obtained fade-in audio data and fade-out audio data to obtain the audio data played by the audio change.
  • the media manager obtains the fade-out audio data of audio A and obtains the fade-in audio data of audio B in the manner described above.
  • the media manager can superimpose the fade-in audio data and the fade-out audio data to obtain the fade-in and fade-out audio data, thereby achieving a smooth transition of the audio while maintaining the original audio length.
  • the audio data transmitted by the media manager to the audio driver is the superimposed audio shown in Figure 27.
  • the fade-in and fade-out part the audio that the user hears is the fade-in and fade-out part, in which 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 is played, the audio data of audio B continues to be played.
  • the electronic device includes corresponding hardware and/or software modules that perform each function.
  • the present application can be implemented in the form of hardware or a combination of hardware and computer software.
  • FIG. 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, and optionally, a memory 2803.
  • bus 2804 which includes a power bus, a control bus, and a status signal bus in addition to a data bus.
  • bus 2804 various buses are referred to as bus 2804 in the figure.
  • the memory 2803 may be used for instructions in the foregoing method embodiments.
  • the processor 2801 can be used to execute instructions in the memory 2803, and control the receiving pin to receive signals, and control the transmitting pin to send signals.
  • the device 2800 may be the electronic device or a chip of the electronic device in the above method embodiment.
  • This embodiment also provides a computer storage medium that stores computer instructions.
  • the electronic device When the computer instructions are run on an electronic device, the electronic device causes the electronic device to execute the above related method steps to implement the method in the above embodiment.
  • This embodiment also provides a computer program product.
  • the computer program product When the computer program product is run on a computer, it causes the computer to perform the above related steps to implement the method in the above embodiment.
  • inventions of the present application also provide a device.
  • This device may be a chip, a component or a module.
  • the device may include a connected processor and a memory.
  • the memory is used to store computer execution instructions.
  • the processor can execute computer execution instructions stored in the memory, so that the chip executes the methods in each of the above method embodiments.
  • the electronic equipment, computer storage media, computer program products or chips provided in this embodiment are all used to execute the corresponding methods provided above. Therefore, the beneficial effects they can achieve can be referred to the corresponding methods provided above. The beneficial effects of the method will not be repeated here.

Landscapes

  • Engineering & Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Signal Processing (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Multimedia (AREA)
  • Theoretical Computer Science (AREA)
  • Environmental & Geological Engineering (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Health & Medical Sciences (AREA)
  • General Health & Medical Sciences (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Circuit For Audible Band Transducer (AREA)

Abstract

Les modes de réalisation selon la présente invention concernent un procédé de contrôle de volume et un dispositif électronique. Le procédé consiste : en ce qu'un dispositif électronique acquiert de premières données audio à lire, tel que le volume moyen des premières données audio pendant une durée prédéfinie est un premier volume ; lorsque le premier volume ne correspond pas à une première plage de volume de sortie, en ce que le dispositif électronique acquiert un paramètre de volume correspondant aux premières données audio, et corrige les premières données audio sur la base du paramètre de volume, afin d'obtenir de deuxièmes données audio dont le volume se trouve dans la première plage de volume de sortie ; et en ce que le dispositif électronique lit les deuxièmes données audio. Par conséquent, lorsque le dispositif électronique lit des données audio, un réglage automatique du volume est réalisé, de sorte que le volume des données audio est réglé pour se trouver dans une plage de volume de sortie, satisfaisant ainsi à l'exigence d'expérience auditive d'un utilisateur.
PCT/CN2023/083111 2022-03-28 2023-03-22 Procédé de contrôle de volume et dispositif électronique WO2023185589A1 (fr)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202210310062.7A CN116866472A (zh) 2022-03-28 2022-03-28 音量控制方法及电子设备
CN202210310062.7 2022-03-28

Publications (1)

Publication Number Publication Date
WO2023185589A1 true WO2023185589A1 (fr) 2023-10-05

Family

ID=88199196

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2023/083111 WO2023185589A1 (fr) 2022-03-28 2023-03-22 Procédé de contrôle de volume et dispositif électronique

Country Status (2)

Country Link
CN (1) CN116866472A (fr)
WO (1) WO2023185589A1 (fr)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170094215A1 (en) * 2015-09-24 2017-03-30 Samantha WESTERN Volume adjusting apparatus and method
CN109996143A (zh) * 2019-03-07 2019-07-09 上海蔚来汽车有限公司 音量调节方法、装置、系统及音频播放设备和车辆
CN111258532A (zh) * 2020-02-19 2020-06-09 西安闻泰电子科技有限公司 音量自适应调节方法、装置、存储介质及电子设备
CN113676595A (zh) * 2021-07-12 2021-11-19 杭州逗酷软件科技有限公司 音量调节方法、终端设备以及计算机可读存储介质
CN113824835A (zh) * 2021-10-25 2021-12-21 Oppo广东移动通信有限公司 音量控制方法及装置、电子设备及存储介质

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170094215A1 (en) * 2015-09-24 2017-03-30 Samantha WESTERN Volume adjusting apparatus and method
CN109996143A (zh) * 2019-03-07 2019-07-09 上海蔚来汽车有限公司 音量调节方法、装置、系统及音频播放设备和车辆
CN111258532A (zh) * 2020-02-19 2020-06-09 西安闻泰电子科技有限公司 音量自适应调节方法、装置、存储介质及电子设备
CN113676595A (zh) * 2021-07-12 2021-11-19 杭州逗酷软件科技有限公司 音量调节方法、终端设备以及计算机可读存储介质
CN113824835A (zh) * 2021-10-25 2021-12-21 Oppo广东移动通信有限公司 音量控制方法及装置、电子设备及存储介质

Also Published As

Publication number Publication date
CN116866472A (zh) 2023-10-10

Similar Documents

Publication Publication Date Title
US20100048133A1 (en) Audio data flow input/output method and system
WO2020253844A1 (fr) Procédé et dispositif permettant de traiter des informations multimédia, et support de stockage
WO2019090726A1 (fr) Procédé de sélection de dispositif bluetooth, terminal et système
WO2020132839A1 (fr) Procédé et dispositif de transmission de données audio appliqués à une commutation de modes monaural et binaural d'un écouteur tws
CN113890932A (zh) 一种音频控制方法、系统及电子设备
US10425758B2 (en) Apparatus and method for reproducing multi-sound channel contents using DLNA in mobile terminal
CN111770416B (zh) 扬声器控制方法、装置及电子设备
CN109379490B (zh) 音频播放方法、装置、电子设备及计算机可读介质
US20150117674A1 (en) Dynamic audio input filtering for multi-device systems
WO2020063065A1 (fr) Procédé et appreil de transmission audio, dispositif électronique et support de stockage
WO2024021736A1 (fr) Procédé, appareil et système de transmission pour paquet multimédia bluetooth, et dispositif
CN110830970A (zh) 蓝牙设备间的音频传输方法、装置、设备及存储介质
KR20170043319A (ko) 전자 장치 및 전자 장치의 오디오 출력 방법
WO2022213689A1 (fr) Procédé et dispositif pour une communication vocale entre des dispositifs audio
WO2023185589A1 (fr) Procédé de contrôle de volume et dispositif électronique
US11665271B2 (en) Controlling audio output
CN109155803B (zh) 音频数据处理方法、终端设备和存储介质
WO2022120782A1 (fr) Synchronisation de lecture multimédia
CN113395576A (zh) 一种场景切换方法、计算机设备和存储介质
CN113271385A (zh) 一种呼叫转移方法
WO2022002218A1 (fr) Procédé de commande audio, système et dispositif électronique
CN113613230B (zh) 一种扫描参数的确定方法及电子设备
US11689690B2 (en) Method and device for audio and video synchronization
CN116744215B (zh) 音频处理方法和装置
WO2024109399A1 (fr) Procédé et appareil de notification d'état

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 23777960

Country of ref document: EP

Kind code of ref document: A1