A method and system for adjusting audio playback mode based on audio detection

By performing spectrum analysis of audio data and extracting low-frequency data segments, dynamically adjusting the audio playback volume, the problem that audio equipment in the existing technology cannot independently adjust the playback effect, and achieve better sound quality and user experience.

CN119835577BActive Publication Date: 2025-05-16DONGGUAN JINWENHUA DIGITAL TECHNOLOGY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510312780.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-03-17
Publication Date
2025-05-16
Estimated Expiration
2045-03-17

AI Technical Summary

Technical Problem

When playing audio, existing audio devices cannot automatically adjust the audio playback effect, especially for audio data with low-frequency sounds. Because the fixed volume setting is easily disturbed by ambient noise, it affects the sound quality and user experience.

Method used

By performing spectrum analysis on the audio data, the low-frequency data segment is extracted, and the playback volume is dynamically adjusted according to the low-frequency change curve, and the initial playback volume is set in combination with the ambient noise spectrum to achieve smooth adjustment of volume.

Benefits of technology

It effectively improves the audio playback effect, reduces the interference of ambient noise, and improves the user's listening experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119835577B_ABST
    Figure CN119835577B_ABST
Patent Text Reader

Abstract

The present invention discloses a method and system for adjusting a sound playing mode based on audio detection, which relates to the field of sound audio technology, including: sampling and analyzing audio data to obtain spectrum data of the audio data; extracting several low-frequency data segments from the spectrum data, and screening low-frequency adjustment data segments from several low-frequency data segments based on a preset time length threshold; obtaining the spectrum average of the audio data; setting the initial playing volume of the sound in combination with the ambient noise spectrum and the spectrum average of the sound, drawing the low-frequency change curve of the low-frequency adjustment data segment, and setting the volume change curve according to the low-frequency change curve; smoothly adjusting the initial playing volume according to the volume change curve, and generating the playing volume adjustment data of the low-frequency adjustment data segment. By extracting and analyzing the low-frequency data segment of the audio and adjusting the volume within the playing time of the low-frequency data segment, the audio playing quality and playing effect of the sound can be effectively improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of sound and audio technology, and in particular to a method and system for adjusting a sound playing mode based on audio detection. Background Art

[0002] Current audio equipment mainly plays audio according to the set fixed playback mode and playback volume. This fixed playback mode setting cannot reflect the playback sound quality and sound effects of different types of audio data. In particular, for the audio playback of a single audio device, the audio playback effect of the audio cannot be adjusted independently. For data segments with some low-frequency sounds in the audio, since low-frequency audio data has less energy, playing at a fixed volume is easily disturbed by environmental noise, affecting the user's audio listening effect, that is, affecting the audio quality and sound effects of the audio data played by the audio device, affecting the user's experience of the audio device. Summary of the invention

[0003] The purpose of the present invention is to overcome the shortcomings of the prior art. The present invention provides a method and system for adjusting the audio playback mode based on audio detection. By analyzing the low-frequency data part of the audio, the audio playback volume is autonomously adjusted during the audio playback process, thereby effectively improving the audio playback effect of the audio and improving the user's experience of the audio.

[0004] The present invention provides a method for adjusting an audio playback mode based on audio detection, the method comprising:

[0005] Read the audio data input into the audio playback system, perform sampling and analysis on the audio data, and obtain the frequency spectrum data of the audio data;

[0006] Extracting a plurality of low-frequency data segments from the spectrum data, and screening the plurality of low-frequency data segments based on a preset time length threshold, extracting low-frequency data segments greater than the preset time length threshold, and marking them as low-frequency adjustment data segments;

[0007] Extracting a plurality of sampled data from the audio data according to the sampling frequency, and performing mean calculation on the plurality of sampled data to obtain a frequency spectrum average value of the audio data;

[0008] The initial playback volume of the speaker is set based on the ambient noise spectrum of the speaker and the average value of the spectrum;

[0009] Resampling the low-frequency adjustment data segment, drawing a low-frequency change curve of the low-frequency adjustment data segment, and setting a volume change curve according to the low-frequency change curve;

[0010] The initial playback volume is smoothly adjusted according to the volume change curve to generate playback volume adjustment data of the low-frequency adjustment data segment.

[0011] Furthermore, the step of reading the audio data input into the audio playback system, sampling and analyzing the audio data, and obtaining the spectrum data of the audio data includes:

[0012] Load the audio data to be played into the audio playback system, perform sound event analysis on the audio data based on the SED algorithm, divide the audio data into multiple channels, and obtain audio data of several channels;

