Disclosure of Invention
The invention mainly aims to provide a scheduling method and device of an audio processing algorithm, an audio processor and a storage medium, and aims to solve the technical problem of large delay in the existing audio processing technology.
In order to achieve the above object, the present invention provides a scheduling method of an audio processing algorithm, comprising: according to a preset shortening proportion, shortening the frame length of an initial audio frame on multiple channels to obtain an audio frame to be processed; wherein the audio frame to be processed comprises a plurality of sub-frames; selecting a current subframe to be processed from a plurality of subframes; acquiring automatic feedback control algorithm programs of all channels written in the current subframe to be processed, and dividing the acquired automatic feedback control algorithm programs into a plurality of groups of algorithm programs with target quantity according to the preset shortening ratio; and reserving one group of the algorithm programs on the current subframe to be processed, sequencing the subframes on a channel according to the frame sequence of the subframes, and sequentially scheduling the remaining groups of the algorithm programs on a plurality of target subframes according to the group from the next subframe of the current subframe to be processed.
Optionally, other audio processing algorithm programs except for the automatic feedback control algorithm program are written in the current subframe to be processed; after the step of reserving one group of the algorithm programs on the current subframe to be processed, sequencing the remaining groups of the algorithm programs on a plurality of target subframes in groups in sequence from the next subframe of the current subframe to be processed according to the frame sequence of the subframes on the channel, the scheduling method of the audio processing algorithm further comprises the following steps: taking the algorithm program reserved for the current subframe to be processed and the other audio processing algorithm programs as algorithms to be operated; and running the algorithm to be run according to a preset execution sequence to realize audio processing on the current subframe to be processed.
Optionally, after the step of running the to-be-run algorithm according to the preset execution sequence to perform audio processing on the current to-be-processed subframe, the method for scheduling an audio processing algorithm further includes: when an audio processing algorithm program finishes running, acquiring a processing object frame of the running audio processing algorithm program; taking the next subframe of the processing object frame as a new current subframe to be processed; and writing the operated audio processing algorithm program into a new current subframe to be processed.
Optionally, after the step of writing the operated audio processing algorithm program into the new current subframe to be processed, the audio processing algorithm scheduling method further includes: and returning to the step of acquiring the automatic feedback control algorithm programs of all the channels written in the current subframe to be processed, and dividing the acquired automatic feedback control algorithm programs into a plurality of groups of algorithm programs with target quantity according to the preset shortening ratio.
Optionally, the initial audio frame comprises a plurality of sub-audio frames; the method comprises the following steps of shortening the frame length of an initial audio frame on multiple channels according to a preset shortening ratio to obtain an audio frame to be processed, and specifically comprises the following steps: and respectively shortening the frame length of each sub audio frame according to a preset shortening proportion, and taking each sub audio frame with the shortened frame length as the audio frame to be processed.
Optionally, before the step of shortening the frame length of the initial audio frame on the multiple channels according to the preset shortening ratio to obtain the audio frame to be processed, the method for scheduling an audio processing algorithm further includes: acquiring an initial audio frame on multiple channels; writing an automatic feedback control algorithm program into a current to-be-processed sub audio frame of the initial audio frame, wherein a subframe corresponding to the current to-be-processed sub audio frame after the frame length of the current to-be-processed sub audio frame is shortened is the current to-be-processed subframe.
Optionally, the acquiring an initial audio frame on multiple channels specifically includes: acquiring a source audio signal input to a multi-channel; and performing framing processing on the source audio signal to obtain an initial audio frame.
In addition, to achieve the above object, the present invention further provides a scheduling apparatus for an audio processing algorithm, including: the frame length shortening module is used for shortening the frame length of the initial audio frame on multiple channels according to a preset shortening proportion to obtain an audio frame to be processed; wherein the audio frame to be processed comprises a plurality of sub-frames; the acquisition module is used for selecting a current subframe to be processed from a plurality of subframes; the grouping module is used for acquiring the automatic feedback control algorithm programs of all channels written in the current subframe to be processed and dividing the acquired automatic feedback control algorithm programs into a plurality of groups of algorithm programs with target quantity according to the preset shortening ratio; and the scheduling module is used for reserving one group of the algorithm programs on the current subframe to be processed, sequencing the subframes on a channel according to the frame sequence of the subframes, and sequentially scheduling the remaining groups of the algorithm programs on a plurality of target subframes according to the group from the next subframe of the current subframe to be processed.
Further, to achieve the above object, the present invention also provides an audio processor, comprising: a memory, a processor and a scheduler of an audio processing algorithm stored on the memory and executable on the processor, the scheduler of the audio processing algorithm implementing the steps of the scheduling method of the audio processing algorithm as described above when executed by the processor.
In addition, to achieve the above object, the present invention further provides a storage medium, wherein the storage medium stores a scheduling program of an audio processing algorithm, and the scheduling program of the audio processing algorithm implements the steps of the scheduling method of the audio processing algorithm when being executed by a processor.
The scheduling method, the device, the audio processor and the storage medium of the audio processing algorithm provided by the embodiment of the invention obtain the audio frame to be processed comprising a plurality of subframes by shortening the frame length of an initial audio frame, obtain the current subframe to be processed from the plurality of subframes, divide AFC algorithm programs of each channel written on the current subframe to be processed into a plurality of groups of algorithm programs with target quantity, sequentially distribute the groups of algorithm programs to the current subframe to be processed and a plurality of target subframes behind the current subframe to be processed by scheduling, so that the AFC algorithm on each channel can be executed by distributing the programs to different subframes, ensure the smooth execution of the AFC algorithm, simultaneously shorten the execution time of the current subframe to be processed, solve the problem of possible execution abnormity of the AFC algorithm programs after the frame length is shortened, effectively reduce the audio processing delay by shortening the audio frame length, the audio processing latency is low.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
The hardware operation environment related to the embodiment of the invention is an audio processor. The internal structure of the audio processor generally comprises an input part and an output part, and the audio processor of the embodiment of the invention also comprises a processing module with draggable programming, and can be formed by a user freely building a system. The audio processor of the embodiment of the invention is a multi-channel audio processor, and can carry out multi-channel processing on audio signals so as to realize multi-channel input and output.
Fig. 1 is a schematic diagram of an audio processor in a hardware operating environment according to an embodiment of the present invention.
The audio processor may include: a processor 1001, such as a CPU, a network interface 1004, a user interface 1003, a memory 1005, a communication bus 1002. Wherein a communication bus 1002 is used to enable connective communication between these components. Alternatively, the user interface 1003 may include a standard wired interface, a wireless interface. The user interface 1003 may be communicatively coupled with the microphone via a wired interface or a wireless interface. The network interface 1004 may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface). The memory 1005 may be a high-speed RAM memory or a non-volatile memory (e.g., a magnetic disk memory). The memory 1005 may alternatively be a storage device separate from the processor 1001.
Those skilled in the art will appreciate that the audio processor architecture shown in fig. 1 does not constitute a limitation of the audio processor and may include more or fewer components than shown, or some components may be combined, or a different arrangement of components.
As shown in fig. 1, a memory 1005, which is a kind of computer storage medium, may include therein a scheduler of an operating system, a network communication module, a user interface module, and an audio processing algorithm.
In the audio processor shown in fig. 1, the network interface 1004 is mainly used for connecting to a backend server and communicating with the backend server; the user interface 1003 is mainly used for connecting a microphone and performing data communication of audio signal frames with the microphone; and the processor 1001 may be configured to invoke a scheduler of the audio processing algorithm stored in the memory 1005 and perform the following operations: according to a preset shortening proportion, shortening the frame length of an initial audio frame on multiple channels to obtain an audio frame to be processed; wherein the audio frame to be processed comprises a plurality of sub-frames; selecting a current subframe to be processed from a plurality of subframes; acquiring automatic feedback control algorithm programs of all channels written in the current subframe to be processed, and dividing the acquired automatic feedback control algorithm programs into a plurality of groups of algorithm programs with target quantity according to the preset shortening ratio; and reserving one group of the algorithm programs on the current subframe to be processed, sequencing the subframes on a channel according to the frame sequence of the subframes, and sequentially scheduling the remaining groups of the algorithm programs on a plurality of target subframes according to the group from the next subframe of the current subframe to be processed.
Optionally, other audio processing algorithm programs except for the automatic feedback control algorithm program are written in the current subframe to be processed; after the step of reserving one group of the algorithm programs on the current subframe to be processed, sequencing the remaining groups of the algorithm programs on a plurality of target subframes in groups in sequence from the next subframe of the current subframe to be processed according to the frame sequence of the subframes on the channel, the scheduling method of the audio processing algorithm further comprises the following steps: taking the algorithm program reserved for the current subframe to be processed and the other audio processing algorithm programs as algorithms to be operated; and running the algorithm to be run according to a preset execution sequence to realize audio processing on the current subframe to be processed.
Optionally, after the step of running the to-be-run algorithm according to the preset execution sequence to perform audio processing on the current to-be-processed subframe, the method for scheduling an audio processing algorithm further includes: when an audio processing algorithm program finishes running, acquiring a processing object frame of the running audio processing algorithm program; taking the next subframe of the processing object frame as a new current subframe to be processed; and writing the operated audio processing algorithm program into a new current subframe to be processed.
Optionally, after the step of writing the operated audio processing algorithm program into the new current subframe to be processed, the audio processing algorithm scheduling method further includes: and returning to the step of acquiring the automatic feedback control algorithm programs of all the channels written in the current subframe to be processed, and dividing the acquired automatic feedback control algorithm programs into a plurality of groups of algorithm programs with target quantity according to the preset shortening ratio.
Optionally, the initial audio frame comprises a plurality of sub-audio frames; the method comprises the following steps of shortening the frame length of an initial audio frame on multiple channels according to a preset shortening ratio to obtain an audio frame to be processed, and specifically comprises the following steps: and respectively shortening the frame length of each sub audio frame according to a preset shortening proportion, and taking each sub audio frame with the shortened frame length as the audio frame to be processed.
Optionally, before the step of shortening the frame length of the initial audio frame on the multiple channels according to the preset shortening ratio to obtain the audio frame to be processed, the method for scheduling an audio processing algorithm further includes: acquiring an initial audio frame on multiple channels; writing an automatic feedback control algorithm program into a current to-be-processed sub audio frame of the initial audio frame, wherein a subframe corresponding to the current to-be-processed sub audio frame after the frame length of the current to-be-processed sub audio frame is shortened is the current to-be-processed subframe.
Optionally, the acquiring an initial audio frame on multiple channels specifically includes: acquiring a source audio signal input to a multi-channel; and performing framing processing on the source audio signal to obtain an initial audio frame.
Referring to fig. 2, a first embodiment of a scheduling method of an audio processing algorithm includes:
step S202, according to a preset shortening proportion, shortening the frame length of an initial audio frame on multiple channels to obtain an audio frame to be processed; wherein the audio frame to be processed comprises a plurality of sub-frames;
in this embodiment, the audio processing is real-time processing, that is, after the microphone collects the audio signal, the audio signal is input to the audio processor of the embodiment of the present invention, and the audio processor immediately processes the audio signal and then outputs the processed audio signal through the speaker. Specifically, after an initial audio frame is input into the multi-channel audio processor of this embodiment, the audio processor shortens the frame length of the initial audio frame according to a preset shortening ratio, so as to obtain an audio frame to be processed. The preset shortening ratio may be 1/2, that is, the frame length of the initial audio frame is shortened to half of the original frame length, and the preset shortening ratio may also be other suitable ratio values. Furthermore, the resulting audio frame to be processed comprises a plurality of sub-frames.
In an embodiment, the initial audio frame comprises a plurality of sub-audio frames; the step S202 specifically includes: and respectively shortening the frame length of each sub audio frame according to a preset shortening proportion, and taking each sub audio frame with the shortened frame length as the audio frame to be processed.
In this embodiment, the audio processor respectively shortens the frame length of each sub-audio frame of the initial audio frame according to the same preset shortening ratio, so as to obtain a plurality of sub-frames corresponding to the plurality of audio frames one to one. Wherein the plurality of sub-frames constitute an audio frame to be processed.
Referring to fig. 3, in an embodiment, before the step S202, the method for scheduling an audio processing algorithm further includes:
step S302, acquiring an initial audio frame on multiple channels;
the audio processor obtains an initial audio frame from a plurality of channels.
Specifically, referring to fig. 4, in an embodiment, step S302 specifically includes:
step S402, acquiring a source audio signal input to a multi-channel;
the source audio signal is an audio signal collected by a microphone, and is transmitted to multiple channels of an audio processor after the source audio signal is collected by the microphone. In this embodiment, after the audio processor collects the source audio signal, the source audio signal is subjected to preliminary processing, such as noise reduction processing.
Step S404, performing framing processing on the source audio signal to obtain an initial audio frame.
The source audio signal collected by the microphone is a sound signal, the audio processor also performs sound-electricity conversion on the source audio signal to obtain an electric signal, and further performs digital-to-analog conversion on the electric signal to obtain an analog audio signal. Further, the audio processor performs framing processing on the analog audio signal to obtain an initial audio frame including a plurality of sub-audio frames. In the framing process, the frames may be of equal frame length, or may be of unequal frame length.
Step S304, writing an automatic feedback control algorithm program into a current to-be-processed sub audio frame of the initial audio frame, wherein a subframe corresponding to the current to-be-processed sub audio frame after the frame length of the current to-be-processed sub audio frame is shortened is the current to-be-processed subframe.
The audio processor writes an AFC-algorithm program onto the current pending sub-audio frame of the initial audio frame. When the audio processor processes the initial audio frame, the audio processor sequentially processes the sub-audio frames according to the frame sequence, wherein the current sub-audio frame to be processed is the sub-audio frame played to the output port. In an embodiment, the audio processor writes the AFC algorithm program into the current sub-audio frame to be processed, and also writes other audio processing algorithm programs, including an AGC algorithm program, a COM algorithm program, a PEQ algorithm program, a Lim algorithm program, an ANS algorithm program, an automatic remix processing algorithm program, and the like. The algorithm programs sequentially perform audio processing on the currently processed sub-audio frames according to a preset execution sequence.
Step S204, selecting a current subframe to be processed from the plurality of subframes;
the audio processor acquires the current pending subframe in which the AFC algorithm program is written.
Step S206, obtaining the automatic feedback control algorithm programs of all channels written in the current subframe to be processed, and dividing the obtained automatic feedback control algorithm programs into a plurality of groups of algorithm programs with target quantity according to the preset shortening ratio;
in this embodiment, the audio processor is a multi-channel audio processor, the sub-frames to be processed correspond to AFC algorithm programs in each channel, and the AFC algorithm programs in each channel process the sub-frames to be processed. Since the AFC algorithm program is calculated once after accumulating a certain number of audio sampling points, after the frame length of the initial audio frame is shortened, there is a possibility that the audio sampling points required for the AFC algorithm program on each channel to be executed are not accumulated after the subframe to be processed is played, and abnormal phenomena such as execution loss and the like occur when the AFC algorithm program of each channel processes the subframe to be processed. In this embodiment, the audio processor divides AFC algorithm programs of each channel into a plurality of sets of algorithm programs of a target number, leaves one set on a subframe to be processed for processing, and schedules the other sets to subsequent frames of the current subframe to be processed. Wherein the setting of the target number is related to a preset shortening ratio. Specifically, the target number is an integer part of the reciprocal of the preset shortening ratio. For example, if the preset shortening ratio is 1/2, the target number is 2.
Step S208, a group of the algorithm programs is reserved on the current subframe to be processed, the subframes are sorted on the channel according to the frame sequence of the subframes, and the remaining groups of algorithm programs are sequentially scheduled to a plurality of target subframes according to the group from the next subframe of the current subframe to be processed.
And the audio processor reserves a group of algorithm programs on the current subframe to be processed to carry out audio processing on the subframe, sorts the algorithm programs according to frames, and sequentially schedules the rest groups of algorithm programs on a plurality of target subframes behind the current subframe to be processed.
In this embodiment, a to-be-processed audio frame including multiple subframes is obtained by shortening the frame length of an initial audio frame, a current to-be-processed subframe is obtained from the multiple subframes, AFC algorithm programs of channels written in the current to-be-processed subframe are divided into multiple sets of algorithm programs of a target number, and the sets of algorithm programs are sequentially distributed to the current to-be-processed subframe and multiple target subframes after the current to-be-processed subframe through scheduling, so that AFC algorithms on the channels can be executed by distributing to different subframes, smooth execution of the AFC algorithms can be guaranteed, execution time of the current to-be-processed subframe is shortened, the problem of execution abnormality possibly existing in the AFC algorithm programs after the frame length is shortened is solved, delay of audio processing can be effectively reduced by shortening the frame length of the audio frame, and audio processing delay is low.
Referring to fig. 4, in an embodiment, other audio processing algorithm programs besides the automatic feedback control algorithm program are written on the current subframe to be processed; after the step S208, the method for scheduling an audio processing algorithm further includes:
step S402, using the algorithm program reserved by the current subframe to be processed and the other audio processing algorithm programs as algorithms to be operated;
the other audio processing algorithm programs include an AGC algorithm program, a COM algorithm program, a PEQ algorithm program, a Lim algorithm program, an ANS algorithm program, an automatic mixing processing algorithm program, and the like. The audio processor takes all audio processing algorithm programs as algorithms to be run.
And S404, operating the algorithm to be operated according to a preset execution sequence to realize audio processing on the current subframe to be processed.
The preset execution sequence is an execution sequence under a common rule among algorithms. And the audio processor sequentially runs the algorithm to be run according to a preset execution sequence to complete the audio processing of the current subframe to be processed.
Referring to fig. 5, in an embodiment, after the step S404, the method for scheduling an audio processing algorithm further includes:
step S502, when an audio processing algorithm program finishes running, acquiring a processing object frame of the running audio processing algorithm program;
an audio processing algorithm includes the same algorithm processing on multiple channels. When the same audio processing algorithm program on multiple channels is executed, the audio processor acquires the processing object frame of the audio processing algorithm program.
Step S504, regard said next subframe which processes the target frame as the new current subframe to be processed;
and the audio processor takes the next subframe of the processing object frame on multiple channels according to the frame sequence as a new current subframe to be processed.
Step S506, writing the operated audio processing algorithm program into a new current subframe to be processed.
And the audio processor writes the running audio algorithm program into the new current subframe to be processed so as to perform audio processing on the new subframe to be processed when the new subframe to be processed is played.
In an embodiment, the executed audio processing algorithm is an automatic feedback control algorithm, and after step S506, the method for scheduling an audio processing algorithm further includes: returning to the step S206.
After the AFC algorithm programs on the multiple channels are divided into multiple groups of algorithm programs of the target number, the audio processor acquires a new current subframe to be processed, the AFC algorithm programs are written into the new current subframe to be processed, the step S206 is returned to, so that the new current subframe to be processed is grouped in the AFC algorithm programs on the multiple channels, algorithm scheduling is carried out again, cyclic grouping scheduling of the AFC algorithm is achieved, and multi-frame subframes are processed.
Referring to fig. 6, an embodiment of the present invention further provides a scheduling apparatus for an audio processing algorithm, where the scheduling apparatus for an audio processing algorithm includes:
a frame length shortening module 610, configured to shorten a frame length of an initial audio frame on multiple channels according to a preset shortening ratio, and obtain an audio frame to be processed; wherein the audio frame to be processed comprises a plurality of sub-frames;
an obtaining module 620, configured to select a current subframe to be processed from a plurality of subframes;
a grouping module 630, configured to obtain automatic feedback control algorithm programs of each channel written on the current subframe to be processed, and divide the obtained automatic feedback control algorithm programs into multiple sets of algorithm programs of a target number according to the preset reduction ratio;
and the scheduling module 640 is configured to reserve one group of the algorithm programs on the current subframe to be processed, sort the subframes on the channel according to the frame sequence of the subframes, and sequentially schedule the remaining groups of the algorithm programs on a plurality of target subframes in groups from a subframe next to the current subframe to be processed.
In this embodiment, the frame length of the initial audio frame is shortened by the frame length shortening module to obtain an audio frame to be processed including a plurality of subframes, the obtaining module obtains a current subframe to be processed from the plurality of subframes, the grouping module divides AFC algorithm programs of each channel written on the current subframe to be processed into a plurality of sets of algorithm programs of a target number, the scheduling module distributes each set of algorithm programs to the current subframe to be processed and a plurality of target subframes after the current subframe to be processed by scheduling in sequence, so that the AFC algorithm on each channel can be executed by being dispersed to different sub-frames, the AFC algorithm can be ensured to be executed smoothly, meanwhile, the execution time of the current subframe to be processed is shortened, the problem of execution abnormity possibly existing in an AFC algorithm program after the frame length is shortened is solved, the audio processing delay can be effectively reduced by shortening the audio frame length, and the audio processing delay is low.
Optionally, other audio processing algorithm programs except for the automatic feedback control algorithm program are written in the current subframe to be processed; the scheduling apparatus of the audio processing algorithm further comprises: the algorithm execution module is used for taking the algorithm program reserved by the current subframe to be processed and the other audio processing algorithm programs as algorithms to be operated; and running the algorithm to be run according to a preset execution sequence to realize audio processing on the current subframe to be processed.
Optionally, the scheduling apparatus of the audio processing algorithm further includes: the algorithm writing module is used for acquiring a processing object frame of an audio processing algorithm program after the operation of the audio processing algorithm program is finished; taking the next subframe of the processing object frame as a new current subframe to be processed; and writing the operated audio processing algorithm program into a new current subframe to be processed.
Optionally, the running audio processing algorithm program is an automatic feedback control algorithm program, and the scheduling device for the audio processing algorithm further includes: and the return module is used for returning to the step of acquiring the automatic feedback control algorithm programs of all the channels written in the current subframe to be processed after the operated audio processing algorithm program is written in the new current subframe to be processed, and dividing the acquired automatic feedback control algorithm programs into a plurality of groups of algorithm programs with target quantity according to the preset shortening ratio.
Optionally, the initial audio frame comprises a plurality of sub-audio frames; the frame length shortening module 610 is further configured to respectively shorten the frame length of each sub audio frame according to a preset shortening ratio, and use each sub audio frame after the frame length is shortened as the audio frame to be processed.
Optionally, the frame length shortening module 610 is further configured to obtain an initial audio frame on multiple channels; writing an automatic feedback control algorithm program into a current to-be-processed sub audio frame of the initial audio frame, wherein a subframe corresponding to the current to-be-processed sub audio frame after the frame length of the current to-be-processed sub audio frame is shortened is the current to-be-processed subframe.
Optionally, the frame length shortening module 610 is further configured to obtain a source audio signal input to the multiple channels; and performing framing processing on the source audio signal to obtain an initial audio frame.
In addition, an embodiment of the present invention further provides an audio processor, where the audio processor includes: a memory, a processor and a scheduler of an audio processing algorithm stored on the memory and executable on the processor, the scheduler of the audio processing algorithm implementing the steps of the scheduling method embodiment of the audio processing algorithm as described above when executed by the processor.
In addition, an embodiment of the present invention further provides a storage medium, where a scheduling program of an audio processing algorithm is stored on the storage medium, and the scheduling program of the audio processing algorithm, when executed by a processor, implements the steps of the foregoing scheduling method embodiment of the audio processing algorithm.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or system. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or system that comprises the element.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on this understanding, the technical solutions of the present invention may be embodied in the form of a software product, which is stored in a storage medium (e.g., ROM/RAM, magnetic disk, optical disk) as described above and includes instructions for causing an audio processor to execute the methods according to the embodiments of the present invention.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.