Audio signal sampling rate adjustment method and device, equipment and computer storage medium
By collecting audio signal data for multiple time periods in the conference system device, determining the sampling rate candidate value and performing adaptive adjustment, the audio tone change caused by inaccurate sampling rate is solved, and the call quality is improved.
Patent Information
- Application Number
- CN202311582419.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-23
- Publication Date
- 2025-05-23
AI Technical Summary
In audio conference system, the sampling rate is inconsistent with the external device, causing the audio tone to change, affecting the call quality. The prior art relies on acquisition thread stability for a single time period, resulting in inaccurate sampling rates.
By collecting audio signal data in at least two time periods, calculate the sampling rate candidate values for each time period, and determine whether the candidate values are consistent, determine the actual sampling rate value, and perform adaptive adjustment of the sampling rate of the audio signal.
It improves the accuracy of the audio signal sampling rate, avoids audio tone change, and improves call quality.
Smart Images

Figure CN120032653A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of audio data technology, and in particular to an audio signal sampling rate adjustment method, a conference system device, an electronic device and a computer-readable storage medium. Background Art
[0002] When a conference system is conducting an audio conference, it is usually connected to an external device. When the sampling rate value of the conference system is inconsistent with the actual sampling rate value of the external device, audio pitch shifting will occur, affecting the call quality.
[0003] Currently, in the process of adjusting the sampling rate value of the conference system device according to the actual sampling rate value of the external device to improve the call quality, the actual sampling rate value of the external device is determined by taking the average number of sampling points in a time period as the actual sampling rate value. This method relies on the stability of the application acquisition thread. If the acquisition thread is unstable in a time period, the statistical data will be low, resulting in inaccurate audio signal sampling rate problems, and then audio pitch shifting. Summary of the invention
[0004] The main technical problem solved by the present application is to provide an audio signal sampling rate adjustment method, a conference system device and a storage medium, which can improve the accuracy of the audio signal sampling rate.
[0005] To solve the above technical problems, a technical solution adopted in the present application is: to provide an audio signal sampling rate adjustment method, the method comprising: collecting audio signal data within at least two time periods; determining a sampling rate candidate value for the corresponding time period based on the audio signal data within each time period; in response to the sampling rate candidate values of each time period being the same, using the sampling rate candidate value as the actual sampling rate value; and performing audio signal sampling rate adaptive adjustment processing based on the actual sampling rate value.
[0006] In some embodiments, the step of determining the candidate sampling rate value for the corresponding time period based on the audio signal data within each time period includes: calculating the initial sampling rate value for the corresponding time period based on the amount of audio signal data within each time period; determining the sampling error based on the initial sampling rate value for each time period and a preset sampling rate expected value; in response to the sampling error within each time period being less than or equal to a preset error threshold, determining the initial sampling rate value as the candidate sampling rate value for the corresponding time period.
[0007] In some embodiments, the step of calculating the initial sampling rate value of the corresponding time period based on the amount of audio signal data in each time period includes: calculating a first ratio between the amount of audio signal data in each time period and the length of the corresponding time period; and using the first ratio as the initial sampling rate value of the corresponding time period.
[0008] In some embodiments, the step of determining the sampling error based on the initial sampling rate value of each time period and the preset sampling rate expected value includes: calculating the absolute value of the difference between the initial sampling rate value in each time period and the preset sampling rate expected value; calculating a second ratio between the absolute value of the difference and the preset sampling rate expected value; and using the second ratio as the sampling error of the corresponding time period.
[0009] In some embodiments, the step of adaptively adjusting the sampling rate of the audio signal based on the actual sampling rate value includes: obtaining the sampling rate value of the current audio; determining whether the sampling rate value of the current audio is the same as the actual sampling rate value; in response to the actual sampling rate value being different from the sampling rate value of the current audio, resampling the sampling rate value of the current audio to the actual sampling rate value.
[0010] In some embodiments, after the step of determining the sampling rate candidate value of the corresponding time period based on the audio signal data in each time period, the method further includes: in response to the sampling rate candidate value corresponding to one time period among the at least two time periods being different from the sampling rate candidate values corresponding to other time periods, reacquiring the audio signal data in at least two time periods.
[0011] To solve the above technical problems, another technical solution adopted in the present application is: a conference system device is provided, the device includes a conference application layer, the conference application layer includes a sampling rate detection module and a sampling rate adjustment module; the sampling rate detection module is used to determine the sampling rate candidate value of the corresponding time period based on the audio signal data in each time period, and in response to the sampling rate candidate values of each time period being the same, the sampling rate candidate value is used as the actual sampling rate value; the sampling rate adjustment module is used to perform adaptive adjustment processing of the audio signal sampling rate based on the actual sampling rate value.
[0012] In some embodiments, the device also includes a signal processing driver layer, which is connected to the sampling rate detection module in the conference application layer; the signal processing driver layer is used to convert the audio signal data collected in at least two time periods into digital signals and analog signals.
[0013] To solve the above technical problem, another technical solution adopted in the present application is: to provide an electronic device, including a memory and a processor, wherein the memory stores program instructions, and the processor retrieves the program instructions from the memory to execute the above audio signal sampling rate adjustment method.
[0014] In order to solve the above technical problem, another technical solution adopted by the present application is: providing a computer-readable storage medium including program data stored therein, wherein the program data is used to implement the above audio signal sampling rate adjustment method when executed by a processor.
[0015] Compared with the current solution that relies on the application acquisition thread to determine the audio signal sampling rate based on the comparison result between the audio signal data in a time period and the preset data threshold, which leads to the problem of inaccurate audio signal sampling rate, the above-mentioned solution determines the sampling rate candidate value in the corresponding time period through the audio signal data in at least two time periods, and determines the actual candidate rate value based on the sampling rate candidate value in the corresponding time period, and then adaptively adjusts the audio signal sampling rate based on the actual candidate rate value, thereby improving the audio signal sampling rate and avoiding the audio pitch problem caused by inaccurate audio signal sampling rate. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative work, among which:
[0017] Figure 1 is a flowchart of an exemplary embodiment of a method for adjusting the sampling rate of an audio signal shown in the present application;
[0018] Figure 2 yes Figure 1 A flowchart of an exemplary embodiment of step S120 in the method for adjusting the sampling rate of an audio signal is shown;
[0019] Figure 3 yes Figure 2 A flow chart of an exemplary embodiment of step S210 in the method for adjusting the sampling rate of an audio signal is shown;
[0020] Figure 4 yes Figure 2 A flowchart of an exemplary embodiment of step S220 in the method for adjusting the sampling rate of an audio signal is shown;
[0021] Figure 5 yes Figure 1 A flowchart of an exemplary embodiment of step S140 in the method for adjusting the sampling rate of an audio signal is shown;
[0022] Figure 6 yes Figure 1 A flow chart of an exemplary embodiment of the method for adjusting the sampling rate of an audio signal after step S120 is shown;
[0023] Figure 7 is a structural schematic diagram of an exemplary embodiment of a conference system device shown in the present application;
[0024] Figure 8 It is a specific structural diagram of an exemplary embodiment of a conference system device provided by the present application;
[0025] Fig. 9 It is a structural schematic diagram of an embodiment of an electronic device provided by the present application;
[0026] Fig.10 It is a structural schematic diagram of an embodiment of a computer-readable storage medium provided by the present application. DETAILED DESCRIPTION
[0027] The technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. It will be appreciated that the specific embodiments described herein are only used to explain the present application, rather than to limit the present application. It should also be noted that, for ease of description, only some but not all structures related to the present application are shown in the drawings. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the art without making creative work are within the scope of protection of the present application.
[0028] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by technicians in the technical field to which this application belongs; the terms used herein are only for the purpose of describing specific embodiments and are not intended to limit this application; the terms "including" and "having" in the specification and claims of this application and the above-mentioned figure descriptions and any variations thereof are intended to cover non-exclusive inclusions.
[0029] First of all, it should be noted that this application proposes a method for adjusting the sampling rate of an audio signal, which can be applied to the sampling rate adjustment of an audio conference. Specifically, the candidate sampling rate value of the corresponding time period is determined based on the audio signal data collected in at least two time periods, and the actual sampling rate value is determined by judging whether the candidate sampling rate values of each time period are the same. The audio signal sampling rate is adaptively adjusted according to the actual sampling rate value to improve the accuracy of the audio signal sampling rate and avoid the audio pitch problem caused by inaccurate audio signal sampling rate. Please refer to Figure 1 , Figure 1 1 is a flowchart of an exemplary embodiment of the method for adjusting the sampling rate of an audio signal shown in the present application. The method for adjusting the sampling rate of an audio signal of the present embodiment can be applied to a conference system device. Specifically, the method for adjusting the sampling rate of an audio signal of the present embodiment may include the following steps:
[0030] S110: Collecting audio signal data in at least two time periods.
[0031] The time period can also be called a time window, which is pre-set. The number of time periods can be set according to actual conditions, but it is at least two. Among them, the duration of each time period is the same, for example, it can be 500 milliseconds. Exemplarily, in order to improve the speed of adjusting the sampling rate of the audio signal, the duration accuracy of each time period can be set to milliseconds. It should be noted that for the determination of the time period, on the one hand, a time length can be divided into several parts, each part is used as a time period, and at this time, there is no time interval between two adjacent time periods. Specifically, the time period length is 500 milliseconds, and 4 time periods can be determined within 2 seconds; on the other hand, a time length can be obtained at intervals of a preset time as a time period. At this time, the adjacent time periods are separated by a preset time. Of course, in a specific embodiment, the preset time between each two adjacent time periods may be different.
[0032] Audio signal data refers to digital data obtained by sampling sound within a certain period of time. For example, data collected by a microphone can be used as audio signal data, or data extracted from a recorded audio file can be used as audio signal data. In actual application environments, audio signal data can be the voice data of a speaker during a meeting, or the audio data of a shared video.
[0033] The conference system device collects audio signal data in corresponding time periods from at least two preset time periods. Exemplarily, during a conference, 9:10 to 9:15 is preset as a first time period, and 9:15 to 9:20 is preset as a second time period. The conference system device collects audio signal data in the first time period, such as the audio of the speaker's speech in this time period, and collects audio signal data in the second time period, such as the audio data of the song played in the conference.
[0034] S120: Determine a candidate sampling rate value for a corresponding time period based on the audio signal data in each time period.
[0035] The sampling rate candidate value refers to a value that can represent the actual sampling rate value of the current time period. Exemplarily, the mean value of the audio signal data in each time period can be used as the sampling rate candidate value of the corresponding time period, the mode of the audio signal data in each time period can be used as the sampling rate candidate value of the corresponding time period, and the mean value of the data after removing the highest audio signal data and the lowest audio signal data in each time period can be used as the sampling rate candidate value of the corresponding time period.
[0036] The conference system device calculates the sampling rate candidate value of the corresponding time period based on the collected audio signal data in each time period. Exemplarily, the conference system device uses the average value of the audio signal data in each time period as the sampling rate candidate value of the corresponding time period.
[0037] S130: In response to the candidate sampling rate values in each time period being the same, taking the candidate sampling rate value as the actual sampling rate value.
[0038] The actual sampling rate value refers to the actual sampling rate value of the audio playback in each time period obtained by detection.
[0039] In order to avoid the problem of audio pitch shifting caused by unstable audio signal data, the embodiment of the present application determines the stability of the audio signal data by judging whether the candidate sampling rate values of each time period are the same. Specifically, the conference system device judges whether the candidate sampling rate values of each time period are the same. If the candidate sampling rate values of each time period are the same, it indicates that the collected audio signal data is stable, and the same candidate sampling rate value is used as the actual sampling rate value of each time period.
[0040] S140: Performing an adaptive adjustment process on the sampling rate of the audio signal based on the actual sampling rate value.
[0041] The audio signal sampling rate adaptive adjustment process is also called resampling process, which means that the audio signal sampling rate value of the conference system device itself can be adaptively adjusted according to the actual sampling rate value.
[0042] The conference system device performs adaptive adjustment processing of the audio signal sampling rate based on the actual sampling rate value. Exemplarily, the conference system device can replace the actual sampling rate value with its own audio signal sampling rate value to obtain the latest audio signal sampling rate value of the conference system device.
[0043] It can be seen that compared with the current reliance on the application acquisition thread to determine the audio signal sampling rate based on the comparison result between the audio signal data in a time period and the preset data threshold, which leads to the problem of inaccurate audio signal sampling rate, the audio signal sampling rate adjustment method of the embodiment of the present application determines the sampling rate candidate value in the corresponding time period through the audio signal data in at least two time periods, and determines the actual candidate rate value based on the sampling rate candidate value in the corresponding time period, and then adaptively adjusts the audio signal sampling rate according to the actual candidate rate value, thereby improving the audio signal sampling rate and avoiding the audio pitch problem caused by inaccurate audio signal sampling rate.
[0044] Based on the above embodiments, the embodiments of the present application adopt Figure 2 The flowchart details how to determine the candidate sampling rate value for the corresponding time period based on the collected audio signal data for each time period. Figure 2 , Figure 2 yes Figure 1 The flowchart of an exemplary embodiment of step S120 in the method for adjusting the sampling rate of an audio signal is shown. Specifically, the process of step S120 determining the candidate sampling rate value of the corresponding time period based on the audio signal data in each time period specifically includes the following steps:
[0045] S210: Calculating an initial sampling rate value of a corresponding time period based on the amount of audio signal data in each time period.
[0046] The amount of audio signal data refers to the amount of audio samples collected within a time period. Exemplarily, the amount of audio signal data can be obtained by real-time counting of the audio signal data collected within the time period.
[0047] The initial sampling rate value refers to the initial sampling rate value of each time period. Exemplarily, the initial sampling rate value can be calculated from the amount of audio signal data.
[0048] The conference system apparatus determines an initial sampling rate value of a corresponding time period based on the amount of audio signal data in each time period.
[0049] S220: Determine a sampling error based on an initial sampling rate value in each time period and a preset sampling rate expected value.
[0050] The preset sampling rate expected value refers to a fixed sampling rate value set by the staff according to the audio sampling situation. Exemplarily, the preset sampling rate expected value can be 8000, 16000, 32000, 44100, 48000, etc.
[0051] Sampling error refers to the difference between the initial sampling rate value in each time period and the preset sampling rate expected value.
[0052] After the conference system device calculates the initial sampling rate value of each time period, the sampling error of the conference system device is calculated by the initial sampling rate value of each time period and the preset sampling rate expected value.
[0053] S230: In response to the sampling error in each time period being less than or equal to a preset error threshold, determining the initial sampling rate value as a candidate sampling rate value for the corresponding time period.
[0054] The preset error threshold may be a numerical value preset manually. For example, the preset error threshold may be set to 5%. It should be noted that the preset error threshold is used to determine whether the sampling error in the corresponding time period is within the allowable range, that is, to determine whether the sampling error in each end is less than or equal to the preset error threshold. If so, the initial sampling rate value is determined as the candidate sampling rate value for the corresponding time period. If not, it means that the initial sampling rate of the corresponding time period cannot be used as the candidate sampling rate value for the time period.
[0055] The conference system device determines whether the sampling error within each time period is less than or equal to a preset error threshold. If the sampling error within each time period is less than or equal to the preset error threshold, the initial sampling rate value is determined as the sampling rate candidate value for the corresponding time period; if the sampling error within each time period is greater than the preset error threshold, the initial sampling rate value will not be used as the sampling rate candidate value.
[0056] It can be seen that the audio signal sampling rate adjustment method in the embodiment of the present application calculates the initial sampling rate value for the corresponding time period based on the number of audio signal data within each time period; determines the sampling error based on the initial sampling rate value of each time period and the preset sampling rate expected value; in response to the sampling error within each time period being less than or equal to the preset error threshold, the initial sampling rate value is determined as the sampling rate candidate value for the corresponding time period. Thus, the initial sampling rate values with large sampling errors are eliminated, which can improve the accuracy of the sampling rate candidate values and further improve the quality of audio signal sampling rate adjustment.
[0057] Based on the above embodiment, the embodiment of the present application uses Figure 3 The flowchart details how to obtain the initial sampling rate value. Please refer to Figure 3 , Figure 3 is Figure 2 FIG. is a schematic flowchart of an exemplary embodiment of step S210 in the audio signal sampling rate adjustment method shown. Specifically, the process of step S210 calculating the initial sampling rate value for the corresponding time period based on the number of audio signal data within each time period specifically includes the following steps:
[0058] S310: Calculate the first ratio between the number of audio signal data within each time period and the duration of the corresponding time period.
[0059] The first ratio refers to the proportional value between the number of audio signal data within each time period and the duration of the corresponding time period. Exemplarily, the number of audio signal data can be represented as m, and the duration of the corresponding time period can be represented as Δt, then the calculation of the first ratio satisfies m / Δt.
[0060] After the conference system device obtains the number of audio signal data within each time period and the duration of the corresponding time period, it calculates the ratio between the number of audio signal data within each time period and the duration of the corresponding time period, and takes this ratio as the first ratio.
[0061] S320: Take the first ratio as the initial sampling rate value for the corresponding time period.
[0062] The conference system device takes the first ratio between the number of audio signal data within each time period and the duration of the corresponding time period calculated as the initial sampling rate value for the corresponding segment.
[0063] Exemplarily, the calculation of the initial sampling rate value satisfies the following formula:
[0064] F0 temp =m / Δt
[0065] Among them, Fs0 temp It represents the initial sampling rate value, m represents the amount of audio signal data in each time period, and Δt represents the duration of the corresponding time period.
[0066] It can be seen that the audio signal sampling rate adjustment method of the embodiment of the present application calculates the first ratio between the amount of audio signal data in each time period and the duration of the corresponding time period; and uses the first ratio as the initial sampling rate value of the corresponding time period. In this way, the initial sampling rate value can be calculated by the amount of audio signal data collected in real time, thereby ensuring the real-time performance of the audio signal sampling rate adjustment.
[0067] Based on the above embodiments, the embodiments of the present application adopt Figure 4 The flowchart details how to determine the sampling error of the corresponding time period based on the initial sampling rate value of each time period. Figure 4 , Figure 4 yes Figure 2 The flowchart of an exemplary embodiment of step S220 in the method for adjusting the sampling rate of an audio signal is shown. Specifically, the process of determining the sampling error based on the initial sampling rate value of each time period and the preset sampling rate expected value in step S220 specifically includes the following steps:
[0068] S410: Calculate the absolute value of the difference between the initial sampling rate value in each time period and the preset sampling rate expected value.
[0069] The conference system device calculates the absolute value of the difference between the initial sampling rate value in each time period and the preset sampling rate expected value.
[0070] Exemplarily, the calculation of the absolute value of the difference between the initial sampling rate in each time period and the preset expected sampling rate value satisfies the following formula:
[0071] x=abs(Fs0 temp -Fs0 expect )
[0072] Where x is the absolute value of the difference, Fs0 temp Expressed as the initial sampling rate value in each time period, Fs0 expect It represents the expected value of the preset sampling rate, and abs represents the absolute value function.
[0073] S420: Calculate a second ratio between the absolute value of the difference and a preset expected value of the sampling rate.
[0074] The second ratio refers to the ratio between the absolute value of the difference between the initial sampling rate value in each time period and the preset expected sampling rate value and the preset expected sampling rate value.
[0075] The conference system device calculates the ratio between the absolute value of the difference and the preset expected value of the sampling rate, and uses the ratio as the second ratio.
[0076] Exemplarily, the calculation method of the second ratio satisfies the following formula:
[0077] y=abs(Fs0 temp -Fs0 expect ) / Fs0 expect
[0078] Where y represents the second ratio, Fs0 temp Expressed as the initial sampling rate value in each time period, Fs0 expect It represents the expected value of the preset sampling rate, and abs represents the absolute value function.
[0079] S430: Using the second ratio as the sampling error of the corresponding time period.
[0080] The conference system device uses the calculated second ratio as the sampling error of the corresponding time period. Exemplarily, the calculation of the sampling error satisfies the following formula:
[0081] Error=abs(Fs0 temp -Fs0 expect ) / Fs0 expect
[0082] Among them, Error represents the sampling error, Fs0 temp Expressed as the initial sampling rate value in each time period, Fs0 expect It represents the expected value of the preset sampling rate, and abs represents the absolute value function.
[0083] It can be seen that the audio signal sampling rate adjustment method of the embodiment of the present application calculates the absolute value of the difference between the initial sampling rate value in each time period and the preset sampling rate expected value; calculates the second ratio between the absolute value of the difference and the preset sampling rate expected value; and uses the second ratio as the sampling error of the corresponding time period. In this way, it is possible to determine whether the calculated initial sampling rate value is accurate, and provide more accurate data for the subsequent audio signal sampling rate adaptive adjustment process.
[0084] Based on the above embodiments, the embodiments of the present application adopt Figure 5 The flowchart explains in detail how to perform the adaptive adjustment of the audio signal sampling rate. Figure 5 , Figure 5 yes Figure 1The flowchart of an exemplary embodiment of step S140 in the audio signal sampling rate adjustment method is shown. Specifically, the process of step S140 performing adaptive adjustment processing of the audio signal sampling rate based on the actual sampling rate value specifically includes the following steps:
[0085] S510: Obtain the sampling rate value of the current audio.
[0086] The current audio sampling rate value refers to the sampling rate value of the current audio playback of the conference system device. Exemplarily, the conference system device can directly use the original sampling rate value of the conference system device as the current audio sampling rate value, or use the adjusted sampling rate value as the current audio sampling rate value.
[0087] The conference system collects the sampling rate value of the current audio playback as the sampling rate value of the current audio.
[0088] S520: Determine whether the current audio sampling rate value is the same as the actual sampling rate value.
[0089] The current audio sampling rate value will be adjusted according to the change of the actual sampling rate value. In order to improve the call quality and prevent the audio pitch from changing, the current audio sampling rate value should be kept the same as the actual sampling rate value.
[0090] Based on this, after obtaining the current audio sampling rate value and the actual sampling rate value, the conference system device determines whether the current audio sampling rate value and the actual sampling rate value are the same. If they are not the same, step S530 is executed.
[0091] S530: Resample the sampling rate value of the current audio to the actual sampling rate value.
[0092] The actual sampling rate value and the current audio sampling rate value are obtained based on the same playback data. If the current audio sampling rate value is inconsistent with the actual sampling rate value, the playback speed based on the actual sampling rate value will be inconsistent with the playback speed based on the current audio sampling rate value, which will cause the playback data played by the conference system device to be pitch-shifted. Therefore, it is necessary to ensure that the current audio sampling rate value is the same as the actual sampling rate value. When the actual sampling rate value is different from the current audio sampling rate value, the current audio sampling rate value is resampled to the actual sampling rate value through the resampling method.
[0093] It can be seen that the audio signal sampling rate adjustment method of the embodiment of the present application obtains the sampling rate value of the current audio; determines whether the sampling rate value of the current audio is the same as the actual sampling rate value; in response to the actual sampling rate value and the sampling rate value of the current audio being different, the sampling rate value of the current audio is resampled to the actual sampling rate value. In this way, it can ensure that the sampling rate value of the current audio is the same as the actual sampling rate value, prevent the occurrence of pitch shifting, and improve the call quality.
[0094] Based on the above examples, please refer to Figure 6 , Figure 6 yes Figure 1 The flowchart of an exemplary embodiment of the method for adjusting the sampling rate of an audio signal after step S120 is shown. Specifically, after determining the candidate sampling rate value of the corresponding time period based on the audio signal data in each time period in step S120, the method for adjusting the sampling rate of an audio signal in the embodiment of the present application further includes the following steps:
[0095] S610: In response to the fact that a sampling rate candidate value corresponding to one of the at least two time periods is different from the sampling rate candidate values corresponding to the other time periods, reacquire audio signal data in the at least two time periods.
[0096] After obtaining the sampling rate candidate values of at least two time periods, the sampling rate candidate values of at least two time periods are compared. If the sampling rate candidate value corresponding to one time period is different from the sampling rate candidate values corresponding to other time periods among the sampling rate candidate values of at least two time periods, the sampling rate candidate value is discarded, and the audio signal data of at least two time periods is obtained again. If the sampling rate candidate values of at least two time periods are the same, the sampling rate candidate value is used as the actual sampling rate value.
[0097] It can be seen that the audio signal sampling rate adjustment method of the embodiment of the present application reacquires the audio signal data in at least two time periods in response to the sampling rate candidate value corresponding to one time period being different from the sampling rate candidate values corresponding to other time periods in at least two time periods. This can resist the problem of low actual sampling rate value caused by untimely data collection due to the obstruction of the collection thread, and enhance the robustness of the audio signal sampling rate adjustment.
[0098] See also Figure 7 , Figure 7 It is a structural diagram of an exemplary embodiment of a conference system device shown in the present application. The conference system device 70 includes a conference application layer 710, and the conference application layer 710 includes a sampling rate detection module 711 and a sampling rate adjustment module 712; the sampling rate detection module 711 is used to determine the sampling rate candidate value of the corresponding time period based on the audio signal data in each time period, and in response to the sampling rate candidate values of each time period being the same, the sampling rate candidate value is used as the actual sampling rate value; the sampling rate adjustment module 712 is used to perform an adaptive adjustment process of the audio signal sampling rate based on the actual sampling rate value.
[0099] It is understandable that the present application can perform sampling rate detection and sampling rate adjustment at the conference application layer 710 without the need for hardware support, thereby improving the adaptability and flexibility of the conference system device 70.
[0100] The conference system device 70 also includes a signal processing driver layer 720, which is connected to the sampling rate detection module 711 in the conference application layer 710; the signal processing driver layer 720 is used to convert the audio signal data collected in at least two time periods into digital signals and analog signals.
[0101] Exemplarily, since the conference application layer 710 of the present application has sampling rate detection and sampling rate adjustment functions, the signal processing driver layer 720 may include an audio signal resampling function, or may not include the audio signal resampling function without affecting the technical effect of the present application.
[0102] In the above scheme, the conference system device 70 of the embodiment of the present application collects audio signal data in at least two time periods; determines the sampling rate candidate value of the corresponding time period based on the audio signal data in each time period; in response to the sampling rate candidate values of each time period being the same, uses the sampling rate candidate value as the actual sampling rate value; and performs adaptive adjustment processing of the audio signal sampling rate based on the actual sampling rate value. In this way, the audio signal sampling rate can be improved, and the audio pitch problem caused by inaccurate audio signal sampling rate can be avoided.
[0103] In order to explain the method for adjusting the sampling rate of an audio signal in detail, Figure 8 The flowchart shown further illustrates it, and the details are as follows:
[0104] The conference system device 70 is usually connected to an external device when conducting an audio conference, such as Figure 8 In the PC, when the sampling rate of the external device is different from the sampling rate of the conference system device 70, the conference system device 70 will cause the audio pitch to change. Therefore, in order to ensure that the sampling rate of the external device is the same as the sampling rate of the conference system device 70, the sampling rate of the conference system device 70 needs to be adjusted in real time according to the sampling rate of the external device. Exemplarily, the external device is usually connected to the signal processing driver layer 720 of the conference system device 70 through an audio input interface such as HDMIIN, USB or LineIn, and the sampling rate value of the external device can be expressed as Fs0. The sampling rate value of the conference system device 70 can be expressed as Fs1.
[0105] The conference system device 70 includes a conference application layer 710 and a signal processing driver layer 720. The conference application layer 710 performs sampling rate detection and sampling rate adjustment. The sampling rate detection module 711 in the conference application layer 710 determines the sampling rate candidate value of the corresponding time period based on the audio signal data in each time period; in response to the sampling rate candidate values of each time period being the same, the sampling rate candidate value is used as the actual sampling rate value, that is, the sampling rate value of the external device. The sampling rate adjustment module 712 of the conference application layer 710 determines whether the sampling rate value of the current audio is the same as the actual sampling rate value. If not, the sampling rate value of the current audio is resampled to the actual sampling rate value.
[0106] The signal processing driver layer 720 is connected to the sampling rate detection module 711. The signal processing driver layer 720 may not be provided with a resampling module, so the signal processing driver layer 720 will not perform adaptive adjustment according to the actual sampling rate value, and its sampling rate value is the sampling rate value of the conference system device, which can be expressed as Fs1.
[0107] In order to implement the audio signal sampling rate adjustment method of the above embodiment, the present application proposes another electronic device, which is specifically referred to as Fig. 9 , Fig. 9 It is a structural schematic diagram of an embodiment of an electronic device provided by the present application.
[0108] The electronic device 90 includes a memory 910 and a processor 920 , wherein the memory 910 and the processor 920 are coupled.
[0109] The memory 910 is used to store program data, and the processor 920 is used to execute the program data to implement the audio signal sampling rate adjustment method of the above embodiment.
[0110] In this embodiment, the processor 920 may also be referred to as a CPU (Central Processing Unit). The processor 920 may be an integrated circuit chip having signal processing capabilities. The processor 920 may also be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components. A general-purpose processor may be a microprocessor or the processor 920 may also be any conventional processor, etc.
[0111] The present application also provides a computer-readable storage medium, such as Fig.10 As shown, the computer-readable storage medium 1000 is used to store program data 1100. When the program data 1100 is executed by the processor, it is used to implement the audio signal sampling rate adjustment method in the method embodiment of the present application.
[0112] The method involved in the embodiment of the audio signal sampling rate adjustment method of the present application, when implemented in the form of a software functional unit and sold or used as an independent product, can be stored in a device, such as a computer-readable storage medium. Based on this understanding, the technical solution of the present application 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, and 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.) or a processor (processor) 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, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.
[0113] The above description is only an implementation method of the present application, and does not limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly used in other related technical fields, are also included in the patent protection scope of the present application.
Claims
1. An audio signal sampling rate adjustment method, characterized in that, the method comprises: collecting audio signal data within at least two time periods; determining a sampling rate candidate value for a corresponding time period based on the audio signal data within each time period; in response to the sampling rate candidate values for each time period being the same, taking the sampling rate candidate value as the actual sampling rate value; performing an adaptive adjustment process on the audio signal sampling rate based on the actual sampling rate value.
2. The audio signal sampling rate adjustment method according to claim 1, characterized in that, the step of determining a sampling rate candidate value for a corresponding time period based on the audio signal data within each time period comprises: calculating an initial sampling rate value for a corresponding time period based on the quantity of audio signal data within each time period; determining a sampling error based on the initial sampling rate value for each time period and a preset sampling rate expected value; in response to the sampling error within each time period being less than or equal to a preset error threshold, determining the initial sampling rate value as the sampling rate candidate value for the corresponding time period.
3. The audio signal sampling rate adjustment method according to claim 2, characterized in that, the step of calculating an initial sampling rate value for a corresponding time period based on the quantity of audio signal data within each time period comprises: calculating a first ratio between the quantity of audio signal data within each time period and the duration of the corresponding time period; taking the first ratio as the initial sampling rate value for the corresponding time period.
4. The audio signal sampling rate adjustment method according to claim 2, characterized in that, the step of determining a sampling error based on the initial sampling rate value for each time period and a preset sampling rate expected value comprises: calculating the absolute value of the difference between the initial sampling rate value within each time period and the preset sampling rate expected value; calculating a second ratio between the absolute value of the difference and the preset sampling rate expected value; taking the second ratio as the sampling error for the corresponding time period.
5. The audio signal sampling rate adjustment method according to claim 1, characterized in that, the step of performing an adaptive adjustment process on the audio signal sampling rate based on the actual sampling rate value comprises: obtaining the sampling rate value of the current audio; judging whether the sampling rate value of the current audio is the same as the actual sampling rate value; in response to the actual sampling rate value being different from the sampling rate value of the current audio, resampling the sampling rate value of the current audio to the actual sampling rate value.
6. The audio signal sampling rate adjustment method according to claim 1, characterized in that, after the step of determining a sampling rate candidate value for a corresponding time period based on the audio signal data within each time period, the method further comprises: in response to there being a time period among the at least two time periods for which the sampling rate candidate value is different from the sampling rate candidate values for other time periods, re - obtaining the audio signal data within at least two time periods.
7. A conference system device, characterized in that, the device comprises a conference application layer, and the conference application layer comprises a sampling rate detection module and a sampling rate adjustment module; The sampling rate detection module is used to determine a candidate sampling rate value of a corresponding time period based on the audio signal data in each time period, and in response to the sampling rate candidate values of each time period being the same, use the candidate sampling rate value as the actual sampling rate value; The sampling rate adjustment module is used to perform adaptive adjustment processing of the sampling rate of the audio signal based on the actual sampling rate value.
8. The conference system device according to claim 7, It is characterized in that The device also includes a signal processing driving layer, which is connected to the sampling rate detection module in the conference application layer; the signal processing driving layer is used to convert the audio signal data collected in at least two time periods into digital signals and analog signals.
9. An electronic device, It is characterized in that include: A memory and a processor, wherein the memory stores program instructions, and the processor retrieves the program instructions from the memory to execute the method according to any one of claims 1 to 6.
10. A computer-readable storage medium, It is characterized in that include: Program data is stored, and when the program data is executed by a processor, it is used to implement the method according to any one of claims 1 to 6.