Volume adjustment method and device and storage medium
By comparing and adjusting the volume of the first electronic device with that of the second electronic device, the problem of the user being unable to adjust the volume of the second electronic device is solved, ensuring that the volume of the audio data output meets the user's needs and improving the user experience.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-26
- Publication Date
- 2026-04-03
AI Technical Summary
The user cannot adjust the volume of the second electronic device by operating the first electronic device, resulting in the output audio data volume still being insufficient to meet the user's needs even when the volume of the first electronic device is turned up to the maximum.
The first electronic device responds to the user's volume adjustment operation, compares the first volume with the second volume, and sends a volume adjustment event to the second electronic device when necessary. The second electronic device adjusts its volume according to the event and shares the adjusted audio data with the first electronic device. The first electronic device then makes further adjustments to output a volume that meets the user's needs.
This technology enables the simultaneous adjustment of the volume of a second electronic device by operating a first electronic device, thereby increasing the upper limit of the audio data output volume, meeting user needs, and improving the user experience.
Smart Images

Figure CN121785554A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of electronic technology, and in particular to a volume adjustment method, device and storage medium. Background Technology
[0002] Trust rings are a connectivity technology that connects various electronic devices, including mobile phones, tablets, personal computers (PCs), and televisions. This technology allows different electronic devices to establish connections, enabling cross-device information transmission and resource sharing, thus improving the convenience of data transmission and the user experience of multi-device collaboration.
[0003] Currently, a trust loop can be used to share audio data from a second electronic device to a first electronic device, which then outputs the audio data through its audio playback device. However, users can only adjust the volume of the first electronic device, not the second. If the volume of the audio data shared from the second device to the first is low, even if the volume of the first device is turned up to maximum, the final output audio volume may still be low, failing to meet the user's needs. Summary of the Invention
[0004] This application provides a volume adjustment method, device, and storage medium.
[0005] To achieve the above objectives, this application adopts the following technical solution:
[0006] Firstly, this application provides a volume adjustment method. When a second electronic device shares audio data of a third volume with a first electronic device, the first electronic device, in response to a user's volume adjustment operation, compares the magnitudes of a first volume and a second volume. The first volume is the volume of the first electronic device after the user adjusts the volume, and the second volume is the volume of the first electronic device before the user adjusts the volume. If it is determined that the first volume is greater than the second volume, the first electronic device sends a volume adjustment event to the second electronic device. The second electronic device adjusts the audio data of the third volume based on the volume adjustment event to obtain audio data of a fourth volume, and shares this fourth volume audio data with the first electronic device. The first electronic device obtains the fourth volume audio data shared by the second electronic device, adjusts the fourth volume audio data based on the first volume, and obtains audio data of a fifth volume. Thus, the first electronic device outputs the fifth volume audio data through an audio playback device.
[0007] The method provided in this application embodiment allows a user to synchronously adjust the shared third volume audio data of the second electronic device by operating the volume of the first electronic device when the second electronic device shares the third volume audio data with the first electronic device. The first electronic device processes the increased fourth volume audio data, effectively increasing the upper limit of the audio data output volume to meet user needs and improve user experience.
[0008] In one possible implementation, the process of the second electronic device adjusting the audio data of the third volume based on a volume adjustment event includes: the second electronic device responding to a volume adjustment event sent by the first electronic device and acquiring the third volume of the second electronic device; and, if the second electronic device determines that the third volume is less than a volume threshold, adjusting the audio data of the third volume to obtain the audio data of the fourth volume. In this embodiment, if the third volume is less than the volume threshold, it indicates that the volume data shared by the second electronic device to the first electronic device is low, and there is a situation where even turning the volume of the first electronic device to its maximum cannot meet the user's needs. Therefore, the second electronic device adjusts the audio data of the third volume based on the volume adjustment event when it determines that the third volume is less than the volume threshold.
[0009] In one possible implementation, when the second electronic device determines that the third volume is less than a volume threshold, it adjusts the audio data of the third volume to obtain the audio data of the fourth volume, including: when the second electronic device determines that the third volume is less than a volume threshold, it determines the difference between the first volume and the second volume based on a volume adjustment event; the second electronic device adjusts the audio data of the third volume based on the difference to obtain the audio data of the fourth volume.
[0010] In one possible implementation, the second electronic device adjusts the audio data of the third volume based on the difference to obtain the audio data of the fourth volume. This includes: the second electronic device converting the difference into a difference that matches the volume level of the second electronic device; and the second electronic device adjusting the audio data of the third volume based on the difference that matches the volume level of the second electronic device to obtain the audio data of the fourth volume. Since the volume levels of the first and second electronic devices may differ, to avoid the volume level differences between different electronic devices affecting the volume adjustment effect, this embodiment performs a volume level conversion, converting the difference into a difference that matches the volume level of the second electronic device.
[0011] In one possible implementation, the first electronic device, in response to a user's volume adjustment operation, compares the magnitudes of a first volume and a second volume, including: the multimedia framework of the first electronic device, in response to the user's volume adjustment operation, sending the first volume to the volume control module of the first electronic device; and the volume control module of the first electronic device comparing the magnitudes of the first volume and the second volume.
[0012] In one possible implementation, in response to a user's volume adjustment operation, after comparing the first volume with the second volume, the first electronic device further includes: if it is determined that the first volume is less than the second volume, the first electronic device adjusts the audio data of the third volume based on the first volume to obtain audio data of the sixth volume; the first electronic device outputs the audio data of the sixth volume through an audio playback device. In this embodiment, if the first volume is less than the second volume, it means that the user operates the first electronic device to turn down its volume. At this time, the volume adjustment range of the audio data output by the first electronic device meets the user's needs, and the third volume of the second electronic device does not need to be adjusted.
[0013] In one possible implementation, after sending a volume adjustment event to the second electronic device when it is determined that the first volume is greater than the second volume, the method further includes: the first electronic device acquiring audio data of a third volume shared by the second electronic device, wherein the third volume is greater than a volume threshold; the first electronic device adjusting the audio data of the third volume based on the first volume to obtain audio data of a sixth volume; and the first electronic device outputting the audio data of the sixth volume through an audio playback device. In this embodiment, when the second electronic device determines that the third volume is greater than the volume threshold, it indicates that the volume of the audio data currently shared by the second electronic device to the first electronic device is appropriate or high, and adjusting only the volume of the first electronic device itself is sufficient to make the volume of the output audio data meet the user's needs.
[0014] In one possible implementation, the first electronic device outputs audio data at a fifth volume level through an audio playback device, and further includes: a volume bar progress bar displayed in the user interface of the second electronic device and the volume bar progress bar displayed in the user interface of the first electronic device increasing simultaneously. In this embodiment, when the user adjusts the volume of the first electronic device, the volume of the second electronic device can be adjusted simultaneously, avoiding the situation where the volume of the output audio data is insufficient to meet the user's needs due to the shared audio data volume of the second electronic device being too low.
[0015] Secondly, this application provides an electronic device, the electronic device comprising: a processor and a memory; the memory is used to store program code and transmit the program code to the processor; the processor is used to execute the steps of a volume adjustment method as described above according to the instructions in the program code.
[0016] Thirdly, this application provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of a volume adjustment method as described above. Attached Figure Description
[0017] Figure 1 A schematic diagram of the user interface of an existing first electronic device;
[0018] Figure 2 A volume adjustment diagram provided for an embodiment of this application;
[0019] Figure 3 This is a schematic diagram illustrating the first application scenario provided in the embodiments of this application;
[0020] Figure 4 This is a schematic diagram illustrating a second application scenario provided in an embodiment of this application;
[0021] Figure 5 This is a schematic diagram illustrating a third application scenario provided in the embodiments of this application;
[0022] Figure 6 This is a schematic diagram illustrating the fourth application scenario provided in the embodiments of this application;
[0023] Figure 7 A timing diagram of the first volume adjustment method provided in the embodiments of this application;
[0024] Figure 8 A timing diagram for a second volume adjustment method provided in an embodiment of this application;
[0025] Figure 9 A timing diagram for a third volume adjustment method provided in an embodiment of this application;
[0026] Figure 10 An example diagram illustrating the composition of an electronic device provided in an embodiment of this application;
[0027] Figure 11 This is an example diagram of the software structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0028] The terms "first," "second," and "third," etc., used in this application specification, claims, and drawings are used to distinguish different objects, not to limit a specific order.
[0029] In the embodiments of this application, the terms "exemplary" or "for example" are used to indicate that something is an example, illustration, or description. Any embodiment or design that is described as "exemplary" or "for example" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or design. Specifically, the use of the terms "exemplary" or "for example" is intended to present the relevant concepts in a specific manner.
[0030] A trust loop can be used to share audio data from a second electronic device to a first electronic device, which then outputs the audio data through its audio playback device (e.g., a speaker). However, currently, the volumes of the interconnected first and second electronic devices are controlled separately. When a user adjusts the volume of the first electronic device that actually outputs the audio data, they can only change the volume of the first electronic device itself.
[0031] The actual audio data volume output by the audio playback device of the first electronic device is the product of the volume shared by the second electronic device to the first electronic device and the volume of the second electronic device itself. If the volume of the audio data shared by the second electronic device to the first electronic device is low, and operating the first electronic device only allows adjusting its own volume, even if the volume of the first electronic device is turned up to maximum, the final audio data volume output by the audio playback device of the first electronic device may still be very low and unable to meet the user's needs.
[0032] For example, if the volume shared by the second electronic device with the first electronic device is N, and the volume adjustment range of the second electronic device is 0-M, then the maximum volume of the audio data output by the audio playback device of the second electronic device can reach the product of the volume N of the second electronic device and the maximum volume M of the first electronic device. In this case, if N is very small, even if the volume of the first electronic device is turned up to the maximum, the volume output by the audio playback device of the first electronic device may still not meet the user's needs.
[0033] It is understandable that, for ease of description, the following description will use the first electronic device as the electronic device whose audio data is being shared, and the second electronic device as the electronic device that shares audio data with the first electronic device.
[0034] like Figure 1 As shown, the first electronic device is a tablet computer, and the second electronic device is a mobile phone. The user interface 1101 of the mobile phone is shared in the user interface 1102 of the tablet computer. In this case, the mobile phone can share audio data with the tablet computer. For example, music on the mobile phone can be played through the speaker of the tablet computer.
[0035] The phone's volume bar 1103 indicates the volume of the audio data shared by the phone to the tablet, while the tablet's volume bar 1104 indicates the tablet's own volume. Figure 1 In the image, the phone's volume bar 1103 is at a low level, indicating that the volume of the audio data shared by the phone to the tablet is low.
[0036] In this situation, even if the tablet's volume is turned up to maximum, such as Figure 1 The volume bar on the tablet is already at a relatively high level (1104), but the final audio output volume through the tablet's audio playback device may still be very low. This is because currently, adjusting the volume of the first electronic device can only amplify the volume shared by the second electronic device within the first device's own volume adjustment range. Figure 2 As shown.
[0037] Understandable Figure 2 The amplitude of each audio data point corresponds to the volume level; that is, the larger the amplitude, the louder the volume, and vice versa.
[0038] The initial volume of the audio data of the second electronic device is as follows: Figure 2 As shown in the first audio data 1201, turning down the volume of the first audio data 1201 yields the second audio data 1202, which has a smaller amplitude. The second electronic device shares the second audio data 1202 with the first electronic device, and the first electronic device receives the second audio data 1202 with the smaller amplitude. In this case, turning up the volume of the first electronic device to its maximum yields the third audio data 1203.
[0039] However, the actual volume of the audio data output by the speaker of the first electronic device is the product of the volume of the second audio data shared by the second electronic device and the volume of the first electronic device. If the volume of the second audio data is very low, even if the volume of the first electronic device is turned up to the maximum, the volume of the resulting third audio data may still be insufficient to meet the needs of human hearing, thus reducing the user experience.
[0040] Based on this, this application provides a volume adjustment method. A first electronic device, in response to a user's volume adjustment operation, compares the magnitudes of a first volume and a second volume. If it determines that the first volume is greater than the second volume, it sends a volume adjustment event to a second electronic device. The second electronic device adjusts its third volume based on this volume adjustment event to obtain audio data at a fourth volume, and shares this fourth volume audio data with the first electronic device. The first electronic device adjusts the fourth volume audio data based on the first volume to obtain audio data at a fifth volume, and outputs the fifth volume audio data through an audio playback device. In this application embodiment, by operating the first electronic device, the volume shared by the second electronic device to the first electronic device can be increased, and the fourth volume audio data after the increased volume can be adjusted, effectively increasing the upper limit of the audio data output by the first electronic device and improving the user experience.
[0041] under Figures 3-5 The volume adjustment application scenarios provided in the embodiments of this application are introduced.
[0042] Users connect multiple interconnected electronic devices to form a trust loop through the interconnection service. Within this trust loop, a user can share audio data from one electronic device to another. For ease of description, the electronic device whose audio data is shared is referred to as the first electronic device, and the electronic device sharing the audio data is referred to as the second electronic device.
[0043] Taking a tablet computer as the first electronic device and a mobile phone as the second electronic device as an example, the user interface 1301 of the mobile phone is shared with the user interface 1302 of the tablet computer. In this case, the mobile phone can share audio data with the tablet computer. For example, when a user clicks on the music application 1303 in the user interface 1301 of the mobile phone, music on the mobile phone can be played, and the music on the mobile phone can be output through the audio playback device of the tablet computer.
[0044] The audio playback device of the tablet computer may include, but is not limited to, speakers, wired headphones, Bluetooth audio devices, etc. Users can choose a suitable audio playback device to output audio data according to their actual needs. This application embodiment does not make specific limitations on this.
[0045] It is understood that the method provided in this application is not limited to the scenario of a second electronic device sharing music with a first electronic device. That is, the audio data may include, but is not limited to, audio data in online meetings, audio data in videos, audio data in voice communication, etc. This application does not make specific limitations on this.
[0046] In one example, a user increases the output of the tablet's audio playback device by adjusting the volume bar 1304 in the tablet's user interface 1302. In this case, the tablet's volume management module sends a volume adjustment event to the phone's volume management module based on the user's volume increase operation. This volume adjustment event can be a StreamType adjustment event. The phone's volume management module can determine that the user has increased the volume based on this volume adjustment event.
[0047] In one possible implementation, after receiving a volume adjustment event, the phone's volume management module obtains the phone's current volume. After obtaining the current volume, the volume management module compares it with a volume threshold. If the current volume is lower than the threshold, the volume management module increases the current volume and shares the increased audio data with the tablet.
[0048] The tablet's volume management module receives the audio data after the volume has been increased. Based on the user's volume adjustment, it processes this increased audio data to obtain adjusted audio data. This adjusted audio data can then be output through the tablet's audio playback device.
[0049] In this embodiment, when the volume of the tablet computer is increased, the current volume of the mobile phone can be increased simultaneously. The adjusted audio data output by the audio playback device of the tablet computer is obtained by amplifying the audio data after the volume is increased, thereby increasing the upper limit of the tablet computer's output volume and better meeting user needs.
[0050] like Figure 3 As shown, before the user increases the volume bar 1304 in the tablet's user interface 1302, the volume bar 1305 in the phone's user interface 1301 indicates that the phone's volume is below the volume threshold. In this situation, when the user increases the volume bar 1304 in the tablet's user interface 1302, the volume bar 1305 in the phone's user interface 1301 is also increased simultaneously, indicating that the volume of the audio data shared by the phone to the tablet has increased.
[0051] In one possible implementation, the phone's volume management module compares the current volume with a volume threshold. If it determines that the phone's current volume is greater than the volume threshold, then the phone's volume management module does not process the phone's current volume.
[0052] like Figure 4As shown, before the user increases the volume bar 1304 in the tablet user interface 1302, the volume bar 1305 in the phone user interface 1301 indicates that the phone's volume is higher than the volume threshold. In this case, while the user increases the volume bar 1304 in the tablet user interface 1302, the volume bar 1305 in the phone user interface 1301 remains unchanged.
[0053] In one example, a user reduces the audio playback output of the tablet computer by adjusting the volume bar 1304 in the tablet user interface 1302. In this case, the tablet's volume management module only reduces the volume of the tablet itself based on the user's volume reduction action.
[0054] like Figure 5 As shown, before the user reduces the volume bar 1304 in the tablet user interface 1302, the volume bar 1205 in the phone user interface 1301 indicates that the phone's volume is higher than the volume threshold. In this case, while the user reduces the volume bar 1304 in the tablet user interface 1302, the volume bar 1305 in the phone user interface 1301 remains unchanged.
[0055] In some embodiments, as the user decreases the volume bar 1304 in the tablet user interface 1302, the volume bar 1305 in the mobile phone user interface 1301 also decreases.
[0056] like Figure 6 As shown, before the user reduces the volume bar 1304 progress in the tablet user interface 1302, although the volume bar 1305 progress in the phone user interface 1301 shows that the phone's volume is below the volume threshold, the volume bar 1305 progress in the phone user interface 1301 remains unchanged when the user reduces the volume bar 1304 progress in the tablet user interface 1302.
[0057] In summary, in this embodiment of the application, when the user increases the volume of the first electronic device, if the volume shared by the second electronic device is less than the volume threshold, it means that the volume of the audio data currently shared by the second electronic device to the first electronic device is relatively low. Even if the volume of the first electronic device is turned up to the maximum, it may not be enough to meet the user's needs. Therefore, while increasing the volume of the first electronic device, the volume of the second electronic device is also increased so that the first electronic device can obtain the audio data after the volume is increased, and the audio data after the volume is increased is amplified to increase the upper limit of the tablet computer's output volume and meet the user's needs.
[0058] It should be noted that the above only refers to the first electronic device. Figures 3-6 The tablet computer on display is a second electronic device. Figures 3-6The mobile phone shown is an example. It can be understood that a tablet computer can also share audio data with a mobile phone. That is, the first electronic device is a mobile phone and the second electronic device is a tablet computer. The types of the first electronic device and the second electronic device are not specifically limited in this application embodiment. The above is just an example.
[0059] The following is combined Figure 7 This application provides a method for adjusting volume according to an embodiment.
[0060] S101, The volume management module of the first electronic device obtains the first volume sent by the multimedia framework of the first electronic device.
[0061] In this embodiment of the application, when the second electronic device shares audio data with the first electronic device, the volume management module of the first electronic device obtains the first volume sent by the multimedia framework of the first electronic device.
[0062] The first electronic device is the electronic device whose audio data is shared, for example, the first electronic device is... Figures 3-6 The tablet computer on display is a second electronic device that shares audio data; for example, the second electronic device is... Figures 3-6 The mobile phone on display. The volume management module can be implemented based on the Device Management Service Development Platform (DMSDP). The volume management module of the first electronic device can be used to adjust the volume of the first electronic device.
[0063] In one example, a volume management module based on the first electronic device can adjust the volume of the first electronic device. For instance, the first electronic device may have multiple volume levels, each corresponding to a different volume level. The volume management module based on the first electronic device can adjust the volume levels of the first electronic device to regulate its volume.
[0064] A multimedia framework is the basic architecture that supports the development and operation of multimedia applications. It provides a rich set of application programming interfaces (APIs) and tools, enabling developers to easily implement functions such as the acquisition, encoding, decoding, transmission, storage, and display of multimedia data such as audio, video, and images.
[0065] It is understood that the multimedia framework in this application embodiment is used to process audio data, and the multimedia framework may include an audio framework, a Windows multimedia framework, etc.
[0066] The application layer of the multimedia framework is responsible for media display, control, and interaction functions, such as media players and video editors, and is the interface layer that users can directly access. In this embodiment, based on the application layer of the multimedia framework, users can adjust the volume of the first electronic device by operating physical buttons, a touch screen interface, or a software interface.
[0067] In one possible implementation, such as Figures 3-4 As shown, the user turns up the volume of the first electronic device. In response to this operation, the multimedia framework of the first electronic device sends a first volume value to its volume management module. This first volume value is the adjusted volume, and the volume level can be represented by volume levels; a higher volume level means a louder volume.
[0068] For example, the volume level range of the first electronic device is 0-10. When the user adjusts the volume of the first electronic device to level 8, the multimedia framework of the first electronic device responds to the user's operation of adjusting the volume of the first electronic device to level 8 by sending a first volume to the volume management module of the first electronic device, which is level 8.
[0069] In another possible implementation, the volume management module of the first electronic device can detect the multimedia framework of the first electronic device in real time to obtain the current volume of the first electronic device and determine whether a volume adjustment event has occurred.
[0070] In this embodiment, the volume management module of the first electronic device can send a first volume acquisition request to the multimedia framework of the first electronic device in real time. Based on the first volume acquisition request, the multimedia framework of the first electronic device sends the current volume of the first electronic device to the volume management module of the first electronic device. Each time the volume management module of the first electronic device receives the current volume of the first electronic device, it can compare the current volume with the previously received volume to determine whether a volume adjustment event has occurred.
[0071] The volume management module of the first electronic device can send a first volume acquisition request to the multimedia framework of the first electronic device at preset time intervals. For example, the volume management module sends the first volume acquisition request to the multimedia framework of the first electronic device at a first moment, and the multimedia framework returns that the current volume of the first electronic device is level 3. The volume management module sends the first volume acquisition request to the multimedia framework of the first electronic device at a second moment, and the multimedia framework returns that the current volume of the first electronic device is level 3. The multimedia framework of the first electronic device determines that the volume of the first electronic device has not changed by comparing the current volume at the second moment and the first moment. The volume management module sends the first volume acquisition request to the multimedia framework of the first electronic device at a third moment, and the multimedia framework returns that the current volume of the first electronic device is level 4. The multimedia framework of the first electronic device determines that the volume of the first electronic device has increased by 1 level by comparing the current volume at the third moment and the current volume at the second moment. At this time, the volume management module of the first electronic device acquires a first volume level of 4.
[0072] S102, The volume management module of the first electronic device compares the size of the first volume with that of the second volume.
[0073] After obtaining the first volume, the volume management module of the first electronic device can determine that the volume of the first electronic device has changed. To determine whether the adjusted volume is greater than the original volume, the volume management module of the first electronic device compares the original volume with the adjusted volume.
[0074] For ease of subsequent description, in this embodiment, the adjusted volume is referred to as the first volume, and the volume before adjustment is referred to as the second volume.
[0075] Understandably, the volume management module of the first electronic device stores the volume at different times.
[0076] In one example, whenever a volume adjustment event occurs, the volume management module of the first electronic device stores the adjusted volume corresponding to the volume adjustment event and the timestamp of the volume adjustment event, and associates the adjusted volume corresponding to the volume adjustment event with the timestamp of the volume adjustment event.
[0077] In another example, the volume management module of the first electronic device can obtain the volume of the first electronic device in real time, as well as the corresponding timestamp.
[0078] In this embodiment of the application, after obtaining the first volume, the volume management module of the first electronic device can obtain the second volume based on the order of timestamps. The timestamp of the second volume is adjacent to the timestamp of the first volume and is earlier than the timestamp of the first volume.
[0079] If the volume management module of the first electronic device determines that the first volume is greater than the second volume, it indicates that the user has increased the volume of the second electronic device. In this case, the volume range achieved by adjusting the volume of the second electronic device may not meet the user's needs.
[0080] To avoid the situation where the volume of the audio data shared by the second electronic device to the first electronic device is too low, making it difficult to meet the user's needs even when the volume of the first electronic device is turned up to the maximum, S103 can be executed.
[0081] S103. When the volume management module of the first electronic device determines that the first volume is greater than the second volume, the volume management module of the first electronic device sends a volume adjustment event to the volume management module of the second electronic device.
[0082] This volume adjustment event indicates that the user has turned up the volume on the first electronic device. Upon receiving this volume adjustment event, the volume management module of the second electronic device can determine that the user has turned up the volume on the first electronic device.
[0083] In some embodiments, the first electronic device sends volume adjustment events to the volume management module of the second electronic device via a control channel based on a trust ring.
[0084] In other embodiments, the first electronic device may send volume adjustment events to the volume management module of the second electronic device via interconnection such as Bluetooth.
[0085] S104. The volume management module of the second electronic device obtains the third volume sent by the multimedia framework of the second electronic device.
[0086] In this embodiment, the second electronic device is an electronic device that shares audio data. When the first electronic device determines that the first volume is greater than the second volume, it sends a volume adjustment event to the second electronic device through a control channel. Based on the volume adjustment event sent by the first electronic device, the second electronic device can determine that a volume increase event has occurred, that is, the volume output by the first electronic device does not meet the user's needs, and the user increases the volume of the second electronic device through a volume adjustment operation.
[0087] In this scenario, the volume management module of the second electronic device obtains a third volume signal sent by the multimedia framework of the second electronic device. This third volume is the current volume of the second electronic device, and also the volume of the audio data shared with the first electronic device.
[0088] In one possible implementation, the volume management module of the second electronic device can send a second volume acquisition request to the multimedia framework of the second electronic device. Based on the second volume acquisition request, the multimedia framework of the second electronic device sends a third volume of the second electronic device to the volume management module of the second electronic device.
[0089] S105, The volume management module of the second electronic device determines whether the third volume is greater than the volume threshold.
[0090] S106. When the volume management module of the second electronic device determines that the third volume is less than the volume threshold, it adjusts the third volume to the fourth volume.
[0091] The fourth volume is greater than the third volume. When the volume management module of the second electronic device determines that the third volume is less than the volume threshold, it indicates that the volume of the audio data shared by the second electronic device to the first electronic device is low. When the shared volume of the second electronic device is low, even turning the volume of the first electronic device to its maximum may not be sufficient to meet the user's needs. Therefore, the volume management module of the second electronic device adjusts its volume to increase the volume of the audio data shared with the first electronic device.
[0092] It is understood that the volume threshold value is not specifically limited in the embodiments of this application, and can be set according to actual needs. For example, when the volume level range of the second electronic device is 0-10, the volume threshold can be set to any level in the range of 0-10, such as setting the volume threshold to level 6.
[0093] In one possible implementation, the volume management module of the second electronic device can adjust the third volume of the second electronic device based on the difference or ratio between the first and second volumes, so that the difference or ratio between the fourth and third volumes is the same as the difference or ratio between the first and second volumes. The difference or ratio between the first and second volumes can be determined based on a volume adjustment event sent by the volume management module of the first electronic device.
[0094] For example, if the difference between the first volume and the second volume is 1 level, the third volume can be increased by one level to obtain the fourth volume; or, if the ratio between the first volume and the second volume is 2, the third volume can be increased by two times to obtain the fourth volume.
[0095] In one possible implementation, the volume levels of the first and second electronic devices differ. For example, the first electronic device uses a Windows system, while the second uses an Android system, resulting in different volume levels. In this case, it is necessary to convert the volume level of the first electronic device to the volume level of the second electronic device, and then adjust the third volume based on the converted volume level of the first electronic device.
[0096] For example, Windows systems have volume levels from 0 to 100, while Android systems have volume levels from 0 to 10. Converting Windows volume levels to Android volume levels, such as Windows volume level 10 corresponding to Android volume level 1, allows you to increase the third volume by one level when the difference between the first and second volume levels is 10 levels.
[0097] In one possible implementation, if the volume management module of the second electronic device determines that the third volume is less than the volume threshold, the third volume of the second electronic device can be increased by a preset level.
[0098] It is understood that the preset level is not specifically limited in the embodiments of this application, and can be set according to actual needs. Taking a preset level of 1 as an example, the level range of the second electronic device is 0-10, and the volume threshold is 6 levels. If the third volume is level 3, the volume management module of the second electronic device determines that the third volume is less than the volume threshold, and at this time, the volume management module of the second electronic device can adjust the volume of the second electronic device from level 3 to level 4. Among them, the fourth volume is level 4.
[0099] In one possible implementation, if the volume management module of the second electronic device determines that the third volume is less than the volume threshold, the volume of the second audio data can be adjusted based on the difference between the third volume and the volume threshold.
[0100] The step of adjusting the volume of the second audio data based on the difference between the third volume and the volume threshold includes steps 61-63.
[0101] Step 61: The volume management module of the second electronic device determines whether the difference between the third volume and the volume threshold is greater than the difference threshold.
[0102] If the volume management module of the second electronic device determines that the difference between the third volume and the volume threshold is greater than the difference threshold, step 62 can be executed; otherwise, step 63 can be executed.
[0103] Step 62: The volume management module of the second electronic device increases the third volume of the second audio data by n levels.
[0104] Step 63: The volume management module of the second electronic device increases the third volume of the second audio data by m levels.
[0105] Where n and m are positive numbers, and m is less than n.
[0106] It is understood that the present application does not impose specific limitations on the size of the difference threshold or the specific values of m and n, which can be set according to actual needs.
[0107] For example, if the level range of the second electronic device is 0-10, the volume threshold is 6, the difference threshold is 3, m is 1, and n is 2, if the third volume is 3, the volume management module of the second electronic device determines that the difference between the third volume and the volume threshold is 3, which is equal to the difference threshold, and then increases the third volume by one level, that is, increases the third volume from level 3 to level 4.
[0108] If the third volume is level 1, the volume management module of the second electronic device determines that the difference between the third volume and the volume threshold is 5 levels. If the difference is greater than the threshold, the third volume will be increased by two levels, that is, the third volume will be increased from level 1 to level 3.
[0109] S107. The volume management module of the second electronic device shares the audio data of the fourth volume with the volume management module of the first electronic device.
[0110] In some application scenarios, when a second electronic device shares third audio data with a first electronic device, the user performs actions such as... Figures 3-4 The volume adjustment operation shown increases the volume of the first electronic device, and the first electronic device executes S101-S103. The second electronic device executes S104-S106 while sharing the third audio data with the first electronic device. Then, the second electronic device executes S107 to share the fourth volume audio data with the volume management module of the first electronic device.
[0111] S108. The volume management module of the first electronic device processes the audio data of the fourth volume based on the first volume to obtain the audio data of the fifth volume.
[0112] In this embodiment of the application, the volume management module of the first electronic device multiplies the audio data of the first volume and the fourth volume to obtain the audio data of the fifth volume.
[0113] S109. The volume management module of the first electronic device sends the audio data of the fifth volume to the audio playback device of the first electronic device.
[0114] S110, The audio playback device of the first electronic device outputs audio data at a fifth volume.
[0115] In this embodiment, when a volume adjustment event occurs, if the third volume of the second electronic device is less than a volume threshold, the volume of the second electronic device can be increased simultaneously with the volume of the first electronic device itself. That is, the audio data of the fifth volume in this embodiment is obtained by simultaneously increasing the volume of the first electronic device itself and the volume shared by the second electronic device with the first electronic device. In this embodiment, by operating the first electronic device, the volume shared by the second electronic device with the first electronic device can be increased, and the audio data of the fourth volume after the volume increase can be adjusted, effectively increasing the upper limit of the audio data output by the first electronic device and improving the user experience.
[0116] like Figure 8 As shown, after the first electronic device executes S101-S102, it executes... Figure 8 S201-S203. After comparing the first volume with the second volume, the volume management module of the first electronic device determines that the first volume is less than the second volume, and then executes S201.
[0117] S201. When the volume management module of the first electronic device determines that the first volume is less than the second volume, the volume management module of the first electronic device processes the audio data of the third volume based on the first volume to obtain the volume data of the sixth volume.
[0118] If the volume management module of the first electronic device determines that the first volume is lower than the second volume, it indicates that the user has turned down the volume of the second electronic device. In this case, the user can adjust the volume of the second electronic device to meet their needs without needing to adjust the volume of the first electronic device simultaneously.
[0119] In some embodiments, if the volume management module of the first electronic device determines that the first volume is less than the second volume, the volume management module of the first electronic device may not send the volume adjustment event in S103 to the second electronic device.
[0120] In other embodiments, if the volume management module of the first electronic device determines that the first volume is lower than the second volume, the volume management module of the first electronic device may send a volume adjustment event to the second electronic device, but the second electronic device does not respond to the volume adjustment event in S103. Therefore, the second electronic device does not adjust the third volume and continues to share the audio data of the third volume with the first electronic device.
[0121] In this embodiment of the application, the volume management module of the first electronic device multiplies the audio data of the first volume and the third volume to obtain the audio data of the sixth volume.
[0122] S202, The volume management module of the first electronic device sends the audio data of the sixth volume to the audio playback device of the first electronic device.
[0123] S203, The audio playback device of the first electronic device outputs audio data at a sixth volume.
[0124] In summary, in this embodiment of the application, when the volume of the first electronic device is turned down, there is no need to adjust the volume of the first electronic device.
[0125] In some embodiments, the user performs, such as Figures 5-6 When the volume of the first electronic device is reduced as shown, the volume of the second electronic device can also be reduced synchronously. The specific method is the same as S103-S110 above, and will not be repeated here.
[0126] like Figure 9 As shown, after the first electronic device and the second electronic device execute S101-S105, they execute... Figure 9 S301-S304. After comparing the third volume with the volume threshold, the volume management module of the second electronic device can execute S301 if it determines that the third volume is greater than or equal to the volume threshold.
[0127] S301. When the volume management module of the second electronic device determines that the third volume is greater than or equal to the volume threshold, it does not adjust the third volume.
[0128] S302, The volume management module of the second electronic device shares the audio data of the third volume with the volume management module of the first electronic device.
[0129] If the third volume is greater than or equal to the volume threshold, it indicates that the current volume of the second electronic device is appropriate or high, and adjusting the volume of the second electronic device itself can meet the user's needs. In this case, there is no need to adjust the third volume, and the volume management module of the second electronic device can continue to share the audio data of the third volume with the first electronic device.
[0130] S303, The volume management module of the first electronic device processes the audio data of the third volume based on the first volume to obtain the volume data of the sixth volume.
[0131] S304. The volume management module of the first electronic device sends the volume data of the sixth volume to the audio playback device of the first electronic device.
[0132] S305, The audio playback device of the first electronic device outputs audio data at a sixth volume.
[0133] It is understandable that S303-S305 are similar to S201-S203 mentioned above, and will not be described again here.
[0134] In summary, during the process of the second electronic device sharing volume data with the first electronic device in this embodiment of the application, if the user increases the volume of the first electronic device, and the current volume of the second electronic device is greater than or equal to the volume threshold, then there is no need to adjust the volume of the second electronic device.
[0135] In this application embodiment, the first electronic device and the second electronic device can be mobile phones, tablets, desktops, laptops, notebook computers, ultra-mobile personal computers (UMPCs), handheld computers, netbooks, personal digital assistants (PDAs), wearable electronic devices, smartwatches, etc. This application does not impose any special restrictions on the specific form of the aforementioned electronic devices. In this embodiment, the structure of the electronic device can be as follows: Figure 10 As shown, Figure 10 This is a component example diagram of an electronic device provided in an embodiment of this application.
[0136] Electronic devices may include a processor 110, an external memory interface 120, an internal memory 121, an audio module 130, a speaker 130A, a headphone jack 130B, a display screen 140, etc.
[0137] It is understood that the structure illustrated in this embodiment does not constitute a specific limitation on the electronic device. In other embodiments, the electronic device may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0138] Processor 110 may include one or more processing units, such as application processors (APs), modem processors, graphics processing units (GPUs), image signal processors (ISPs), controllers, video codecs, digital signal processors (DSPs), baseband processors, and / or neural network processing units (NPUs). These different processing units may be independent devices or integrated into one or more processors.
[0139] In this embodiment, the processor 110 of the first electronic device can compare the size of the first volume and the second volume in response to the user's volume adjustment operation; if it is determined that the first volume is greater than the second volume, it sends a volume adjustment event to the second electronic device; the second electronic device is an electronic device that shares audio data with the first electronic device; the first electronic device obtains the audio data of the fourth volume shared by the second electronic device, adjusts the audio data of the fourth volume based on the first volume to obtain the audio data of the fifth volume, and outputs the audio data of the fifth volume through an audio playback device.
[0140] Electronic devices implement display functions through a GPU, a display screen 140, and an application processor. The GPU is a microprocessor for image processing, connecting the display screen 140 and the application processor. The GPU performs mathematical and geometric calculations and is used for graphics rendering. The processor 110 may include one or more GPUs, which execute program instructions to generate or modify display information.
[0141] The display screen 140 is used to display images, videos, etc. In some embodiments, the electronic device may include one or N display screens 140, where N is a positive integer greater than 1.
[0142] The external storage 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. The external memory card communicates with the processor 110 through the external storage interface 120 to perform data storage functions. For example, music, video, and other files can be saved on the external memory card.
[0143] Internal memory 121 can be used to store computer executable program code, which includes instructions. Processor 110 executes various functional applications and data processing of the electronic device by running the instructions stored in internal memory 121.
[0144] Electronic devices can implement audio functions, such as music playback and recording, through audio module 130, speaker 130A, headphone jack 130B, and application processor.
[0145] The audio module 130 is used to convert digital audio information into analog audio signals for output, and also to convert analog audio input into digital audio signals. The audio module 130 can also be used for encoding and decoding audio signals. In some embodiments, the audio module 130 may be located in the processor 110, or some functional modules of the audio module 130 may be located in the processor 110.
[0146] The speaker 130A, also known as a "loudspeaker," is used to convert audio electrical signals into sound signals. Electronic devices can listen to music or make hands-free calls through the speaker 130A.
[0147] The headphone jack 130B is used to connect wired headphones. The headphone jack 130B can be a USB 130 interface or a 3.5mm Open Mobile Terminal Platform (OMTP) standard interface, a CTIA (Cellular Telecommunications Industry Association of the USA) standard interface.
[0148] In addition, an operating system runs on top of the aforementioned components. Examples include Apple's iOS operating system, Google's Android open-source operating system, and Microsoft's Windows operating system. Applications can be installed and run on this operating system. The operating system of an electronic device can adopt a layered architecture, event-driven architecture, microkernel architecture, microservices architecture, or cloud architecture. This application uses the layered architecture of the Android system as an example to exemplify the software structure of the electronic device.
[0149] Figure 11 This is an example diagram of the software structure of an electronic device provided in an embodiment of this application.
[0150] A layered architecture divides software into several layers, each with a clear role and function. Layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers, from top to bottom: the application layer, the application framework layer, the Android runtime and system libraries, and the kernel layer.
[0151] The application layer can include a series of application packages. For example... Figure 11 As shown, the application package can include applications such as music and Bluetooth.
[0152] The application framework layer provides application programming interfaces (APIs) and a programming framework for applications in the application layer. The application framework layer includes some predefined functions. For example... Figure 11 As shown, the application framework layer may include a multimedia framework and a volume management module. The volume management modules of the first electronic device and the second electronic device can be used to execute S101-S108, S201, and S301-S303 as described above.
[0153] The Android Runtime consists of core libraries and a virtual machine. The Android runtime is responsible for the scheduling and management of the Android system.
[0154] The core library consists of two parts: one part is the functionalities that need to be called by the Java language, and the other part is the Android core library.
[0155] The application layer and application framework layer run in a virtual machine. The virtual machine executes the Java files of the application layer and application framework layer as binary files. The virtual machine is used to perform functions such as object lifecycle management, stack management, thread management, security and exception management, and garbage collection.
[0156] A system library can include multiple functional modules. For example, media libraries, 3D graphics processing libraries (e.g., OpenGL ES), 2D graphics engines (e.g., SGL), etc.
[0157] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.
[0158] A 2D graphics engine is a graphics engine for 2D drawing.
[0159] The kernel layer is the layer between hardware and software. The kernel layer contains at least a display driver and an audio driver. The audio driver is used to output audio data.
[0160] It should be noted that although the embodiments of this application are illustrated using the Android system as an example, the basic principles are also applicable to electronic devices based on operating systems such as iOS and Windows.
[0161] This embodiment also provides a computer-readable storage medium including instructions that, when executed on an electronic device, cause the electronic device to perform the aforementioned method steps to implement the method described in the above embodiment.
[0162] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any changes or substitutions within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A volume adjustment method, characterized in that, The second electronic device shares audio data of a third volume with the first electronic device, including: In response to a user's volume adjustment operation, the first electronic device compares the magnitudes of a first volume and a second volume; the first volume is the volume of the first electronic device after the user adjusts the volume, and the second volume is the volume of the first electronic device before the user adjusts the volume; If it is determined that the first volume is greater than the second volume, a volume adjustment event is sent to the second electronic device; The first electronic device acquires audio data of a fourth volume shared by the second electronic device; the audio data of the fourth volume is obtained by the second electronic device adjusting the audio data of the third volume based on the volume adjustment event; the audio data of the third volume is the audio data shared by the second electronic device to the first electronic device before the user adjusts the volume. The first electronic device adjusts the audio data of the fourth volume based on the first volume to obtain the audio data of the fifth volume; The first electronic device outputs the audio data of the fifth volume through an audio playback device.
2. The method according to claim 1, characterized in that, The process by which the second electronic device adjusts the audio data of the third volume based on the volume adjustment event includes: The second electronic device responds to the volume adjustment event sent by the first electronic device and obtains the third volume of the second electronic device; When the second electronic device determines that the third volume is less than the volume threshold, it adjusts the audio data of the third volume to obtain the audio data of the fourth volume.
3. The method according to claim 2, characterized in that, When the second electronic device determines that the third volume is less than a volume threshold, it adjusts the audio data of the third volume to obtain the audio data of the fourth volume, including: If the second electronic device determines that the third volume is less than the volume threshold, it determines the difference between the first volume and the second volume based on the volume adjustment event; The second electronic device adjusts the audio data of the third volume based on the difference to obtain the audio data of the fourth volume.
4. The method according to claim 3, characterized in that, The second electronic device adjusts the audio data of the third volume based on the difference to obtain the audio data of the fourth volume, including: The second electronic device converts the difference into a difference that matches the volume level of the second electronic device; The second electronic device adjusts the audio data of the third volume based on the difference that matches the volume level of the second electronic device to obtain the audio data of the fourth volume.
5. The method according to claim 1, characterized in that, The first electronic device, in response to a user's volume adjustment operation, compares the levels of a first volume and a second volume, including: In response to a user's volume adjustment operation, the multimedia framework of the first electronic device sends a first volume to the volume control module of the first electronic device; The volume control module of the first electronic device compares the first volume with the second volume.
6. The method according to any one of claims 1-5, characterized in that, In response to a user's volume adjustment operation, the first electronic device, after comparing the levels of a first volume and a second volume, further includes: If it is determined that the first volume is less than the second volume, the first electronic device adjusts the audio data of the third volume based on the first volume to obtain the audio data of the sixth volume; The first electronic device outputs the audio data of the sixth volume through an audio playback device.
7. The method according to any one of claims 1-5, characterized in that, After determining that the first volume is greater than the second volume, the method of sending a volume adjustment event to the second electronic device further includes: The first electronic device acquires audio data of a third volume shared by the second electronic device, wherein the third volume is greater than a volume threshold; The first electronic device adjusts the audio data of the third volume based on the first volume to obtain the audio data of the sixth volume; The first electronic device outputs the audio data of the sixth volume through an audio playback device.
8. The method according to any one of claims 1-5, characterized in that, The first electronic device outputs the audio data of the fifth volume through an audio playback device, and further includes: The volume progress displayed in the second electronic device's user interface and the volume progress displayed in the first electronic device's user interface both increase simultaneously.
9. An electronic device, characterized in that, The electronic device includes: a processor and a memory; The memory is used to store program code and transmit the program code to the processor; The processor is configured to execute the steps of a volume adjustment method as described in any one of claims 1-8 according to instructions in the program code.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps of a volume adjustment method as described in any one of claims 1-8.