Audio processing method and device based on audio cache model, and related medium
By introducing the audio cache model and dynamic management of the delay bus into the audio processing architecture, the problem of insufficient versatility and compatibility of the hybrid audio processing architecture is solved, and the performance and efficiency of audio processing are improved.
Patent Information
- Application Number
- CN202410738292.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-07
- Publication Date
- 2024-09-27
AI Technical Summary
The existing hybrid audio processing architecture has poor versatility and compatibility, resulting in performance degradation, increased latency and compatibility issues in complex processing environments, making it difficult to adapt to the needs of multiple audio processing plug-ins.
Using a method based on the audio cache model, a delay bus with a first-in-first-out storage structure is created for multiple input channels, the corresponding delay bus is linked according to the number of channels required by the audio processing unit, and the memory block is dynamically managed through the memory judgment unit. Ensures processing and output of audio input sources.
It improves the versatility and compatibility of audio processing, reduces memory resource consumption, reduces latency, and solves compatibility issues in plug-in collaborative work.
Smart Images

Figure CN118711628A
Abstract
Description
Technical Field
[0001] The present invention relates to the field of audio processing technology, and in particular to an audio processing method, device and related media based on an audio cache model. Background Art
[0002] Existing hybrid audio processing architectures can often only support one or several specific plug-ins. This limitation leads to poor versatility and compatibility of hybrid audio processing architectures. Common hybrid audio processing architectures have exposed some obvious defects in complex processing environments: first, this hybrid audio processing architecture will occupy more memory resources in terms of performance. When multiple plug-ins are used in combination, the system memory consumption will increase significantly, resulting in a decrease in the performance of the hybrid audio processing architecture; second, the delay of real-time processing results will also increase with the increase in the number of plug-ins; finally, each plug-in in the hybrid audio processing architecture has different design logic, and compatibility issues will arise when working together, further affecting the efficiency and effect of audio processing.
[0003] Therefore, there is an urgent need for a hybrid audio processing architecture that can provide higher versatility and compatibility to meet the needs of various audio processing plug-ins. Summary of the invention
[0004] The embodiments of the present invention provide an audio processing method, an apparatus and related media based on an audio cache model, aiming to solve the problem of poor versatility and compatibility of a hybrid audio processing architecture in the prior art.
[0005] In a first aspect, an embodiment of the present invention provides an audio processing method based on an audio cache model, comprising:
[0006] Creating a plurality of delay buses corresponding to the plurality of input channels; wherein the delay bus is an audio cache model using a first-in-first-out storage structure, and the first-in-first-out storage structure includes a fixed number of memory blocks;
[0007] According to the channel number requirements of different audio processing units, each of the audio processing units is connected to the corresponding delay bus;
[0008] When the delay bus receives the current audio input source of the corresponding input channel, it is determined whether there is an empty memory block, if so, the current audio input source is filled into the corresponding memory block, if not, the audio input source stored in the memory block earliest is removed, and the current audio input source is filled into the corresponding memory block;
[0009] The audio processing unit connected by the delay bus performs audio processing on the audio input source in the memory block, obtains the audio processing result and outputs it.
[0010] In a second aspect, an embodiment of the present invention provides an audio processing device based on an audio cache model, comprising:
[0011] A model building unit, configured to create a plurality of delay buses corresponding to a plurality of input channels; wherein the delay bus is an audio cache model using a first-in-first-out storage structure, and the first-in-first-out storage structure includes a fixed number of memory blocks;
[0012] An audio link unit, used for linking each audio processing unit to the corresponding delay bus according to the channel number requirements of different audio processing units;
[0013] a memory determination unit, configured to determine whether there is an empty memory block when the delay bus receives the current audio input source of the corresponding input channel, and if so, fill the current audio input source into the corresponding memory block; if not, remove the audio input source stored earliest in the memory block, and fill the current audio input source into the corresponding memory block;
[0014] The audio output unit is used to perform audio processing on the audio input source in the memory block through the audio processing unit connected to the delay bus, obtain the audio processing result and output it.
[0015] In a third aspect, an embodiment of the present invention provides a computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the audio processing method based on the audio cache model of the first aspect when executing the computer program.
[0016] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, wherein a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the audio processing method based on the audio cache model of the first aspect is implemented.
[0017] An embodiment of the present invention provides an audio processing method based on an audio cache model, including creating corresponding multiple delay buses for multiple input channels; linking each audio processing unit to a corresponding delay bus according to the channel number requirements of different audio processing units; when the delay bus receives the current audio input source of the corresponding input channel, it is determined whether there is an empty memory block, if so, the current audio input source is filled into the corresponding memory block, if not, the audio input source stored in the memory block earliest is removed, and the current audio input source is filled into the corresponding memory block; the audio processing unit linked by the delay bus performs audio processing on the audio input source in the memory block, obtains an audio processing result and outputs it. The present invention uses a delay bus to receive an audio input source and performs audio processing on the audio input source in the memory block through an audio processing unit, thereby greatly improving the versatility and compatibility of audio processing.
[0018] The embodiment of the present invention also provides an audio processing device, a computer device and a storage medium based on an audio cache model, which also have the above-mentioned beneficial effects. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying any creative work.
[0020] Figure 1 A flowchart of an audio processing method based on an audio cache model provided by an embodiment of the present invention;
[0021] Figure 2 A schematic block diagram of an audio processing device based on an audio cache model provided by an embodiment of the present invention;
[0022] Figure 3 Another flowchart of an audio processing method based on an audio cache model provided by an embodiment of the present invention;
[0023] Figure 4 Schematic diagram of the operation of the circular audio buffer provided by the embodiment of the present invention Figure 1 ;
[0024] Figure 5 Schematic diagram of the operation of the circular audio buffer provided by the embodiment of the present invention Figure 2 ;
[0025] Figure 6 Schematic diagram of the operation of the circular audio buffer provided by the embodiment of the present invention Figure 3 ;
[0026] Figure 7 Schematic diagram of the operation of the circular audio buffer provided by the embodiment of the present invention Figure 4 ;
[0027] Figure 8 Another schematic block diagram of an audio processing device based on an audio cache model provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0028] 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 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.
[0029] It should be understood that when used in this specification and the appended claims, the terms "include" and "comprises" indicate the presence of described features, integers, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or combinations thereof.
[0030] It should also be understood that the terms used in this specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. As used in the specification of the present invention and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include plural forms.
[0031] It should be further understood that the term "and / or" used in the present description and the appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0032] See below Figure 1 , Figure 1 A flowchart of an audio processing method based on an audio cache model provided by an embodiment of the present invention specifically includes: steps S101 to S104.
[0033] S101, creating a plurality of corresponding delay buses for a plurality of input channels; wherein the delay bus is an audio cache model using a first-in-first-out storage structure, and the first-in-first-out storage structure includes a plurality of memory blocks of a fixed number;
[0034] S102, linking each audio processing unit to the corresponding delay bus according to the channel number requirements of different audio processing units;
[0035] S103, when the delay bus receives the current audio input source of the corresponding input channel, it is determined whether there is an empty memory block, if so, the current audio input source is filled into the corresponding memory block, if not, the audio input source stored earliest in the memory block is removed, and the current audio input source is filled into the corresponding memory block;
[0036] S104: Perform audio processing on the audio input source in the memory block through the audio processing unit connected to the delay bus, obtain an audio processing result, and output it.
[0037] Combination Figure 2 and Figure 3As shown, in step S101, multiple delay buses are created for multiple input channels. For example, if there are four input channels, four delay buses will be established respectively, and each delay bus corresponds to one input channel. The delay bus is an audio buffer model designed based on the input channel. The input channel refers to each audio input source (corresponding to Figure 3 The source of the audio frame can be a microphone, a musical instrument, etc. The input audio format of each input channel is usually different. In order to ensure the consistency of the input source, the delay bus also needs to have a resampling function.
[0038] The delay bus is an audio cache model based on a FIFO storage structure. The FIFO storage structure only allows deletion operations at its front end and insertion operations at the back end. In audio processing, the FIFO storage structure is particularly suitable for occasions where data needs to be processed sequentially and random access to the data is not required. Specifically, the FIFO storage structure includes a fixed number of multiple memory blocks. These memory blocks can be memory units on hardware or buffers in software. Each memory block is used to store a part of the audio data. Writing and reading these memory blocks in sequence can achieve delay processing of the audio input source.
[0039] Combination Figure 4 As shown, in one embodiment, step S101 includes:
[0040] Defining parameters of an audio buffer model for each input channel; wherein the parameters of the audio buffer model include buffer size, sampling rate, and bit depth;
[0041] Allocating a fixed number of memory blocks according to the parameters of the audio cache model to obtain a ring audio buffer;
[0042] A start pointer, an end pointer and an empty flag are set based on the annular audio buffer to obtain a corresponding delay bus; wherein the start pointer is used to indicate the position of the audio frame to be read, the end pointer is used to indicate the position of the audio frame to be stored, and the empty flag indicates whether the annular audio buffer is empty; when the annular audio buffer is empty or full, the start pointer and the end pointer point to the same memory block.
[0043] In this embodiment, for each input channel, it is necessary to define the parameters of the corresponding audio buffer model, and these parameters include: buffer size, sampling rate and bit depth;
[0044] Cache size: determines how much audio data the audio buffer can store, usually in samples or seconds;
[0045] Sampling rate: The sampling rate of audio data determines the number of audio samples collected per second, such as 44100Hz or 48000Hz;
[0046] Bit depth: The number of bits per audio sample. Common bit depths are 16, 24 or 32 bits, which affects the dynamic range and signal-to-noise ratio of the audio data.
[0047] According to the audio cache model parameters defined above, a fixed number of memory blocks are allocated for each channel to create a ring audio buffer (such as Figure 4 The left part shows the initial state of the circular audio buffer. This circular audio buffer allows audio data to be stored in a circular manner, which is easy to manage and can efficiently use memory. Based on the constructed circular audio buffer, the start pointer, end pointer and empty flag can be set;
[0048] Head pointer: used to indicate the position of the audio frame to be read. This is the position of the first valid data point in the circular audio buffer, from which data reading begins;
[0049] Rear pointer: used to indicate the location of the audio frame to be stored. New audio data will be stored at the location indicated by this pointer ( Figure 4 The right part shows that the circular audio buffer stores part of the audio data);
[0050] Empty flag: A Boolean flag used to indicate whether the circular audio buffer is empty. When the circular audio buffer is empty, the start pointer and the end pointer point to the same memory block; when the circular audio buffer is full, the two pointers will point to the same position, but at this time there is no space available in the circular audio buffer.
[0051] In step S102, different audio processing units have different requirements for the number of channels, and the system meets these requirements by linking the audio processing units to corresponding delay buses. For example, if an audio processing unit needs to process two channels of audio, the audio processing unit will be connected to two independent delay buses, each bus processing one channel (e.g. Figure 2 During the connection process, the system checks the number of channels required for each audio processing unit and correctly links it to the delay bus with the corresponding channel data.
[0052] In step S103, the delay bus first receives the current audio input source from the corresponding input channel, and checks whether there is an empty memory block in the delay bus; if the check result shows that there is an empty memory block, the system directly fills the current audio input source into this memory block to ensure that the newly received audio data can be stored in time; if there is no empty memory block, the system first removes the earliest stored audio input source, that is, deletes the oldest audio data from the memory block, and then fills the current audio input source into the corresponding memory block to ensure that the delay bus can continue to receive new audio input. By dynamically managing the contents of the memory block, the system can maximize the use of available memory and avoid resource waste.
[0053] Combination Figure 5 As shown, in one embodiment, the step S103 includes:
[0054] Fill the audio input source into the memory block with the end pointer as the starting address through the end pointer, move the end pointer audio input source length, and set the empty flag position to 0;
[0055] Furthermore, the audio input source is filled into a memory block with the end pointer as the starting address through the end pointer, the end pointer is moved by the length of the audio input source, and the empty flag is set to 0; and, the start pointer is moved by the same length.
[0056] In this embodiment, audio input sources from different input channels are continuously received. Whenever there is a new audio input source, the end pointer is used to locate the filling start position in the annular audio buffer, and the audio input source is then filled into the memory block with the end pointer as the starting address. After the filling is completed, the end pointer moves forward according to the length of the audio input source to update the data storage position. At the same time, the empty flag is set to 0, indicating that there is data in the annular audio buffer and there is still space for storage.
[0057] When the circular audio buffer is completely filled, the end pointer wraps around and points to the same memory block as the start pointer (e.g. Figure 5 In this case, if you continue to receive new audio input sources, you need to move both the start pointer and the end pointer. To maintain the continuity of the circular audio buffer and avoid data overwriting, each time the end pointer moves, the start pointer also needs to move forward by the same length, ensuring that the old data that is about to be overwritten can be released to make room for new data to be written (such as Figure 5 The ring audio buffer design makes use of every memory block without reserving unnecessary space for old data.
[0058] In step S104, all audio input sources need to be stored in the designated memory block of the circular audio buffer through the delay bus first. Each audio processing unit is linked to a specific memory block through the delay bus. This link allows the audio processing unit to directly access the audio data it needs without additional data transmission or copying steps, thereby improving processing efficiency and response speed. The audio processing unit performs various audio processing operations on the audio input sources in the memory blocks it is linked to. These operations include but are not limited to amplification, compression, equalization, noise elimination or adding special effects of audio signals. The processing process is automatically adjusted according to preset parameters or according to real-time analysis. The audio results after processing are output from the corresponding audio processing unit through the delay bus.
[0059] Combination Figure 6 and Figure 7 As shown, in one embodiment, the step S104 includes:
[0060] Determining the number of delay buses connected to the audio processing unit and the number of sampling points of the connected delay buses;
[0061] Based on the number of delay buses linked to the audio processing unit and the number of sampling points of the linked delay buses, the audio input source in the memory block corresponding to the number of sampling points in the corresponding delay bus is extracted, and audio processing is performed to obtain and output the audio processing result.
[0062] In this embodiment, for each audio processing unit, the number of delay buses to be connected is first determined; at the same time, the number of sampling points required by each audio processing unit is determined. According to the determined audio cache model parameters, a corresponding number of sampling points are extracted from the delay buses connected to each audio processing unit, and these sampling points are located in a predefined memory block. The audio processing unit processes the audio data extracted from the delay bus, and the audio output after processing is sent out through the relevant output interface.
[0063] Specifically, for each independent audio processing unit, the number of channels and the number of sampling points required are different, so when the delay bus links the audio processing units, it is necessary to allocate pointers according to the length required by the audio processing units. For example, suppose audio processing unit A requires 7 sampling points and audio processing unit B requires 12 sampling points (such as Figure 6The A part and the B part shown in the figure are connected in series on the delay bus, then the audio processing unit A only needs to access the first 7 sampling points of the delay bus, and the audio processing unit B only needs to access the first 12 sampling points of the delay bus. When the start pointer moves, the memory accessed by each audio processing unit can also be changed according to the change of relative position. For example, when the start pointer moves forward by 10 units, the memory accessed by the audio processing unit A (i.e., plug-in A) and the audio processing unit B (i.e., plug-in B) only needs to move forward by 10 units as a whole, and the total length of their respective accesses does not need to change (such as Figure 7 Part A and Part B shown in FIG.
[0064] In one embodiment, extracting the audio input source in the memory block corresponding to the number of sampling points in the corresponding delay bus includes:
[0065] Locate the start pointer of the corresponding delay bus, read and retrieve the length of the required audio input source from the address pointed to by the start pointer according to the number of sampling points, and move the start pointer to retrieve the length of the audio input source;
[0066] Determine whether the addresses of the start pointer and the end pointer are the same. If they are the same, set the empty flag to 1.
[0067] In this embodiment, the current position of the start pointer in the delay bus is determined, and the start pointer identifies the start address in the annular audio buffer where the audio input source can be read. According to the number of sampling points of the audio input source to be processed, the audio input source of the corresponding length is read from the address pointed to by the start pointer. After reading the audio input source of the required length, the start pointer moves forward by the corresponding length. After each movement of the start pointer, it is necessary to determine whether the addresses of the start pointer and the end pointer are the same, in order to confirm the filling state of the annular audio buffer. If the addresses of the start pointer and the end pointer are the same, this indicates that there is no unread valid data in the annular audio buffer. Therefore, the empty flag position is set to 1, indicating that the storage space of the annular audio buffer is full.
[0068] In one embodiment, the locating the start pointer of the corresponding delay bus includes:
[0069] When the start pointer corresponding to the delay bus moves, the length of the movement is obtained, and the start pointer after the movement is positioned according to the length of the movement.
[0070] In this embodiment, when the system reads the audio input source from the circular audio buffer of the delay bus, the start pointer needs to be moved to indicate the new starting point of the next batch of readable data. This movement is based on the length of the audio input source that has been read. The specific length that the start pointer needs to move is calculated and obtained, and this length is equal to the length of the audio input source that has been read. Using the above-obtained movement length, the position of the start pointer is updated. If the movement of the start pointer causes it to reach or exceed the physical end of the buffer, the pointer automatically wraps around to the beginning of the circular audio buffer to form a ring structure.
[0071] In one embodiment, after the step of the delay bus receiving the current audio input source of the corresponding input channel, the method further comprises:
[0072] Acquire the original sampling rate of the audio input source, and resample the audio input source according to the original sampling rate;
[0073] The step of obtaining and outputting the audio processing result includes:
[0074] The processing sampling rate of the audio processing result is obtained, and the audio processing result is resampled according to the processing sampling rate and outputted.
[0075] In this embodiment, when the delay bus receives the audio input source of the input channel, the original sampling rate of the audio input source is first identified, and resampling is performed to match the predetermined processing sampling rate according to the original sampling rate of the audio input source. For example, if the original audio sampling rate is 44100Hz, and the audio processing unit requires 48000Hz audio, the system will use interpolation or other resampling algorithms to resample the audio from 44100Hz to 48000Hz. The audio processing unit processes the resampled audio data, including steps such as effect addition, equalization, and dynamic range adjustment. The processed audio usually needs to be adapted to a specific output device or storage format. The system will obtain the sampling rate of the processed audio and resample it again according to the requirements of the target output format. For example, if the processed audio sampling rate is 48000Hz, but the final output requires a sampling rate of 44100Hz, the system will perform corresponding resampling.
[0076] Combination Figure 8 As shown, Figure 8 A schematic block diagram of an audio processing device based on an audio cache model provided by an embodiment of the present invention, the audio processing device 800 based on the audio cache model includes:
[0077] The model building unit 801 is used to create a plurality of delay buses corresponding to the plurality of input channels; wherein the delay bus is an audio cache model using a first-in-first-out storage structure, and the first-in-first-out storage structure includes a plurality of memory blocks of a fixed number;
[0078] An audio link unit 802, used to link each audio processing unit to the corresponding delay bus according to the channel number requirements of different audio processing units;
[0079] The memory judgment unit 803 is used to judge whether there is an empty memory block when the delay bus receives the current audio input source of the corresponding input channel. If so, fill the current audio input source into the corresponding memory block; if not, remove the audio input source stored in the memory block earliest, and fill the current audio input source into the corresponding memory block;
[0080] The audio output unit 804 is used to perform audio processing on the audio input source in the memory block through the audio processing unit connected to the delay bus, obtain the audio processing result and output it.
[0081] In this embodiment, the model building unit 801 creates corresponding multiple delay buses for multiple input channels; wherein the delay bus is an audio cache model using a first-in-first-out storage structure, and the first-in-first-out storage structure includes a fixed number of multiple memory blocks; the audio link unit 802 links each of the audio processing units to the corresponding delay bus according to the channel number requirements of different audio processing units; the memory judgment unit 803 determines whether there is an empty memory block when the delay bus receives the current audio input source of the corresponding input channel, and if so, fills the current audio input source into the corresponding memory block, and if not, removes the audio input source stored in the memory block earliest, and fills the current audio input source into the corresponding memory block; the audio output unit 804 performs audio processing on the audio input source in the memory block through the audio processing unit linked to the delay bus, obtains the audio processing result and outputs it.
[0082] In one embodiment, the model building unit 801 includes:
[0083] A parameter unit, used to define parameters of an audio cache model for each input channel; wherein the parameters of the audio cache model include a cache size, a sampling rate, and a bit depth;
[0084] an allocating unit, configured to allocate a fixed number of memory blocks according to the parameters of the audio cache model to obtain a ring audio buffer;
[0085] A setting unit is used to set a start pointer, an end pointer and an empty flag respectively based on the annular audio buffer to obtain a corresponding delay bus; wherein the start pointer is used to indicate the position of the audio frame to be read, the end pointer is used to indicate the position of the audio frame to be stored, and the empty flag indicates whether the annular audio buffer is empty; when the annular audio buffer is empty or full, the start pointer and the end pointer point to the same memory block.
[0086] In one embodiment, the memory determination unit 803 includes:
[0087] A filling unit, used to fill the audio input source into the memory block with the end pointer as the starting address through the end pointer, move the end pointer by the length of the audio input source, and set the empty flag position to 0;
[0088] Furthermore, the moving unit is used to fill the audio input source into the memory block with the end pointer as the starting address through the end pointer, move the length of the end pointer audio input source, and set the empty flag position to 0; and move the same length as the starting pointer.
[0089] In one embodiment, the audio output unit 804 includes:
[0090] A linking unit, used to determine the number of delay buses linked to the audio processing unit and the number of sampling points of the linked delay buses;
[0091] The extraction unit is used to extract the audio input source in the memory block corresponding to the number of sampling points in the delay bus based on the number of delay buses connected to the audio processing unit and the number of sampling points of the connected delay buses, and perform audio processing to obtain and output the audio processing result.
[0092] In one embodiment, the extraction unit comprises:
[0093] A positioning unit, used to locate the start pointer of the corresponding delay bus, read and obtain the length of the required audio input source from the address pointed by the start pointer according to the number of sampling points, and move the start pointer to obtain the length of the audio input source;
[0094] The pointer unit is used to determine whether the addresses of the start pointer and the end pointer are the same. If they are the same, the empty flag is set to 1.
[0095] In one embodiment, the positioning unit includes:
[0096] The delay unit is used to obtain the length of the movement when the start pointer of the corresponding delay bus moves, and to locate the start pointer after the movement according to the length of the movement.
[0097] In one embodiment, the audio processing device 800 based on the audio cache model further includes:
[0098] A sampling unit, used to obtain the original sampling rate of the audio input source, and resample the audio input source according to the original sampling rate;
[0099] The output unit is used to obtain a processing sampling rate of the audio processing result, resample the audio processing result according to the processing sampling rate, and output the resampled audio processing result.
[0100] Since the embodiments of the apparatus part correspond to the embodiments of the method part, please refer to the description of the embodiments of the method part for the embodiments of the apparatus part, which will not be repeated here.
[0101] The embodiment of the present invention further provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed, the steps provided in the above embodiment can be implemented. The storage medium may include: a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and other media that can store program codes.
[0102] The embodiment of the present invention also provides a computer device, which may include a memory and a processor, wherein a computer program is stored in the memory, and when the processor calls the computer program in the memory, the steps provided in the above embodiment may be implemented. Of course, the computer device may also include various network interfaces, power supplies and other components.
[0103] The various embodiments in the specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same and similar parts between the various embodiments can be referred to each other. For the system disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part description. It should be pointed out that for ordinary technicians in this technical field, without departing from the principles of this application, several improvements and modifications can be made to the present application, and these improvements and modifications also fall within the scope of protection of the claims of this application.
[0104] It should also be noted that, in this specification, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "comprises", "comprising" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including 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 statement "comprising a ..." does not exclude the presence of other identical elements in the process, method, article or device including the element.
Claims
1. An audio processing method based on an audio cache model, characterized in that: include: Creating a plurality of delay buses corresponding to the plurality of input channels; wherein the delay bus is an audio cache model using a first-in-first-out storage structure, and the first-in-first-out storage structure includes a fixed number of memory blocks; According to the channel number requirements of different audio processing units, each of the audio processing units is connected to the corresponding delay bus; When the delay bus receives the current audio input source of the corresponding input channel, it is determined whether there is an empty memory block, if so, the current audio input source is filled into the corresponding memory block, if not, the audio input source stored in the memory block earliest is removed, and the current audio input source is filled into the corresponding memory block; The audio processing unit connected by the delay bus performs audio processing on the audio input source in the memory block, obtains the audio processing result and outputs it.
2. The audio processing method based on the audio cache model according to claim 1, characterized in that: The step of creating a plurality of delay buses corresponding to the plurality of input channels comprises: Defining parameters of an audio buffer model for each input channel; wherein the parameters of the audio buffer model include buffer size, sampling rate, and bit depth; Allocating a fixed number of memory blocks according to the parameters of the audio cache model to obtain a ring audio buffer; A start pointer, an end pointer and an empty flag are set based on the annular audio buffer to obtain a corresponding delay bus; wherein the start pointer is used to indicate the position of the audio frame to be read, the end pointer is used to indicate the position of the audio frame to be stored, and the empty flag indicates whether the annular audio buffer is empty; when the annular audio buffer is empty or full, the start pointer and the end pointer point to the same memory block.
3. The audio processing method based on the audio cache model according to claim 2, characterized in that: If so, filling the current audio input source into the corresponding memory block includes: Fill the audio input source into the memory block with the end pointer as the starting address through the end pointer, move the end pointer audio input source length, and set the empty flag position to 0; If not, then the audio input source stored earliest in the memory block is removed, and the current audio input source is filled into the corresponding memory block, including: Through the end pointer, fill the audio input source into the memory block with the end pointer as the starting address, move the end pointer audio input source length, and set the empty flag position to 0; and move the start pointer by the same length.
4. The audio processing method based on the audio cache model according to claim 2, characterized in that: The audio processing unit connected through the delay bus performs audio processing on the audio input source in the memory block, obtains and outputs an audio processing result, including: Determining the number of delay buses connected to the audio processing unit and the number of sampling points of the connected delay buses; Based on the number of delay buses linked to the audio processing unit and the number of sampling points of the linked delay buses, the audio input source in the memory block corresponding to the number of sampling points in the corresponding delay bus is extracted, and audio processing is performed to obtain and output the audio processing result.
5. The audio processing method based on the audio cache model according to claim 4 is characterized in that: The step of extracting the audio input source in the memory block corresponding to the number of sampling points in the corresponding delay bus includes: Locate the start pointer of the corresponding delay bus, read and retrieve the length of the required audio input source from the address pointed to by the start pointer according to the number of sampling points, and move the start pointer to retrieve the length of the audio input source; Determine whether the addresses of the start pointer and the end pointer are the same. If they are the same, set the empty flag to 1.
6. The audio processing method based on the audio cache model according to claim 5, characterized in that: The positioning of the start pointer of the corresponding delay bus includes: When the start pointer corresponding to the delay bus moves, the length of the movement is obtained, and the start pointer after the movement is positioned according to the length of the movement.
7. The audio processing method based on the audio cache model according to claim 1, characterized in that: After the step of the delay bus receiving the current audio input source of the corresponding input channel, the method includes: Acquire the original sampling rate of the audio input source, and resample the audio input source according to the original sampling rate; The step of obtaining and outputting the audio processing result includes: The processing sampling rate of the audio processing result is obtained, and the audio processing result is resampled according to the processing sampling rate and outputted.
8. An audio processing device based on an audio cache model, characterized in that: include: A model building unit, configured to create a plurality of delay buses corresponding to a plurality of input channels; wherein the delay bus is an audio cache model using a first-in-first-out storage structure, and the first-in-first-out storage structure includes a fixed number of memory blocks; An audio link unit, used for linking each audio processing unit to the corresponding delay bus according to the channel number requirements of different audio processing units; a memory determination unit, configured to determine whether there is an empty memory block when the delay bus receives the current audio input source of the corresponding input channel, and if so, fill the current audio input source into the corresponding memory block; if not, remove the audio input source stored earliest in the memory block, and fill the current audio input source into the corresponding memory block; The audio output unit is used to perform audio processing on the audio input source in the memory block through the audio processing unit connected to the delay bus, obtain the audio processing result and output it.
9. A computer device, characterized in that: The method comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the audio processing method based on the audio cache model as described in any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by the processor, the audio processing method based on the audio cache model according to any one of claims 1 to 7 is implemented.
