Audio generation method, device, equipment and storage medium
The audio segment is processed through the frequency domain expansion model to determine and add high-frequency data, which solves the problem of sound quality degradation caused by removing high-frequency data in the audio database, and achieves improvement in audio quality and optimization of data volume.
Patent Information
- Application Number
- CN202010901040.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-08-31
- Publication Date
- 2024-09-06
- Estimated Expiration
- 2040-08-31
AI Technical Summary
In order to reduce space usage when storing audio, existing audio databases often remove high-frequency data, resulting in reduced sound quality and poor user listening experience.
By processing audio segments based on the frequency domain expansion model, high-frequency data is determined and added to improve the sound quality of the audio. Specific steps include segmenting the target audio, using the frequency domain extension model to process the amplitude matrix of the audio segment and its transpose matrix, determining the audio segment containing high-frequency data, and combining them to generate the target audio with added high-frequency data.
Without increasing the amount of data, high-frequency data is effectively added to improve the audio quality and improve the user's listening experience.
Smart Images

Figure CN112133319B
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a method, apparatus, device and storage medium for audio generation. Background Art
[0002] The amount of audio that needs to be stored in the audio database is very large, and the storage space required is also very large. In order to meet this storage demand, the operator of the audio database often removes the high-frequency data in the audio, so that the compression rate can be increased and the amount of data can be reduced when encoding the audio, thereby reducing the storage space occupied. The audio processed in this way can still be heard normally by the human ear.
[0003] However, removing high-frequency data from the audio will have a relatively large impact on the audio quality. Summary of the invention
[0004] The embodiments of the present application provide a method, device, equipment and storage medium for audio generation, which can solve the problem of poor listening experience of users. The technical solution is as follows:
[0005] In one aspect, a method for generating audio is provided, the method comprising:
[0006] Divide the target audio based on a preset duration to obtain multiple audio segments, wherein the preset duration is N times the frame interval duration of the target audio, and N is an integer greater than 1;
[0007] Based on the first frequency domain expansion module of the frequency domain expansion model, the amplitude matrix of each audio segment is processed respectively to obtain a first intermediate result matrix corresponding to each audio segment;
[0008] A second frequency domain expansion module based on the frequency domain expansion model processes the transposed matrix of the amplitude matrix of each audio segment respectively to obtain a second intermediate result matrix corresponding to each audio segment;
[0009] For each audio segment, determining an audio segment containing high-frequency data based on the first intermediate result matrix and the second intermediate result matrix of the audio segment;
[0010] Each audio segment containing high-frequency data is combined to obtain a target audio containing high-frequency data.
[0011] Optionally, before segmenting the target audio based on the preset duration, the method further includes:
[0012] The original audio is obtained, and the original audio is decoded and short-time Fourier transformed to obtain the target audio.
[0013] Optionally, the first frequency domain extension module based on the frequency domain extension model processes the amplitude matrix of each audio segment respectively to obtain a first intermediate result matrix corresponding to each audio segment, including:
[0014] Processing the amplitude matrix of each audio segment in turn based on the input layer, the long short-term memory layer, and the output layer of the first frequency domain extension module to obtain a first intermediate result matrix corresponding to each audio segment;
[0015] The second frequency domain extension module based on the frequency domain extension model processes the transposed matrix of the amplitude matrix of each audio segment respectively to obtain a second intermediate result matrix corresponding to each audio segment, including:
[0016] The transposed matrix of the amplitude matrix of each audio segment is processed in sequence based on the input layer, the long short-term memory layer, and the output layer of the second frequency domain extension module to obtain a second intermediate result matrix corresponding to each audio segment.
[0017] Optionally, determining the audio segment containing high-frequency data based on the first intermediate result matrix and the second intermediate result matrix includes:
[0018] Transposing the second intermediate result matrix to obtain a transposed matrix of the second intermediate result matrix;
[0019] Determine an amplitude matrix of an audio segment containing high-frequency data based on the transpose of the first intermediate result matrix and the second intermediate result matrix;
[0020] An audio segment containing high-frequency data is generated based on the phase data corresponding to each time point and each frequency point in the audio segment and the amplitude data corresponding to each time point and each frequency point in the amplitude matrix of the audio segment containing high-frequency data.
[0021] Optionally, determining the amplitude matrix of the audio segment containing high-frequency data based on the transposed matrix of the first intermediate result matrix and the second intermediate result matrix includes:
[0022] The first intermediate result matrix is added to the transposed matrix of the second intermediate result matrix to obtain an amplitude matrix of the audio segment containing high-frequency data.
[0023] On the other hand, a method for training a frequency domain extension model is provided, characterized in that the method comprises:
[0024] Get a sample audio segment;
[0025] Performing high-frequency data removal processing on the sample audio segment to obtain a sample audio segment that does not contain high-frequency data;
[0026] Inputting the sample audio segment not containing high-frequency data into an initial frequency domain expansion model to obtain an output audio segment;
[0027] Based on the mapping relationship between the sample audio segment not containing high-frequency data and the sample audio segment, and the mapping relationship between the sample audio segment not containing high-frequency data and the output audio segment, an initial discriminant model is input for recognition;
[0028] The initial frequency domain extension model is trained based on the recognition result to obtain a target frequency domain extension model.
[0029] Optionally, the step of inputting the mapping relationship between the sample audio segment not containing high-frequency data and the sample audio segment and the mapping relationship between the sample audio segment not containing high-frequency data and the output audio segment into an initial discriminant model for recognition includes:
[0030] Acquire a mapping relationship between the sample audio segment not containing high-frequency data and the sample audio segment, and input the mapping relationship between the sample audio segment not containing high-frequency data and the sample audio segment into an initial discrimination model to obtain a first discrimination result;
[0031] Obtaining a mapping relationship between the sample audio segment not containing high-frequency data and the output audio segment, and inputting the mapping relationship between the sample audio segment not containing high-frequency data and the output audio segment into an initial discrimination model to obtain a second discrimination result;
[0032] The initial discriminant model is used to determine whether an input audio segment is obtained by correctly adding high-frequency data to another input audio segment;
[0033] The training of the initial frequency domain extension model based on the recognition result to obtain a target frequency domain extension model includes:
[0034] Based on the first discrimination result, the sample audio segment containing high-frequency data and the output audio segment, the parameters of the initial frequency domain extension model are updated to obtain a frequency domain extension model.
[0035] Optionally, after inputting the sample audio segment not containing high-frequency data and the output audio segment into an initial discriminant model to obtain a first discriminant result, and inputting the sample audio segment not containing high-frequency data and the sample audio segment containing high-frequency data into an initial discriminant model to obtain a second discriminant result, the method further includes:
[0036] Based on the first discrimination result and the second discrimination result, the parameters of the initial discrimination model are updated to obtain a discrimination model.
[0037] In another aspect, a device for audio generation is provided, the device comprising:
[0038] A segmentation module, used to segment the target audio based on a preset duration to obtain multiple audio segments, wherein the preset duration is N times the frame interval duration of the target audio, and N is an integer greater than 1;
[0039] A processing module, configured to process the amplitude matrix of each audio segment based on the first frequency domain extension module of the frequency domain extension model, and obtain a first intermediate result matrix corresponding to each audio segment;
[0040] The processing module is further used for processing the transposed matrix of the amplitude matrix of each audio segment based on the second frequency domain extension module of the frequency domain extension model to obtain a second intermediate result matrix corresponding to each audio segment;
[0041] A determination module, configured to determine, for each audio segment, an audio segment containing high-frequency data based on the first intermediate result matrix and the second intermediate result matrix of the audio segment;
[0042] The combining module is used to combine each audio segment containing high-frequency data to obtain a target audio containing high-frequency data.
[0043] Optionally, the processing module is further used to:
[0044] The original audio is obtained, and the original audio is decoded and short-time Fourier transformed to obtain the target audio.
[0045] Optionally, the processing module is used to:
[0046] Processing the amplitude matrix of each audio segment in turn based on the input layer, the long short-term memory layer, and the output layer of the first frequency domain extension module to obtain a first intermediate result matrix corresponding to each audio segment;
[0047] The transposed matrix of the amplitude matrix of each audio segment is processed in sequence based on the input layer, the long short-term memory layer, and the output layer of the second frequency domain extension module to obtain a second intermediate result matrix corresponding to each audio segment.
[0048] Optionally, the determining module is used to:
[0049] Transposing the second intermediate result matrix to obtain a transposed matrix of the second intermediate result matrix;
[0050] Determine an amplitude matrix of an audio segment containing high-frequency data based on the transpose of the first intermediate result matrix and the second intermediate result matrix;
[0051] An audio segment containing high-frequency data is generated based on the phase data corresponding to each time point and each frequency point in the audio segment and the amplitude data corresponding to each time point and each frequency point in the amplitude matrix of the audio segment containing high-frequency data.
[0052] Optionally, the determining module is used to:
[0053] The first intermediate result matrix is added to the transposed matrix of the second intermediate result matrix to obtain an amplitude matrix of the audio segment containing high-frequency data.
[0054] On the other hand, a device for training a frequency domain extension model is provided, characterized in that the device comprises:
[0055] An acquisition module, used to acquire a sample audio segment;
[0056] A processing module, used for performing high-frequency data removal processing on the sample audio segment to obtain a sample audio segment that does not contain high-frequency data;
[0057] The input module is further used to input the sample audio segment that does not contain high-frequency data into the initial frequency domain expansion model to obtain an output audio segment;
[0058] A recognition module, configured to input an initial discriminant model for recognition based on a mapping relationship between the sample audio segment not containing high-frequency data and the sample audio segment, and a mapping relationship between the sample audio segment not containing high-frequency data and the output audio segment;
[0059] A training module is used to train the initial frequency domain extension model based on the recognition result to obtain a target frequency domain extension model.
[0060] Optionally, the identification module is used to:
[0061] Acquire a mapping relationship between the sample audio segment not containing high-frequency data and the sample audio segment, and input the mapping relationship between the sample audio segment not containing high-frequency data and the sample audio segment into an initial discrimination model to obtain a first discrimination result;
[0062] Obtaining a mapping relationship between the sample audio segment not containing high-frequency data and the output audio segment, and inputting the mapping relationship between the sample audio segment not containing high-frequency data and the output audio segment into an initial discrimination model to obtain a second discrimination result;
[0063] The initial discriminant model is used to determine whether an input audio segment is obtained by correctly adding high-frequency data to another input audio segment;
[0064] The training model is used to:
[0065] Based on the first discrimination result, the sample audio segment containing high-frequency data and the output audio segment, the parameters of the initial frequency domain extension model are updated to obtain a frequency domain extension model.
[0066] Optionally, the device further includes an updating module, wherein the updating module is configured to:
[0067] Based on the first discrimination result and the second discrimination result, the parameters of the initial discrimination model are updated to obtain a discrimination model.
[0068] On the other hand, a computer device is provided. The computer device includes a processor and a memory. The memory stores instructions. The processor executes the instructions so that the computer device implements the audio generation method.
[0069] On the other hand, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores instructions, and a computer device executes the instructions so that the computer device implements the audio generation method.
[0070] The beneficial effects of the technical solution provided by the embodiment of the present application are:
[0071] This solution adds high-frequency data to an audio segment of a target audio through a frequency domain expansion model, thereby obtaining multiple audio segments after adding high-frequency data, and then combines the multiple audio segments after adding high-frequency data to obtain the target audio after adding high-frequency data. In this way, through the above processing, high-frequency data can be added to the target audio that does not contain high-frequency data, and the audio is generated, thereby improving the sound quality of the target audio. BRIEF DESCRIPTION OF THE DRAWINGS
[0072] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0073] Figure 1 is a flow chart of a method for generating audio provided by an embodiment of the present application;
[0074] Figure 2 is a schematic diagram of an audio generation method provided in an embodiment of the present application;
[0075] Figure 3 It is a flow chart of a method for training a frequency domain expansion model provided in an embodiment of the present application;
[0076] Figure 4It is a schematic diagram of the structure of an audio generation device provided in an embodiment of the present application;
[0077] Figure 5 It is a structural schematic diagram of a device for training a frequency domain expansion model provided in an embodiment of the present application;
[0078] Figure 6 It is a schematic diagram of the terminal structure provided in an embodiment of the present application;
[0079] Figure 7 It is a schematic diagram of the server structure provided in an embodiment of the present application. DETAILED DESCRIPTION
[0080] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below with reference to the accompanying drawings.
[0081] The embodiment of the present application provides a method for audio generation, which can be implemented by a terminal or a server. The terminal can be a mobile phone, a desktop computer, a tablet computer, a laptop computer, a smart wearable device, etc. The terminal can have an audio playback component and an audio processing component. The terminal can have the function of displaying and playing audio and the function of processing audio, and the terminal can be installed with an audio playback application. The server can be the background server of the above-mentioned audio playback application. The server can be a separate server or a server group. If it is a separate server, the server can be responsible for all the processing required by the server in the following scheme. If it is a server group, different servers in the server group can be responsible for different processing in the following scheme respectively. The specific processing distribution can be arbitrarily set by the technical personnel according to actual needs, and will not be repeated here.
[0082] Due to previous technical limitations, when users upload audio to the background server of the audio playback application, they can only upload some audio that lacks high-frequency data, which means that there are many audios that lack high-frequency data stored in the background server of the audio playback application. The playback effect of audio that lacks high-frequency data is very poor. In order to improve the user's auditory experience, developers can use electronic devices to add high-frequency data to the audio that lacks high-frequency data, and obtain the audio after adding high-frequency data. In turn, to improve the user's auditory experience.
[0083] Figure 1 is a flow chart of a method for generating audio provided by an embodiment of the present application. Figure 1 , the process includes:
[0084] Step 101: Segment the target audio based on a preset duration to obtain multiple audio segments.
[0085] The preset duration is N times the frame interval duration of the target audio, where N is an integer greater than 1.
[0086] In implementation, first, the electronic device can obtain audio lacking high-frequency data (i.e., original audio), which is a time domain data. Then, the electronic device can decode the original audio to obtain raw data, and then perform short-time Fourier transform on the raw data to obtain target audio, which is a frequency domain data.
[0087] It should be noted here that high-frequency data refers to audio data with a frequency between one quarter and one half of the sampling rate, and correspondingly, low-frequency data refers to audio data with a frequency below one quarter of the sampling rate.
[0088] For example, Figure 2 As shown, the electronic device may be a terminal, and the terminal may receive the original audio x sent by the server. t,f , and the original audio x t,f Decode and get the original audio x t,f The raw data is then short-time Fourier transformed to obtain the target audio X t,f .
[0089] For example, the electronic device may be a server, and the server may obtain the original audio x stored internally. t,f , and the original audio x t,f Decode and get the original audio x t,f The raw data is then short-time Fourier transformed to obtain the target audio X t,f .
[0090] Secondly, the electronic device can segment the target audio based on a preset duration to obtain multiple audio segments.
[0091] For example, if the preset duration is 32 frames, the electronic device can divide the target audio into audio segments with a length of 32 frames. If the number of frames after division is less than 32 frames, the electronic device can fill in 0 to generate an audio segment containing 32 audio frames.
[0092] Optionally, the electronic device may first segment the target audio based on a preset duration to obtain multiple audio segments, which are all time domain data. The electronic device may then decode the audio segments to obtain raw data, and then perform a short-time Fourier transform on the raw data to obtain audio segments of frequency domain data.
[0093] It should be noted here that, in the above audio segment, the amplitude of the high frequency is 0.
[0094] Step 102: Based on the first frequency domain expansion module of the frequency domain expansion model, the amplitude matrix of each audio segment is processed respectively to obtain a first intermediate result matrix corresponding to each audio segment.
[0095] In implementation, after obtaining a plurality of audio segments, first, the electronic device may obtain amplitude data corresponding to each time point and each frequency point in the audio segment to obtain an amplitude matrix of the audio segment.
[0096] For example, an audio segment of the target audio is Among them, X t,f is the amplitude data, is the phase data, t represents time, and f represents frequency. The electronic device obtains the amplitude data corresponding to each time point and each frequency point, and then arranges the obtained amplitude data according to the two dimensions of time and frequency, and performs logarithmic operation to obtain the amplitude matrix X of the audio segment. log , that is, the amplitude matrix X log Contains a time axis and a frequency axis.
[0097] Then, the amplitude matrix of the audio segment is input into the first frequency domain expansion module to obtain a first intermediate result matrix.
[0098] For example, Figure 2 As shown, the amplitude matrix X of the audio segment is obtained log After that, the amplitude matrix X of the audio segment log The form is [Batch, T, N]. The electronic device can input the amplitude matrix of the audio segment (i.e., the matrix with the time axis as the horizontal axis and the frequency axis as the vertical axis) into Time-LSTM (i.e., the first frequency domain extension module including the long short-term memory layer) and obtain the first intermediate result matrix after calculation.
[0099] Step 103: The second frequency domain extension module based on the frequency domain extension model processes the transposed matrix of the amplitude matrix of each audio segment respectively to obtain a second intermediate result matrix corresponding to each audio segment.
[0100] In implementation, the amplitude matrix of the audio segment is transposed to obtain a transposed matrix, which is input into the second frequency domain expansion module to obtain a second intermediate result matrix.
[0101] For example, when obtaining the amplitude matrix X of the audio segment log After that, the amplitude matrix of the audio segment is transposed to obtain the transposed matrix of the amplitude matrix of the audio segment (i.e., a matrix with the frequency axis as the horizontal axis and the time axis as the vertical axis), which is in the form of [Batch, T, N] T Then, the transposed matrix of the amplitude matrix of the audio segment is input into the Frequency-LSTM (i.e., the second frequency domain extension module including the long short-term memory layer), and the second intermediate result matrix is obtained through calculation.
[0102] Optionally, the first frequency domain extension module and the second frequency domain extension module may include an input layer, a long short-term memory layer, and an output layer. Accordingly, the processing of the above steps 102 and 103 may be to process the amplitude matrix of each audio segment based on the input layer, the long short-term memory layer, and the output layer of the first frequency domain extension module in turn to obtain a first intermediate result matrix corresponding to each audio segment, and to process the transposed matrix of the amplitude matrix of each audio segment based on the input layer, the long short-term memory layer, and the output layer of the second frequency domain extension module in turn to obtain a second intermediate result matrix corresponding to each audio segment.
[0103] For example, Figure 2 As shown, the amplitude matrix X of the audio segment is obtained log After that, the amplitude matrix X of the audio segment log The form is [Batch, T, N]. The electronic device can input the amplitude matrix of the audio segment (that is, the matrix with the time axis as the horizontal axis and the frequency axis as the vertical axis) into Time-LSTM (that is, the first frequency domain extension module including the input layer, the long short-term memory layer, and the output layer), and obtain the first intermediate result matrix after calculation.
[0104] And in the obtained audio segment amplitude matrix X log After that, the amplitude matrix of the audio segment is transposed to obtain the transposed amplitude matrix of the audio segment (i.e., a matrix with the frequency axis as the horizontal axis and the time axis as the vertical axis), which is in the form of [Batch, T, N] T Then, the transpose of the amplitude matrix of the audio segment is input into the Frequency-LSTM (i.e., the second frequency domain extension module including the input layer, the long short-term memory layer, and the output layer), and the second intermediate result matrix is obtained by calculation.
[0105] Step 104: For each audio segment, determine the audio segment containing high-frequency data based on the first intermediate result matrix and the second intermediate result matrix of the audio segment.
[0106] In implementation, for each audio segment, the first intermediate result matrix and the second intermediate result matrix of each audio segment are added together to obtain an amplitude matrix of the audio segment containing high-frequency data.
[0107] For example, after obtaining the first intermediate result matrix and the second intermediate result matrix, the electronic device can perform positional addition on the first intermediate result matrix and the second intermediate result matrix to obtain an amplitude matrix Y' of the audio segment containing high-frequency data. log Then, the amplitude matrix Y' of the audio segment containing high-frequency data is output through the nonlinear unit. log .
[0108] Then, based on the phase data corresponding to each time point and each frequency point in the audio segment and the amplitude data corresponding to each time point and each frequency point in the amplitude matrix of the audio segment containing high-frequency data, an audio segment containing high-frequency data is generated.
[0109] For example, Figure 2 As shown, the amplitude matrix Y' of the audio segment containing high-frequency data is obtained. log After that, the electronic device can be based on the phase data corresponding to each time point and each frequency point in the audio segment, and the amplitude matrix Y' of the audio segment containing high-frequency data log The amplitude data corresponding to each time point and each frequency point in the is used to generate an audio segment containing high-frequency data.
[0110] It should be noted that, after being processed by the frequency domain expansion model, the amplitude of the high frequency in the audio segment is not zero.
[0111] Step 105: Combine each audio segment containing high-frequency data to obtain target audio containing high-frequency data.
[0112] In implementation, the above steps 102 and 103 are continuously performed until all audio segments corresponding to the target audio are processed to obtain multiple audio segments containing high-frequency data. Then, the electronic device can sort and combine the audio segments according to the identifier of each audio segment containing high-frequency data, and can also sort and combine the audio segments according to the time information of each audio segment containing high-frequency data. Then, as Figure 2 As shown, after each audio segment containing high-frequency data is combined, the electronic device can perform a short-time inverse Fourier transform on the target audio containing high-frequency data, convert the frequency domain data into time domain data, and obtain the target audio containing high-frequency data.
[0113] Optionally, after obtaining the target audio containing high-frequency data, if the above-mentioned electronic device is a terminal, the target audio containing high-frequency data can be directly played; if the above-mentioned electronic device is a server, the target audio containing high-frequency data can be encoded, for example, encoded into mp3 format, and then stored in the mp3 format.
[0114] like Figure 3 As shown, in progress Figure 1 Before the processing in, the present application embodiment also provides a flowchart of a method for training a frequency domain expansion model. Figure 3 , the process includes:
[0115] Step 301: Obtain a sample audio segment.
[0116] In implementation, the electronic device can obtain sample audio containing high-frequency data stored in a database. The sample audio containing high-frequency data is frequency domain data. The sample audio containing high-frequency data can be divided into multiple audio segments to obtain sample audio segments containing high-frequency data.
[0117] For example, with Y t,f Represents a sample audio segment containing high-frequency data.
[0118] Step 302: Perform high-frequency data removal processing on the sample audio segment to obtain a sample audio segment that does not contain high-frequency data.
[0119] In implementation, after obtaining a sample audio segment containing high-frequency data, the electronic device may call a high-frequency data removal function to perform noise processing on the sample audio segment containing high-frequency data, thereby obtaining a sample audio segment that does not contain high-frequency data.
[0120] For example, with X t,f Represents a sample audio segment that does not contain high-frequency data.
[0121] Step 303: Input the sample audio segment that does not contain high-frequency data into the initial frequency domain expansion model to obtain an output audio segment.
[0122] In the implementation, first, the amplitude data corresponding to each time point and each frequency point of the sample audio segment that does not contain high-frequency data is obtained to obtain the amplitude matrix of the audio segment. Then, the amplitude matrix is input into the initial frequency domain extension model, which includes the first initial frequency domain extension module and the second initial frequency domain extension module. Then, the amplitude matrix of the audio segment is input into the first initial frequency domain extension module, and the transpose of the amplitude matrix of the audio segment is input into the second initial frequency domain extension module. Then, the first training intermediate result matrix and the second training intermediate result matrix are obtained, and then the first training intermediate result matrix and the second training intermediate result matrix are added to obtain the output audio segment.
[0123] For example, the sample audio segment that does not contain high-frequency data is Then get the phase data |X t,f |, and for the phase data |X t,f | Perform logarithmic operation to obtain the amplitude matrix X of the sample audio segment log , and then the amplitude matrix X of the sample audio segment log Input into the initial frequency domain expansion model, which includes Time-LSTM (i.e., the first initial frequency domain expansion module) and Frequency-LSTM (i.e., the second initial frequency domain expansion module). Then X in the format of [Batch, T, N] logInput Time-LSTM, the format is [Batch, T, N] T X log The transposed input is input into the Frequency-LSTM. Then, the first training intermediate result matrix and the second training intermediate result matrix are obtained. Then, the first training intermediate result matrix and the second training intermediate result matrix are added to obtain the training amplitude matrix Y' log (ie output audio segment).
[0124] Step 304: input an initial discriminant model for recognition based on the mapping relationship between the sample audio segments not containing high-frequency data and the sample audio segments, and the mapping relationship between the sample audio segments not containing high-frequency data and the output audio segments.
[0125] During implementation, the electronic device can obtain a mapping relationship between sample audio segments that do not contain high-frequency data and sample audio segments, and input the mapping relationship between sample audio segments that do not contain high-frequency data and sample audio segments into an initial discrimination model to obtain a first discrimination result, and at the same time obtain a mapping relationship between sample audio segments that do not contain high-frequency data and output audio segments, and input the mapping relationship between sample audio segments that do not contain high-frequency data and output audio segments into the initial discrimination model to obtain a second discrimination result.
[0126] The initial discriminant model is used to determine whether an input audio segment is obtained by correctly adding high-frequency data to another input audio segment.
[0127] It should be noted here that the above initial discrimination model is a dual-channel model, that is, two sets of mapping relationships can be input at the same time, and the two sets of mapping relationships are processed respectively to obtain two discrimination results at the same time.
[0128] For example, the initial discriminator model can be a VGG (Visual Geometry Group, visual image generator)-like binary classification model, with two-channel input in the format of [Batch, T, N, 2], and then [X log , Y log ] and [X log , Y' log ] The two combinations are input into the initial discriminator model for processing, and 0 and 1 corresponding to the above two mapping relationships can be obtained respectively, where 1 is the above first discrimination result and 0 is the above second discrimination result.
[0129] Optionally, after performing the above processing, the electronic device may update the parameters of the initial discrimination model based on the first discrimination result and the second discrimination result to obtain a discrimination model.
[0130] In implementation, after obtaining the first discrimination result and the second discrimination result, based on the loss function: The parameters of the initial discriminant model are updated to obtain the discriminant model.
[0131] Among them, D(X log , Y' log ) is the second discrimination result, as a parameter.
[0132] Step 305: Train the initial frequency domain extension model based on the recognition result to obtain a target frequency domain extension model.
[0133] In implementation, after obtaining the first discrimination result and the second discrimination result, the electronic device can update the parameters of the initial frequency domain extension model based on the first discrimination result, the sample audio segment containing high-frequency data and the output audio segment to obtain the frequency domain extension model.
[0134] For example, after obtaining the first discrimination result and the second discrimination result, the electronic device determines the loss function corresponding to the initial frequency domain expansion model based on: The parameters of the initial frequency domain expansion model are updated.
[0135] Among them, D(X log , Y' log ) is the second discrimination result, D(X log , Y log ) is the first discrimination result.
[0136] It should be noted here that the above training of the initial frequency domain extension model and the initial discriminant model is performed sequentially, that is, the initial discriminant model is not trained when the initial frequency domain extension model is trained, and the initial frequency domain extension model is not trained when the initial discriminant model is trained.
[0137] It should be noted here that the above-mentioned processing scheme for obtaining the frequency domain extension model is constructed based on a generative adversarial network, and the initial frequency domain extension model and the discriminant model are trained at the same time, thereby maximizing the training effect, so that the final output frequency domain extension model can increase the low-frequency data while increasing the high-frequency data more accurately.
[0138] It should be noted that in the above process of obtaining the frequency domain extension model, the electronic device may be a server. After the server obtains the frequency domain extension model, the frequency domain extension model may be stored in the server, or the frequency domain extension model may be sent to the terminal and processed. Figure 1 in the processing.
[0139] This solution adds high-frequency data to an audio segment of a target audio through a frequency domain expansion model, thereby obtaining multiple audio segments after adding high-frequency data, and then combines the multiple audio segments after adding high-frequency data to obtain the target audio after adding high-frequency data. In this way, through the above processing, high-frequency data can be added to the target audio that does not contain high-frequency data, and the audio is generated, thereby improving the sound quality of the target audio.
[0140] All the above optional technical solutions can be arbitrarily combined to form optional embodiments of the present disclosure, and will not be described in detail here.
[0141] The present application embodiment provides a device for generating audio, which may be the electronic device in the above embodiment, such as Figure 4 As shown, the device comprises:
[0142] A segmentation module 410, configured to segment the target audio based on a preset duration to obtain a plurality of audio segments, wherein the preset duration is N times the frame interval duration of the target audio, where N is an integer greater than 1;
[0143] A processing module 420, configured to process the amplitude matrix of each audio segment based on the first frequency domain extension module of the frequency domain extension model, to obtain a first intermediate result matrix corresponding to each audio segment;
[0144] The processing module 420 is further configured to process the transposed matrix of the amplitude matrix of each audio segment based on the second frequency domain extension module of the frequency domain extension model to obtain a second intermediate result matrix corresponding to each audio segment;
[0145] A determination module 430 is used to determine, for each audio segment, an audio segment containing high-frequency data based on the first intermediate result matrix and the second intermediate result matrix of the audio segment;
[0146] The combining module 440 is used to combine each audio segment containing high-frequency data to obtain target audio containing high-frequency data.
[0147] Optionally, the processing module 420 is further configured to:
[0148] The original audio is obtained, and the original audio is decoded and short-time Fourier transformed to obtain the target audio.
[0149] Optionally, the processing module 420 is used to:
[0150] Processing the amplitude matrix of each audio segment in turn based on the input layer, the long short-term memory layer, and the output layer of the first frequency domain extension module to obtain a first intermediate result matrix corresponding to each audio segment;
[0151] The transposed matrix of the amplitude matrix of each audio segment is processed in sequence based on the input layer, the long short-term memory layer, and the output layer of the second frequency domain extension module to obtain a second intermediate result matrix corresponding to each audio segment.
[0152] Optionally, the determining module 430 is used to:
[0153] Transposing the second intermediate result matrix to obtain a transposed matrix of the second intermediate result matrix;
[0154] Determine an amplitude matrix of an audio segment containing high-frequency data based on the transpose of the first intermediate result matrix and the second intermediate result matrix;
[0155] An audio segment containing high-frequency data is generated based on the phase data corresponding to each time point and each frequency point in the audio segment and the amplitude data corresponding to each time point and each frequency point in the amplitude matrix of the audio segment containing high-frequency data.
[0156] Optionally, the determining module 430 is used to:
[0157] The first intermediate result matrix is added to the transposed matrix of the second intermediate result matrix to obtain an amplitude matrix of the audio segment containing high-frequency data.
[0158] This solution adds high-frequency data to an audio segment of a target audio through a frequency domain expansion model, thereby obtaining multiple audio segments after adding high-frequency data, and then combines the multiple audio segments after adding high-frequency data to obtain the target audio after adding high-frequency data. In this way, through the above processing, high-frequency data can be added to the target audio that does not contain high-frequency data, and the audio is generated, thereby improving the sound quality of the target audio.
[0159] It should be noted that: the audio generation device provided in the above embodiment only uses the division of the above functional modules as an example to illustrate audio generation. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. In addition, the audio generation method embodiments provided in the above embodiment belong to the same concept, and the specific implementation process is detailed in the method embodiment, which will not be repeated here.
[0160] The present application embodiment provides a device for training a frequency domain expansion model, which may be the electronic device in the above embodiment, such as Figure 5 As shown, the device comprises:
[0161] An acquisition module 510 is used to acquire a sample audio segment;
[0162] A processing module 520 is used to perform high-frequency data removal processing on the sample audio segment to obtain a sample audio segment that does not contain high-frequency data;
[0163] The input module 530 is further used to input the sample audio segment that does not contain high-frequency data into the initial frequency domain expansion model to obtain an output audio segment;
[0164] An identification module 540, configured to input an initial discriminant model for identification based on a mapping relationship between the sample audio segment not containing high-frequency data and the sample audio segment, and a mapping relationship between the sample audio segment not containing high-frequency data and the output audio segment;
[0165] The training module 550 is used to train the initial frequency domain extension model based on the recognition result to obtain a target frequency domain extension model.
[0166] Optionally, the identification module 540 is used to:
[0167] Acquire a mapping relationship between the sample audio segment not containing high-frequency data and the sample audio segment, and input the mapping relationship between the sample audio segment not containing high-frequency data and the sample audio segment into an initial discrimination model to obtain a first discrimination result;
[0168] Obtaining a mapping relationship between the sample audio segment not containing high-frequency data and the output audio segment, and inputting the mapping relationship between the sample audio segment not containing high-frequency data and the output audio segment into an initial discrimination model to obtain a second discrimination result;
[0169] The initial discriminant model is used to determine whether an input audio segment is obtained by correctly adding high-frequency data to another input audio segment;
[0170] The training model 550 is used to:
[0171] Based on the first discrimination result, the sample audio segment containing high-frequency data and the output audio segment, the parameters of the initial frequency domain extension model are updated to obtain a frequency domain extension model.
[0172] Optionally, the device further includes an updating module, wherein the updating module is configured to:
[0173] Based on the first discrimination result and the second discrimination result, the parameters of the initial discrimination model are updated to obtain a discrimination model.
[0174] This solution adds high-frequency data to an audio segment of a target audio through a frequency domain expansion model, thereby obtaining multiple audio segments after adding high-frequency data, and then combines the multiple audio segments after adding high-frequency data to obtain the target audio after adding high-frequency data. In this way, through the above processing, high-frequency data can be added to the target audio that does not contain high-frequency data, and the audio is generated, thereby improving the sound quality of the target audio.
[0175] It should be noted that: the audio generation device provided in the above embodiment only uses the division of the above functional modules as an example to illustrate audio generation. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. In addition, the audio generation method embodiments provided in the above embodiment belong to the same concept, and the specific implementation process is detailed in the method embodiment, which will not be repeated here.
[0176] Figure 6 The structure block diagram of a terminal 600 provided by an exemplary embodiment of the present application is shown. The terminal 600 may be: a smart phone, a tablet computer, an MP3 player (Moving Picture Experts Group Audio Layer III, Moving Picture Experts Group Audio Layer 3), an MP4 player (Moving Picture Experts Group Audio Layer IV, Moving Picture Experts Group Audio Layer 4), a laptop computer or a desktop computer. The terminal 600 may also be called a user device, a portable terminal, a laptop terminal, a desktop terminal or other names.
[0177] Typically, the terminal 600 includes a processor 601 and a memory 602 .
[0178] The processor 601 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 601 may be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). The processor 601 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a CPU (Central Processing Unit); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 601 may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 601 may also include an AI (Artificial Intelligence) processor, which is used to process computing operations related to machine learning.
[0179] The memory 602 may include one or more computer-readable storage media, which may be non-transitory. The memory 602 may also include a high-speed random access memory, and a non-volatile memory, such as one or more disk storage devices, flash memory storage devices. In some embodiments, the non-transitory computer-readable storage medium in the memory 602 is used to store at least one instruction, which is used to be executed by the processor 601 to implement the audio generation method provided in the method embodiment of the present application.
[0180] In some embodiments, the terminal 600 may further optionally include: a peripheral device interface 603 and at least one peripheral device. The processor 601, the memory 602 and the peripheral device interface 603 may be connected via a bus or a signal line. Each peripheral device may be connected to the peripheral device interface 603 via a bus, a signal line or a circuit board. Specifically, the peripheral device includes: at least one of a radio frequency circuit 604, a touch display screen 605, a camera 606, an audio circuit 607, a positioning component 608 and a power supply 609.
[0181] The peripheral device interface 603 may be used to connect at least one peripheral device related to I / O (Input / Output) to the processor 601 and the memory 602. In some embodiments, the processor 601, the memory 602, and the peripheral device interface 603 are integrated on the same chip or circuit board; in some other embodiments, any one or two of the processor 601, the memory 602, and the peripheral device interface 603 may be implemented on a separate chip or circuit board, which is not limited in this embodiment.
[0182] The radio frequency circuit 604 is used to receive and transmit RF (Radio Frequency) signals, also known as electromagnetic signals. The radio frequency circuit 604 communicates with the communication network and other communication devices through electromagnetic signals. The radio frequency circuit 604 converts the electrical signal into an electromagnetic signal for transmission, or converts the received electromagnetic signal into an electrical signal. Optionally, the radio frequency circuit 604 includes: an antenna system, an RF transceiver, one or more amplifiers, a tuner, an oscillator, a digital signal processor, a codec chipset, a user identity module card, and the like. The radio frequency circuit 604 can communicate with other terminals through at least one wireless communication protocol. The wireless communication protocol includes, but is not limited to: a metropolitan area network, various generations of mobile communication networks (2G, 3G, 4G and 5G), a wireless local area network and / or a WiFi (Wireless Fidelity) network. In some embodiments, the radio frequency circuit 604 may also include circuits related to NFC (Near Field Communication), which is not limited in this application.
[0183] The display screen 605 is used to display the UI (User Interface). The UI may include graphics, text, icons, videos and any combination thereof. When the display screen 605 is a touch display screen, the display screen 605 also has the ability to collect touch signals on the surface or above the surface of the display screen 605. The touch signal can be input to the processor 601 as a control signal for processing. At this time, the display screen 605 can also be used to provide virtual buttons and / or virtual keyboards, also known as soft buttons and / or soft keyboards. In some embodiments, the display screen 605 can be one, and the front panel of the terminal 600 is set; in other embodiments, the display screen 605 can be at least two, which are respectively set on different surfaces of the terminal 600 or are folded; in some other embodiments, the display screen 605 can be a flexible display screen, which is set on the curved surface or folded surface of the terminal 600. Even, the display screen 605 can also be set to a non-rectangular irregular shape, that is, a special-shaped screen. The display screen 605 can be made of materials such as LCD (Liquid Crystal Display), OLED (Organic Light-Emitting Diode, organic light-emitting diode).
[0184] The camera assembly 606 is used to capture images or videos. Optionally, the camera assembly 606 includes a front camera and a rear camera. Typically, the front camera is arranged on the front panel of the terminal, and the rear camera is arranged on the back of the terminal. In some embodiments, there are at least two rear cameras, which are any one of a main camera, a depth of field camera, a wide-angle camera, and a telephoto camera, so as to realize the fusion of the main camera and the depth of field camera to realize the background blur function, the fusion of the main camera and the wide-angle camera to realize the panoramic shooting and VR (Virtual Reality) shooting function or other fusion shooting functions. In some embodiments, the camera assembly 606 may also include a flash. The flash can be a monochrome temperature flash or a dual-color temperature flash. A dual-color temperature flash refers to a combination of a warm light flash and a cold light flash, which can be used for light compensation at different color temperatures.
[0185] The audio circuit 607 may include a microphone and a speaker. The microphone is used to collect sound waves from the user and the environment, and convert the sound waves into electrical signals and input them into the processor 601 for processing, or input them into the radio frequency circuit 604 to achieve voice communication. For the purpose of stereo acquisition or noise reduction, there may be multiple microphones, which are respectively arranged at different parts of the terminal 600. The microphone may also be an array microphone or an omnidirectional acquisition microphone. The speaker is used to convert the electrical signal from the processor 601 or the radio frequency circuit 604 into sound waves. The speaker may be a traditional film speaker or a piezoelectric ceramic speaker. When the speaker is a piezoelectric ceramic speaker, it can not only convert the electrical signal into sound waves audible to humans, but also convert the electrical signal into sound waves inaudible to humans for purposes such as ranging. In some embodiments, the audio circuit 607 may also include a headphone jack.
[0186] Positioning component 608 is used to locate the current geographical location of terminal 600 to implement navigation or LBS (Location Based Service). Positioning component 608 can be a positioning component based on the US GPS (Global Positioning System), China's Beidou system, Russia's Grenas system or the European Union's Galileo system.
[0187] The power supply 609 is used to power various components in the terminal 600. The power supply 609 can be an alternating current, a direct current, a disposable battery, or a rechargeable battery. When the power supply 609 includes a rechargeable battery, the rechargeable battery can support wired charging or wireless charging. The rechargeable battery can also be used to support fast charging technology.
[0188] In some embodiments, the terminal 600 further includes one or more sensors 610 , including but not limited to: an acceleration sensor 611 , a gyroscope sensor 612 , a pressure sensor 613 , a fingerprint sensor 614 , an optical sensor 615 , and a proximity sensor 616 .
[0189] The acceleration sensor 611 can detect the magnitude of acceleration on the three coordinate axes of the coordinate system established by the terminal 600. For example, the acceleration sensor 611 can be used to detect the components of gravity acceleration on the three coordinate axes. The processor 601 can control the touch display screen 605 to display the user interface in a horizontal view or a vertical view according to the gravity acceleration signal collected by the acceleration sensor 611. The acceleration sensor 611 can also be used for collecting game or user motion data.
[0190] The gyro sensor 612 can detect the body direction and rotation angle of the terminal 600, and the gyro sensor 612 can cooperate with the acceleration sensor 611 to collect the user's 3D actions on the terminal 600. The processor 601 can implement the following functions based on the data collected by the gyro sensor 612: motion sensing (such as changing the UI according to the user's tilt operation), image stabilization during shooting, game control, and inertial navigation.
[0191] The pressure sensor 613 can be set on the side frame of the terminal 600 and / or the lower layer of the touch display screen 605. When the pressure sensor 613 is set on the side frame of the terminal 600, it can detect the user's holding signal of the terminal 600, and the processor 601 performs left and right hand recognition or shortcut operation according to the holding signal collected by the pressure sensor 613. When the pressure sensor 613 is set on the lower layer of the touch display screen 605, the processor 601 controls the operability controls on the UI interface according to the user's pressure operation on the touch display screen 605. The operability controls include at least one of a button control, a scroll bar control, an icon control, and a menu control.
[0192] The fingerprint sensor 614 is used to collect the user's fingerprint, and the processor 601 identifies the user's identity based on the fingerprint collected by the fingerprint sensor 614, or the fingerprint sensor 614 identifies the user's identity based on the collected fingerprint. When the user's identity is identified as a trusted identity, the processor 601 authorizes the user to perform relevant sensitive operations, including unlocking the screen, viewing encrypted information, downloading software, paying, and changing settings. The fingerprint sensor 614 can be set on the front, back, or side of the terminal 600. When a physical button or a manufacturer logo is set on the terminal 600, the fingerprint sensor 614 can be integrated with the physical button or the manufacturer logo.
[0193] The optical sensor 615 is used to collect the ambient light intensity. In one embodiment, the processor 601 can control the display brightness of the touch display screen 605 according to the ambient light intensity collected by the optical sensor 615. Specifically, when the ambient light intensity is high, the display brightness of the touch display screen 605 is increased; when the ambient light intensity is low, the display brightness of the touch display screen 605 is reduced. In another embodiment, the processor 601 can also dynamically adjust the shooting parameters of the camera assembly 606 according to the ambient light intensity collected by the optical sensor 615.
[0194] The proximity sensor 616, also called a distance sensor, is usually arranged on the front panel of the terminal 600. The proximity sensor 616 is used to collect the distance between the user and the front of the terminal 600. In one embodiment, when the proximity sensor 616 detects that the distance between the user and the front of the terminal 600 is gradually decreasing, the processor 601 controls the touch display screen 605 to switch from the screen-on state to the screen-off state; when the proximity sensor 616 detects that the distance between the user and the front of the terminal 600 is gradually increasing, the processor 601 controls the touch display screen 605 to switch from the screen-off state to the screen-on state.
[0195] Those skilled in the art will understand that Figure 6 The structure shown in the figure does not constitute a limitation on the terminal 600, and the terminal 600 may include more or less components than those shown in the figure, or combine some components, or adopt a different component arrangement.
[0196] Figure 7 It is a structural diagram of a server provided in an embodiment of the present application. The server may be an electronic device in the above embodiment. The server 700 may have relatively large differences due to different configurations or performances, and may include one or more processors (Central Processing Units, CPU) 701 and one or more memories 702, wherein the memory 702 stores at least one instruction, and the at least one instruction is loaded and executed by the processor 701 to implement the methods provided in the above-mentioned various method embodiments. Of course, the server may also have components such as a wired or wireless network interface, a keyboard, and an input and output interface for input and output. The server may also include other components for implementing device functions, which will not be described in detail here.
[0197] In an exemplary embodiment, a computer-readable storage medium is also provided, such as a memory including instructions, and the instructions can be executed by a processor in a terminal to complete the method of audio generation in the above embodiment. For example, the computer-readable storage medium can be a read-only memory (ROM), a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.
[0198] A person skilled in the art will understand that all or part of the steps to implement the above embodiments may be accomplished by hardware or by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a disk or an optical disk, etc.
[0199] The above description is only an optional embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included in the protection scope of the present application.
Claims
1. An audio generation method, characterized in that: The method comprises: Divide the target audio based on a preset duration to obtain multiple audio segments, wherein the preset duration is N times the frame interval duration of the target audio, and N is an integer greater than 1; Processing the amplitude matrix of each audio segment in turn based on the input layer, the long short-term memory layer, and the output layer of the first frequency domain extension module to obtain a first intermediate result matrix corresponding to each audio segment; The transposed matrix of the amplitude matrix of each audio segment is processed based on the input layer, the long short-term memory layer, and the output layer of the second frequency domain extension module in sequence to obtain a second intermediate result matrix corresponding to each audio segment; For each audio segment, determining an audio segment containing high-frequency data based on the first intermediate result matrix and the second intermediate result matrix of the audio segment; Each audio segment containing high-frequency data is combined to obtain a target audio containing high-frequency data.
2. The method according to claim 1, characterized in that Before segmenting the target audio based on the preset duration, the method further includes: The original audio is obtained, and the original audio is decoded and short-time Fourier transformed to obtain the target audio.
3. The method according to claim 1, characterized in that The step of determining the audio segment containing high-frequency data based on the first intermediate result matrix and the second intermediate result matrix includes: Transposing the second intermediate result matrix to obtain a transposed matrix of the second intermediate result matrix; Determine an amplitude matrix of an audio segment containing high-frequency data based on the transpose of the first intermediate result matrix and the second intermediate result matrix; An audio segment containing high-frequency data is generated based on the phase data corresponding to each time point and each frequency point in the audio segment and the amplitude data corresponding to each time point and each frequency point in the amplitude matrix of the audio segment containing high-frequency data.
4. The method according to claim 3, characterized in that The step of determining the amplitude matrix of the audio segment containing high-frequency data based on the transposed matrix of the first intermediate result matrix and the second intermediate result matrix comprises: The first intermediate result matrix is added to the transposed matrix of the second intermediate result matrix to obtain an amplitude matrix of the audio segment containing high-frequency data.
5. A method for training a frequency domain expansion model, characterized in that: The method comprises: Get a sample audio segment; Performing high-frequency data removal processing on the sample audio segment to obtain a sample audio segment that does not contain high-frequency data; Inputting the sample audio segment that does not contain high-frequency data into an initial frequency domain extension model to obtain an output audio segment, wherein the initial frequency domain extension model includes a first frequency domain extension module and a second frequency domain extension module, wherein the first frequency domain extension module includes an input layer, a long short-term memory layer, and an output layer, and the second frequency domain extension module includes an input layer, a long short-term memory layer, and an output layer; Inputting the mapping relationship between the sample audio segment not containing high-frequency data and the sample audio segment into an initial discriminant model to obtain a first discrimination result, and inputting the mapping relationship between the sample audio segment not containing high-frequency data and the output audio segment into an initial discriminant model to obtain a second discrimination result, wherein the initial discriminant model is used to discriminate whether an input audio segment is obtained by correctly adding high-frequency data to another input audio segment; Based on the first discrimination result, the sample audio segment and the output audio segment, parameters of the initial frequency domain extension model are updated to obtain a frequency domain extension model.
6. The method according to claim 5, characterized in that After inputting the sample audio segment not containing high-frequency data and the output audio segment into the initial discrimination model to obtain a first discrimination result, and inputting the sample audio segment not containing high-frequency data and the sample audio segment containing high-frequency data into the initial discrimination model to obtain a second discrimination result, the method further includes: Based on the first discrimination result and the second discrimination result, the parameters of the initial discrimination model are updated to obtain a discrimination model.
7. An audio generation device, characterized in that: The device comprises: A segmentation module, used to segment the target audio based on a preset duration to obtain multiple audio segments, wherein the preset duration is N times the frame interval duration of the target audio, and N is an integer greater than 1; A processing module, used for processing the amplitude matrix of each audio segment based on the input layer, the long short-term memory layer, and the output layer of the first frequency domain extension module in sequence to obtain a first intermediate result matrix corresponding to each audio segment; The processing module is further used to process the transposed matrix of the amplitude matrix of each audio segment based on the input layer, the long short-term memory layer, and the output layer of the second frequency domain extension module in sequence to obtain a second intermediate result matrix corresponding to each audio segment; A determination module, configured to determine, for each audio segment, an audio segment containing high-frequency data based on the first intermediate result matrix and the second intermediate result matrix of the audio segment; The combining module is used to combine each audio segment containing high-frequency data to obtain a target audio containing high-frequency data.
8. The device according to claim 7, characterized in that The processing module is further used for: The original audio is obtained, and the original audio is decoded and short-time Fourier transformed to obtain the target audio.
9. The device according to claim 7, characterized in that The determining module is used to: Transposing the second intermediate result matrix to obtain a transposed matrix of the second intermediate result matrix; Determine an amplitude matrix of an audio segment containing high-frequency data based on the transpose of the first intermediate result matrix and the second intermediate result matrix; An audio segment containing high-frequency data is generated based on the phase data corresponding to each time point and each frequency point in the audio segment and the amplitude data corresponding to each time point and each frequency point in the amplitude matrix of the audio segment containing high-frequency data.
10. The device according to claim 9, characterized in that The determining module is used to: The first intermediate result matrix is added to the transposed matrix of the second intermediate result matrix to obtain an amplitude matrix of the audio segment containing high-frequency data.
11. A device for training a frequency domain expansion model, characterized in that: The device comprises: An acquisition module, used to acquire a sample audio segment; A processing module, used for performing high-frequency data removal processing on the sample audio segment to obtain a sample audio segment that does not contain high-frequency data; The input module is further used to input the sample audio segment that does not contain high-frequency data into the initial frequency domain extension model to obtain an output audio segment, wherein the initial frequency domain extension model includes a first frequency domain extension module and a second frequency domain extension module, wherein the first frequency domain extension module includes an input layer, a long short-term memory layer, and an output layer, and the second frequency domain extension module includes an input layer, a long short-term memory layer, and an output layer; an identification module, configured to input the mapping relationship between the sample audio segment not containing high-frequency data and the sample audio segment into an initial discrimination model to obtain a first discrimination result, and input the mapping relationship between the sample audio segment not containing high-frequency data and the output audio segment into an initial discrimination model to obtain a second discrimination result, wherein the initial discrimination model is used to determine whether an input audio segment is obtained by correctly adding high-frequency data to another input audio segment; A training module is used to update the parameters of the initial frequency domain extension model based on the first discrimination result, the sample audio segment and the output audio segment to obtain a frequency domain extension model.
12. The device according to claim 11, characterized in that The device further includes an updating module, wherein the updating module is configured to: Based on the first discrimination result and the second discrimination result, the parameters of the initial discrimination model are updated to obtain a discrimination model.
13. A computer device, characterized in that: The computer device includes a processor and a memory, wherein the memory stores at least one instruction, and the at least one instruction is loaded and executed by the processor to implement the operation performed by the audio generation method according to any one of claims 1 to 4.
14. A computer-readable storage medium, characterized in that: The storage medium stores at least one instruction, and the at least one instruction is loaded and executed by the processor to implement the operation performed by the audio generation method according to any one of claims 1 to 4.