[0013] The audio data of each channel is sampled based on 44.1 kHz, and spectrum data of the audio data of each channel is acquired.

[0014] Further, the extracting of a plurality of low-frequency data segments from the spectrum data, screening the plurality of low-frequency data segments based on a preset time length threshold, extracting low-frequency data segments greater than the preset time length threshold, and marking them as low-frequency adjusted data segments includes:

[0015] Setting 60 Hz as a screening threshold, using the screening threshold as a cutoff line in the spectrum data, and marking the audio data below the cutoff line as a low-frequency data segment;

[0016] The preset time length threshold is set to 3s, each low-frequency data segment is compared with the preset time length threshold, and the low-frequency data segments greater than the preset time length threshold are extracted and marked as low-frequency adjusted data segments.

[0017] Furthermore, extracting a plurality of sampled data from the audio data according to the sampling frequency, and performing mean calculation on the plurality of sampled data to obtain the frequency spectrum average value of the audio data includes:

[0018] In the audio data loading stage, sampling is performed according to the audio playback timing, and the sampled data is accumulated and calculated;

[0019] Calculate the average value of the frequency spectrum of the audio data according to the number of samples of the sampling data of the audio data.

[0020] Furthermore, the step of setting the initial playback volume of the audio system in combination with the ambient noise spectrum of the audio system and the spectrum average value includes:

[0021] The audio playback system recognizes and detects the ambient sound during the audio loading stage, extracts the ambient sound frequency data within the audio loading duration, and marks it as the ambient noise spectrum;

[0022] The initial playback volume of the speaker is set based on the ambient noise spectrum of the speaker and the average value of the spectrum.

[0023] Furthermore, the step of setting the initial playback volume of the audio system in combination with the ambient noise spectrum of the audio system and the spectrum average value also includes:

[0024] Detect environmental noise and obtain the noise decibel of the environmental noise;

[0025] Extracting the maximum value of the noise spectrum from the environmental noise spectrum, and comparing the spectrum average value with the maximum value of the noise spectrum;

[0026] If the spectrum average is greater than the noise spectrum maximum, the relationship between the initial playback volume of the speaker and the noise decibel setting is:

[0027] ;

[0028] in, is the initial playback volume, is the noise decibel, is the spectrum average, is the maximum value of the noise spectrum;

[0029] If the spectrum average value is less than the noise spectrum maximum value, the relationship between the initial playback volume of the speaker and the noise decibel setting is:

[0030] ;

[0031] in, is the initial playback volume, is the noise decibel, is the spectrum average, is the maximum value of the noise spectrum.

[0032] Further, resampling the low-frequency adjustment data segment, drawing a low-frequency change curve of the low-frequency adjustment data segment, and setting the volume change curve according to the low-frequency change curve includes:

[0033] Resampling the acquired low-frequency adjustment data at a preset resampling frequency to construct a low-frequency change curve of the low-frequency adjustment data segment;

[0034] Dividing the change curve into a plurality of spectrum intervals according to a preset spectrum interval, and extracting the slope of each spectrum interval according to the low-frequency change curve;

[0035] The volume change curve is constructed according to the slopes of several spectrum intervals.

[0036] Furthermore, the step of smoothly adjusting the initial playback volume according to the volume change curve to generate playback volume adjustment data of the low-frequency adjustment data segment includes:

[0037] Extracting the slope of each frequency spectrum interval from the volume change curve, and calculating the interval end value of the audio playback volume in combination with the slope of each frequency spectrum interval and the interval start value of the audio playback volume;

[0038] The volume change value of the spectrum interval is calculated according to the interval start value and the interval end value, and the volume change rate of the spectrum interval is calculated in combination with the time length of the spectrum interval;

[0039] The playback volume of the frequency spectrum interval is smoothly adjusted and controlled based on the volume change rate, and the playback volume adjustment data is generated by combining several frequency spectrum intervals.

[0040] Furthermore, the volume change rate is calculated as follows:

[0041] ;

[0042] in, is the volume change rate of the i-th spectrum interval, is the starting value of the playback volume of the i-th spectrum interval, is the end value of the playback volume of the i-th spectrum interval, is the interval length of the i-th spectrum interval, i is a positive integer, and i≥1;

[0043] The calculation formula for smooth adjustment of the playback volume in the spectrum interval is:

[0044] ;

