Audio processing method and device, computer device and storage medium
By dividing audio into segments and identifying keyframes for compression, the problem of insufficient accuracy in understanding long-term audio is solved, and a large language model is able to achieve efficient and detailed understanding of long-term audio.
Patent Information
- Application Number
- CN202311257571.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-26
- Publication Date
- 2026-11-20
- Estimated Expiration
- 2043-09-26
AI Technical Summary
Existing technologies are not accurate in understanding long audio files, and large language models are prone to losing the overall information of the audio after multiple segmented inputs, resulting in coarse granularity of audio content understanding and an inability to achieve fine-grained understanding.
By dividing the audio to be processed into multiple audio segments and identifying keyframes, compression processing is performed based on keyframes and audio segments to generate input information for inputting into a large language model, reducing the number of audio frames and ensuring that overall information is preserved.
It improves the accuracy of understanding long-duration audio, avoids information loss caused by multiple segmented inputs, and enhances the understanding effect of large language models on long-duration audio.
Smart Images

Figure CN117079671B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of audio processing technology, and more specifically, to an audio processing method, apparatus, computer device, and storage medium. Background Technology
[0002] With the rapid development of artificial intelligence (AI) technology, large language models (LLMs) have gained widespread attention in recent years for their ability to more intelligently understand and respond to user questions. Furthermore, LLMs are often used for audio understanding; however, the accuracy of these technologies in understanding longer audio clips remains poor. Summary of the Invention
[0003] This application proposes an audio processing method, apparatus, computer device, and storage medium that can improve the accuracy of understanding long-duration audio.
[0004] In a first aspect, embodiments of this application provide an audio processing method, the method comprising: dividing an audio to be processed into multiple audio segments; performing keyframe recognition on the audio to be processed to obtain keyframes in the audio to be processed; compressing the audio to be processed based on the keyframes and the multiple audio segments; generating first input information for inputting into a large language model based on first prompt information and the compressed audio to be processed, the first prompt information being used to prompt the large language model to perform audio understanding; and inputting the first input information into the large language model to obtain an audio understanding result corresponding to the audio to be processed.
[0005] Secondly, embodiments of this application provide an audio processing apparatus, comprising: an audio segmentation module, a keyframe recognition module, an audio compression module, an information generation module, and an audio understanding module. The audio segmentation module is used to divide the audio to be processed into multiple audio segments; the keyframe recognition module is used to perform keyframe recognition on the audio to be processed to obtain keyframes in the audio; the audio compression module is used to compress the audio to be processed based on the keyframes and the multiple audio segments; the information generation module is used to generate first input information for inputting into a large language model based on first prompt information and the compressed audio to be processed, wherein the first prompt information is used to prompt the large language model to perform audio understanding; and the audio understanding module is used to input the first input information into the large language model to obtain the audio understanding result corresponding to the audio to be processed.
[0006] Thirdly, embodiments of this application provide a computer device, including: one or more processors; a memory; and one or more application programs, wherein the one or more application programs are stored in the memory and configured to be executed by the one or more processors, and the one or more application programs are configured to perform the audio processing method provided in the first aspect above.
[0007] Fourthly, embodiments of this application provide a computer-readable storage medium storing program code, which can be invoked by a processor to execute the audio processing method provided in the first aspect above.
[0008] The solution provided in this application divides the audio to be processed into multiple audio segments, performs keyframe recognition on the audio to be processed to obtain keyframes in the audio to be processed, compresses the audio to be processed based on the keyframes and multiple audio segments, and generates first input information for inputting into the large language model based on the first prompt information used to prompt the large language model for audio understanding and the compressed audio to be processed. Then, the first input information is input into the large language model to obtain the audio understanding result corresponding to the audio to be processed. Therefore, since the large language model compresses the audio to be processed based on the identified keyframes and the segmented audio segments, and then determines the input information for inputting into the large language model based on the compressed audio to be processed, it is not necessary to input the audio to be processed into segments and then into the large language model multiple times when understanding long audio. This allows the large language model to better understand long audio and improves the accuracy of understanding long audio. Attached Figure Description
[0009] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0010] Figure 1 A schematic flowchart of an audio processing method according to an embodiment of this application is shown.
[0011] Figure 2 A flowchart illustrating an audio processing method according to another embodiment of this application is shown.
[0012] Figure 3 A schematic flowchart of an audio processing method according to yet another embodiment of this application is shown.
[0013] Figure 4A schematic flowchart of an audio processing method according to another embodiment of this application is shown.
[0014] Figure 5 A flowchart illustrating an audio processing method according to yet another embodiment of this application is shown.
[0015] Figure 6 A schematic flowchart of an audio processing method according to yet another embodiment of this application is shown.
[0016] Figure 7 A flowchart illustrating an audio processing method according to another embodiment of this application is shown.
[0017] Figure 8 A block diagram of an audio processing apparatus according to one embodiment of this application is shown.
[0018] Figure 9 This is a block diagram of a computer device for performing an audio processing method according to an embodiment of this application.
[0019] Figure 10 This is a storage unit in this application embodiment for storing or carrying program code that implements the audio processing method according to this application embodiment. Detailed Implementation
[0020] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings.
[0021] With the rise of AI technology in recent years, deep learning has emerged as a means of audio understanding. This involves training neural network models to extract useful features from massive amounts of data. In audio understanding, this technology helps computers accurately identify and comprehend the content of audio. Furthermore, with the development of artificial intelligence, audio understanding can be achieved through Large Language Models (LLMs). Large Language Models refer to complex artificial neural networks trained on massive amounts of data and computational resources, capable of learning rich language patterns and knowledge, thereby producing accurate responses to natural language input.
[0022] In related technologies, when using large language models for audio understanding, features are extracted from the original audio, transformed into the feature space of the large language model, and then input into the large language model, which then outputs the audio understanding result based on the input content. However, when the original audio is long and contains a large number of audio frames, the large language model has limitations on the amount of content that can be input at any given time. Therefore, when processing the actual input audio, it is often divided into multiple segments. Features are extracted from each segment, transformed into the feature space of the large language model, and then input into the large language model to obtain the audio understanding result for each segment. In this approach, because the audio is divided into multiple segments and the input information is determined separately before being input into the large language model, the large language model loses the overall information of the original audio during audio understanding. This results in limited perception and understanding of long audio segments and a coarse-grained understanding of the audio content, failing to provide a refined understanding of the audio content.
[0023] To address the aforementioned problems, the inventors have proposed the audio processing method, apparatus, computer device, and storage medium provided in the embodiments of this application. These methods enable audio understanding using a large language model. First, the audio is compressed based on identified keyframes and segmented audio segments. Then, the input information for the large language model is determined based on the compressed audio. Therefore, when understanding long-duration audio, it is unnecessary to segment the audio and input it into the large language model multiple times. This allows the large language model to better understand long-duration audio and improves the accuracy of its understanding. The specific audio processing methods are described in detail in the subsequent embodiments.
[0024] The audio processing method provided in the embodiments of this application will now be described in detail with reference to the accompanying drawings.
[0025] Please see Figure 1 , Figure 1 A flowchart illustrating an embodiment of the audio processing method provided in this application is shown. In a specific embodiment, the audio processing method is applied to, for example... Figure 8 The audio processing device 700 shown and the computer device 100 configured with the audio processing device 700 are also shown. Figure 9 The following will use a computer device as an example to illustrate the specific process of this embodiment. Of course, it is understood that the computer device used in this embodiment can be a server, smartphone, tablet computer, smartwatch, laptop computer, etc., and is not limited thereto. The following will focus on... Figure 1 The process shown will be described in detail. The audio processing method may specifically include the following steps:
[0026] Step S110: Divide the audio to be processed into multiple audio segments.
[0027] In this embodiment, when a computer device performs audio understanding on the audio to be processed, considering that the audio to be processed is long, it needs to divide the audio to be processed into multiple audio segments. Then, the multiple audio segments are converted into information for input into a large language model, and then input into the large language model to obtain the audio understanding result corresponding to each audio segment. This will cause the large language model to lose the overall information of the original audio when performing audio understanding, thus making the accuracy of audio understanding of the audio to be processed insufficient. Therefore, the computer device can divide the audio to be processed that needs to be understood into multiple audio segments, so that the audio to be processed can be compressed according to the divided audio segments and the key frames in the audio to be processed subsequently identified, thereby reducing the number of audio frames in the audio to be processed, and thus eliminating the need to input the audio into the large language model multiple times after segmentation.
[0028] In some implementations, when dividing audio to be processed into audio segments, the computer device can divide the audio to be processed into segments based on different sound events in the audio segments, such as human voices, bird calls, car horns, musical instrument sounds, etc.
[0029] In one possible implementation, since audio understanding is typically performed on speech, multiple audio segments can be divided by recognizing human voice segments, marking the human voice segments with timestamps, and then using audio segments composed of adjacent timestamps as a single audio segment.
[0030] In some implementations, the computer device may also divide the audio to be processed into multiple audio segments according to the target time length. For example, the audio to be processed may be divided into multiple audio segments with a time length of 10 seconds.
[0031] Of course, the specific method of dividing the audio into segments for processing is not limited in this embodiment.
[0032] In some implementations, when the executing entity of the audio processing method provided in this application is a server, the audio to be processed can be audio uploaded by an electronic device, or target audio selected from the audio stored on the server according to the selection instruction sent by the electronic device; when the executing entity of the audio processing method provided in this application is an electronic device, such as a smartphone, tablet computer, or laptop computer, the audio to be processed can be audio stored locally on the electronic device, or audio downloaded from the server.
[0033] Step S120: Perform keyframe recognition on the audio to be processed to obtain the keyframes in the audio to be processed.
[0034] In this embodiment, when the computer device performs audio understanding on the audio to be processed, it can also perform keyframe recognition on the audio to be processed. Based on the recognized keyframes in the audio to be processed, the audio to be processed can be compressed, thereby reducing the number of audio frames in the audio to be processed, thus eliminating the need to segment the audio and input it multiple times into a large language model. The keyframes in the audio to be processed can be audio frames where there are abrupt changes in pitch period, energy, etc., therefore, keyframes can have good representativeness among their neighboring audio frames.
[0035] In some implementations, audio features can be extracted from the audio to be processed, and the pitch parameter values of each audio frame can be determined based on the extracted audio features. The pitch parameter values may include pitch period, pitch energy, etc. Then, based on the pitch parameter values of each audio frame, for each two adjacent audio frames, the degree of change between the pitch parameter values of the two adjacent audio frames can be obtained. If the degree of change of the pitch parameter value of the subsequent audio frame relative to the pitch parameter value of the previous audio frame is greater than a target threshold, the subsequent audio frame can be determined as a key frame. If the degree of change of the pitch parameter value of the subsequent audio frame relative to the pitch parameter value of the previous audio frame is not greater than the target threshold, then the subsequent audio frame is not a key frame.
[0036] In some implementations, a pre-trained keyframe recognition model can be used to identify keyframes in the audio to be processed, thereby obtaining the keyframes in the audio. When identifying keyframes in the audio, each audio frame can be input into the keyframe recognition model to obtain the recognition result for each audio frame. Based on the recognition result of each audio frame, the keyframes in the audio can be determined. The specific type of keyframe recognition model is not limited; for example, the keyframe recognition model can be a deep neural network (DNN), a long short-term memory neural network (LSTM), a Transformer network, etc.
[0037] In one possible implementation, the keyframe recognition model's recognition result for each audio frame can include whether the audio frame is a keyframe. For example, the recognition result can include 1 and 0. If the recognition result is 1, it indicates that the audio frame is a keyframe; if the recognition result is 0, it indicates that the audio frame is not a keyframe. Thus, based on the keyframe recognition model's recognition result for each audio frame, it is possible to determine which audio frames in the audio to be processed are keyframes.
[0038] In one possible implementation, the keyframe recognition model may include a keyframe probability in the recognition result for each audio frame. This keyframe probability characterizes the likelihood that the audio frame is a keyframe; a higher keyframe probability indicates a greater likelihood that the audio frame is a keyframe. In this approach, the keyframe probability corresponding to each audio frame can be compared with a keyframe threshold. Based on the comparison result, if the keyframe probability is greater than the keyframe threshold, the audio frame is determined to be a keyframe; if the keyframe probability is not greater than the keyframe threshold, the audio frame is determined not to be a keyframe. Thus, by further judging the recognition result corresponding to each audio frame, the keyframes present in the audio to be processed can be identified.
[0039] In one possible implementation, the keyframe recognition model described above can be trained as follows: Sample audio is acquired, and each audio frame in the sample audio can be labeled with a keyframe tag, which characterizes whether the audio frame is a keyframe. When training the keyframe recognition model based on the sample audio, each sample audio frame can be input into the initial recognition model to obtain the recognition result of the initial recognition model for the sample audio frames. Then, based on the recognition result of each sample audio frame and the keyframe tag labeled for each sample audio frame, the loss value corresponding to the initial recognition model is determined. After determining the loss value corresponding to the initial recognition model, the initial recognition model can be iteratively trained based on the loss value to obtain the final keyframe recognition model. Specifically, when determining the loss value corresponding to the initial recognition model, the loss value can be determined based on the difference between the recognition result corresponding to each sample audio frame and the labeled keyframe tag.
[0040] Optionally, when iteratively training the initial recognition model based on the determined loss value, the model parameters of the initial recognition model can be adjusted according to the calculated loss value. Sample audio frames are repeatedly input into the initial recognition model to obtain the recognition results output by the initial recognition model for the input sample audio frames. Based on the recognition results of the sample audio frames and the labeled keyframes, the loss value corresponding to the initial device model is determined, and the model parameters of the initial recognition model are adjusted according to the loss value until the training termination condition is met, resulting in the trained keyframe recognition model. The training termination condition for iterative training may include: the number of iterations reaches the target number; or the total loss value of the initial recognition model meets a set condition.
[0041] Of course, the specific method for keyframe recognition of the audio to be processed is not limited in the embodiments of this application.
[0042] Step S130: Based on the keyframe and the multiple audio segments, compress the audio to be processed.
[0043] In this embodiment, after identifying keyframes in the audio to be processed and dividing the audio into multiple audio segments, the audio can be compressed based on the divided audio segments and the identified keyframes. Here, compression in this embodiment refers to reducing the number of audio frames in the audio to be processed. Understandably, since keyframes are representative among their adjacent audio frames, multiple audio segments can be compressed based on these keyframes, thereby reducing the number of audio frames while ensuring effective extraction of information from the audio to be processed during subsequent audio understanding.
[0044] In some implementations, for each of the multiple audio segments, it can be determined whether the audio segment includes a keyframe. If the audio segment includes a keyframe, the keyframe and a first target number of audio frames adjacent to the keyframe can be extracted from the audio segment as a portion of the audio frames in the audio segment. If the audio segment does not include a keyframe, a second target number of audio frames can be extracted from the audio segment according to a specified extraction rule. The specific values of the first and second target numbers are not limited; for example, they can be 5 frames, 10 frames, 20 frames, etc.
[0045] In one possible implementation, the number of second targets can be less than the number of first targets. That is, for audio segments that include keyframes, the number of extracted partial audio frames can be greater than the number of extracted partial audio frames from audio segments that do not include keyframes. Understandably, since audio segments that do not include keyframes are audio segments with relatively small variations in pitch period, energy, etc., the information contained in their audio frames is relatively similar. Therefore, fewer audio frames can be extracted to further reduce the number of audio frames used in subsequent audio understanding.
[0046] In one possible implementation, when extracting a second target number of audio frames from an audio segment according to a specified extraction rule, if no keyframe is included in any audio segment, the second target number of audio frames can be randomly extracted from the audio segment.
[0047] In one possible implementation, when a keyframe is not included in any audio segment, and a second target number of audio frames are extracted from the audio segment according to a specified extraction rule, a second target number of audio frames that satisfy the target distribution condition can also be extracted as a portion of the audio frames in the audio segment. The target distribution condition can be that the frames are evenly distributed throughout the audio segment, thereby ensuring that information can be effectively extracted from the audio segment during subsequent audio understanding.
[0048] Of course, in this embodiment, the specific method of compressing the audio to be processed based on keyframes and multiple audio segments is not limited. It is only necessary to ensure that the necessary audio frames are retained from the audio to be processed based on keyframes so as to effectively extract information from the audio to be processed.
[0049] Step S140: Based on the first prompt information and the audio to be processed after the compression process, generate first input information for inputting into the large language model. The first prompt information is used to prompt the large language model to perform audio understanding.
[0050] In this embodiment, after compressing the audio to be processed, the input information for the large language model can be determined based on all the audio frames retained in the audio. Specifically, the input information for the large language model can be generated based on the first prompt and the retained audio frames, and used as the input information. The first prompt can be a prompt word used to guide the large language model in audio understanding; it provides the user's intent. After understanding the first prompt, the large language model can recognize the user's intent and perform corresponding processing. Understandably, because the audio to be processed is compressed using identified keyframes and segmented audio segments before generating the input information for the large language model, the number of audio frames needed to generate the input information is reduced. This ensures that the remaining audio frames provide the necessary information for audio understanding. Therefore, for the audio to be processed, the input information for the large language model only needs to be generated once, thus retaining the overall information of the audio to be processed, making the audio understanding results output by the large language model more accurate.
[0051] In some implementations, features can be extracted from the compressed audio to be processed, and then the extracted features can be transformed into the feature space of a large language model, that is, transformed into text tokens that are usually input into the large language model. This allows them to be concatenated with the first prompt information (also text tokens) to obtain the first input information for inputting into the large language model.
[0052] Step S150: Input the first input information into the large language model to obtain the audio understanding result corresponding to the audio to be processed.
[0053] In this embodiment, after obtaining the first input information, it can be input into a large language model to obtain an audio understanding result corresponding to the audio to be processed. The audio understanding result may include a description of the audio, a response after understanding the first prompt information, etc., and the specific content of the audio understanding result is not limited. The large language model can be a pre-trained model capable of audio understanding. This large language model can be a generative large language model based on AIGC, and it can generate audio understanding results based on the input information. Based on the first input information, the large language model understands the first prompt information in the first input information, obtains the user's intent, and then outputs the audio understanding result based on the information extracted from the compressed audio to be processed in the first input information.
[0054] In some implementations, considering the broad capabilities of large language models and the numerous audio understanding scenarios, a low-rank adaptation (LoRA) model can be added to the large language model. This LoRA model is then trained using sample audio from the corresponding scenarios, enabling the large language model to better understand audio in these scenarios. Specifically, the LoRA model is obtained by fine-tuning the cross-attention layer in the UNet module of the large language model. By applying the LoRA model to the cross-attention layer of the large language model and training it with sample audio from the corresponding scenarios while freezing the parameters of the large language model, a LoRA model capable of better audio understanding in that scenario can be obtained. When in use, the parameters of this LoRA model are injected into the large language model, causing the large language model to output the audio understanding results for that scenario.
[0055] In some embodiments, when the entity executing the audio processing method provided in this application is an electronic device, some steps S110 to S150 can be performed locally on the electronic device, while others can be performed by the electronic device submitting a corresponding request to the server, which then executes the request and returns the result. For example, to perform keyframe recognition on the audio frame to be processed, the electronic device can submit a keyframe recognition request to the corresponding server and upload the audio to be processed to the server, so that the server can perform keyframe recognition on the audio and return the recognition result to the electronic device. The electronic device locally divides the audio to be processed into multiple audio segments, and then compresses the audio based on the keyframes and the multiple audio segments. The compressed audio and a first prompt message are then uploaded to the server. Based on the first prompt message and the compressed audio, the server generates first input information for inputting into a large language model, inputs the first input information into the large language model, obtains the audio understanding result corresponding to the audio to be processed, and returns the audio understanding result to the electronic device.
[0056] The audio processing method provided in this application, when performing audio understanding on the audio to be processed using a large language model, compresses the audio to be processed based on the identified keyframes and segmented audio segments, and then determines the input information for inputting into the large language model based on the compressed audio to be processed. Therefore, when understanding long-term audio, it is not necessary to input the audio to be processed into the large language model multiple times after segmenting the audio to be processed, thereby enabling the large language model to better understand long-term audio and improve the accuracy of understanding long-term audio.
[0057] Please see Figure 2 , Figure 2 A flowchart illustrating another embodiment of the audio processing method provided in this application is shown. This audio processing method is applied to the aforementioned computer device, and will be discussed below. Figure 2 The process shown will be described in detail. The audio processing method may specifically include the following steps:
[0058] Step S210: Divide the audio to be processed into multiple audio segments.
[0059] In some implementations, when dividing the audio to be processed into multiple audio segments, voice activity detection (VAD) can be performed on the audio to be processed to obtain the detection results, and then the audio to be processed can be divided into multiple audio segments based on the detection results. That is to say, the division of the audio segments of the audio to be processed is determined based on the audio parts containing speech signals.
[0060] In one possible implementation, when dividing the audio to be processed into multiple audio segments based on the detection results of speech activity detection, multiple target timestamps can be labeled on the audio to be processed according to the detection results. The audio between two adjacent target timestamps constitutes an audio segment, and the target timestamps are located at the start and end audio frames of the audio segments containing speech signals in the detection results. In other words, the audio to be processed can be segmented by labeling the timestamps of audio segments containing speech signals, so that an audio segment is formed between two adjacent target timestamps, thus obtaining multiple audio segments. Subsequent processing of the audio to be processed can then be performed based on the labeled timestamps and the audio segments formed by each pair of adjacent timestamps, allowing for compression processing of the audio to be processed.
[0061] Step S220: Perform keyframe recognition on the audio to be processed to obtain the keyframes in the audio to be processed.
[0062] In this embodiment, step S220 can be referred to the content of the foregoing embodiments, and will not be repeated here.
[0063] Step S230: Based on the keyframe, perform at least one of audio segment filtering and downsampling on the plurality of audio segments to obtain the compressed audio to be processed. The audio segment filtering includes filtering out at least one audio segment from the plurality of audio segments.
[0064] In this embodiment of the application, when compressing the audio to be processed based on the identified keyframes and multiple audio segments, at least one of audio segment filtering and downsampling can be performed on the multiple audio segments based on the keyframes, thereby reducing the number of audio frames and obtaining the compressed audio to be processed.
[0065] In some implementations, when filtering audio segments from multiple audio segments based on identified keyframes in the audio to be processed, a first audio segment that does not contain keyframes can be identified and then filtered out from the multiple audio segments. In other words, for the audio to be processed, audio segments that do not contain keyframes can be directly deleted. Understandably, since audio segments that do not contain keyframes are audio segments with little variation in pitch period, energy, etc., they may be silent segments or meaningless audio segments, and the information contained in their audio frames is relatively similar. Therefore, they can be directly deleted to significantly reduce the number of audio frames in the audio to be processed.
[0066] In some implementations, when downsampling multiple audio segments based on identified keyframes in the audio to be processed, a second audio segment comprising at least one keyframe can be identified among the multiple audio segments; the second audio segment is then downsampled. It is understood that audio segments comprising keyframes can be downsampled to reduce the number of audio frames in these audio segments, thereby preserving the necessary audio frames for effective extraction of information from the audio to be processed.
[0067] It should be noted that this implementation method can be combined with the previous embodiment. That is, the compression processing of the audio to be processed can be audio segment filtering and downsampling of multiple audio segments. When combined, it is determined whether to filter directly or downsample based on whether the audio segment includes a keyframe.
[0068] In one possible implementation, the second audio segment is divided based on keyframes in the second audio segment to obtain multiple audio sub-segments corresponding to the second audio segment; each audio sub-segment in the multiple audio sub-segments is downsampled, wherein the sampling rate of the audio sub-segment where the keyframe is located is higher than the sampling rate of other audio sub-segments, and the other audio sub-segments are audio sub-segments other than the audio sub-segment where the keyframe is located in the multiple audio sub-segments.
[0069] In the above embodiments, based on keyframes in the second audio segment, audio sub-segments containing keyframes and audio sub-segments not containing keyframes can be divided from the second audio segment. That is, for the second audio segment, the audio segment can be further divided according to the position of the keyframes within the audio segment, resulting in multiple audio sub-segments, such that some audio sub-segments include keyframes and some do not. Then, the audio sub-segments containing keyframes are sampled according to the sampling rate corresponding to the audio sub-segments containing keyframes, and the audio sub-segments not containing keyframes are sampled according to the sampling rate corresponding to the audio sub-segments not containing keyframes. Furthermore, since the pitch parameter values of audio segments not containing keyframes do not vary much, the information contained in each audio frame is relatively similar, so a relatively low sampling rate can be used to extract relatively fewer audio frames. For audio segments containing keyframes, a relatively high sampling rate can be used to retain the necessary audio frames for effective extraction of information from the audio to be processed.
[0070] Optionally, after dividing the second audio segment into audio sub-segments containing keyframes and audio sub-segments not containing keyframes based on keyframes in the second audio segment, if the audio sub-segments containing keyframes are two adjacent audio sub-segments, the duration between the keyframes in the two audio sub-segments can be determined. If the duration is less than the duration threshold, the two audio sub-segments can be merged into one audio sub-segment so that after sampling, the effective information for audio understanding can be better preserved.
[0071] In one possible implementation, the identified keyframes may include primary keyframes and secondary keyframes. A primary keyframe is an audio frame whose pitch parameter value change relative to the previous audio frame is greater than a first threshold. A secondary keyframe is an audio frame whose pitch parameter value change relative to the previous audio frame is greater than a second threshold, where the first threshold is greater than the second threshold. In other words, both the pitch parameter value change of the primary keyframe and the pitch parameter value change of the secondary keyframe relative to the previous audio frame are greater than a certain threshold, but the pitch parameter value change of the primary keyframe is greater. In the above implementation, the sampling rate of the audio sub-segment including the primary keyframe can be greater than the sampling rate of the audio sub-segment including the secondary keyframe, thereby better preserving effective information for audio understanding.
[0072] In some implementations, considering that the audio duration of the audio to be processed for audio understanding each time is not fixed, in order to ensure that input information for inputting a large language model can be generated at once for each compressed audio to be processed, the total number of audio frames obtained after the compressed audio to be processed can be a fixed value, such as 400 frames, 500 frames, 700 frames, etc.
[0073] Step S240: Based on the first prompt information and the audio to be processed after the compression process, generate first input information for inputting into the large language model. The first prompt information is used to prompt the large language model to perform audio understanding.
[0074] Step S250: Input the first input information into the large language model to obtain the audio understanding result corresponding to the audio to be processed.
[0075] In the embodiments of this application, steps S240 and S250 can be referred to the content of the foregoing embodiments, and will not be repeated here.
[0076] The audio processing method provided in this application, when performing audio understanding on the audio to be processed using a large language model, involves filtering and downsampling multiple audio segments based on identified keyframes. Then, the input information for inputting into the large language model is determined based on the compressed audio to be processed. Therefore, when understanding long-duration audio, it is unnecessary to segment the audio to be processed and input it into the large language model multiple times, thereby enabling the large language model to better understand long-duration audio and improving the accuracy of its understanding. Furthermore, since the audio to be processed is obtained by filtering and downsampling multiple audio segments based on keyframes, necessary audio frames can be retained. Thus, after the input information determined based on the compressed audio to be processed is input into the large language model, the large language model can effectively extract information from the audio to be processed, thereby ensuring the accuracy of audio understanding.
[0077] Please see Figure 3 , Figure 3 A schematic flowchart of another embodiment of the audio processing method provided in this application is shown. This audio processing method is applied to the aforementioned computer device, and will be discussed below. Figure 3 The process shown will be described in detail. The audio processing method may specifically include the following steps:
[0078] Step S310: Divide the audio to be processed into multiple audio segments.
[0079] Step S320: Perform keyframe recognition on the audio to be processed to obtain the keyframes in the audio to be processed.
[0080] Step S330: Based on the keyframe and the multiple audio segments, compress the audio to be processed.
[0081] In the embodiments of this application, steps S310 to S330 can be referred to the contents of other embodiments, and will not be repeated here.
[0082] Step S340: Extract features from the compressed audio to obtain the input features.
[0083] In this embodiment of the application, after compressing the audio to be processed based on the identified keyframes and the segmented audio segments, when generating the first input information for inputting into the large language model based on the first prompt information and the compressed audio to be processed, feature extraction can be performed on the compressed audio to be processed. The audio features corresponding to the compressed audio to be processed can be converted into information for inputting into the large language model, that is, converted into the feature space of the large language model, so that they can be input into the large language model.
[0084] In some implementations, when performing feature extraction on the audio to be processed to obtain the above-mentioned input features, feature extraction can be performed on the spectrogram corresponding to each audio segment in the compressed audio to obtain the global features of the spectrogram corresponding to each audio segment and the patch features corresponding to multiple image blocks; according to the order of the audio segments in the audio to be processed, the global features corresponding to the audio to be processed are concatenated to obtain the first feature; the patch features corresponding to the audio to be processed are average pooled to obtain the second feature; the first feature and the second feature are concatenated to obtain the input features.
[0085] Global features typically refer to features extracted from the entire image, such as color, texture, and shape. These features can describe the content and contextual information of the entire image. Patch features are features extracted from local patches or small areas of an image. They are typically used to express local details of the image, and these features can be color, texture, or shape.
[0086] In the above embodiments, when compressing the audio to be processed, a spectrogram corresponding to each audio segment retained in the compressed audio can be determined, so that the spectrogram can be used as input information for feature extraction. Specifically, the spectrogram can be obtained by performing spectral analysis on the audio signal of each retained audio segment.
[0087] In one possible implementation, the spectrograms corresponding to all retained audio segments can be input into a pre-trained feature extraction model to obtain image features corresponding to each spectrogram, namely global features and patch features. The specific type of feature extraction model used for image feature extraction is not limited; for example, it could be a visual encoder, such as a low-resolution variant of a visual classifier (Vision Transformer for Low Resolution Classification, ViT-L).
[0088] In the above implementation, after extracting the image features corresponding to the spectrograms, pooling can be performed on these features to reduce data volume, subsequent computation, and memory consumption. The pooled image features are then concatenated to obtain the input features. Specifically, the image features can be input into a spatial pool and a temporal pool. Spatial pooling is used to perform spatial pooling on the image features corresponding to the spectrograms, and temporal pooling is used to perform temporal pooling. The pooled image features obtained from the spatial and temporal pools are then concatenated to obtain the input features. Specifically, in the temporal pool, the global features corresponding to the spectrograms of all retained audio segments are concatenated according to the order of the audio segments in the audio to be processed, resulting in a first feature. In the spatial pool, the block features corresponding to all spectrograms are averaged to obtain a second feature. The first and second features are then concatenated to obtain the input features. Thus, since the temporal pool is processed according to the temporal order of all retained audio segments (i.e., the sequential order within the audio segments), temporal information is preserved, ensuring accuracy in audio understanding.
[0089] In some implementations, since the understanding is for audio, it can also be done in the usual audio processing way. After extracting audio features from the audio using an audio encoder, audio tokens are generated based on the extracted audio features. Subsequently, the generated audio tokens are concatenated with the first prompt information to obtain the first input information for inputting into the large language model.
[0090] Step S350: Concatenate the feature to be input with the first prompt information to obtain the first input information for inputting into the large language model. The first prompt information is used to prompt the large language model to perform audio understanding.
[0091] Step S360: Input the first input information into the large language model to obtain the audio understanding result corresponding to the audio to be processed.
[0092] In the embodiments of this application, steps S350 and S360 can be referred to the contents of other embodiments, and will not be repeated here.
[0093] The audio processing method provided in this application embodiment, when performing audio understanding on the audio to be processed using a large language model, compresses the audio to be processed based on the identified keyframes and the multiple audio segments, and then extracts features from the compressed audio to be processed. Based on the extracted features and the first prompt information, the input information for inputting into the large language model is determined. Therefore, when understanding long-term audio, it is not necessary to input the audio to be processed into the large language model multiple times after segmenting the audio, thereby enabling the large language model to better understand long-term audio and improving the accuracy of understanding long-term audio.
[0094] Please see Figure 4 , Figure 4 A flowchart illustrating an audio processing method provided in another embodiment of this application is shown. This audio processing method is applied to the aforementioned computer device, and will be discussed below. Figure 4 The process shown will be described in detail. The audio processing method may specifically include the following steps:
[0095] Step S410: Divide the audio to be processed into multiple audio segments.
[0096] Step S420: Perform keyframe recognition on the audio to be processed to obtain the keyframes in the audio to be processed.
[0097] Step S430: Based on the keyframe and the multiple audio segments, compress the audio to be processed.
[0098] Step S440: Based on the first prompt information and the audio to be processed after the compression process, generate first input information for inputting into the large language model. The first prompt information is used to prompt the large language model to perform audio understanding.
[0099] Step S450: Input the first input information into the large language model to obtain the audio understanding result corresponding to the audio to be processed.
[0100] In the embodiments of this application, steps S410 and S450 can be referred to the contents of other embodiments, and will not be repeated here.
[0101] Step S460: Input the second prompt information and the audio understanding result into the generative model to obtain the generated target data of the target type. The second prompt information is used to prompt the generative model to generate the target data.
[0102] In this embodiment, after performing audio understanding on the audio to be processed using a large language model and obtaining the audio understanding result, data of the target type, such as video data or image data, can be further generated based on the audio understanding result, thereby realizing the generation of multimodal data based on the understanding of the audio to be processed. Specifically, a second prompting information can be obtained to prompt the generative model to generate data of the target type. Then, the second prompting information and the audio understanding result are input into the generative model to obtain the generated target data of the target type. The generative model can be a pre-trained model capable of generating data of the corresponding type. For example, it can be a generative large language model based on AIGC; when the target type is video, the generative model can also be VideoComposer, etc. Of course, the specific type of generative model is not limited in this embodiment.
[0103] In some implementations, the target data generated above can be of multiple types, thereby enriching the types of data generated based on the audio understanding results. For example, an image can be generated based on the audio understanding results for a first time segment of the audio to be processed, and a video can be generated based on the audio understanding results for a second time segment of the audio to be processed.
[0104] The audio processing method provided in this application, when performing audio understanding on the audio to be processed using a large language model, compresses the audio based on the identified keyframes and segmented audio segments, and then determines the input information for inputting into the large language model based on the compressed audio. Therefore, when understanding long-term audio, it is not necessary to input the audio to be processed into the large language model multiple times after segmenting the audio, thereby enabling the large language model to better understand long-term audio and improve the accuracy of understanding long-term audio. In addition, it can further generate corresponding types of data based on the audio understanding results, thereby realizing the generation of multimodal data based on the understanding of the audio to be processed, enriching the application scenarios.
[0105] Please see Figure 5 , Figure 5 A flowchart illustrating an audio processing method according to another embodiment of this application is shown. This audio processing method is applied to the aforementioned computer device, and will be discussed below. Figure 5 The process shown will be described in detail. The audio processing method may specifically include the following steps:
[0106] Step S510: Obtain the audio duration corresponding to the audio to be processed.
[0107] In this embodiment of the application, when performing audio understanding on the audio to be processed, the audio duration corresponding to the audio to be processed can be determined in order to determine whether the audio to be processed that needs to be understood this time is a long audio.
[0108] Step S520: If the audio duration is less than or equal to the target duration, then based on the audio to be processed and the first prompt information, generate third input information for inputting into the large language model.
[0109] In this embodiment of the application, after obtaining the audio duration of the audio to be processed, the audio duration can be compared with the target duration. According to the comparison result, if the audio duration is less than or equal to the target duration, it means that the audio to be processed for audio understanding is not a long-duration audio. Therefore, according to the conventional processing method, the input information determined for the audio to be processed can be input into the large language model at once, without needing to segment the audio to be processed and input it into the large language model multiple times. Therefore, the second input information for inputting into the large language model can be directly generated based on the audio frames in the audio to be processed and the target prompt information.
[0110] Specifically, features can be extracted from the audio to be processed to obtain input features; these input features are then concatenated with the first prompt information to obtain the third input information used to input into the large language model. The method for feature extraction from the audio to be processed can be found in the previous embodiment and will not be repeated here.
[0111] Step S530: Input the third input information into the large language model to obtain the audio understanding result corresponding to the audio to be processed.
[0112] In this embodiment, after obtaining the third input information, it can be input into the large language model to obtain the audio understanding result corresponding to the audio to be processed. Thus, audio understanding of the audio to be processed can be completed by inputting the input information into the large language model only once.
[0113] Step S540: If the audio duration is longer than the target duration, the audio to be processed is divided into multiple audio segments.
[0114] In this embodiment of the application, after obtaining the audio duration of the audio to be processed, the audio duration is compared with the target duration. According to the comparison result, if the audio duration is longer than the target duration, it means that the audio to be processed for audio understanding is a long-duration audio. Therefore, the audio to be processed can be divided into multiple audio segments and subsequent steps can be performed to improve the accuracy of audio understanding of long-duration audio.
[0115] Step S550: Perform keyframe recognition on the audio to be processed to obtain the keyframes in the audio to be processed.
[0116] Step S560: Based on the keyframe and the multiple audio segments, compress the audio to be processed.
[0117] Step S570: Based on the first prompt information and the audio to be processed after the compression process, generate first input information for inputting into the large language model. The first prompt information is used to prompt the large language model to perform audio understanding.
[0118] Step S580: Input the first input information into the large language model to obtain the audio understanding result corresponding to the audio to be processed.
[0119] In this embodiment, steps S550 to S580 can be found in other embodiments and will not be repeated here.
[0120] The audio processing method provided in this application, when performing audio understanding on the audio to be processed using a large language model, compresses the audio to be processed based on the identified keyframes and segmented audio segments when the audio duration exceeds the target duration. Then, it determines the input information for inputting the large language model based on the compressed audio. Therefore, when understanding long-duration audio, the input information for inputting the large language model can be determined for the audio to be input at once, enabling the large language model to better understand long-duration audio and improve the accuracy of understanding long-duration audio. Conversely, when the audio duration is not greater than the target duration, the input information for inputting the large language model is directly determined based on the audio to be processed, thus enabling accurate understanding not only of long-duration audio but also of short-duration audio.
[0121] The audio processing method provided in the foregoing embodiments will be further illustrated below with examples.
[0122] Please see Figure 6When performing audio understanding on the audio to be processed, the audio can be divided into keyframe audio and audio segments, so that the audio to be processed is labeled with timestamps used to divide the audio segments and keyframes; then, based on the labeled timestamps and keyframes, the audio to be processed is compressed; then, the spectrograms corresponding to each audio segment in the compressed audio to be processed are input into the audio encoder to obtain the corresponding features; then, the extracted features are input into the spatial pool and the temporal pool. In the spatial pool, the global features in the image features corresponding to all spectrograms are concatenated according to the temporal order of the audio frames. In the time pool, average pooling is performed on the patch features in the image features corresponding to all spectrograms; then the features obtained from the spatial pool and the time pool are concatenated and mapped to the feature space of the large language model. After being concatenated with the first prompt information, it is input into the large language model, so that the large language model outputs the audio understanding result based on the input information. For example, from 3 to 5.6 seconds, two people are having a quick conversation with a Sichuan accent, mixing Chinese and English; from 5 minutes 30 seconds to 8 minutes 15 seconds, four people are racing and fighting, passing through scenes of streets, bridges, and rivers, with cicadas chirping.
[0123] Please see Figure 7 After the audio to be processed is understood by the audio processing method provided in this application embodiment, the output of the large language model can also be input into the generative model together with the second prompt information used to prompt the generative model to generate target data of the target type. The generative model can generate target data of the target type according to the input information. For example, for audio understanding results of 3S-5.6S, an image is generated, and for audio understanding results of 5min30S-8min15S, a corresponding video is generated.
[0124] Please see Figure 8This document illustrates a structural block diagram of an audio processing apparatus 700 provided in an embodiment of this application. The audio processing apparatus 700 utilizes the aforementioned computer equipment and includes: an audio segmentation module 710, a keyframe recognition module 720, an audio compression module 730, an information generation module 740, and an audio understanding module 750. Specifically, the audio segmentation module 710 divides the audio to be processed into multiple audio segments; the keyframe recognition module 720 performs keyframe recognition on the audio to be processed to obtain keyframes; the audio compression module 730 compresses the audio to be processed based on the keyframes and the multiple audio segments; the information generation module 740 generates first input information for inputting into a large language model based on first prompt information and the compressed audio to be processed, the first prompt information prompting the large language model to perform audio understanding; and the audio understanding module 750 inputs the first input information into the large language model to obtain the audio understanding result corresponding to the audio to be processed.
[0125] In some embodiments, the audio compression module 730 may be specifically used to perform at least one of audio segment filtering and downsampling on the plurality of audio segments based on the keyframe, wherein the audio segment filtering includes filtering out at least one audio segment among the plurality of audio segments.
[0126] In one possible implementation, the audio compression module 730 may also be specifically used to determine a first audio segment among the plurality of audio segments that does not include the keyframe; and to filter out the first audio segment from the plurality of audio segments.
[0127] In one possible implementation, the audio compression module 730 may further be used to determine a second audio segment among the plurality of audio segments that includes at least one of the keyframes; and to downsample the second audio segment.
[0128] Optionally, the audio compression module 730 may also be specifically used to divide the second audio segment based on the key frame in the second audio segment to obtain multiple audio sub-segments corresponding to the second audio segment; and to downsample each of the multiple audio sub-segments, wherein the sampling rate of the audio sub-segment where the key frame is located is higher than the sampling rate of other audio sub-segments, and the other audio sub-segments are audio sub-segments other than the audio sub-segment where the key frame is located among the multiple audio sub-segments.
[0129] In some implementations, the audio segmentation module 710 may be specifically used to perform speech activity detection on the audio to be processed, obtain detection results, and divide the audio to be processed into multiple audio segments based on the detection results.
[0130] In one possible implementation, the audio segmentation module 710 may also be specifically used to annotate the audio to be processed with multiple target timestamps according to the detection results, wherein the audio between two adjacent target timestamps constitutes an audio segment, and the target timestamps are located at the start audio frame and the end audio frame of the audio segment containing speech signals in the detection results.
[0131] In some implementations, the information generation module 740 may be specifically used to extract features from the compressed audio to obtain input features; and to concatenate the input features with the first prompt information to obtain first input information for inputting into a large language model.
[0132] In one possible implementation, the information generation module 740 may further be used to extract features from the spectrogram corresponding to each audio segment in the compressed audio to obtain global features of the spectrogram corresponding to each audio segment and block features corresponding to multiple image blocks; according to the order of the audio segments in the audio to be processed, the global features corresponding to the audio to be processed are concatenated to obtain a first feature; the block features corresponding to the audio to be processed are averaged and pooled to obtain a second feature; and the first feature and the second feature are concatenated to obtain the input feature.
[0133] In some embodiments, the audio processing apparatus 700 may further include a data generation module. The data generation module is used to input a second prompt and the audio understanding result to a generative model after the first input information is input to the large language model to obtain the audio understanding result corresponding to the audio to be processed, thereby obtaining target data of the target type. The second prompt is used to prompt the generative model to generate the target type data.
[0134] In some embodiments, the audio processing device 700 may further include a duration acquisition module, which is used to acquire the audio duration corresponding to the audio to be processed before dividing the audio to be processed into multiple audio segments; the audio segmentation module 710 may be specifically used to divide the audio to be processed into multiple audio segments if the audio duration is greater than the target duration.
[0135] In one possible implementation, the information generation module 740 can also be used to generate third input information for inputting into the large language model based on the audio to be processed and the first prompt information after obtaining the audio duration corresponding to the audio to be processed; the audio understanding module 750 can also be used to input the third input information into the large language model to obtain the audio understanding result corresponding to the audio to be processed.
[0136] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working process of the above-described device and module can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0137] In the several embodiments provided in this application, the coupling between modules can be electrical, mechanical, or other forms of coupling.
[0138] Furthermore, the functional modules in the various embodiments of this application can be integrated into one processing module, or each module can exist physically separately, or two or more modules can be integrated into one module. The integrated modules described above can be implemented in hardware or as software functional modules.
[0139] In summary, the solution provided in this application divides the audio to be processed into multiple audio segments, performs keyframe recognition on the audio to be processed to obtain keyframes in the audio to be processed, compresses the audio to be processed based on the keyframes and multiple audio segments, and generates first input information for inputting into the large language model based on the first prompt information used to prompt the large language model for audio understanding and the compressed audio to be processed. Then, the first input information is input into the large language model to obtain the audio understanding result corresponding to the audio to be processed. Therefore, since the large language model compresses the audio to be processed based on the identified keyframes and the divided audio segments, and then determines the input information for inputting into the large language model based on the compressed audio to be processed, it is not necessary to input the audio to be processed into segments and then into the large language model multiple times when understanding long audio. This allows the large language model to better understand long audio and improves the accuracy of understanding long audio.
[0140] Please refer to Figure 9This diagram illustrates a structural block diagram of a computer device according to an embodiment of this application. The computer device 100 can be a smartphone, tablet, smartwatch, e-reader, or other device capable of running applications. The computer device 100 in this application may include one or more of the following components: a processor 110, a memory 120, and one or more applications, wherein the one or more applications can be stored in the memory 120 and configured to be executed by the one or more processors 110, and the one or more applications are configured to perform the methods described in the foregoing method embodiments.
[0141] Processor 110 may include one or more processing cores. Processor 110 connects to various parts within the computer device 100 using various interfaces and lines, and performs various functions and processes data by running or executing instructions, programs, code sets, or instruction sets stored in memory 120, and by calling data stored in memory 120. Optionally, processor 110 may be implemented using at least one hardware form of Digital Signal Processing (DSP), Field-Programmable Gate Array (FPGA), or Programmable Logic Array (PLA). Processor 110 may integrate one or a combination of several of the following: Central Processing Unit (CPU), Graphics Processing Unit (GPU), and modem. The CPU primarily handles the operating system, user interface, and applications; the GPU is responsible for rendering and drawing the displayed content; and the modem handles wireless communication. It is understood that the modem may also not be integrated into processor 110 and may be implemented separately using a communication chip.
[0142] The memory 120 may include random access memory (RAM) or read-only memory (ROM). The memory 120 can be used to store instructions, programs, code, code sets, or instruction sets. The memory 120 may include a program storage area and a data storage area. The program storage area may store instructions for implementing an operating system, instructions for implementing at least one function (such as touch functionality, sound playback functionality, image playback functionality, etc.), and instructions for implementing the various method embodiments described below. The data storage area may also store data created by the computer device 100 during use (such as phonebooks, audio and video data, chat log data, etc.).
[0143] Please refer to Figure 10 This diagram illustrates a structural block diagram of a computer-readable storage medium provided in an embodiment of this application. The computer-readable medium 800 stores program code that can be called by a processor to execute the methods described in the above method embodiments.
[0144] The computer-readable storage medium 800 may be an electronic memory such as flash memory, EEPROM (Electrically Erasable Programmable Read-Only Memory), EPROM, hard disk, or ROM. Optionally, the computer-readable storage medium 800 includes a non-transitory computer-readable storage medium. The computer-readable storage medium 800 has storage space for program code 810 that performs any of the method steps described above. This program code can be read from or written to one or more computer program products. The program code 810 may be compressed, for example, in a suitable form.
[0145] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application.
Claims
1. An audio processing method, characterized in that, The method includes: The audio to be processed is divided into multiple audio segments; Keyframe recognition is performed on the audio to be processed to obtain the keyframes in the audio; Based on the keyframes and the multiple audio segments, the audio to be processed is compressed. Based on the first prompt information and the audio to be processed after the compression process, first input information is generated for inputting into the large language model. The first prompt information is used to prompt the large language model to perform audio understanding. The first input information is input into the large language model to obtain the audio understanding result corresponding to the audio to be processed; The second prompt information and the audio understanding result are input into the generative model to obtain target data of the target type. The second prompt information is used to prompt the generative model to generate the target type data.
2. The method according to claim 1, characterized in that, The compression process of the audio to be processed based on the keyframes and the multiple audio segments includes: Based on the keyframe, at least one of audio segment filtering and downsampling is performed on the plurality of audio segments, wherein the audio segment filtering includes filtering out at least one audio segment among the plurality of audio segments.
3. The method according to claim 2, characterized in that, The step of performing at least one of audio segment filtering and downsampling on the plurality of audio segments based on the keyframe includes: Identify a first audio segment among the plurality of audio segments that does not include the keyframe; The first audio segment is filtered out from the plurality of audio segments.
4. The method according to claim 2, characterized in that, The step of performing at least one of audio segment filtering and downsampling on the plurality of audio segments based on the keyframe includes: Identify a second audio segment among the plurality of audio segments that includes at least one of the keyframes; The second audio segment is downsampled.
5. The method according to claim 4, characterized in that, The downsampling of the second audio segment includes: Based on the keyframes in the second audio segment, the second audio segment is divided to obtain multiple audio sub-segments corresponding to the second audio segment; Each of the plurality of audio sub-segments is downsampled, wherein the sampling rate of the audio sub-segment containing the keyframe is higher than the sampling rate of the other audio sub-segments, and the other audio sub-segments are the audio sub-segments other than the audio sub-segment containing the keyframe among the plurality of audio sub-segments.
6. The method according to claim 1, characterized in that, The process of dividing the audio to be processed into multiple audio segments includes: The audio to be processed is subjected to speech activity detection to obtain the detection result; Based on the detection results, the audio to be processed is divided into multiple audio segments.
7. The method according to claim 6, characterized in that, Based on the detection results, the audio to be processed is divided into multiple audio segments, including: Based on the detection results, multiple target timestamps are marked on the audio to be processed. The audio between two adjacent target timestamps constitutes an audio segment. The target timestamps are located at the start and end audio frames of the audio segments containing speech signals in the detection results.
8. The method according to any one of claims 1-7, characterized in that, The first prompt information, based on the first prompt information and the compressed audio to be processed, generates first input information for inputting into the large language model. The first prompt information includes: Feature extraction is performed on the compressed audio to obtain the input features; The feature to be input is concatenated with the first prompt information to obtain the first input information for inputting into the large language model.
9. The method according to claim 8, characterized in that, The step of extracting features from the compressed audio to obtain input features includes: Feature extraction is performed on the spectrogram corresponding to each audio segment in the audio to be processed after the compression process to obtain the global features of the spectrogram corresponding to each audio segment and the block features corresponding to multiple image blocks; Based on the order of the audio segments in the audio to be processed, the global features corresponding to the audio to be processed are concatenated to obtain the first feature; The block features corresponding to the audio to be processed are subjected to average pooling to obtain the second feature; The first feature and the second feature are concatenated to obtain the input feature.
10. The method according to any one of claims 1-7, characterized in that, Before dividing the audio to be processed into multiple audio segments, the method further includes: Obtain the audio duration corresponding to the audio to be processed; If the audio duration is longer than the target duration, then the step of dividing the audio to be processed into multiple audio segments is performed.
11. The method according to claim 10, characterized in that, After obtaining the audio duration corresponding to the audio to be processed, the method further includes: If the audio duration is less than or equal to the target duration, then based on the audio to be processed and the first prompt information, a third input information for inputting into the large language model is generated; The third input information is input into the large language model to obtain the audio understanding result corresponding to the audio to be processed.
12. An audio processing device, characterized in that, The device includes: an audio segmentation module, a keyframe recognition module, an audio compression module, an information generation module, an audio understanding module, and a data generation module, wherein... The audio segmentation module is used to divide the audio to be processed into multiple audio segments; The keyframe recognition module is used to perform keyframe recognition on the audio to be processed, and obtain the keyframes in the audio to be processed. The audio compression module is used to compress the audio to be processed based on the keyframe and the multiple audio segments; The information generation module is used to generate first input information for inputting into the large language model based on the first prompt information and the audio to be processed after compression. The first prompt information is used to prompt the large language model to perform audio understanding. The audio understanding module is used to input the first input information into the large language model to obtain the audio understanding result corresponding to the audio to be processed; The data generation module is used to input the second prompt information and the audio understanding result into the generative model to obtain target data of the target type. The second prompt information is used to prompt the generative model to generate the target type data.
13. A computer device, characterized in that, include: One or more processors; Memory; One or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, the one or more programs being configured to perform the method as described in any one of claims 1-11.
14. A computer-readable storage medium, characterized in that, The computer-readable storage medium contains program code that can be invoked by a processor to execute the method as described in any one of claims 1-11.
Citation Information
Patent Citations
Method for reducing size of multimedia archive
CN107360386A
Audio processing method and device, electronic equipment and medium
CN114420125A
Underwater sound target identification method, device and equipment
CN115295007A
Safe interaction method and device based on large language model
CN116738476A
