Volume display method and device, equipment and storage medium
By analyzing audio signals and environmental noise, combining user preference models, and using multi-factor fusion and weight allocation mechanisms, the problem of insufficient volume display of traditional audio equipment is solved, and a more accurate and personalized volume display is achieved.
Patent Information
- Application Number
- CN202410959848.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-17
- Publication Date
- 2024-12-17
AI Technical Summary
The fixed volume meter display of traditional audio devices cannot adapt to the dynamic range differences of different audio contents, cannot consider the impact of environmental noise, and cannot meet personalized user preferences, resulting in low accuracy of volume display.
By obtaining audio signals, ambient noise and initial volume settings, analyzing audio types and dynamic ranges, calculating comprehensive volume values in combination with user preference models, and mapping to update the user interface display results, a multi-factor fusion and weight allocation mechanism is adopted.
It improves the accuracy and reliability of volume display, can more accurately reflect audio content and user needs, and adapt to different environments and preferences.
Smart Images

Figure CN119148965A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of audio processing technology, and in particular to a volume display method, device, equipment and storage medium. Background Art
[0002] Traditional audio devices usually use a fixed standard to display the real-time volume level, which reflects the level of the audio signal. In early analog audio devices, this fixed volume meter display method performed well, but with the development of digital audio technology and the popularization of smart devices, its limitations have become increasingly prominent. The fixed volume meter display cannot adapt to the dynamic range differences of different audio content, resulting in the volume display being not accurate enough or not reflecting the real listening experience in some cases. At the same time, it also fails to take into account the impact of ambient noise, which may cause the volume display to be inconsistent with the actual perception in different environments. In addition, different users have different preferences for volume display, and fixed volume meters are difficult to meet personalized display needs. Therefore, the traditional fixed volume meter display method is difficult to fully adapt to existing audio content and user needs, resulting in low accuracy of volume display. Summary of the invention
[0003] The main purpose of the present invention is to solve the problem that the traditional fixed volume meter display mode is difficult to fully adapt to the existing audio content and user needs, resulting in low accuracy of volume display.
[0004] A first aspect of the present invention provides a volume display method, comprising: acquiring an audio signal, ambient noise and an initial volume display setting of an audio device; analyzing the audio signal to obtain an audio type and a first volume value; inputting the audio type, the ambient noise and the initial volume display setting into a preset user preference model to obtain a second volume value; calculating a noise level of the ambient noise, and determining a third volume value based on the noise level; assigning corresponding weights to the first volume value, the second volume value and the third volume value; calculating a comprehensive volume value based on the first volume value, the second volume value and the third volume value and the corresponding weights; and mapping the comprehensive volume value to obtain a display result of the comprehensive volume value on a user interface.
[0005] In a feasible implementation manner, the analyzing based on the audio signal to obtain the audio type and the first volume value includes: inputting the audio signal into a preset audio classification model to obtain the audio type corresponding to the audio signal; calculating the dynamic range of the audio signal; performing spectrum analysis on the audio signal to obtain a spectrum analysis result; and determining the first volume value based on the dynamic range and the spectrum analysis result.
[0006] In a feasible implementation manner, the calculating the dynamic range of the audio signal includes: calculating a peak level and a root mean square level of the audio signal; and calculating a difference between the peak level and the root mean square level to obtain the dynamic range of the audio signal.
[0007] In a feasible implementation, performing spectrum analysis on the audio signal to obtain spectrum analysis results includes: calculating the energy of each frequency band in the audio signal; weighting the energy of each frequency band; and calculating the total spectrum energy based on the energy of each frequency band and the allocated weight.
[0008] In a feasible implementation manner, determining the first volume value based on the dynamic range and the spectrum analysis result includes: standardizing the dynamic range to obtain a target dynamic range; and calculating the first volume value based on the sum of the spectrum energy, the target dynamic range and a preset adjustment coefficient.
[0009] In a feasible implementation manner, the calculating the noise level of the ambient noise and determining the third volume value based on the noise level includes: calculating the short-time RMS value of the ambient noise; calculating the average value of the short-time RMS value to obtain the noise level; and querying the corresponding third volume value through a preset mapping relationship according to the noise level.
[0010] In a feasible implementation, calculating the comprehensive volume value based on the first volume value, the second volume value, the third volume value and the corresponding weights includes: respectively calculating the products of the first volume value, the second volume value and the third volume value and the corresponding weights, and adding the calculation results to obtain the comprehensive volume value.
[0011] In a feasible implementation manner, before obtaining the audio signal, ambient noise and initial volume display setting of the audio device, it also includes: obtaining a historical usage record of the audio device, the historical usage record including a historical audio type, a historical ambient noise level, a historical initial volume display setting and a historical final volume; using the historical audio type, the historical ambient noise level and the historical initial volume display setting as input and the historical final volume display as output, training a preset learning model to obtain a user preference model.
[0012] In a feasible implementation manner, before obtaining the audio signal, audio type, ambient noise and initial volume display setting of the audio device, it also includes: constructing volume standard curves for different audio types, and creating a lookup table based on the volume standard curve.
[0013] In a feasible implementation, mapping the integrated volume value to obtain a display result of the integrated volume value on the user interface includes: searching for a mapping entry corresponding to the integrated volume value in the lookup table to obtain a volume display value; and updating a volume display element on the user interface based on the volume display value.
[0014] In a feasible implementation manner, after mapping the comprehensive volume value to obtain the display result of the comprehensive volume value on the user interface, it also includes: when a standard modification instruction is received, converting the display standard through a preset standard conversion matrix dictionary; real-time monitoring of the performance indicators of the device, and adjusting the refresh rate of the volume display according to the changes in the performance indicators.
[0015] In a feasible implementation, the converting of the display standard through a preset standard conversion matrix dictionary includes: parsing the standard modification instruction to extract the original display standard and the target display standard; searching for a corresponding conversion matrix in a preset standard conversion matrix dictionary based on the original display standard and the target display standard; and converting the current display data according to the target display standard based on the conversion matrix so that the display data is displayed under the target display standard.
[0016] A second aspect of the present invention provides a volume display device, comprising: a first acquisition module, used to acquire an audio signal, environmental noise and an initial volume display setting of an audio device; an analysis module, used to analyze based on the audio signal to obtain an audio type and a first volume value; a processing module, used to input the audio type, the environmental noise and the initial volume display setting into a preset user preference model to obtain a second volume value; a first calculation module, used to calculate the noise level of the environmental noise and determine a third volume value based on the noise level; an allocation module, used to allocate corresponding weights to the first volume value, the second volume value and the third volume value; a second calculation module, used to calculate a comprehensive volume value based on the first volume value, the second volume value and the third volume value and the corresponding weights; and a mapping module, used to map the comprehensive volume value to obtain a display result of the comprehensive volume value on a user interface.
[0017] In a feasible implementation, the analysis module includes: an input unit, used to input the audio signal into a preset audio classification model to obtain an audio type corresponding to the audio signal; a calculation unit, used to calculate the dynamic range of the audio signal; an analysis unit, used to perform spectral analysis on the audio signal to obtain a spectral analysis result; and a determination unit, used to determine a first volume value based on the dynamic range and the spectral analysis result.
[0018] In a feasible implementation manner, the calculation unit is specifically used to: calculate a peak level and a root mean square level of the audio signal; and calculate a difference between the peak level and the root mean square level to obtain a dynamic range of the audio signal.
[0019] In a feasible implementation, the analysis unit is specifically used to: calculate the energy of each frequency band in the audio signal; assign weights to the energy of each frequency band; and calculate the total spectrum energy based on the energy of each frequency band and the assigned weights.
[0020] In a feasible implementation manner, the determination unit is specifically configured to: standardize the dynamic range to obtain a target dynamic range; and calculate a first volume value based on the total spectral energy, the target dynamic range, and a preset adjustment coefficient.
[0021] In a feasible implementation, the processing module is specifically used to: calculate the short-time RMS value of the ambient noise; calculate the average value of the short-time RMS value to obtain the noise level; and query the corresponding third volume value through a preset mapping relationship based on the noise level.
[0022] In a feasible implementation manner, the second calculation module is specifically used to: respectively calculate the products of the first volume value, the second volume value and the third volume value with corresponding weights, and add the calculation results to obtain a comprehensive volume value.
[0023] In a feasible implementation manner, the volume display device further includes: a second acquisition module, used to acquire a historical usage record of the audio device, wherein the historical usage record includes a historical audio type, a historical environmental noise level, a historical initial volume display setting, and a historical final volume; and a training module, used to train a preset learning model using the historical audio type, the historical environmental noise level, and the historical initial volume display setting as input and the historical final volume display as output to obtain a user preference model.
[0024] In a feasible implementation manner, the volume display device further includes: a creation module, configured to construct volume standard curves for different audio types, and to create a lookup table based on the volume standard curves.
[0025] In a feasible implementation manner, the mapping module is specifically used to: search the lookup table for a mapping entry corresponding to the integrated volume value to obtain a volume display value; and update a volume display element on a user interface based on the volume display value.
[0026] In a feasible implementation, the volume display device further includes: a conversion module, which is used to convert the display standard through a preset standard conversion matrix dictionary when a standard modification instruction is received; and an adjustment module, which is used to monitor the performance indicators of the device in real time and adjust the refresh rate of the volume display according to changes in the performance indicators.
[0027] In a feasible implementation, the conversion module is specifically used to: parse the standard modification instruction to extract the original display standard and the target display standard; search for the corresponding conversion matrix in a preset standard conversion matrix dictionary based on the original display standard and the target display standard; based on the conversion matrix, convert the current display data according to the target display standard so that the display data is displayed under the target display standard.
[0028] A third aspect of the present invention provides a volume display device, comprising: a memory and at least one processor, wherein the memory stores instructions; the at least one processor calls the instructions in the memory so that the volume display device executes the above-mentioned volume display method.
[0029] A fourth aspect of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores instructions, which, when executed on a computer, enable the computer to execute the above-mentioned volume display method.
[0030] In the technical solution provided by the present invention, the audio signal, environmental noise and initial volume display setting of the audio device are obtained; the audio signal is analyzed to obtain the audio type and the first volume value; the audio type, the environmental noise and the initial volume display setting are input into a preset user preference model to obtain the second volume value; the noise level of the environmental noise is calculated, and the third volume value is determined based on the noise level; corresponding weights are assigned to the first volume value, the second volume value and the third volume value; the comprehensive volume value is calculated based on the first volume value, the second volume value and the third volume value and the corresponding weights; the comprehensive volume value is mapped to obtain the display result of the comprehensive volume value on the user interface. In the embodiment of the present invention, through the fusion of multiple factors and the weight allocation mechanism, the volume calculation is more accurate and meets the actual needs, and the accuracy and reliability of the volume display are improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] Figure 1 A schematic diagram of an embodiment of a volume display method in an embodiment of the present invention;
[0032] Figure 2 A schematic diagram of another embodiment of a volume display method in an embodiment of the present invention;
[0033] Figure 3A schematic diagram of another embodiment of a volume display method in an embodiment of the present invention;
[0034] Figure 4 A schematic diagram of an embodiment of a volume display device in an embodiment of the present invention;
[0035] Figure 5 A schematic diagram of another embodiment of a volume display device in an embodiment of the present invention;
[0036] Figure 6 FIG. 4 is a schematic diagram of an embodiment of a volume display device in an embodiment of the present invention. DETAILED DESCRIPTION
[0037] The embodiments of the present invention provide a volume display method, device, equipment and storage medium, which make the volume calculation more accurate and meet the actual needs through multi-factor fusion and weight distribution mechanism, and improve the accuracy and reliability of volume display.
[0038] The terms "first", "second", "third", "fourth", etc. (if any) in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments described herein can be implemented in an order other than that illustrated or described herein. In addition, the terms "including" or "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0039] It is understandable that the execution subject of the present invention may be a volume display device, or a terminal or a server, which is not limited here. The embodiment of the present invention is described by taking a server as the execution subject as an example.
[0040] For ease of understanding, the specific process of the embodiment of the present invention is described below. Figure 1 , an embodiment of the volume display method in the embodiment of the present invention includes:
[0041] 101. Obtain the audio signal, ambient noise and initial volume display settings of the audio device;
[0042] Audio signals can be captured by microphones or other audio input devices, which convert analog audio signals into digital signals for subsequent processing.
[0043] In audio programming, you can use libraries or APIs such as PyAudio and PortAudio to process and manage audio input.
[0044] The captured audio signal is transmitted through the audio driver, which transmits the digital audio signal from the audio input device to the server's processing unit.
[0045] 102. Analyze the audio signal to obtain an audio type and a first volume value;
[0046] The audio signal is preprocessed. The preprocessing process can use digital signal processing technology to remove background noise, use filters to smooth the non-stationary part of the signal, and unify the sampling rate of the audio signal to a range suitable for deep learning model processing. In addition, the audio signal can be normalized to ensure that all input data are within the same amplitude range to avoid gradient disappearance or explosion problems during model training. Although the preprocessed audio signal is relatively clean and standardized, it may still be complicated and difficult to capture its intrinsic characteristics when directly input into the CNN model. Therefore, the preprocessed audio signal is converted from the time domain to the frequency domain, and a spectrogram is obtained by calculating its short-time Fourier transform (STFT) and taking the square of the modulus. The spectrogram shows the energy distribution of the audio signal at different frequencies and time points in the form of a two-dimensional image, providing rich feature information for the CNN model. In addition, other feature representation methods, such as Mel frequency cepstral coefficient (MFCC) feature maps, can also be used. In this embodiment, the spectrogram corresponding to the audio signal is input into a preset CNN model to obtain the audio type of the audio signal.
[0047] Each sample value of the audio signal is traversed, each sample value is squared, an average value of all square values is calculated, and a square root of the average value is obtained to obtain a root mean square level of the audio signal, and the root mean square level is converted into a first volume value.
[0048] 103. Input the audio type, environmental noise, and initial volume display setting into a preset user preference model to obtain a second volume value;
[0049] The user preference model receives the input audio type, ambient noise, and initial volume display setting, and performs feature extraction on each input parameter. By querying the stored user preference database, the volume adjustment rule is determined. The user preference model calculates and outputs the corresponding volume value based on the features and the volume adjustment rule, thereby obtaining a second volume value.
[0050] 104. Calculate a noise level of environmental noise, and determine a third volume value based on the noise level;
[0051] The noise level in the environment is measured by a decibel meter, which can measure sound pressure and express it in decibels. The noise is divided into three levels, namely low noise level, medium noise level and high noise level. For example, the low noise level can be less than 40dB, the medium noise level can be 40-70dB, and the high noise level can be greater than 70dB. When the noise level belongs to the low noise level, the first target value is selected, when the noise level belongs to the medium noise level, the second target value is selected, and when the noise level belongs to the high noise level, the third target value is selected. The first target value, the second target value or the third target value is determined as the third volume value, wherein the first target value is less than the second target value and less than the third target value, and the third target value is not greater than the preset maximum volume value.
[0052] 105. assign corresponding weights to the first volume value, the second volume value, and the third volume value;
[0053] Based on the preset allocation strategy, a first weight is allocated to the first volume value, a second weight is allocated to the second volume value, and a third weight is allocated to the third volume value. The preset allocation strategy may be determined by defining the importance of the first volume value, the second volume value, and the third volume value. For example, the order of the importance values is: the first volume value is greater than the second volume value, greater than the third volume value, then the first volume value may be allocated a first weight of 50%, the second volume value may be allocated a second weight of 30%, and the third volume value may be allocated a third weight of 20%.
[0054] 106. Calculate a comprehensive volume value based on the first volume value, the second volume value, the third volume value and corresponding weights;
[0055] Calculate the product of the first volume value and the first weight to obtain a first calculation result; calculate the product of the second volume value and the second weight to obtain a second calculation result; calculate the product of the third volume value and the third weight to obtain a third calculation result; add the first calculation result, the second calculation result and the third calculation result to obtain a comprehensive volume value.
[0056] 107. Map the integrated volume value to obtain a display result of the integrated volume value on the user interface.
[0057] Determine the total length or total height of the volume bar on the user interface, calculate the length that the current volume should occupy on the volume bar according to the comprehensive volume value, obtain the target length, and draw the volume bar on the user interface according to the target length.
[0058] In an embodiment of the present invention, an audio signal, environmental noise and an initial volume display setting of an audio device are obtained; an audio type and a first volume value are obtained based on an analysis of the audio signal; the audio type, environmental noise and the initial volume display setting are input into a preset user preference model to obtain a second volume value; a noise level of the environmental noise is calculated, and a third volume value is determined based on the noise level; corresponding weights are assigned to the first volume value, the second volume value and the third volume value; a comprehensive volume value is calculated based on the first volume value, the second volume value and the third volume value and the corresponding weights; the comprehensive volume value is mapped to obtain a display result of the comprehensive volume value on a user interface, and through the fusion of multiple factors and the weight allocation mechanism, the volume calculation is more accurate and meets actual needs, and the accuracy and reliability of the volume display are improved.
[0059] See also Figure 2 Another embodiment of the volume display method in the embodiment of the present invention includes:
[0060] 201. Obtaining historical usage records of audio devices, the historical usage records including historical audio types, historical environmental noise levels, historical initial volume display settings, and historical final volumes;
[0061] The collected data is sorted in chronological order to ensure that each record contains key information such as historical audio type, historical environmental noise level, historical initial volume display setting and historical final volume; the data is cleaned to remove duplicate or invalid records to ensure the accuracy and completeness of the data; data storage; the sorted data is stored in a secure and reliable database for subsequent data analysis and model training.
[0062] 202. Taking historical audio types, historical environmental noise levels, and historical initial volume display settings as inputs and historical final volume displays as outputs, train a preset learning model to obtain a user preference model;
[0063] Perform feature extraction on the input data, and convert historical audio types, historical environmental noise levels, and historical initial volume display settings into numerical or vector forms that can be recognized by the model. Perform the same processing on the target output historical final volume display to ensure that it is consistent with the input data in format and dimension. Select an appropriate machine learning or deep learning model, for example, a neural network, regression model, or decision tree. Divide the preprocessed data into a training set and a test set, where the training set is used to train the model and the test set is used to evaluate the performance of the model. Use the training set data to train the model, and iteratively optimize the algorithm parameters to minimize the prediction error and improve the prediction accuracy of the model. During the training process, techniques such as cross-validation can be used to avoid overfitting and improve the generalization ability of the model. Use the test set data to evaluate the trained model to check whether its prediction accuracy and generalization ability meet the requirements. If the model performance is poor, you can adjust the model structure, parameters, or use other optimization strategies to improve the model.
[0064] 203. Obtaining audio signals, ambient noise, and initial volume display settings of an audio device;
[0065] The process of step 203 is similar to that of step 101 and will not be described again here.
[0066] 204. Input the audio signal into a preset audio classification model to obtain an audio type corresponding to the audio signal;
[0067] The audio signal is input into a preset audio classification model, which calculates the probability that the audio signal belongs to each audio type, compares the probabilities, and selects the audio type with the highest probability as the classification result.
[0068] 205. Calculate the dynamic range of the audio signal;
[0069] Calculate the peak level and the RMS level of the audio signal; calculate the difference between the peak level and the RMS level to obtain the dynamic range of the audio signal.
[0070] Set the sliding window and step size, start from the starting position of the audio signal, move the number of samples specified by the step size each time to form a new window, traverse all the sample numbers in each window, find the sample value with the largest absolute value, and obtain the peak level of each window; square the sample values in each window, calculate the average value of all square values, and take the square root of the average value to obtain the root mean square level of each window; store the peak level and root mean square level of each window in the corresponding array respectively; traverse the array of stored peak levels, and query the maximum value in the array as the peak level of the audio signal; traverse the array of stored root mean square levels, and query the maximum value in the array as the root mean square level of the audio signal, or average all root mean square levels and use the average value as the root mean square level of the audio signal.
[0071] Dynamic range = peak level - root mean square level. For this calculation formula, the level value needs to be converted from a linear scale to a decibel scale.
[0072] 206. Perform spectrum analysis on the audio signal to obtain a spectrum analysis result;
[0073] Calculate the energy of each frequency band in the audio signal; assign weights to the energy of each frequency band; and calculate the total spectrum energy based on the energy of each frequency band and the assigned weights.
[0074] Convert the audio signal from a time domain signal to an array of complex numbers in the frequency domain, where each complex number represents the amplitude and phase of a frequency component. The energy of each frequency band can be calculated by taking the square of the modulus of the complex number and summing them. Define a weight for each frequency band and add up all the weighted frequency band energies to get the total spectral energy.
[0075] By assigning weights to each frequency band in the spectrum, it is possible to flexibly adjust the importance of each frequency band in the audio signal according to the needs of different application scenarios, thereby optimizing the signal processing effect, such as enhancing the information expression of key frequency bands and suppressing unnecessary noise interference, thereby improving audio quality, improving the listening experience, or improving the accuracy and efficiency of audio processing.
[0076] 207. Determine a first volume value based on the dynamic range and the spectrum analysis result;
[0077] The dynamic range is normalized to obtain a target dynamic range; and a first volume value is calculated based on the total spectrum energy, the target dynamic range and a preset adjustment coefficient.
[0078] First, the dynamic range of the audio signal is normalized, that is, the dynamic range is mapped to a preset range, such as 0-100 or 0-10, depending on the specific application scenario. This step eliminates the calculation differences between different audio signals due to different original dynamic ranges.
[0079] Assuming the target dynamic range is DR, the total spectral energy is E, and the first volume value is V, then V=α×DR+β×E, where α and β are adjustment coefficients used to balance the contribution of the dynamic range and spectral energy in the first volume value.
[0080] 208. Input the audio type, the ambient noise, and the initial volume display setting into a preset user preference model to obtain a second volume value;
[0081] The execution process of step 208 is similar to that of step 103 and will not be described again here.
[0082] 209. Calculate a noise level of environmental noise, and determine a third volume value based on the noise level;
[0083] Calculate the short-time RMS value of the ambient noise; calculate the average value of the short-time RMS value to obtain the noise level; and query the corresponding third volume value through a preset mapping relationship according to the noise level.
[0084] The signal of the environmental noise is processed in segments, each segment being a short-time frame. The sum of squares of all samples in each short-time frame is calculated, and the sum of squares is divided by the number of samples in the short-time frame to obtain the mean square value. The square root of the mean square value is taken to obtain the short-time RMS value. The sum of the short-time RMS values of all short-time frames corresponding to the signal is calculated to obtain the total short-time RMS value. The total short-time RMS value is divided by the number of short-time frames to obtain the average short-time RMS value. The average short-time RMS value represents the noise level of the environmental noise.
[0085] Select a frame length and a frame shift, determine the number of samples contained in each short-time frame based on the frame length, determine the degree of overlap between frames or the movement of frames based on the frame shift, segment the signal according to the selected frame length and frame shift, and obtain short-time frame data. The mapping relationship can be a mapping table, a function, or an algorithm.
[0086] 210. Assign corresponding weights to the first volume value, the second volume value, and the third volume value;
[0087] The first volume value corresponds to the result of audio analysis, the second volume value corresponds to the result of noise analysis, and the third volume value corresponds to the result of user preference; in the initial setting of the audio device, the corresponding relationship of the weights can be set first, for example, the result of audio analysis corresponds to the first weight, the result of noise analysis corresponds to the second weight, and the result of user preference corresponds to the third weight. Therefore, the first volume value is assigned the first weight, the second volume value is assigned the second weight, and the third volume value is assigned the third weight.
[0088] 211. Calculate a comprehensive volume value based on the first volume value, the second volume value, the third volume value and corresponding weights;
[0089] The products of the first volume value, the second volume value and the third volume value and the corresponding weights are calculated respectively, and the calculation results are added to obtain a comprehensive volume value.
[0090] The product of the first volume value and the first weight is calculated to obtain a first calculation result; the product of the second volume value and the second weight is calculated to obtain a second calculation result; and the product of the third volume value and the third weight is calculated to obtain a third calculation result.
[0091] 212. Map the integrated volume value to obtain a display result of the integrated volume value on the user interface.
[0092] The execution process of step 212 is similar to that of step 107 and will not be described again here.
[0093] In an embodiment of the present invention, a historical usage record of an audio device is obtained, the historical usage record includes a historical audio type, a historical environmental noise level, a historical initial volume display setting, and a historical final volume. The historical audio type, the historical environmental noise level, and the historical initial volume display setting are used as inputs, and the historical final volume display is used as an output. A preset learning model is trained to obtain a user preference model, an audio signal, environmental noise, and an initial volume display setting of the audio device are obtained, the audio signal is input into a preset audio classification model, an audio type corresponding to the audio signal is obtained, a dynamic range of the audio signal is calculated, a spectrum analysis is performed on the audio signal, a spectrum analysis result is obtained, a first volume value is determined based on the dynamic range and the spectrum analysis result, the audio type, the environmental noise, and the initial volume display setting are input into a preset user preference model, a second volume value is obtained, a noise level of the environmental noise is calculated, and a third volume value is determined based on the noise level, corresponding weights are assigned to the first volume value, the second volume value, and the third volume value, a comprehensive volume value is calculated based on the first volume value, the second volume value, the third volume value, and the corresponding weights, the comprehensive volume value is mapped, and a display result of the comprehensive volume value on the user interface is obtained, thereby improving the accuracy and reliability of the volume display.
[0094] See also Figure 3 Another embodiment of the volume display method in the embodiment of the present invention includes:
[0095] 301. Constructing volume standard curves for different audio types, and creating a lookup table based on the volume standard curves;
[0096] For each audio type, multiple samples are collected to cover a wide range of changes. The loudness of each sample is measured using audio analysis tools. The target volume level of each audio type is defined. Based on the sample data of each audio type, its volume distribution is calculated. Based on the target volume level, a volume standard curve corresponding to each audio type is drawn. Based on the volume standard curve, a corresponding lookup table is created, through which the input volume is mapped to the target volume value. This table can be a simple list of key-value pairs or a more complex interpolation table to handle situations where the input volume value is not at an exact matching point.
[0097] Creating a lookup table based on the volume standard curves of different audio types can accurately and efficiently map the comprehensive volume value of the audio to the display value suitable for the audio type, ensuring the accuracy and intuitiveness of volume adjustment, while simplifying the complexity of volume management and improving user experience.
[0098] 302. Obtain an audio signal, ambient noise, and initial volume display setting of an audio device;
[0099] 303. Analyze the audio signal to obtain an audio type and a first volume value;
[0100] 304. Input the audio type, the ambient noise, and the initial volume display setting into a preset user preference model to obtain a second volume value;
[0101] 305. Calculate a noise level of environmental noise, and determine a third volume value based on the noise level;
[0102] 306. Allocate corresponding weights to the first volume value, the second volume value, and the third volume value;
[0103] 307. Calculate a comprehensive volume value based on the first volume value, the second volume value, the third volume value and corresponding weights;
[0104] The execution process of steps 302-307 is similar to that of steps 101-106, and will not be repeated here.
[0105] 308. Mapping the integrated volume value to obtain a display result of the integrated volume value on the user interface;
[0106] The mapping entry corresponding to the comprehensive volume value is searched in the lookup table to obtain the volume display value; and the volume display element on the user interface is updated based on the volume display value.
[0107] Using the comprehensive volume value as a key, search for the corresponding volume display value in the lookup table. If the corresponding value is directly retrieved from the lookup table, the retrieved value is determined as the volume display value. If the corresponding value cannot be directly obtained from the lookup table, the corresponding volume display value is calculated using the interpolation method.
[0108] The steps of calculating the volume display value using the interpolation calculation method may be: finding two adjacent data points of the comprehensive volume value, determining an interpolation interval based on the two adjacent data points, the volume display value corresponding to the comprehensive volume value is within the interpolation interval, calculating the interpolation ratio of the comprehensive volume value, and based on the interpolation ratio, calculating the volume display value corresponding to the comprehensive volume value using an interpolation formula.
[0109] Calculation of interpolation ratio: two adjacent data points are respectively the first adjacent value less than the integrated volume value and the second adjacent value greater than the integrated volume value, the starting value of the interpolation interval is determined based on the first adjacent value, the end value of the interpolation interval is determined based on the second adjacent value, the first difference between the integrated volume value and the first adjacent value is calculated, the second difference between the second adjacent value and the first adjacent value is calculated, the first difference is divided by the second difference, and the interpolation ratio is obtained. The interpolation formula is: volume display value = starting value + (end value - starting value) × interpolation ratio.
[0110] A volume display element on the user interface is updated based on the volume display value. The volume display element may be a slide bar, a digital display, a volume icon, or other forms of visual indicators.
[0111] 309. When a standard modification instruction is received, the display standard is converted by using a preset standard conversion matrix dictionary;
[0112] Parse the standard modification instruction to extract the original display standard and the target display standard; search for the corresponding conversion matrix in the preset standard conversion matrix dictionary based on the original display standard and the target display standard; based on the conversion matrix, convert the current display data according to the target display standard so that the display data is displayed under the target display standard.
[0113] The preset standard conversion matrix dictionary stores the mathematical matrices required for conversion between different display standards. Based on the parsed original display standard and target display standard, the corresponding conversion matrix is searched in the preset dictionary. Confirm whether the conversion matrix exists and is applicable to the specified conversion. If it does not exist, it may be necessary to perform error handling or notify the user that the conversion is not supported. If it exists, extract the conversion matrix and prepare it for subsequent calculations or conversion processes. Get the currently displayed data, which may include color information and resolution, etc. Based on the extracted conversion matrix, convert the current display data, which usually involves mathematical operations, such as matrix multiplication, to map data from one display standard to another; display the converted data under the new display standard, including adjusting the settings of the video processing hardware, updating the display driver, or directly modifying the rendering logic at the software level.
[0114] By searching the table to find the mapping entry corresponding to the comprehensive volume value and updating the volume display element on the user interface accordingly, the display accuracy, user experience and system performance can be improved.
[0115] 310. Monitor the performance indicators of the device in real time and adjust the refresh rate of the volume display according to changes in the performance indicators.
[0116] Collect CPU usage data, compare the CPU usage data with a preset threshold, and set a first threshold and a second threshold. For example, set the first threshold to 50% and the second threshold to 80%.
[0117] Set the upper and lower limits of the volume display refresh rate. For example, set the target lower limit to 30fps and the target upper limit to 60fps.
[0118] If the CPU usage is lower than the first threshold, it means that the current system load is low and there are sufficient resources to improve the user experience. Therefore, the refresh rate of the volume display can be increased to a value between the current refresh rate and the target upper limit.
[0119] If the CPU usage exceeds the second threshold, it means that the current system load is high. In order to reduce the CPU burden, the refresh rate of the volume display is reduced to a value between the current refresh rate and the target lower limit.
[0120] If the CPU usage is between the first threshold and the second threshold, the current volume display refresh rate is kept unchanged.
[0121] Based on the result of the decision logic, the refresh rate of the volume display is adjusted through system configuration or by calling relevant APIs.
[0122] By monitoring the performance indicators of the device in real time, the volume display refresh rate can be dynamically adjusted. This solution not only helps to improve the overall performance of the system, but also can be flexibly adjusted according to the actual needs of users to improve the user experience.
[0123] In an embodiment of the present invention, by constructing volume standard curves of different audio types and creating a lookup table based on the volume standard curve, an audio signal, environmental noise and an initial volume display setting of an audio device are obtained, an analysis is performed based on the audio signal to obtain an audio type and a first volume value, the audio type, environmental noise and the initial volume display setting are input into a preset user preference model to obtain a second volume value, the noise level of the environmental noise is calculated, and a third volume value is determined based on the noise level, corresponding weights are assigned to the first volume value, the second volume value and the third volume value, a comprehensive volume value is calculated based on the first volume value, the second volume value and the third volume value and the corresponding weights, the comprehensive volume value is mapped, and a display result of the comprehensive volume value on the user interface is obtained, and when a standard modification instruction is received, the display standard is converted by a preset standard conversion matrix dictionary, and when a standard modification instruction is received, the display standard is converted by a preset standard conversion matrix dictionary, so that the volume calculation is more accurate and meets actual needs, and the accuracy and reliability of volume display are improved.
[0124] The volume display method in the embodiment of the present invention is described above. The volume display device in the embodiment of the present invention is described below. Figure 4 In one embodiment of the present invention, a volume display device includes:
[0125] A first acquisition module 401 is used to acquire an audio signal, ambient noise and an initial volume display setting of an audio device;
[0126] An analysis module 402 is used to analyze the audio signal to obtain an audio type and a first volume value;
[0127] The processing module 403 is used to input the audio type, the ambient noise and the initial volume display setting into a preset user preference model to obtain a second volume value;
[0128] A first calculation module 404, configured to calculate a noise level of the ambient noise, and determine a third volume value based on the noise level;
[0129] An allocating module 405, configured to allocate corresponding weights to the first volume value, the second volume value, and the third volume value;
[0130] A second calculation module 406, configured to calculate a comprehensive volume value based on the first volume value, the second volume value, the third volume value and corresponding weights;
[0131] The mapping module 407 is used to map the comprehensive volume value to obtain a display result of the comprehensive volume value on the user interface.
[0132] In an embodiment of the present invention, an audio signal, environmental noise and an initial volume display setting of an audio device are obtained; an audio type and a first volume value are obtained based on an analysis of the audio signal; the audio type, environmental noise and the initial volume display setting are input into a preset user preference model to obtain a second volume value; a noise level of the environmental noise is calculated, and a third volume value is determined based on the noise level; corresponding weights are assigned to the first volume value, the second volume value and the third volume value; a comprehensive volume value is calculated based on the first volume value, the second volume value and the third volume value and the corresponding weights; the comprehensive volume value is mapped to obtain a display result of the comprehensive volume value on a user interface, and through the fusion of multiple factors and the weight allocation mechanism, the volume calculation is more accurate and meets actual needs, and the accuracy and reliability of the volume display are improved.
[0133] See also Figure 5 Another embodiment of the volume display device in the embodiment of the present invention includes:
[0134] A first acquisition module 401 is used to acquire an audio signal, ambient noise and an initial volume display setting of an audio device;
[0135] An analysis module 402 is used to analyze the audio signal to obtain an audio type and a first volume value;
[0136] The processing module 403 is used to input the audio type, the ambient noise and the initial volume display setting into a preset user preference model to obtain a second volume value;
[0137] A first calculation module 404, configured to calculate a noise level of the ambient noise, and determine a third volume value based on the noise level;
[0138] An allocating module 405, configured to allocate corresponding weights to the first volume value, the second volume value, and the third volume value;
[0139] A second calculation module 406, configured to calculate a comprehensive volume value based on the first volume value, the second volume value, the third volume value and corresponding weights;
[0140] The mapping module 407 is used to map the comprehensive volume value to obtain a display result of the comprehensive volume value on the user interface.
[0141] Optionally, the analysis module 402 includes:
[0142] The input unit 4021 is used to input the audio signal into a preset audio classification model to obtain an audio type corresponding to the audio signal;
[0143] A calculation unit 4022, used to calculate the dynamic range of the audio signal;
[0144] The analysis unit 4023 is used to perform spectrum analysis on the audio signal to obtain a spectrum analysis result;
[0145] The determining unit 4024 is configured to determine a first volume value based on the dynamic range and the spectrum analysis result.
[0146] Optionally, the calculation unit 4022 may be specifically configured to:
[0147] Calculate the peak level and the RMS level of the audio signal; calculate the difference between the peak level and the RMS level to obtain the dynamic range of the audio signal.
[0148] Optionally, the analysis unit 4023 may be specifically used for:
[0149] Calculate the energy of each frequency band in the audio signal; assign weights to the energy of each frequency band; and calculate the total spectrum energy based on the energy of each frequency band and the assigned weights.
[0150] Optionally, the determining unit 3041 may be specifically configured to:
[0151] The dynamic range is normalized to obtain a target dynamic range; and a first volume value is calculated based on the total spectrum energy, the target dynamic range and a preset adjustment coefficient.
[0152] Optionally, the processing module 403 may be specifically configured to:
[0153] Calculate the short-time RMS value of the ambient noise; calculate the average value of the short-time RMS value to obtain the noise level; and query the corresponding third volume value through a preset mapping relationship according to the noise level.
[0154] Optionally, the second calculation module 406 may be specifically configured to:
[0155] The products of the first volume value, the second volume value and the third volume value and the corresponding weights are calculated respectively, and the calculation results are added to obtain a comprehensive volume value.
[0156] Optionally, the volume display device may further include:
[0157] A second acquisition module 408 is used to acquire a historical usage record of the audio device, where the historical usage record includes a historical audio type, a historical ambient noise level, a historical initial volume display setting, and a historical final volume;
[0158] The training module 409 is used to take the historical audio type, historical environmental noise level and historical initial volume display setting as input and the historical final volume display as output, train the preset learning model and obtain the user preference model.
[0159] Optionally, the volume display device may further include:
[0160] The creation module 410 is used to construct volume standard curves for different audio types and create a lookup table based on the volume standard curves.
[0161] Optionally, the mapping module 407 may be specifically used for:
[0162] The mapping entry corresponding to the comprehensive volume value is searched in the lookup table to obtain the volume display value; and the volume display element on the user interface is updated based on the volume display value.
[0163] Optionally, the volume display device may further include:
[0164] The conversion module 411 is used to convert the display standard through a preset standard conversion matrix dictionary when receiving a standard modification instruction;
[0165] The adjustment module 412 is used to monitor the performance indicators of the device in real time and adjust the refresh rate of the volume display according to the changes in the performance indicators.
[0166] Optionally, the conversion module 411 may be specifically used for:
[0167] Parse the standard modification instruction to extract the original display standard and the target display standard; search for the corresponding conversion matrix in the preset standard conversion matrix dictionary based on the original display standard and the target display standard; based on the conversion matrix, convert the current display data according to the target display standard so that the display data is displayed under the target display standard.
[0168] In an embodiment of the present invention, by constructing volume standard curves of different audio types and creating a lookup table based on the volume standard curve, an audio signal, environmental noise and an initial volume display setting of an audio device are obtained, an analysis is performed based on the audio signal to obtain an audio type and a first volume value, the audio type, environmental noise and the initial volume display setting are input into a preset user preference model to obtain a second volume value, the noise level of the environmental noise is calculated, and a third volume value is determined based on the noise level, corresponding weights are assigned to the first volume value, the second volume value and the third volume value, a comprehensive volume value is calculated based on the first volume value, the second volume value and the third volume value and the corresponding weights, the comprehensive volume value is mapped, and a display result of the comprehensive volume value on the user interface is obtained, and when a standard modification instruction is received, the display standard is converted by a preset standard conversion matrix dictionary, and when a standard modification instruction is received, the display standard is converted by a preset standard conversion matrix dictionary, so that the volume calculation is more accurate and meets actual needs, and the accuracy and reliability of volume display are improved.
[0169] above Figure 4 and Figure 5The volume display device in the embodiment of the present invention is described in detail from the perspective of modular functional entities. The volume display device in the embodiment of the present invention is described in detail from the perspective of hardware processing.
[0170] See also Figure 6 As shown, the volume display device includes a processor 600 and a memory 601 . The memory 601 stores machine executable instructions that can be executed by the processor 600 . The processor 600 executes the machine executable instructions to implement the above volume display method.
[0171] Further, Figure 6 The volume display device shown further includes a bus 602 and a communication interface 603 , and the processor 600 , the communication interface 603 and the memory 601 are connected via the bus 602 .
[0172] The memory 601 may include a high-speed random access memory (RAM), and may also include a non-volatile memory (non-volatile memory), for example, at least one disk storage. The communication connection between the system network element and at least one other network element is realized through at least one communication interface 603 (which may be wired or wireless), and the Internet, wide area network, local area network, metropolitan area network, etc. may be used. The bus 602 may be an ISA bus, a PCI bus, or an EISA bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 6 Only one bidirectional arrow is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0173] The processor 600 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the hardware integrated logic circuit or software instructions in the processor 600. The above processor 600 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The disclosed methods, steps and logic block diagrams in the embodiments of the present disclosure can be implemented or executed. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor. The steps of the method disclosed in conjunction with the embodiments of the present disclosure can be directly embodied as a hardware decoding processor to be executed, or a combination of hardware and software modules in the decoding processor can be executed. The software module can be located in a mature storage medium in the field such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory 601 , and the processor 600 reads the information in the memory 601 and completes the method steps of the above-mentioned embodiment in combination with its hardware.
[0174] The present invention also provides a volume display device, wherein the computer device comprises a memory and a processor, wherein the memory stores computer-readable instructions, and when the computer-readable instructions are executed by the processor, the processor executes the steps of the volume display method in the above-mentioned embodiments.
[0175] The present invention also provides a computer-readable storage medium, which may be a non-volatile computer-readable storage medium or a volatile computer-readable storage medium. Instructions are stored in the computer-readable storage medium. When the instructions are executed on a computer, the computer executes the steps of the volume display method.
[0176] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0177] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk and other media that can store program codes.
[0178] As described above, the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features thereof may be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A volume display method, It is characterized in that The volume display method comprises: Get the audio signal, ambient noise and initial volume display settings of the audio device; Analyze the audio signal to obtain an audio type and a first volume value; Inputting the audio type, the ambient noise, and the initial volume display setting into a preset user preference model to obtain a second volume value; calculating a noise level of the environmental noise, and determining a third volume value based on the noise level; assigning corresponding weights to the first volume value, the second volume value, and the third volume value; Calculate a comprehensive volume value based on the first volume value, the second volume value, the third volume value and corresponding weights; The comprehensive volume value is mapped to obtain a display result of the comprehensive volume value on a user interface.
2. The volume display method according to claim 1, It is characterized in that The step of analyzing the audio signal to obtain the audio type and the first volume value includes: Inputting the audio signal into a preset audio classification model to obtain an audio type corresponding to the audio signal; Calculating a dynamic range of the audio signal; Performing spectrum analysis on the audio signal to obtain a spectrum analysis result; A first volume value is determined based on the dynamic range and the spectrum analysis result.
3. The volume display method according to claim 2, It is characterized in that The calculating the dynamic range of the audio signal comprises: Calculating a peak level and a root mean square level of the audio signal; The difference between the peak level and the root mean square level is calculated to obtain the dynamic range of the audio signal.
4. The volume display method according to claim 3, It is characterized in that The performing spectrum analysis on the audio signal to obtain a spectrum analysis result includes: Calculating the energy of each frequency band in the audio signal; Weight allocation of energy to each frequency band; The total spectrum energy is calculated based on the energy of each frequency band and the assigned weights.
5. The volume display method according to claim 4, It is characterized in that The determining a first volume value based on the dynamic range and the spectrum analysis result comprises: normalizing the dynamic range to obtain a target dynamic range; A first volume value is calculated based on the total spectrum energy, the target dynamic range and a preset adjustment coefficient.
6. The volume display method according to claim 1, It is characterized in that The calculating the noise level of the environmental noise and determining the third volume value based on the noise level comprises: Calculating the short-time RMS value of the environmental noise; Calculate the average value of the short-time RMS value to obtain the noise level; According to the noise level, a corresponding third volume value is queried through a preset mapping relationship.
7. The volume display method according to claim 1, It is characterized in that The calculating the comprehensive volume value based on the first volume value, the second volume value, the third volume value and the corresponding weights includes: The products of the first volume value, the second volume value, and the third volume value and the corresponding weights are calculated respectively, and the calculation results are added to obtain a comprehensive volume value.
8. The volume display method according to claim 1, It is characterized in that Before obtaining the audio signal, ambient noise and initial volume display setting of the audio device, the method further includes: Acquire a historical usage record of the audio device, wherein the historical usage record includes a historical audio type, a historical ambient noise level, a historical initial volume display setting, and a historical final volume; The historical audio type, the historical ambient noise level and the historical initial volume display setting are used as inputs, and the historical final volume display is used as output, and a preset learning model is trained to obtain a user preference model.
9. The volume display method according to claim 1, It is characterized in that Before obtaining the audio signal, audio type, ambient noise, and initial volume display settings of the audio device, it also includes: Volume standard curves for different audio types are constructed, and a lookup table is created based on the volume standard curves.
10. The volume display method according to claim 9, It is characterized in that Mapping the integrated volume value to obtain a display result of the integrated volume value on a user interface includes: Searching the mapping entry corresponding to the comprehensive volume value in the lookup table to obtain a volume display value; A volume display element on the user interface is updated based on the volume display value.
11. The volume display method according to claim 1, It is characterized in that After mapping the integrated volume value to obtain a display result of the integrated volume value on the user interface, the method further includes: When a standard modification instruction is received, the display standard is converted through a preset standard conversion matrix dictionary; The performance indicators of the device are monitored in real time, and the refresh rate of the volume display is adjusted according to changes in the performance indicators.
12. The volume display method according to claim 11, It is characterized in that The converting of the display standard by using a preset standard conversion matrix dictionary includes: Parsing the standard modification instruction to extract the original display standard and the target display standard; Searching for a corresponding conversion matrix in a preset standard conversion matrix dictionary based on the original display standard and the target display standard; Based on the conversion matrix, the current display data is converted according to the target display standard so that the display data is displayed under the target display standard.
13. A volume display device, It is characterized in that The volume display device comprises: A first acquisition module is used to acquire an audio signal, environmental noise and an initial volume display setting of an audio device; An analysis module, configured to analyze the audio signal to obtain an audio type and a first volume value; A processing module, configured to input the audio type, the ambient noise and the initial volume display setting into a preset user preference model to obtain a second volume value; a first calculation module, configured to calculate a noise level of the environmental noise, and determine a third volume value based on the noise level; an allocating module, configured to allocate corresponding weights to the first volume value, the second volume value, and the third volume value; A second calculation module, configured to calculate a comprehensive volume value based on the first volume value, the second volume value, the third volume value and corresponding weights; The mapping module is used to map the comprehensive volume value to obtain a display result of the comprehensive volume value on the user interface.
14. A volume display device, It is characterized in that The volume display device comprises: a memory and at least one processor, wherein instructions are stored in the memory; The at least one processor calls the instruction in the memory to enable the volume display device to execute the volume display method according to any one of claims 1 to 12.
15. A computer-readable storage medium having stored thereon instructions, It is characterized in that When the instructions are executed by a processor, the volume display method according to any one of claims 1 to 12 is implemented.
Citation Information
Cited By
Volume unit table display optimization method and system, storage medium and equipment
CN121528237A
Volume unit table display optimization method, system, storage medium, and device
CN121528237B