[0045] in, is the volume change rate of the i-th spectrum interval, is the starting value of the playback volume of the i-th spectrum interval, is the playback volume at the jth moment in the i-th spectrum interval.

[0046] The present invention also provides a sound playing mode adjustment system based on audio detection, the adjustment system comprising:

[0047] Input detection component: used to read the audio data input into the audio playback system, perform sampling analysis on the audio data, and obtain the spectrum data of the audio data;

[0048] A marking component is used to extract a number of low-frequency data segments from the spectrum data, and screen the number of low-frequency data segments based on a preset time length threshold, extract the low-frequency data segments greater than the preset time length threshold, and mark them as low-frequency adjustment data segments;

[0049] A calculation component is used to extract a number of sampled data from the audio data according to the sampling frequency, and perform mean calculation on the number of sampled data to obtain the frequency spectrum average value of the audio data;

[0050] Volume setting component: used to set the initial playback volume of the audio system in combination with the ambient noise spectrum of the audio system and the average value of the spectrum;

[0051] Sampling and analysis component: used for resampling the low-frequency adjustment data segment, drawing the low-frequency change curve of the low-frequency adjustment data segment, and setting the volume change curve according to the low-frequency change curve;

[0052] Audio playback adjustment component: used for smoothly adjusting the initial playback volume according to the volume change curve, and generating playback volume adjustment data of the low-frequency adjustment data segment.

[0053] The present invention provides a method and system for adjusting a sound playing mode based on audio detection, which analyzes the low-frequency data part of the audio and autonomously adjusts the audio playing volume during the audio playing process; and extracts and analyzes the low-frequency data segment of the audio and adjusts the volume during the playing time of the low-frequency data segment, which can effectively improve the audio playing quality and playing effect of the sound, thereby improving the user experience of the sound. BRIEF DESCRIPTION OF THE DRAWINGS

[0054] Figure 1 is a flow chart of a method for adjusting an audio playback mode based on audio detection according to an embodiment of the present invention;

[0055] Figure 2 is a sampling spectrum diagram of audio data in an embodiment of the present invention;

[0056] Figure 3 is a volume change curve diagram in an embodiment of the present invention;

[0057] Figure 4 Schematic diagram of an audio playback mode adjustment system based on audio detection in an embodiment of the present invention. DETAILED DESCRIPTION

[0058] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0059] Embodiment 1:

[0060] Figure 1 The flowchart of the method for adjusting the audio playback mode based on audio detection according to an embodiment of the present invention is shown. The adjustment method comprises:

[0061] S11: reading audio data input into the audio playback system, and performing sampling and analysis on the audio data to obtain frequency spectrum data of the audio data.

[0062] The loaded audio data is detected based on the SED (Sound Event Detection) algorithm, and the sound events of the audio data are detected and analyzed through machine learning. The audio is divided into several channels of sound data according to different sound events, so that the audio playback system can analyze and process the audio data.

[0063] Furthermore, for audio data such as song music and pure music, the complexity of SED algorithm in processing audio data can be reduced, thereby improving the convenience of audio data processing, and at the same time improving the audio processing effect, achieving good audio processing and playback effects.

[0064] Based on the sampling frequency of 44.1kHz, the audio data of each channel is sampled at 44.1kHz to obtain high-precision spectrum data, thereby providing accurate data support for subsequent audio playback mode adjustments.

[0065] Furthermore, the sampling frequency of 44.1kHz is the standard sampling rate for CD quality and is widely used in music production, storage and playback.

[0066] S12: extracting a plurality of low-frequency data segments from the spectrum data, and screening the plurality of low-frequency data segments based on a preset time length threshold, extracting low-frequency data segments greater than the preset time length threshold, and marking them as low-frequency adjustment data segments.

[0067] Setting 60 Hz as a screening threshold, using the screening threshold as a cutoff line in the spectrum data, and marking the audio data below the cutoff line as a low-frequency data segment;

[0068] The preset time length threshold is set to 3s, each low-frequency data segment is compared with the preset time length threshold, and the low-frequency data segments greater than the preset time length threshold are extracted and marked as low-frequency adjusted data segments.

[0069] S13: extracting a plurality of sampling data from the audio data according to the sampling frequency, and performing mean calculation on the plurality of sampling data to obtain a frequency spectrum average value of the audio data.

[0070] During the audio data loading stage, sampling is performed according to the audio playback timing, and the sampled data is accumulated and calculated. When the audio processing is on standby or during audio playback, the next audio data can be read and loaded according to user operations. The audio processing system based on the audio loads the audio data, thereby performing preliminary detection and processing on the frequency of the audio data.

