Audio resampling method and device, electronic equipment and storage medium
By segmenting the audio data and resampling it in segments, the problem of excessive data volume in the prior art is solved, and the audio resampling is successfully carried out on devices with limited memory, and memory usage and device performance are optimized.
Patent Information
- Application Number
- CN202510238414.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-28
- Publication Date
- 2025-05-13
AI Technical Summary
When existing audio resampling technologies resample low-sampling rate audio data to high sampling rates, the output data size increases significantly, which may exceed the memory limit of the processing device, resulting in resampling failure.
By dividing the target audio data into multiple data segments, and resampling each data segment according to the required resampling rate, and finally the resampling output results of each data segment are combined to obtain the final resampling output result.
On the premise of ensuring the consistency and integrity of audio data, this method optimizes the memory usage of electronic devices, avoids resampling failures due to insufficient memory, and improves the competitiveness of low-cost embedded devices.
Smart Images

Figure CN119993174A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of image processing technology, and in particular to an audio resampling method, device, electronic device and storage medium. Background Art
[0002] Audio resampling is a key link in digital audio processing. It refers to the process of converting an audio signal from one sampling rate to another. During the conversion process, the format, number of channels, and data size of the original audio data will change.
[0003] In the existing audio resampling technology, when resampling low-sampling rate audio data to high-sampling rate audio data, the size of the output data will increase significantly, which can be several times or even dozens of times. This sharp increase in the amount of processed data may exceed the memory processing limit of the processing device, thereby causing the audio resampling to fail. Summary of the invention
[0004] The embodiments of the present application provide an audio resampling method, device, electronic device and storage medium, which solve the technical problem in the related art that audio resampling fails due to insufficient memory in electronic devices by processing original data in segments.
[0005] In a first aspect, an embodiment of the present application provides an audio resampling method, comprising:
[0006] Determine a resampling rate of the target audio data, wherein the resampling rate is determined according to a ratio of a resampling output sampling rate corresponding to the target audio data to a resampling input sampling rate, and the resampling output sampling rate is greater than the resampling input sampling rate;
[0007] dividing the target audio data into a plurality of target audio data segments;
[0008] Based on the resampling rate, resampling the plurality of target audio data segments respectively to obtain corresponding resampling output results;
[0009] The resampled output results corresponding to the multiple target audio data segments are combined and processed to obtain the resampled output result of the target audio data.
[0010] In some implementations, resampling the plurality of target audio data segments based on the resampling rate to obtain corresponding resampling output results includes:
[0011] According to the resampling rate, the multiple target audio data segments are sequentially input into the resampling function to obtain the resampling output result corresponding to each of the target audio data segments, and the resampling function is used to execute the interpolation algorithm.
[0012] In some embodiments, it further comprises:
[0013] After inputting the target audio data segment into the resampling function, determining whether there are any remaining target audio data segments;
[0014] If there are remaining target audio data segments, inputting the next target audio data segment into the resampling function;
[0015] When there are no target audio data segments remaining, the calling of the resampling function is exited.
[0016] In some implementations, the merging the resampled output results corresponding to the multiple target audio data segments to obtain the resampled output result of the target audio data includes:
[0017] According to the input order of the multiple target audio data segments, sorting the resampled output results corresponding to each of the target audio data segments;
[0018] The resampled output results corresponding to the target audio data segments are sorted and merged to obtain the resampled output results of the target audio data.
[0019] In some implementations, segmenting the target audio data into a plurality of target audio data segments includes:
[0020] Determining the data size of the target audio data segment according to the ratio of the data size of the preset processed data to the resampling rate;
[0021] The target audio data is divided into a plurality of target audio data segments based on the data size of the target audio data segment.
[0022] In some embodiments, it further comprises:
[0023] Determining the frame type of the first frame of each of the target audio data segments;
[0024] Filter out the target audio data segment whose first frame type is not an I frame;
[0025] The first frame of the filtered target audio data segment is re-determined as the last I frame that appears in the previous target audio data segment of the target audio data segment.
[0026] In some embodiments, it further comprises:
[0027] In the case where the ratio of the data size of the preset processing data to the resampling rate is an odd number, the data size of the target audio data segment is determined according to a value of the ratio plus 1 or minus 1.
[0028] In a second aspect, an embodiment of the present application provides an audio resampling device, comprising:
[0029] A determination unit, which determines a resampling rate of the target audio data, wherein the resampling rate is determined according to a ratio of a resampling output sampling rate corresponding to the target audio data to a resampling input sampling rate, and the resampling output sampling rate is greater than the resampling input sampling rate;
[0030] a segmentation unit, which segments the target audio data into a plurality of target audio data segments;
[0031] A sampling unit, based on the resampling rate, resamples the plurality of target audio data segments respectively to obtain corresponding resampled output results;
[0032] The merging unit merges the resampled output results corresponding to the multiple target audio data segments to obtain the resampled output result of the target audio data.
[0033] In a third aspect, an embodiment of the present application provides an electronic device, including:
[0034] Memory for storing computer programs;
[0035] A processor is used to execute the computer program to implement the steps of any one of the methods in the first aspect.
[0036] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program runs on a computer or a processor, the computer or the processor executes the steps of the method described in any one of the first aspects of the rights.
[0037] An audio resampling method provided in an embodiment of the present application divides the original target audio data into a plurality of target audio data segments, and resamples each target audio data segment at a desired resampling rate to obtain a resampled output result corresponding to each target audio data segment, and then merges the resampled output results corresponding to each target audio data segment to obtain a resampled output result of the original target audio data. In this way, when faced with the situation of resampling low-sampling rate audio data to high-sampling rate audio data, some audio electronic devices with smaller memory, especially those including embedded systems, can also be processed, and there will be no resampling failure due to insufficient memory, thereby optimizing the memory usage of electronic devices while ensuring the consistency and integrity of audio data, and improving the competitiveness of some low-cost embedded devices.
[0038] The technical effects obtained in the above-mentioned second to fourth aspects are similar to the technical effects obtained by the corresponding technical means in the first aspect, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] In order to more clearly illustrate the technical solution of the present application, the drawings required for use in the embodiments are briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0040] Figure 1 A flowchart of an audio resampling method provided in an embodiment of the present application;
[0041] Figure 2 A flowchart of another audio resampling method provided in an embodiment of the present application;
[0042] Figure 3 A schematic diagram of the structure of an audio resampling device provided in an embodiment of the present application;
[0043] Figure 4 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0044] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution 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. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.
[0045] It should be understood that the "multiple" mentioned herein refers to two or more. In the description of the embodiments of the present application, unless otherwise specified, " / " means or, for example, A / B can mean A or B; "and / or" in this article is only a description of the association relationship of the associated objects, indicating that there can be three relationships, for example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, in order to facilitate the clear description of the technical solution of the embodiments of the present application, in the embodiments of the present application, the words "first", "second" and the like are used to distinguish between the same items or similar items with basically the same functions and effects. Those skilled in the art can understand that the words "first", "second" and the like do not limit the quantity and execution order, and the words "first", "second" and the like do not limit them to be necessarily different.
[0046] In addition, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, system, product, or apparatus that includes a series of steps or elements is not necessarily limited to those steps or elements explicitly listed, but may include other steps or elements not explicitly listed or inherent to such process, method, product, or apparatus.
[0047] Figure 1 A flowchart of an audio resampling method provided in an embodiment of the present application is shown in FIG. Figure 1 As shown, the method includes:
[0048] S110, determining a resampling rate of the target audio data, the resampling rate being determined according to a ratio of a resampling output sampling rate corresponding to the target audio data to a resampling input sampling rate, and the resampling output sampling rate being greater than the resampling input sampling rate.
[0049] Exemplarily, the resampling rate of the target audio data is determined by the ratio of the resampling input sampling rate to the resampling output sampling rate, and the resampling output sampling rate is greater than the resampling input sampling rate, that is, after resampling, the sampling rate of the target audio data will increase, and accordingly, the memory required by the target audio data will also increase. For example, the target audio data length is originally 5120 bytes, the resampling input sampling rate is 8K, and the resampling output sampling rate is 96K. At this time, the output data size is 96K / 16K*5120=64K, that is, the data of one frame is changed from 5120 bytes to 61440 bytes. In this case, for some audio processing devices whose memory is not particularly large, there is a situation where the audio resampling fails due to insufficient memory.
[0050] S120, dividing the target audio data into multiple target audio data segments.
[0051] Exemplarily, the target audio data is divided into a plurality of target audio data segments. The plurality of target audio data segments are preferably divided so as to have the same data length for easy processing.
[0052] S130 . Based on the resampling rate, resample the multiple target audio data segments respectively to obtain corresponding resampled output results.
[0053] Exemplarily, the multiple target audio data segments obtained in the above steps are resampled respectively to obtain a resampled output result corresponding to each target audio data segment.
[0054] It should be noted that, through steps 120 and 130, a complete audio data is divided into multiple audio data segments, and each audio data segment is processed at a required resampling rate by an electronic device that performs audio resampling. In this way, for some electronic devices with limited memory space, the situation that the resampled audio data is too large to be processed will not occur.
[0055] S140: Combine and process the resampled output results corresponding to the multiple target audio data segments to obtain the resampled output result of the target audio data.
[0056] Exemplarily, the resampling output results corresponding to the above-mentioned multiple target audio data segments are merged, so as to obtain a complete resampling output result of the above-mentioned target audio data.
[0057] An audio resampling method provided in an embodiment of the present application divides the original target audio data into a plurality of target audio data segments, and resamples each target audio data segment at a desired resampling rate to obtain a resampled output result corresponding to each target audio data segment, and then merges the resampled output results corresponding to each target audio data segment to obtain a resampled output result of the original target audio data. In this way, when faced with the situation of resampling low-sampling rate audio data to high-sampling rate audio data, some audio electronic devices with smaller memory, especially those including embedded systems, can also be processed, and there will be no resampling failure due to insufficient memory, thereby optimizing the memory usage of electronic devices while ensuring the consistency and integrity of audio data, and improving the competitiveness of some low-cost embedded devices.
[0058] In some examples, resampling the plurality of target audio data segments based on the resampling rate to obtain corresponding resampled output results may include:
[0059] According to the resampling rate, multiple target audio data segments are sequentially input into the resampling function to obtain the resampling output result corresponding to each target audio data segment. The resampling function is used to execute the interpolation algorithm.
[0060] It should be noted that the above resampling function converts a signal from one sampling rate to another sampling rate by executing an interpolation algorithm, and the interpolation algorithm includes nearest neighbor interpolation, linear interpolation, cubic interpolation and other algorithms.
[0061] Exemplarily, the multiple target audio data segments obtained through step S120 are input into the resampling function in a certain order, and based on the above resampling rate, the resampling output results corresponding to each target audio data segment are output in sequence through the resampling function.
[0062] In some examples, the above-mentioned merging and processing of the resampled output results corresponding to the plurality of target audio data segments to obtain the resampled output result of the target audio data includes:
[0063] According to the input order of the multiple target audio data segments, the resampled output results corresponding to each target audio data segment are sorted.
[0064] Exemplarily, according to the foregoing, multiple target audio data segments are input into the above resampling function in a certain order, and the resampling output results corresponding to the multiple target audio data segments are sorted. For example, the first and last data of the resampling output result of each target audio data segment can be numbered in a counting order, and the sorting can be performed in the counting order.
[0065] The resampled output results corresponding to the target audio data segments are sorted and merged to obtain the resampled output results of the target audio data.
[0066] Exemplarily, the resampling output results corresponding to the above-mentioned multiple target audio data segments are merged according to the above-mentioned sorting, so as to avoid distortion of the target audio data after resampling.
[0067] In some examples, the audio resampling method further includes:
[0068] After inputting the target audio data segment into the resampling function, determining whether there are any remaining target audio data segments;
[0069] In case there are remaining target audio data segments, inputting the next target audio data segment into the resampling function;
[0070] In the event that there are no target audio data segments remaining, exit the call of the resampling function.
[0071] Exemplarily, in the process of inputting each target audio data segment into the above resampling function, it can be determined whether there is a next target audio data segment to be processed. If there is, the next target audio data segment is processed continuously, and if not, the sampling function call is exited and the resampling process is terminated, thereby saving the occupation of data processing resources.
[0072] According to some embodiments, dividing the target audio data into a plurality of target audio data segments includes:
[0073] The data size of the target audio data segment is determined according to the ratio of the data size of the preset processed data to the resampling rate.
[0074] The target audio data is divided into a plurality of target audio data segments based on the data size of the target audio data segment.
[0075] Exemplarily, the size of the preset processing data can be determined according to the data processing capability of the audio processing device. By comparing the preset processing data with the resampling rate, it is possible to determine the size of the corresponding input data required to process the data of the preset processing data size, that is, the size of the target audio data segment, and segment the target audio data based on the calculated size of the target audio data segment. For example, the data size of each target audio data segment can be determined according to the following formula:
[0076] maxInFrmSize=IN_SIZE_MAX*enInRate / enOutRate
[0077] Wherein, enInRate represents the resampling input sampling rate, enOutRate represents the resampling output sampling rate, IN_SIZE_MAX represents the data size of the preset processing data, and maxInFrmSize represents the data size of the target audio data segment. In the formula, (enInRate / enOutRate) represents the reciprocal of the resampling rate.
[0078] The target audio data is segmented based on the size of the target audio data segment determined by the above formula.
[0079] Further, considering that the size of the target audio data segment is calculated according to the above preset processing data, and the target audio data is segmented based on the calculation result, this method does not consider the influence of the data type on the resampling process. Therefore, the above audio resampling method also includes:
[0080] The frame type of the first frame of each target audio data segment is determined.
[0081] Filter out target audio data segments whose first frames are not I frames.
[0082] The first frame of the filtered target audio data segment is re-determined as the last I frame that appears in the previous target audio data segment of the target audio data segment.
[0083] It should be noted that the I frame here refers to the key frame / independent coding frame in the target audio data segment. Extracting the I frame helps to achieve functions such as synchronization and random access of audio data.
[0084] Exemplarily, after calculating the size of the target audio data segment according to the aforementioned preset processing data and segmenting the target audio data based on the value, the frame type of the first frame of each target audio data segment is determined. It can be understood that in the embodiment of the present application, each target audio data segment includes a first frame and a last frame, and all the data between the two constitute a target audio data segment.
[0085] Target audio data segments whose first frames are not I frames are screened out from multiple target audio data segments, the first frames of these target audio data segments are adjusted, and the last I frame appearing in the previous data segment of the target audio data segment is determined as the first frame of the target audio data segment, which is equivalent to adjusting the segmentation of the target audio data segments whose first frames are not I frames, so that the first frame of each target audio data segment is an I frame.
[0086] The embodiment of the present application adjusts the data length of the target audio data segment so that the frame type of the first frame of each target audio data segment is an I frame, thereby improving the accuracy of sampling the target audio data segment.
[0087] In some examples, the audio resampling method further includes:
[0088] In the case where the ratio of the data size of the preset processed data to the resampling rate is an odd number, the data size of the target audio data segment is determined according to a value plus 1 or minus 1 of the ratio.
[0089] It should be noted that, as shown in the calculation formula of the data size of the target audio data segment, the ratio of the data size of the preset processed data to the resampling rate here can also be the product of the data size of the preset processed data and the inverse of the resampling rate.
[0090] Exemplarily, when the ratio of the data size of the preset processing data to the resampling rate is an odd number, that is, when the calculated data size of the target audio data segment is an odd number, the data can be processed by adding 1 or subtracting 1 to make the data size of the target audio data segment an even number. In this way, on the basis that the data size of the target audio data segment is an even number, it is more conducive to data alignment and boundary processing to avoid additional offset or padding operations. In addition, the target audio data segment with an even data size is also more conducive to the data access process in the memory access scenario, which can improve the speed and efficiency of memory access.
[0091] Figure 2 A flowchart of another audio resampling method provided in an embodiment of the present application is shown in FIG. Figure 2 As shown, including:
[0092] A01. Determine the resampling rate.
[0093] Exemplarily, a resampling rate of the target audio data is determined.
[0094] A02. Get the output audio size.
[0095] Exemplarily, the output audio can be understood as the above-mentioned preset processing data.
[0096] A03. Calculate the size of each audio data segment to be processed.
[0097] Exemplarily, the size of each audio data segment to be input for processing may be determined according to the aforementioned formula maxInFrmSize=IN_SIZE_MAX*enInRate / enOutRate.
[0098] A04. Enter the resampling function processing.
[0099] Exemplarily, each segment of audio data of A03 is sent to a resampling function for processing, such as a process function.
[0100] A05. Determine whether there is any remaining original data.
[0101] Exemplarily, it is determined whether each segment of audio data has been processed. If so, proceed to the next step; if not, return to A04.
[0102] A06. Merge the results.
[0103] Exemplarily, the processing results of each segment of audio data are merged to obtain the resampling result of the target audio data.
[0104] The method embodiment according to the present application is described above by way of example. Based on the audio resampling method provided in the embodiment of the present application, the embodiment of the present application provides an audio resampling device. Figure 3 A schematic diagram of the structure of an audio resampling device provided in an embodiment of the present application. Figure 3 , the device includes the following units.
[0105] The determining unit 310 determines a resampling rate of the target audio data, wherein the resampling rate is determined according to a ratio of a resampling output sampling rate corresponding to the target audio data to a resampling input sampling rate, and the resampling output sampling rate is greater than the resampling input sampling rate;
[0106] A segmentation unit 320, which segments the target audio data into a plurality of target audio data segments;
[0107] The sampling unit 330 resamples the plurality of target audio data segments respectively based on the resampling rate to obtain corresponding resampled output results;
[0108] The merging unit 340 merges the resampled output results corresponding to the multiple target audio data segments to obtain the resampled output result of the target audio data.
[0109] The above describes the device embodiments of the present application. For detailed descriptions of the specific execution processes of data, terms, nouns, steps, technical issues and effects, alternative methods and combinations, please refer to the descriptions in the method embodiments, which will not be repeated here.
[0110] An embodiment of the present application also provides a computer-readable storage medium, which stores a computer program. When the computer program runs on a computer or a processor, it enables the computer or the processor to execute the steps of any one of the methods described in the first aspect of the rights.
[0111] The present application also provides an electronic device, including:
[0112] Memory for storing computer programs;
[0113] A processor is used to execute the computer program to implement the steps of any one of the methods in the first aspect.
[0114] For example, Figure 4 As shown, the electronic device includes a processor 410, at least one communication bus 420, a user interface 430, at least one external communication interface 440 and a memory 450. The communication bus 420 is configured to achieve connection and communication between these components. The user interface 430 may include a display screen, and the external communication interface 440 may include a standard wired interface and a wireless interface. The memory 450 stores a computer program. The processor 410 is used to execute the computer program stored in the memory 450.
[0115] The description of the above computer program product, computer-readable storage medium, and electronic device is similar to the description of the above method embodiment, and has similar beneficial effects as the method embodiment. For technical details not disclosed in the computer program product, computer-readable storage medium, and electronic device of this application, please refer to the description of the method embodiment of this application for understanding.
[0116] The sequence of serial numbers or introduction of the embodiments of the present application is for description only and does not represent the superiority or inferiority of the embodiments.
[0117] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units can be a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.
[0118] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0119] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0120] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network or other programmable device. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium can be any available medium that a computer can access, or a data storage device such as a server or data center that includes one or more available media integrated. The available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a magnetic tape), an optical medium (e.g., a digital versatile disc (DVD)), or a semiconductor medium (e.g., a solid state disk (SSD)). It is worth noting that the computer-readable storage medium mentioned in the embodiment of the present application may be a non-volatile storage medium, in other words, a non-transient storage medium.
[0121] It should be noted that the information (including but not limited to user device information, user personal information, etc.), data (including but not limited to data for analysis, stored data, displayed data, etc.) and signals involved in the embodiments of this application are all authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions. For example, the scene data of the current frame in the three-dimensional virtual scene, the device information of the client, and the scene interaction information involved in the embodiments of this application are all obtained with full authorization.
[0122] Similar parts between the embodiments provided in this application can be referenced to each other. The specific implementation methods provided above are only a few examples under the general concept of this application and do not constitute a limitation on the protection scope of this application. For those skilled in the art, any other implementation methods expanded based on the scheme of this application without creative work belong to the protection scope of this application.
Claims
1. An audio resampling method, characterized in that: include: Determine a resampling rate of the target audio data, wherein the resampling rate is determined according to a ratio of a resampling output sampling rate corresponding to the target audio data to a resampling input sampling rate, and the resampling output sampling rate is greater than the resampling input sampling rate; dividing the target audio data into a plurality of target audio data segments; Based on the resampling rate, resampling the plurality of target audio data segments respectively to obtain corresponding resampling output results; The resampled output results corresponding to the multiple target audio data segments are combined and processed to obtain the resampled output result of the target audio data.
2. The method according to claim 1, characterized in that The resampling of the plurality of target audio data segments based on the resampling rate to obtain corresponding resampling output results includes: According to the resampling rate, the multiple target audio data segments are sequentially input into the resampling function to obtain the resampling output result corresponding to each of the target audio data segments, and the resampling function is used to execute the interpolation algorithm.
3. The method according to claim 2, characterized in that Also includes: After inputting the target audio data segment into the resampling function, determining whether there are any remaining target audio data segments; In case there are remaining target audio data segments, inputting the next target audio data segment into the resampling function; When there are no target audio data segments remaining, the calling of the resampling function is exited.
4. The method according to claim 2, characterized in that: The merging and processing of the resampled output results corresponding to the plurality of target audio data segments to obtain the resampled output result of the target audio data includes: According to the input order of the multiple target audio data segments, sorting the resampled output results corresponding to each of the target audio data segments; The resampled output results corresponding to the target audio data segments are sorted and merged to obtain the resampled output results of the target audio data.
5. The method according to any one of claims 1 to 4, characterized in that The step of dividing the target audio data into a plurality of target audio data segments comprises: Determining the data size of the target audio data segment according to the ratio of the data size of the preset processed data to the resampling rate; The target audio data is divided into a plurality of target audio data segments based on the data size of the target audio data segment.
6. The method according to claim 5, characterized in that Also includes: Determining the frame type of the first frame of each of the target audio data segments; Filter out the target audio data segment whose first frame type is not an I frame; The first frame of the filtered target audio data segment is re-determined as the last I frame that appears in the previous target audio data segment of the target audio data segment.
7. The method according to claim 5, characterized in that Also includes: In the case where the ratio of the data size of the preset processing data to the resampling rate is an odd number, the data size of the target audio data segment is determined according to a value of the ratio plus 1 or minus 1.
8. An audio resampling device, characterized in that: include: A determination unit, which determines a resampling rate of the target audio data, wherein the resampling rate is determined according to a ratio of a resampling output sampling rate corresponding to the target audio data to a resampling input sampling rate, and the resampling output sampling rate is greater than the resampling input sampling rate; a segmentation unit, which segments the target audio data into a plurality of target audio data segments; A sampling unit, based on the resampling rate, resamples the plurality of target audio data segments respectively to obtain corresponding resampled output results; The merging unit merges the resampled output results corresponding to the multiple target audio data segments to obtain the resampled output result of the target audio data.
9. An electronic device, characterized in that: include: Memory for storing computer programs; A processor, configured to execute the computer program to implement the steps of the method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program runs on a computer or a processor, the computer or the processor executes the steps of the method according to any one of claims 1 to 7.