Audio data processing method and device, storage medium and electronic equipment
By slicing and delaying the audio signal to generate audio signals with different sound effects, it solves the problem of manual data collection in the existing technology that is time-consuming and expensive in audio playback testing, and achieves efficient and low-cost audio data processing.
Patent Information
- Application Number
- CN202410605796.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-15
- Publication Date
- 2024-09-03
AI Technical Summary
The existing technology requires a large amount of audio data with different playback effects during audio playback testing, which makes manual data collection time-consuming and expensive, and cannot effectively reduce costs.
By slicing and delaying the source audio signal, delayed audio signals with different sound effects are generated, reducing manual collection workload and cost.
It realizes the rapid acquisition of audio signals with different sound effects, reduces test costs, and improves the efficiency of audio data processing and the complexity of sound effects.
Smart Images

Figure CN118590705A
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing technology, and in particular to an audio data processing method and device, a storage medium and an electronic device. Background Art
[0002] Before being put on the market, software and hardware used to play audio need to undergo audio playback testing to determine whether there are any problems with the audio playback and whether the sound quality during audio playback meets the requirements.
[0003] When performing audio playback testing on software and hardware, a large amount of audio data with different playback effects is required. The current method of obtaining audio data used for testing relies on manual collection, which takes a lot of time and incurs high costs. Summary of the invention
[0004] In view of this, an embodiment of the present invention provides an audio data processing method and device, a storage medium and an electronic device. The present invention is applied to delay a source audio signal to obtain a delayed audio signal whose sound effect is different from that of the source audio signal. Audio signals with different sound effects can be quickly obtained, thereby reducing the workload of manual collection and reducing costs.
[0005] To achieve the above objectives, the embodiments of the present invention provide the following technical solutions:
[0006] The first aspect of the present invention discloses an audio data processing method, comprising:
[0007] Using the source audio signal to be processed as the target audio signal;
[0008] Slicing the target audio signal to obtain a plurality of signal slices;
[0009] Performing delay processing on each of the signal slices to obtain a delayed slice of each of the signal slices;
[0010] A delayed audio signal of the source audio signal is obtained based on each of the delay slices.
[0011] In the above method, optionally, obtaining the delayed audio signal of the source audio signal based on each of the delay slices includes:
[0012] After obtaining the delayed slices of all signal slices of the source audio signal, updating the number of delayed recursions of the source audio signal;
[0013] When the number of delayed recursions of the source audio signal is less than the preset number of recursions, all delayed slices are used as new target audio signals, and the operation of slicing the target audio signal is returned to obtain multiple signal slices, until the number of delayed recursions of the source audio signal is not less than the preset number of recursions, and then a delayed audio signal is obtained based on the delayed slices of the source audio signal.
[0014] In the above method, optionally, the slicing process of the target audio signal to obtain a plurality of signal slices includes:
[0015] Acquire a slice parameter of the target audio signal;
[0016] determining a slice length based on the slice parameters;
[0017] Based on the slice length, the target audio signal is sliced to obtain a plurality of signal slices.
[0018] In the above method, optionally, the delay processing of each signal slice to obtain a delayed slice of each signal slice includes:
[0019] For each of the signal slices, a signal to be replaced is determined in the signal slice, and a preset delayed signal is used to replace the signal to be replaced in the signal slice to obtain a delayed slice.
[0020] In the above method, optionally, the obtaining of the delayed audio signal based on each delayed slice of the source audio signal includes:
[0021] Sorting the delayed slices to obtain a slice sequence;
[0022] The delayed slices in the slice sequence are spliced one by one to obtain a delayed audio signal.
[0023] A second aspect of the present invention discloses an audio data processing device, comprising:
[0024] A determination unit, configured to use a source audio signal to be processed as a target audio signal;
[0025] A slicing unit, configured to perform slicing processing on the target audio signal to obtain a plurality of signal slices;
[0026] A delay processing unit, used for performing delay processing on each of the signal slices to obtain a delayed slice of each of the signal slices;
[0027] An acquiring unit is used to acquire a delayed audio signal of the source audio signal based on each of the delay slices.
[0028] In the above device, optionally, the acquisition unit executes a process of acquiring a delayed audio signal of the source audio signal based on each of the delay slices, comprising:
[0029] After obtaining the delayed slices of all signal slices of the source audio signal, updating the number of delayed recursions of the source audio signal;
[0030] When the number of delayed recursions of the source audio signal is less than the preset number of recursions, all delayed slices are used as new target audio signals, and the operation of slicing the target audio signal is returned to obtain multiple signal slices, until the number of delayed recursions of the source audio signal is not less than the preset number of recursions, and then a delayed audio signal is obtained based on the delayed slices of the source audio signal.
[0031] In the above device, optionally, the slicing unit performs slicing processing on the target audio signal to obtain a plurality of signal slices, including:
[0032] Acquire a slice parameter of the target audio signal;
[0033] determining a slice length based on the slice parameters;
[0034] Based on the slice length, the target audio signal is sliced to obtain a plurality of signal slices.
[0035] In the above-mentioned device, optionally, the delay processing unit performs delay processing on each of the signal slices to obtain a delayed slice of each of the signal slices, comprising:
[0036] For each of the signal slices, a signal to be replaced is determined in the signal slice, and a preset delayed signal is used to replace the signal to be replaced in the signal slice to obtain a delayed slice.
[0037] In the above device, optionally, the acquisition unit executes a process of acquiring a delayed audio signal based on each delayed slice of the source audio signal, comprising:
[0038] Sorting the delayed slices to obtain a slice sequence;
[0039] The delayed slices in the slice sequence are spliced one by one to obtain a delayed audio signal.
[0040] A third aspect of the present invention discloses a storage medium, which includes stored instructions, wherein when the instructions are executed, the device where the storage medium is located is controlled to execute the audio data processing method as described above.
[0041] A fourth aspect of the present invention discloses an electronic device, comprising a memory and one or more instructions, wherein the one or more instructions are stored in the memory and are configured to be executed by one or more processors to perform the audio data processing method as described above.
[0042] Compared with the prior art, the present invention has the following advantages:
[0043] The present invention discloses an audio data processing method and device, a storage medium and an electronic device, specifically: taking a source audio signal to be processed as a target audio signal, slicing the target audio signal to obtain a plurality of signal slices, delaying each signal slice to obtain a delayed slice of each signal slice, and obtaining a delayed audio signal of the source audio signal based on each delayed slice; slicing the audio signal and delaying the signal slices obtained by slicing to change the harmonic structure of the signal, thereby obtaining a delayed audio signal with a different sound effect from the source audio signal. The method provided by the present invention increases the sound complexity of the signal and changes the sound effect of the audio signal by slicing and delaying the signal, thereby obtaining an audio signal with different sound effects, without the need for manual collection in different scenes, thereby reducing the cost of obtaining audio signals with different sound effects. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.
[0045] Figure 1 A flowchart of an audio data processing method provided by an embodiment of the present invention;
[0046] Figure 2 A flowchart of another audio data processing method provided by an embodiment of the present invention;
[0047] Figure 3 A flowchart of another audio data processing provided by an embodiment of the present invention;
[0048] Figure 4 A schematic diagram of the structure of an audio data processing device provided by an embodiment of the present invention;
[0049] Figure 5 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0050] 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.
[0051] In this application, the terms "comprises", "comprising" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprising a ..." does not exclude the presence of other identical elements in the process, method, article or device comprising the element.
[0052] Currently, when developing software and hardware for playing audio, it is necessary to use audio data to test the sound quality of the audio played by the software and hardware. During the test, it is necessary to use audio data with various spatial senses and complex sound effects for testing. Audio data with different effects need to be generated in different scenarios. Therefore, it is necessary to manually collect audio data in different scenarios. The whole process requires a lot of time and energy, and requires high costs.
[0053] In order to solve the above problems, the present invention provides an audio data processing solution, which slices the source audio signal to obtain multiple signal slices, delays the signal slices to obtain multiple delayed slices, and obtains a delayed audio signal based on each delayed slice. By performing delay processing, the complexity and hierarchy of the harmonic structure of the delayed audio signal are increased, so that the sound effect of the delayed audio signal is different from the sound effect of the delayed audio signal. Using this solution, the sound effect of the audio signal can be changed, and there is no need to manually collect audio signals with different sound effects in different scenarios, thereby reducing costs.
[0054] The present invention can be used in many general or special computing device environments or configurations, such as personal computers, server computers, handheld or portable devices, tablet devices, multi-processor devices, distributed computing environments including any of the above devices or devices, etc.
[0055] Reference Figure 1 , is a flowchart of an audio data processing method provided by an embodiment of the present invention, and is specifically described as follows:
[0056] S101: Use a source audio signal to be processed as a target audio signal.
[0057] The present invention can process multiple source audio signals simultaneously, or process each source audio signal one by one, wherein the source audio signals are pre-collected audio signals.
[0058] A source audio signal may be randomly selected from a signal library as the source audio signal to be processed, and the signal library is used to store audio signals.
[0059] The same source audio signal can be processed multiple times using the method provided by the present invention, thereby generating multiple delayed audio signals with different sound effects.
[0060] S102: Slice the target audio signal to obtain a plurality of signal slices.
[0061] When slicing the target audio signal, the target audio signal may be sliced according to a slicing parameter of the target audio signal, and the slicing parameters of different target audio signals are different.
[0062] The slicing parameters include but are not limited to the current number of delayed recursions of the source audio signal to which the target audio signal belongs, the data length of the target audio signal, the Nth time the source audio signal to which the target audio signal belongs is used to generate a delayed audio signal, etc., and the value of N is a positive integer.
[0063] A slice length when slicing a target audio signal is determined using a slice parameter, and then the target audio signal is sliced based on the slice length to obtain a plurality of signal slices. Furthermore, the slice length is less than the data length of the target audio signal, and the data lengths of the respective signal slices obtained after slicing the target audio signal may be equal, or there may be signal slices of different lengths.
[0064] It should be noted that when applying the slicing parameters to determine the slice length when slicing the target audio signal, if the target audio signal is not sliced for the first time, it means that the target audio signal is the source audio signal and the source audio signal is not used for the first time to generate a delayed audio signal. At this time, the slice length determined for the target audio signal is different from the slice lengths of the target audio signal determined in previous times.
[0065] When using slicing parameters to determine the slice length for slicing the target audio signal, the slice length is determined according to a preset matching rule, and the matching rule can be set according to actual needs. For example, when the source audio signal to which the target audio signal belongs is used to generate a delayed audio signal for the first time, the current delay recursion number of the source audio signal to which the target audio signal belongs is 0, and the data length of the target audio signal is 100, it means that the target audio signal is sliced for the first time, and a value smaller than the data length of the target audio signal can be randomly used as the slice length; the slice length determined for the target audio signal by using the slicing parameters and the matching rule is unique in the process in which the source audio signal to which the target audio signal belongs is used to generate the delayed audio signal this time.
[0066] Preferably, the slice value can also be determined according to the slice parameter, and then the target audio signal is sliced based on the number of slices to obtain slice signals with the same number as the slice value, that is, the number of obtained slice signals is equal to the slice value.
[0067] Exemplarily, assume that the slicing parameters of the target audio signal are specifically as follows: the data length of the target audio signal is 100, the current delayed recursion number of the source audio signal to which the target audio signal belongs is 1, and the source audio signal to which the target audio signal belongs is used for the first time to generate a delayed audio signal; based on the slicing parameters, the slicing length is determined to be 10, then the target audio signal is sliced to obtain 10 signal slices.
[0068] S103: Perform delay processing on each signal slice to obtain a delayed slice of each signal slice.
[0069] When delay processing is performed on each signal slice signal, a delayed signal can be added to the signal slice to obtain a corresponding delayed slice. Specifically, for each signal slice, a signal to be replaced is determined in the signal slice, and a preset delayed signal is used to replace the signal to be replaced in the signal slice to obtain a delayed slice. It should be noted that the delayed signal has the same length as the signal to be replaced, and the signal to be replaced can be determined based on the length of the delayed signal. The specific content of the delayed signal can be set according to actual needs.
[0070] Preferably, when delay processing is performed on a signal slice, the number of delayed samples can be determined based on the delay parameters corresponding to the signal slice, the delay parameters include the delay time and the sampling rate, the product of the delay time*sampling rate is rounded, and the rounded value is used as the number of delayed samples. Preferably, the number of delayed samples can be understood as the data length of the delayed signal; different signal slices can set different delay parameters, or a universal delay parameter can be set. Furthermore, when delay processing is performed on a signal slice, a delayed signal can be added by phase shifting, and the number of delayed samples at this time can be understood as the specific step length of the phase shift.
[0071] Preferably, the signal slice can be called a sub-signal, and the delayed sub-signal data is realized by shifting the frequency domain representation by a corresponding number of samples. Specifically, for the input sub-signal:
[0072] [1,2,3,4,5,6,7,8,9,0], the delayed sub-signal is: [0,0,0,0,1,2,3,4,5,6], the delayed sub-signal is obtained by the following steps:
[0073] 1. Create an array of zeros t_x_s of the same size as the input subsignal, with initial values of [0,0,0,0,0,0,0,0,0,0].
[0074] 2. Copy the delayed frequency domain representation to t_x_s, starting from index delay_int, until the last data in the sub-signal. In this example, the index delay_int is 4, so the delayed frequency domain representation is copied to t_x_s starting from index 4. The index delay_int can be used to determine the data retained in the sub-signal, or it can represent the specific step size of the phase shift of the frequency domain of the sub-signal. Further, the index delay_int can be understood as the number of delayed samples. The product of the delay time * sampling rate is rounded, and the rounded value is the number of delayed samples.
[0075] 3. The frequency domain representation after delay is [1, 2, 3, 4, 5, 6], which is copied to the corresponding position in t_x_s to obtain [0, 0, 0, 0, 1, 2, 3, 4, 5, 6]. Preferably, the phase of the present invention moves to the right, and the direction of movement can be set according to actual needs.
[0076] In this process, the latter part of the input sub-signal [7,8,9,0] is subtracted, not the former part. This is because when implementing sound delay, the phase of the frequency domain representation is shifted, not the entire sub-signal. The shifted frequency domain representation only contains a part of the input sub-signal and is related to the number of delayed samples.
[0077] When padding with 0 elements, the reason for padding with 0 in front of the sub-signal is to keep the length of the output sub-signal consistent with that of the input sub-signal. In the code, we create a zero array t_x_s of the same size as the input sub-signal, and copy the delayed frequency domain representation to the appropriate position in t_x_s. In order to keep the length consistent, a sufficient number of zero elements (which can be understood as delayed signals) need to be filled in front so that the delayed sub-signal has the same length as the input sub-signal. Doing so ensures that the length of the output sub-signal is consistent with the input sub-signal, and that the delayed part is correctly aligned at the beginning of the output sub-signal.
[0078] Therefore, in this example, to achieve a delay of 4 samples, the last 4 samples of the input sub-signal [7,8,9,0] are subtracted and 4 zero elements are padded in front of the output sub-signal to keep the length consistent.
[0079] By delaying each signal slice, the harmonic structure of the signal slice is changed, thereby changing the sound effect.
[0080] S104: Obtain a delayed audio signal of the source audio signal based on each delay slice.
[0081] Preferably, each delayed slice is sorted to obtain a slice sequence; each delayed slice in the slice sequence is spliced together one by one to obtain a delayed audio signal; further, each delayed slice has a corresponding number, and the number indicates the order of the delayed slice sorting. The each delayed slice can be sorted based on the number of each delayed slice to obtain a slice sequence, and then the each delayed slice in the slice sequence is spliced together to obtain a delayed audio signal. Furthermore, the length of the delayed audio signal is the same as the length of the source audio signal.
[0082] In the method provided by the embodiment of the present invention, the source audio signal to be processed is used as the target audio signal, the target audio signal is sliced to obtain a plurality of signal slices, each signal slice is delayed to obtain a delayed slice of each signal slice, and a delayed audio signal of the source audio signal is obtained based on each delayed slice; the harmonic structure of the signal is changed by slicing the audio signal and delaying the signal slices obtained by the slices, thereby obtaining a delayed audio signal with a different sound effect from the source audio signal. The method provided by the present invention increases the sound complexity of the signal and changes the sound effect of the audio signal by slicing and delaying the signal, thereby obtaining an audio signal with different sound effects. There is no need for manual collection in different scenes, thereby reducing the cost of obtaining audio signals with different sound effects, and a large amount of audio data for testing can be obtained at a relatively low cost, thereby reducing the cost of testing.
[0083] Reference Figure 2 , is a flowchart of another audio data processing method provided by an embodiment of the present invention, which is specifically described as follows:
[0084] S201: Use a source audio signal to be processed as a target audio signal.
[0085] S202: Slice the target audio signal to obtain a plurality of signal slices.
[0086] S203: Perform delay processing on each signal slice to obtain a delayed slice of each signal slice.
[0087] The description of steps S201-S203 can be found in Figure 1 The relevant descriptions of S101-S103 in will not be repeated here.
[0088] S204: After obtaining the delayed slices of all signal slices of the source audio signal, update the number of delayed recursions of the source audio signal.
[0089] Preferably, the initial value of the delayed recursive number of the source audio signal is set to 0, and each time the delayed slices of all signal slices of the source audio signal are obtained, the current delayed recursive number of the source audio signal is increased by one, that is, the delayed recursive number of the source audio signal is updated.
[0090] S205, determining whether the delayed recursive number of the source audio signal is less than the preset recursive number; when the delayed recursive number of the source audio signal is less than the preset recursive number, executing S206; when the delayed recursive number of the source audio signal is not less than the preset recursive number, executing S207.
[0091] The preset number of recursions may be set according to actual needs. Preferably, the preset number of recursions for different source audio signals may be different, or a universal preset number of recursions may be set.
[0092] After updating the delayed recursive number of the source audio signal, it is necessary to determine whether the updated delayed recursive number of the source audio signal is less than the preset recursive number, in other words, determine whether the current delayed recursive number of the source audio signal is less than the preset recursive number.
[0093] S206: All delayed slices are used as new target audio signals, and the process returns to S202.
[0094] When the number of delayed recursions of the updated source audio signal is less than the preset number of recursions, the source audio signal needs to be delayed again. When delay processing is performed again, all the delayed slices obtained in S203 need to be used as new target audio signals, and then S202 is executed.
[0095] Exemplarily, the source audio signal is used as the target audio signal, and then the target audio signal is sliced to obtain multiple signal slices, and then each signal slice is delayed to obtain a delayed slice of each signal slice; after obtaining all delayed slices of the source audio signal, the delayed recursive number of the source audio signal is updated. When the updated delayed recursive number is less than the preset recursive number, all the delayed slices are used as new target audio signals, and then the operation of slicing the target audio signal is returned to be performed. It should be noted that there are multiple target audio signals at this time, and the slicing operation needs to be performed on all target audio signals; this iteration is continuously performed until the updated delayed recursive number is greater than or equal to the preset recursive number, and the delayed audio signal is obtained based on all the delayed slices currently output.
[0096] S207: Obtain a delayed audio signal based on each delayed slice of the source audio signal.
[0097] It should be noted that the relevant instructions for S207 can be found in Figure 1 The relevant description of S104 will not be repeated here.
[0098] When the present invention performs delay processing on the source audio signal, the delay effect of the sound is increased through continuous iteration, so that the delayed audio signal finally obtained has a rich harmonic structure and sound texture, and a sound effect rich in spatial sense and complex is obtained.
[0099] Reference Figure 3 , is a flowchart of another audio data processing provided by an embodiment of the present invention, which is specifically described as follows:
[0100] Step 1: Read audio signal data.
[0101] The audio signal data here is equivalent to the source audio signal mentioned above. After the audio signal data is read, the audio signal data is used as an input signal source for subsequent processing.
[0102] Step 2: Slice the input signal source and divide it into multiple sub-signals.
[0103] The input signal source here is equivalent to the target audio signal mentioned above, and the sub-signal is equivalent to the signal slice mentioned above.
[0104] Step 3: Apply a delay effect to the sub-signal.
[0105] After applying the delay effect to the sub-signal, a delayed sub-signal is obtained; the delayed sub-signal is equivalent to the delay slice mentioned above.
[0106] Step 4: Detect the current recursive level. When the recursion is not completed, use all sub-signals that have passed step 3 as new input signal sources, and then return to execute step 2; when the recursion is completed, execute step 5.
[0107] Step 5: Superimpose all delayed sub-signals.
[0108] Step 6: Output the delayed audio data.
[0109] The audio data output here is equivalent to the delayed audio signal above.
[0110] It should be noted that the generation of multi-channel speech test data relies on manual collection and no effective automated test solution has been implemented. This solution fills the gap in the automatic generation of test data for this scenario and forms a complete closed loop. The method provided by the present invention slices the input audio data, then delays each slice, and finally recursively applies fractal delay. The delayed signal undergoes repeated subdivision and delay processing to produce a complex, complicated and multi-level structure. This structure increases the complexity and richness of the sound, and can generate a delay effect with rich harmonic structure and sound texture. By recursively applying fractal delay, a delay effect with rich harmonic structure and sound texture can be generated. It can simulate the characteristics of some nonlinear acoustic systems and produce a sound effect that is rich in spatial sense and complicated, replacing artificial real-scene simulation and improving test results and efficiency.
[0111] Preferably, the solution provided by the present invention can be divided into four parts, such as: a basic parameter setting part, a signal slicing part, a signal delay part, and a recursive fractal delay part. Each part can be implemented using a corresponding module, such as: a basic parameter setting module, a signal slicing module, a signal delay module, and a recursive fractal delay module. The parameters set by the basic parameter setting module are used for slicing by the signal slicing module, delay processing by the signal delay module, and the operation of the recursive fractal delay module.
[0112] Basic parameter setting module: This module is mainly used to define the pre-defined parameters required to generate multi-audio delay signal test data, such as: 1. Frame size of sub-signal; 2. Audio delay time; 3. Recursion level; 4. Sampling rate.
[0113] The above parameters are set according to actual needs. By setting different parameters, it is possible to simulate the characteristics of some nonlinear acoustic systems and produce spatial and complex sound effects.
[0114] 1) Frame size of sub-signal: Frame size refers to the length of the short time window (frame) into which the audio signal is divided. Setting the frame size of the sub-signal can affect the following aspects: a. Delay effect: Shorter frame size can produce shorter delay effect because each frame takes less time to process. Conversely, longer frame size will result in longer delay effect because each frame takes longer to process. By adjusting the frame size, the time length of the delay effect can be controlled to meet specific audio processing needs. b. Time resolution and frequency resolution: Shorter frame size can provide higher time resolution, that is, it can capture the rapid changes of the audio signal more finely. However, shorter frame size may result in lower frequency resolution, that is, it cannot capture the details of higher frequencies well. Conversely, longer frame size can provide higher frequency resolution, but may reduce time resolution. Depending on the needs of specific applications, a trade-off can be made between time and frequency resolution based on the choice of frame size. c. Computational complexity: Shorter frame size will result in more frequent processing operations, which may increase the computational complexity of the algorithm. Conversely, longer frame size can reduce the amount of calculation, but may reduce the accuracy of processing for rapidly changing audio signals. Therefore, the availability of computing resources and the requirements of real-time processing need to be considered when selecting the frame size. The frame size setting of the sub-signal has an impact on the delay effect, time resolution, frequency resolution, and computational complexity. According to the specific audio processing requirements and algorithm design considerations, an appropriate frame size can be selected to obtain the desired audio effect and performance.
[0115] 2) Audio delay time: Delay time refers to the time interval between the audio signal input and output.
[0116] 3) Recursive level: The significance of recursively applying fractal delay in this algorithm is to generate multi-level delay effects through multiple subdivisions and delay processing, increase the complexity, stereoscopic sense and spatial sense of audio, and make the delayed signal richer and more natural. Therefore, the corresponding level can be set according to actual business needs.
[0117] 4) Sampling rate: The sampling rate determines the level of refinement of the audio signal. A higher sampling rate means more sampling of the audio signal per unit time, so the rapid changes and details of the audio signal can be captured more accurately. If the sampling rate is too low, the audio signal will not be sampled enough, and the details and dynamic range of the original audio cannot be accurately restored. This may cause audio distortion, blur or low fidelity. In summary, the sampling rate determines the quality and restoration ability of digital audio. A higher sampling rate can provide better audio details and dynamic range, but it also requires more storage and transmission resources. Choosing an appropriate sampling rate can strike a balance between audio quality and cost.
[0118] Signal slicing module: This module is mainly used to slice the original audio signal data according to the set sub-signal frame size parameter. It is divided into multiple sub-signals according to the fixed frame size, and these sub-signals are stored in a list and returned.
[0119] The workflow of the signal slicing module is as follows: Read audio data: First use the wavfile.read method to read and store the local audio file data, which is convenient for subsequent processing of the audio signal data. The audio data can also be directly passed in later; Confirm the number of sub-signals that the original audio signal can be divided into: According to the set sub-signal frame size parameter and the calculated original signal data length, the number of sub-signals that can be divided is obtained by dividing the length of the input signal by the frame size; Divide the input signal into multiple sub-signals according to a fixed frame size, and store these sub-signals in a list: Use code to loop through the start and end indexes of each sub-signal. Extract the current sub-signal from the input signal through the slicing operation and add it to the sliced list.
[0120] Signal Delay Module: This module mainly applies the delay effect to the previously cut sub-signal. It adds a zero padding at the beginning of the signal data to represent the delay part, and then concatenates the delay part with the remaining part to obtain the signal after the delay is applied.
[0121] The workflow of the signal delay module is as follows: Delay the sub-signal: First, calculate the length of the incoming sub-signal. Then, according to the set parameters, multiply the delay time and the sampling rate to get the number of delayed samples and round it up. Subtract the length of the obtained number of delayed samples from the input sub-signal data, and fill it with 0 elements of the same length to get the final delayed signal.
[0122] Recursive fractal delay module: This module mainly recursively calls each delayed sub-module again according to the settings of the previous recursive level parameters (the essence of recursive fractal delay is to pass the sub-signal after delay processing to the signal slicing module again, and perform a series of operations after slicing again). The significance of recursive application of fractal delay in this algorithm is to generate multi-level delay effects through multiple subdivisions and delay processing, increase the complexity, three-dimensionality and spatial sense of the audio, and make the delayed signal richer and more natural.
[0123] The workflow of the recursive fractal delay module is as follows: Check the current recursion times: If the current recursion times are less than the set recursion levels, the sub-signal data that has been delayed in the signal delay is used as the signal source to be passed into step 5 again to repeat the subsequent steps, and the recursion times are increased by one; Sub-signal superposition: If the recursion times are equal to the set recursion levels, the sub-signal that has been processed by delay and recursion is added to the total signal list. When all sub-signals are processed according to the above process, the list is the final processed audio data.
[0124] The audio signal processed by the method provided by the present invention can produce a complex and unique delay effect, with rich harmonic structure and sound texture. It can simulate the characteristics of some nonlinear acoustic systems and produce a spatial and complex sound effect. Test data can be generated repeatedly, in large quantities, and with high customization, improving efficiency and authenticity.
[0125] and Figure 1 Corresponding to the method shown in the figure, an embodiment of the present invention provides an audio data processing device, which is used to support Figure 1 For the specific implementation of the method shown, refer to Figure 4 , is a structural diagram of an audio data processing device provided in an embodiment of the present invention, and the specific description is as follows.
[0126] A determination unit 401 is used to use a source audio signal to be processed as a target audio signal;
[0127] A slicing unit 402, configured to perform slicing processing on the target audio signal to obtain a plurality of signal slices;
[0128] A delay processing unit 403 is used to perform delay processing on each of the signal slices to obtain a delayed slice of each of the signal slices;
[0129] The acquisition unit 404 is configured to acquire a delayed audio signal of the source audio signal based on each of the delay slices.
[0130] In the device provided by the embodiment of the present invention, the source audio signal to be processed is used as the target audio signal, the target audio signal is sliced to obtain multiple signal slices, each signal slice is delayed to obtain a delayed slice of each signal slice, and a delayed audio signal of the source audio signal is obtained based on each delayed slice; the harmonic structure of the signal is changed by slicing the audio signal and delaying the signal slices obtained by the slices, thereby obtaining a delayed audio signal with a different sound effect from the source audio signal. The method provided by the present invention increases the sound complexity of the signal and changes the sound effect of the audio signal by slicing and delaying the signal, thereby obtaining an audio signal with different sound effects, without the need for manual collection in different scenes, thereby reducing the cost of obtaining audio signals with different sound effects.
[0131] In another embodiment of the present invention, the acquisition unit of the device performs a process of acquiring a delayed audio signal of the source audio signal based on each of the delay slices, including:
[0132] After obtaining the delayed slices of all signal slices of the source audio signal, updating the number of delayed recursions of the source audio signal;
[0133] When the number of delayed recursions of the source audio signal is less than the preset number of recursions, all delayed slices are used as new target audio signals, and the operation of slicing the target audio signal is returned to obtain multiple signal slices, until the number of delayed recursions of the source audio signal is not less than the preset number of recursions, and then a delayed audio signal is obtained based on the delayed slices of the source audio signal.
[0134] In another embodiment of the present invention, the slicing unit of the device performs slicing processing on the target audio signal to obtain a plurality of signal slices, including:
[0135] Acquire a slice parameter of the target audio signal;
[0136] determining a slice length based on the slice parameters;
[0137] Based on the slice length, the target audio signal is sliced to obtain a plurality of signal slices.
[0138] In another embodiment of the present invention, the delay processing unit of the device performs delay processing on each of the signal slices to obtain a delayed slice of each of the signal slices, including:
[0139] For each of the signal slices, a signal to be replaced is determined in the signal slice, and a preset delayed signal is used to replace the signal to be replaced in the signal slice to obtain a delayed slice.
[0140] In another embodiment of the present invention, the acquisition unit of the device performs a process of acquiring a delayed audio signal based on each delayed slice of the source audio signal, including:
[0141] Sorting the delayed slices to obtain a slice sequence;
[0142] The delayed slices in the slice sequence are spliced one by one to obtain a delayed audio signal.
[0143] An embodiment of the present invention further provides a storage medium, which includes stored instructions, wherein when the instructions are executed, the device where the storage medium is located is controlled to execute the above-mentioned audio data processing method.
[0144] The embodiment of the present invention further provides an electronic device, the structural diagram of which is shown in FIG. Figure 5 As shown, it specifically includes a memory 601 and one or more instructions 602, wherein the one or more instructions 602 are stored in the memory 601 and are configured to be executed by one or more processors 603 to execute the one or more instructions 602 to perform the above-mentioned audio data processing method.
[0145] It should be noted that the information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards of relevant countries and regions.
[0146] The specific implementation processes and derivative methods of the above-mentioned embodiments are all within the protection scope of the present invention.
[0147] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can refer to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system or system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can refer to the partial description of the method embodiment. The system and system embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without creative work.
[0148] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0149] The above description of the disclosed embodiments enables one skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for processing audio data, It is characterized in that include: Using the source audio signal to be processed as the target audio signal; Slicing the target audio signal to obtain a plurality of signal slices; Performing delay processing on each of the signal slices to obtain a delayed slice of each of the signal slices; A delayed audio signal of the source audio signal is obtained based on each of the delay slices.
2. The method according to claim 1, It is characterized in that The acquiring the delayed audio signal of the source audio signal based on each of the delay slices includes: After obtaining the delayed slices of all signal slices of the source audio signal, updating the number of delayed recursions of the source audio signal; When the number of delayed recursions of the source audio signal is less than the preset number of recursions, all delayed slices are used as new target audio signals, and the operation of slicing the target audio signal is returned to obtain multiple signal slices, until the number of delayed recursions of the source audio signal is not less than the preset number of recursions, and then a delayed audio signal is obtained based on the delayed slices of the source audio signal.
3. The method according to claim 1, It is characterized in that The slicing process of the target audio signal to obtain a plurality of signal slices includes: Acquire a slice parameter of the target audio signal; determining a slice length based on the slice parameters; Based on the slice length, the target audio signal is sliced to obtain a plurality of signal slices.
4. The method according to claim 2, It is characterized in that The delay processing is performed on each of the signal slices to obtain a delayed slice of each of the signal slices, including: For each of the signal slices, a signal to be replaced is determined in the signal slice, and a preset delayed signal is used to replace the signal to be replaced in the signal slice to obtain a delayed slice.
5. The method according to claim 2, It is characterized in that The step of obtaining a delayed audio signal based on each delayed slice of the source audio signal comprises: Sorting the delayed slices to obtain a slice sequence; The delayed slices in the slice sequence are spliced one by one to obtain a delayed audio signal.
6. An audio data processing device, It is characterized in that include: A determination unit, configured to use a source audio signal to be processed as a target audio signal; A slicing unit, configured to perform slicing processing on the target audio signal to obtain a plurality of signal slices; A delay processing unit, used for performing delay processing on each of the signal slices to obtain a delayed slice of each of the signal slices; An acquiring unit is used to acquire a delayed audio signal of the source audio signal based on each of the delay slices.
7. The device according to claim 6, It is characterized in that The acquisition unit performs a process of acquiring a delayed audio signal of the source audio signal based on each of the delay slices, including: After obtaining the delayed slices of all signal slices of the source audio signal, updating the number of delayed recursions of the source audio signal; When the number of delayed recursions of the source audio signal is less than the preset number of recursions, all delayed slices are used as new target audio signals, and the operation of slicing the target audio signal is returned to obtain multiple signal slices, until the number of delayed recursions of the source audio signal is not less than the preset number of recursions, and then a delayed audio signal is obtained based on the delayed slices of the source audio signal.
8. The device according to claim 6, It is characterized in that The slicing unit performs slicing processing on the target audio signal to obtain a plurality of signal slices, including: Acquire a slice parameter of the target audio signal; determining a slice length based on the slice parameters; Based on the slice length, the target audio signal is sliced to obtain a plurality of signal slices.
9. A storage medium, It is characterized in that The storage medium includes stored instructions, wherein when the instructions are executed, the device where the storage medium is located is controlled to execute the audio data processing method according to any one of claims 1 to 5.
10. An electronic device, It is characterized in that The device comprises a memory and one or more instructions, wherein the one or more instructions are stored in the memory and configured to be executed by one or more processors to perform the audio data processing method according to any one of claims 1 to 5.