[0071] According to the number of samples of the sampling data of the audio data, the spectral average value of the audio data is calculated. By analyzing the spectral average value of the audio data, the high-frequency data segment and the low-frequency data segment of the audio data can be detected and divided based on the spectral average value, so that the audio processing system of the audio can accurately adjust the playback volume according to the audio data.

[0072] S14: setting an initial playback volume of the audio system in combination with the ambient noise spectrum of the audio system and the average value of the spectrum.

[0073] The audio playback system recognizes and detects the ambient sound during the audio loading stage, extracts the ambient sound frequency data within the audio loading duration, and marks it as the ambient noise spectrum;

[0074] The initial playback volume of the speaker is set in combination with the ambient noise spectrum of the speaker and the average value of the spectrum. The noise detection unit of the speaker is used to detect the noise of the environment in which the speaker is located, so as to make targeted adjustments to the playback sound of the speaker to ensure that the playback sound effect of the speaker can meet the listening needs of the user.

[0075] Furthermore, when the speaker is in a state of playing audio, the volume decibel of the ambient noise detected by the speaker needs to be subtracted from the average volume decibel of the audio played by the speaker, thereby improving the accuracy of ambient noise detection.

[0076] Specifically, the step of setting the initial playback volume of the audio system in combination with the ambient noise spectrum of the audio system and the spectrum average value further includes:

[0077] Detect environmental noise and obtain the noise decibel of the environmental noise;

[0078] Extracting the maximum value of the noise spectrum from the environmental noise spectrum, and comparing the spectrum average value with the maximum value of the noise spectrum;

[0079] If the spectrum average is greater than the noise spectrum maximum, the relationship between the initial playback volume of the speaker and the noise decibel setting is:

[0080] ;

[0081] in, is the initial playback volume, is the noise decibel, is the spectrum average, is the maximum value of the noise spectrum;

[0082] If the spectrum average value is less than the noise spectrum maximum value, the relationship between the initial playback volume of the speaker and the noise decibel setting is:

[0083] ;

[0084] in, is the initial playback volume, is the noise decibel, is the spectrum average, is the maximum value of the noise spectrum.

[0085] S15: resampling the low-frequency adjustment data segment, drawing a low-frequency change curve of the low-frequency adjustment data segment, and setting a volume change curve according to the low-frequency change curve.

[0086] Figure 2 shows a sampling spectrum diagram of audio data in an embodiment of the present invention, Figure 3 The volume change curve diagram in the embodiment of the present invention is shown. The acquired low-frequency adjustment data is resampled by a preset resampling frequency to construct a low-frequency change curve of the low-frequency adjustment data segment;

[0087] The change curve is divided into several spectrum intervals according to the preset spectrum interval, the slope of each spectrum interval is extracted according to the low-frequency change curve, and the volume change curve is constructed according to the slopes of several spectrum intervals. In the change curve, the change curve is divided according to the change amplitude of the curve direction, that is, the slope of each spectrum interval is greatly different, so as to adjust and analyze the audio data.

[0088] S16: Smoothly adjusting the initial playback volume according to the volume change curve to generate playback volume adjustment data for the low-frequency adjustment data segment.

[0089] Specifically, the step of smoothly adjusting the initial playback volume according to the volume change curve to generate playback volume adjustment data of the low-frequency adjustment data segment includes:

[0090] The slope of each spectrum interval is extracted from the volume change curve, and the interval end value of the audio playback volume is calculated in combination with the slope of each spectrum interval and the interval start value of the audio playback volume, and the interval end value of the audio playback volume of the adjacent previous spectrum interval is used as the interval start value of the current spectrum interval.

[0091] Furthermore, in the volume change curve, the obtained starting frequency of the audio data is used as the interval starting value of the first frequency spectrum interval.

[0092] The volume change value of the spectrum interval is calculated according to the interval start value and the interval end value, and the volume change rate of the spectrum interval is calculated in combination with the time length of the spectrum interval;

[0093] The playback volume of the frequency spectrum interval is smoothly adjusted and controlled based on the volume change rate, and the playback volume adjustment data is generated by combining several frequency spectrum intervals.

[0094] The calculation formula of the volume change rate is:

[0095] ;

[0096] in, is the volume change rate of the i-th spectrum interval, is the starting value of the playback volume of the i-th spectrum interval, is the end value of the playback volume of the i-th spectrum interval, is the interval length of the i-th spectrum interval, i is a positive integer, and i≥1;

[0097] Furthermore, by performing a difference processing between the interval start value of the playback volume and the interval end value of the playback volume, a volume change value of the corresponding frequency spectrum interval is obtained, so as to calculate the volume change rate of the frequency spectrum interval.

[0098] The calculation formula for smooth adjustment of the playback volume in the spectrum interval is:

[0099] ;

[0100] in, is the volume change rate of the i-th spectrum interval, is the starting value of the playback volume of the i-th spectrum interval, is the playback volume at the jth moment in the i-th spectrum interval.

[0101] By adjusting the playback volume of each spectrum interval according to the volume change in the spectrum interval, the audio data of different channels are adjusted and integrated to form complete audio data, so that the sound effect of the low-frequency part of the audio data can be improved and meet the audio listening needs of the user in the current environment, thereby improving the playback effect of the audio data.

[0102] Specifically, the embodiment of the present invention provides a method for adjusting the sound playback mode based on audio detection, which reduces the interference of environmental noise and improves the sound quality and user listening experience by dynamically adjusting the playback volume of the sound, especially for changes in low-frequency data segments. The prior art usually adopts a fixed playback mode and volume setting, which cannot be dynamically adjusted according to changes in audio data and is easily interfered by environmental noise, affecting the sound quality and user experience.

[0103] By reading audio data and performing sampling analysis to obtain spectrum data, the low-frequency data segments in the audio can be accurately extracted, and low-frequency data segments greater than the preset time length threshold can be screened out and marked as low-frequency adjustment data segments. The sampled data is extracted and the spectrum average is calculated. The initial playback volume is set in combination with the ambient noise spectrum and the spectrum average. The playback volume of the audio can be dynamically adjusted according to changes in ambient noise. The low-frequency adjustment data segment is resampled and a low-frequency change curve is drawn. The volume change curve is set according to the low-frequency change curve, which can accurately reflect the changes in the low-frequency data segment. The initial playback volume is smoothly adjusted according to the volume change curve to generate playback volume adjustment data, which can achieve a smooth transition of the volume and enhance the user's listening experience.

[0104] Among them, the steps of acquiring spectrum data, screening low-frequency data segments, calculating the spectrum average, setting the initial playback volume, drawing the low-frequency change curve, setting the volume change curve, and smoothly adjusting the playback volume, through mutual cooperation, realize the dynamic adjustment of the audio playback volume according to the characteristics of different audio data, especially the changes in the low-frequency data segments, thereby reducing the interference of environmental noise and improving the sound quality and the user's listening experience.

[0105] Embodiment 2:

[0106] Figure 4 A schematic diagram of an audio playing mode adjustment system based on audio detection in an embodiment of the present invention is shown.

[0107] Input detection component 10: used to read the audio data input into the audio playback system, and perform sampling and analysis on the audio data to obtain the frequency spectrum data of the audio data.

[0108] The step of reading the audio data input into the audio playback system, sampling and analyzing the audio data, and obtaining the spectrum data of the audio data includes:

[0109] Load the audio data to be played into the audio playback system, perform sound event analysis on the audio data based on the SED algorithm, divide the audio data into multiple channels, and obtain audio data of several channels;

[0110] The audio data of each channel is sampled based on 44.1 kHz, and spectrum data of the audio data of each channel is acquired.

[0111] The marking component 20 is used to extract a plurality of low-frequency data segments from the spectrum data, and screen the plurality of low-frequency data segments based on a preset time length threshold, extract the low-frequency data segments greater than the preset time length threshold, and mark them as low-frequency adjusted data segments.

[0112] The step of extracting a plurality of low-frequency data segments from the spectrum data, screening the plurality of low-frequency data segments based on a preset time length threshold, extracting low-frequency data segments greater than the preset time length threshold, and marking them as low-frequency adjusted data segments comprises:

[0113] Setting 60 Hz as a screening threshold, using the screening threshold as a cutoff line in the spectrum data, and marking the audio data below the cutoff line as a low-frequency data segment;

[0114] The preset time length threshold is set to 3s, each low-frequency data segment is compared with the preset time length threshold, and the low-frequency data segments greater than the preset time length threshold are extracted and marked as low-frequency adjusted data segments.

[0115] The calculation component 30 is used to extract a plurality of sampled data from the audio data according to the sampling frequency, and perform mean calculation on the plurality of sampled data to obtain the frequency spectrum average value of the audio data.

[0116] The step of extracting a plurality of sampled data from the audio data according to the sampling frequency, and performing mean calculation on the plurality of sampled data to obtain the frequency spectrum average value of the audio data comprises:

[0117] In the audio data loading stage, sampling is performed according to the audio playback timing, and the sampled data is accumulated and calculated;

[0118] Calculate the average value of the frequency spectrum of the audio data according to the number of samples of the sampling data of the audio data.

[0119] The volume setting component 40 is used to set the initial playback volume of the audio system in combination with the ambient noise spectrum of the audio system and the average value of the spectrum.

[0120] The step of setting the initial playback volume of the audio system in combination with the ambient noise spectrum of the audio system and the spectrum average value comprises:

[0121] The audio playback system recognizes and detects the ambient sound during the audio loading stage, extracts the ambient sound frequency data within the audio loading duration, and marks it as the ambient noise spectrum;

[0122] The initial playback volume of the speaker is set based on the ambient noise spectrum of the speaker and the average value of the spectrum.

[0123] The step of setting the initial playback volume of the audio system in combination with the ambient noise spectrum of the audio system and the spectrum average value also includes:

[0124] Detect environmental noise and obtain the noise decibel of the environmental noise;

[0125] Extracting the maximum value of the noise spectrum from the environmental noise spectrum, and comparing the spectrum average value with the maximum value of the noise spectrum;

[0126] If the spectrum average is greater than the noise spectrum maximum, the relationship between the initial playback volume of the speaker and the noise decibel setting is:

[0127] ;

[0128] in, is the initial playback volume, is the noise decibel, is the spectrum average, is the maximum value of the noise spectrum;

[0129] If the spectrum average value is less than the noise spectrum maximum value, the relationship between the initial playback volume of the speaker and the noise decibel setting is:

[0130] ;

[0131] in, is the initial playback volume, is the noise decibel, is the spectrum average, is the maximum value of the noise spectrum.

[0132] Sampling and analysis component 50: used for resampling the low-frequency adjustment data segment, drawing a low-frequency change curve of the low-frequency adjustment data segment, and setting a volume change curve according to the low-frequency change curve;

[0133] Resampling the acquired low-frequency adjustment data at a preset resampling frequency to construct a low-frequency change curve of the low-frequency adjustment data segment;

[0134] Dividing the change curve into a plurality of spectrum intervals according to a preset spectrum interval, and extracting the slope of each spectrum interval according to the low-frequency change curve;

[0135] The volume change curve is constructed according to the slopes of several spectrum intervals.

[0136] The audio playback adjustment component 60 is used to smoothly adjust the initial playback volume according to the volume change curve, and generate playback volume adjustment data of the low-frequency adjustment data segment.

[0137] The step of smoothly adjusting the initial playback volume according to the volume change curve to generate playback volume adjustment data for the low-frequency adjustment data segment comprises:

[0138] Extracting the slope of each frequency spectrum interval from the volume change curve, and calculating the interval end value of the audio playback volume in combination with the slope of each frequency spectrum interval and the interval start value of the audio playback volume;

[0139] The volume change value of the spectrum interval is calculated according to the interval start value and the interval end value, and the volume change rate of the spectrum interval is calculated in combination with the time length of the spectrum interval;

[0140] The playback volume of the frequency spectrum interval is smoothly adjusted and controlled based on the volume change rate, and the playback volume adjustment data is generated by combining several frequency spectrum intervals.

[0141] The calculation formula of the volume change rate is:

[0142] ;

[0143] in, is the volume change rate of the i-th spectrum interval, is the starting value of the playback volume of the i-th spectrum interval, is the end value of the playback volume of the i-th spectrum interval, is the interval length of the i-th spectrum interval, i is a positive integer, and i≥1;

[0144] The calculation formula for smooth adjustment of the playback volume in the spectrum interval is:

[0145] ;

[0146] in, is the volume change rate of the i-th spectrum interval, is the starting value of the playback volume of the i-th spectrum interval, is the playback volume at the jth moment in the i-th spectrum interval.

[0147] Specifically, the embodiment of the present invention provides a system for adjusting the sound playback mode based on audio detection, which reduces the interference of environmental noise and improves the sound quality and user listening experience by dynamically adjusting the playback volume of the sound, especially for changes in low-frequency data segments. The existing technology usually adopts fixed playback modes and volume settings, which cannot be dynamically adjusted according to changes in audio data and are easily interfered by environmental noise, affecting the sound quality and user experience.

[0148] By reading audio data and performing sampling analysis to obtain spectrum data, the low-frequency data segments in the audio can be accurately extracted, and low-frequency data segments greater than the preset time length threshold can be screened out and marked as low-frequency adjustment data segments. The sampled data is extracted and the spectrum average is calculated. The initial playback volume is set in combination with the ambient noise spectrum and the spectrum average. The playback volume of the audio can be dynamically adjusted according to changes in ambient noise. The low-frequency adjustment data segment is resampled and a low-frequency change curve is drawn. The volume change curve is set according to the low-frequency change curve, which can accurately reflect the changes in the low-frequency data segment. The initial playback volume is smoothly adjusted according to the volume change curve to generate playback volume adjustment data, which can achieve a smooth transition of the volume and enhance the user's listening experience.

[0149] A person skilled in the art may understand that all or part of the steps in the various methods of the above embodiments may be completed by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, and the storage medium may include: a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk, etc.

[0150] In addition, the above provides a detailed introduction to the embodiments of the present invention. Specific examples are used herein to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. At the same time, for those skilled in the art, according to the idea of ​​the present invention, there will be changes in the specific implementation methods and application scopes. In summary, the content of this specification should not be understood as a limitation on the present invention.

Claims

1. A method for adjusting an audio playing mode based on audio detection, characterized in that: The adjustment method comprises: Read the audio data input into the audio playback system, perform sampling and analysis on the audio data, and obtain the frequency spectrum data of the audio data; Extracting a plurality of low-frequency data segments from the spectrum data, and screening the plurality of low-frequency data segments based on a preset time length threshold, extracting low-frequency data segments greater than the preset time length threshold, and marking them as low-frequency adjustment data segments; Extracting a plurality of sampled data from the audio data according to the sampling frequency, and performing mean calculation on the plurality of sampled data to obtain a frequency spectrum average value of the audio data; The initial playback volume of the speaker is set based on the ambient noise spectrum of the speaker and the average value of the spectrum; Resampling the low-frequency adjustment data segment, drawing a low-frequency change curve of the low-frequency adjustment data segment, and setting a volume change curve according to the low-frequency change curve; Resampling the acquired low-frequency adjustment data at a preset resampling frequency to construct a low-frequency change curve of the low-frequency adjustment data segment; Dividing the change curve into a plurality of spectrum intervals according to a preset spectrum interval, and extracting the slope of each spectrum interval according to the low-frequency change curve; Constructing a volume change curve according to the slopes of several frequency spectrum intervals; Smoothly adjusting the initial playback volume according to the volume change curve to generate playback volume adjustment data of the low-frequency adjustment data segment; Extracting the slope of each frequency spectrum interval from the volume change curve, and calculating the interval end value of the audio playback volume in combination with the slope of each frequency spectrum interval and the interval start value of the audio playback volume; The volume change value of the spectrum interval is calculated according to the interval start value and the interval end value, and the volume change rate of the spectrum interval is calculated in combination with the time length of the spectrum interval; The playback volume of the frequency spectrum interval is smoothly adjusted and controlled based on the volume change rate, and the playback volume adjustment data is generated by combining several frequency spectrum intervals.

2. The method for adjusting the sound playing mode based on audio detection according to claim 1, characterized in that: The step of reading the audio data input into the audio playback system, sampling and analyzing the audio data, and obtaining the spectrum data of the audio data includes: Load the audio data to be played into the audio playback system, perform sound event analysis on the audio data based on the SED algorithm, divide the audio data into multiple channels, and obtain audio data of several channels; The audio data of each channel is sampled based on 44.1 kHz, and spectrum data of the audio data of each channel is acquired.

3. The method for adjusting the sound playing mode based on audio detection according to claim 1, characterized in that: The step of extracting a plurality of low-frequency data segments from the spectrum data, screening the plurality of low-frequency data segments based on a preset time length threshold, extracting low-frequency data segments greater than the preset time length threshold, and marking them as low-frequency adjusted data segments comprises: Setting 60 Hz as a screening threshold, using the screening threshold as a cutoff line in the spectrum data, and marking the audio data below the cutoff line as a low-frequency data segment; The preset time length threshold is set to 3s, each low-frequency data segment is compared with the preset time length threshold, and the low-frequency data segments greater than the preset time length threshold are extracted and marked as low-frequency adjusted data segments.

4. The method for adjusting the sound playing mode based on audio detection according to claim 1, characterized in that: The step of extracting a plurality of sampled data from the audio data according to the sampling frequency, and performing mean calculation on the plurality of sampled data to obtain the frequency spectrum average value of the audio data comprises: In the audio data loading stage, sampling is performed according to the audio playback timing, and the sampled data is accumulated and calculated; Calculate the average value of the frequency spectrum of the audio data according to the number of samples of the sampling data of the audio data.

5. The method for adjusting the sound playing mode based on audio detection according to claim 1, characterized in that: The step of setting the initial playback volume of the audio system in combination with the ambient noise spectrum of the audio system and the spectrum average value comprises: The audio playback system recognizes and detects the ambient sound during the audio loading stage, extracts the ambient sound frequency data within the audio loading duration, and marks it as the ambient noise spectrum; The initial playback volume of the speaker is set based on the ambient noise spectrum of the speaker and the average value of the spectrum.

6. The method for adjusting the sound playing mode based on audio detection according to claim 5, characterized in that: The step of setting the initial playback volume of the audio system in combination with the ambient noise spectrum of the audio system and the spectrum average value also includes: Detect environmental noise and obtain the noise decibel of the environmental noise; Extracting the maximum value of the noise spectrum from the environmental noise spectrum, and comparing the spectrum average value with the maximum value of the noise spectrum; If the spectrum average is greater than the noise spectrum maximum, the relationship between the initial playback volume of the speaker and the noise decibel setting is: ; in, is the initial playback volume, is the noise decibel, is the spectrum average, is the maximum value of the noise spectrum; If the spectrum average value is less than the noise spectrum maximum value, the relationship between the initial playback volume of the speaker and the noise decibel setting is: ; in, is the initial playback volume, is the noise decibel, is the spectrum average, is the maximum value of the noise spectrum.

7. The method for adjusting the sound playing mode based on audio detection according to claim 1, characterized in that: The calculation formula of the volume change rate is: ; in, is the volume change rate of the i-th spectrum interval, is the starting value of the playback volume of the i-th spectrum interval, is the end value of the playback volume of the ith spectrum interval, is the interval length of the i-th spectrum interval, i is a positive integer, and i≥1; The calculation formula for smooth adjustment of the playback volume in the spectrum interval is: ; in, is the volume change rate of the i-th spectrum interval, is the starting value of the playback volume of the i-th spectrum interval, is the playback volume at the jth moment in the i-th spectrum interval.

8. A sound playing mode adjustment system based on audio detection, characterized in that: The adjustment system comprises: Input detection component: used to read the audio data input into the audio playback system, perform sampling analysis on the audio data, and obtain the spectrum data of the audio data; A marking component is used to extract a number of low-frequency data segments from the spectrum data, and screen the number of low-frequency data segments based on a preset time length threshold, extract the low-frequency data segments greater than the preset time length threshold, and mark them as low-frequency adjustment data segments; A calculation component is used to extract a number of sampled data from the audio data according to the sampling frequency, and perform mean calculation on the number of sampled data to obtain the frequency spectrum average value of the audio data; Volume setting component: used to set the initial playback volume of the audio system in combination with the ambient noise spectrum of the audio system and the average value of the spectrum; Sampling and analysis component: used for resampling the low-frequency adjustment data segment, drawing the low-frequency change curve of the low-frequency adjustment data segment, and setting the volume change curve according to the low-frequency change curve; Resampling the acquired low-frequency adjustment data at a preset resampling frequency to construct a low-frequency change curve of the low-frequency adjustment data segment; Dividing the change curve into a plurality of spectrum intervals according to a preset spectrum interval, and extracting the slope of each spectrum interval according to the low-frequency change curve; Constructing a volume change curve according to the slopes of several frequency spectrum intervals; An audio playback adjustment component: used for smoothly adjusting the initial playback volume according to the volume change curve, and generating playback volume adjustment data of the low-frequency adjustment data segment; Extracting the slope of each frequency spectrum interval from the volume change curve, and calculating the interval end value of the audio playback volume in combination with the slope of each frequency spectrum interval and the interval start value of the audio playback volume; The volume change value of the spectrum interval is calculated according to the interval start value and the interval end value, and the volume change rate of the spectrum interval is calculated in combination with the time length of the spectrum interval; The playback volume of the frequency spectrum interval is smoothly adjusted and controlled based on the volume change rate, and the playback volume adjustment data is generated by combining several frequency spectrum intervals.

Citation Information

Patent Citations

  • Audio data processing method and device and electronic equipment

    CN113556654A

  • Audio gain control method and system for Bluetooth sound box

    CN117939360A