Song work generation method and device, computer equipment and readable storage medium
By calling the operating system audio synthesizer and performing completeness detection during the song work generation process, the problems of reduced audio synthesis speed and reduced results accuracy are solved, and more efficient and accurate song work generation is achieved.
Patent Information
- Application Number
- CN202411628169.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-14
- Publication Date
- 2025-03-21
- Estimated Expiration
- 2044-11-14
AI Technical Summary
In the prior art, in the process of song production, audio synthesis speed decreases and result accuracy decreases.
By calling the audio synthesizer provided by the operating system, synthesize the accompaniment audio and the human voice audio, and use the human voice audio to detect the target audio integrity to display the generation progress, and finally display the work preview interface.
It improves the accuracy of audio synthesis results and the efficiency of song production, and avoids the bad experience brought to users by abnormal works that cannot be played normally.
Smart Images

Figure CN119673131A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of audio processing technology, and in particular to a method, device, computer equipment, computer-readable storage medium and computer program product for generating a song work. Background Art
[0002] In the scenario of song production, the audio needs to be synthesized first, and then the synthesized audio is used to produce the song. The device can be installed with program software for audio processing to complete tasks such as audio synthesis. When processing tasks such as audio synthesis, third-party synthesis tools can be used, such as FFmpeg (Fast Forward Mpeg, an open source program tool for recording or converting digital audio or video) for audio synthesis. Although this method is not limited by the black box characteristics, it will significantly increase the storage resources occupied by the application. At the same time, the hardware acceleration and internal optimization functions brought by the device's operating system cannot be used, resulting in a significant decrease in the synthesis speed.
[0003] If you abandon third-party synthesis tools and use the audio synthesizer function provided by the device's operating system to synthesize audio, when the system fluctuates or is abnormal, the operating system's callback result may show that the synthesis is successful, but the actual synthesized audio is abnormal during playback. Since the audio synthesizer that comes with the operating system is a black box implementation, the problem cannot be solved by modifying its implementation, which reduces the accuracy of the audio synthesis results and further reduces the accuracy of the song generation. Summary of the invention
[0004] Based on this, it is necessary to provide a method, device, computer equipment, computer-readable storage medium and computer program product for generating song works that can improve the accuracy of audio synthesis results and song work generation results in response to the above technical problems.
[0005] In a first aspect, an embodiment of the present application provides a method for generating a song work. The method comprises:
[0006] In response to the song work generation instruction, the audio synthesizer provided by the operating system is called to synthesize the accompaniment audio with the human voice audio recorded based on the accompaniment audio to obtain the target audio of the song work;
[0007] In the case where the call result returned by the operating system indicates that the audio synthesizer successfully synthesizes the target audio, the target audio is checked for integrity using the human voice audio, and during the integrity check of the target audio, the generation progress of the song work is displayed on the song work recording interface;
[0008] When the target audio passes the integrity check, a work preview interface of the song work is displayed; the work preview interface is used to guide the saving or publishing of the song work.
[0009] In one embodiment, the using the human voice audio to perform integrity detection on the target audio includes:
[0010] Determining at least one content to be detected in the target audio;
[0011] Determine the content location of the content to be detected according to the audio metadata of the target audio; the content location represents the relative address of the content to be detected in the audio file of the target audio;
[0012] Acquire the first audio data corresponding to the content position from the audio file of the target audio, and acquire the second audio data corresponding to the content position from the audio file of the human voice audio;
[0013] When the audio fingerprints of the first audio data and the second audio data are consistent, it is determined that the target audio passes the integrity check.
[0014] In one of the embodiments, before the step of determining the content location of the to-be-detected content according to the audio metadata of the target audio, the method further includes:
[0015] Acquire the audio metadata of the target audio, and detect whether various audio parameters recorded in the audio metadata are normal;
[0016] In the case that the detection of each audio parameter is normal, the step of determining the content location of the content to be detected based on the audio metadata of the target audio is performed.
[0017] In one of the embodiments, the content to be detected includes: the start content of the target audio, the end content of the target audio, and at least one content in the target audio except the start content and the end content.
[0018] In one of the embodiments, the audio file of the target audio includes a plurality of data packets arranged in sequence, and the audio metadata includes a sampling rate of the target audio and a number of audio frames included in the data packet; and determining the content position of the content to be detected according to the audio metadata of the target audio includes:
[0019] Obtain the start time and end time corresponding to the content to be detected in the target audio;
[0020] Determine the relative address of the start data packet in the audio file of the target audio according to the start time, the sampling rate and the number of audio frames included in the data packet; the start data packet is the data packet containing the content to be detected corresponding to the start time;
[0021] Determine the relative address of the end data packet in the audio file of the target audio according to the end time, the sampling rate and the number of audio frames included in the data packet; the end data packet is the data packet containing the content to be detected corresponding to the end time;
[0022] The relative address of the start data packet in the audio file of the target audio and the relative address of the end data packet in the audio file of the target audio are the content locations of the content to be detected.
[0023] In one embodiment, the audio file of the target audio includes a header information area and a streaming media data area; the multiple data packets are sequentially arranged in the streaming media data area;
[0024] Determining the relative address of the start data packet in the audio file of the target audio according to the start time, the sampling rate, and the number of audio frames included in the data packet includes:
[0025] According to the start time, the sampling rate and the number of audio frames included in the data packet, the sorting position of the start data packet in the audio file is obtained; the sorting position of the start data packet in the audio file is mapped to the relative address of the start data packet in the streaming media data area by using an offset position function; according to the relative address of the streaming media data area in the audio file of the target audio and the relative address of the start data packet in the streaming media data area, the relative address of the start data packet in the audio file of the target audio is obtained;
[0026] Determining the relative address of the end data packet in the audio file of the target audio according to the end time, the sampling rate, and the number of audio frames included in the data packet includes:
[0027] The sorting position of the end data packet in the audio file is obtained according to the end time, the sampling rate and the number of audio frames included in the data packet; the sorting position of the end data packet in the audio file is mapped to the relative address of the end data packet in the streaming media data area by using an offset position function; the relative address of the end data packet in the audio file of the target audio is obtained according to the relative address of the streaming media data area in the audio file of the target audio and the relative address of the end data packet in the streaming media data area.
[0028] In one embodiment, the method further comprises:
[0029] When the calling result indicates that the audio synthesizer fails to synthesize, or the target audio fails to pass the integrity check, the step of returning to the step of calling the audio synthesizer provided by the operating system to synthesize the accompaniment audio with the vocal audio recorded based on the accompaniment audio to obtain the target audio required for the song work.
[0030] In one embodiment, the method further comprises:
[0031] Record the number of times the audio synthesizer is not successfully called to synthesize the target audio;
[0032] When the number of times meets a preset number threshold, a device restart prompt message is generated to instruct the device to restart.
[0033] In one embodiment, the method further comprises:
[0034] In response to a draft saving operation for the song work, saving the target audio;
[0035] When the operating system is idle, all the audio data in the saved target audio is used as the third audio data, and all the audio data in the human voice audio is used as the fourth audio data;
[0036] In a case where the audio fingerprints between the third audio data and the fourth audio data are consistent, it is determined that the target audio passes the integrity check.
[0037] In a second aspect, the present application also provides a device for generating a song work. The device comprises:
[0038] The target audio synthesis module is used to respond to the song work generation instruction and call the audio synthesizer provided by the operating system to synthesize the accompaniment audio with the human voice audio recorded based on the accompaniment audio to obtain the target audio of the song work;
[0039] An integrity check module, for performing integrity check on the target audio using the human voice audio when the call result returned by the operating system indicates that the audio synthesizer successfully synthesizes the target audio, and for displaying the generation progress of the song work on the song work recording interface during the integrity check of the target audio;
[0040] The work preview interface display module is used to display the work preview interface of the song work when the target audio passes the integrity detection; the work preview interface is used to guide the saving or publishing of the song work.
[0041] In a third aspect, the present application further provides a computer device. The computer device includes a memory and a processor, the memory stores a computer program, and the processor implements the following steps when executing the computer program:
[0042] In response to the song work generation instruction, the audio synthesizer provided by the operating system is called to synthesize the accompaniment audio with the human voice audio recorded based on the accompaniment audio to obtain the target audio of the song work;
[0043] In the case where the call result returned by the operating system indicates that the audio synthesizer successfully synthesizes the target audio, the target audio is checked for integrity using the human voice audio, and during the integrity check of the target audio, the generation progress of the song work is displayed on the song work recording interface;
[0044] When the target audio passes the integrity check, a work preview interface of the song work is displayed; the work preview interface is used to guide the saving or publishing of the song work.
[0045] In a fourth aspect, the present application further provides a computer-readable storage medium. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the following steps are implemented:
[0046] In response to the song work generation instruction, the audio synthesizer provided by the operating system is called to synthesize the accompaniment audio with the human voice audio recorded based on the accompaniment audio to obtain the target audio of the song work;
[0047] In the case where the call result returned by the operating system indicates that the audio synthesizer successfully synthesizes the target audio, the target audio is checked for integrity using the human voice audio, and during the integrity check of the target audio, the generation progress of the song work is displayed on the song work recording interface;
[0048] When the target audio passes the integrity check, a work preview interface of the song work is displayed; the work preview interface is used to guide the saving or publishing of the song work.
[0049] In a fifth aspect, the present application further provides a computer program product. The computer program product includes a computer program, and when the computer program is executed by a processor, the following steps are implemented:
[0050] In response to the song work generation instruction, the audio synthesizer provided by the operating system is called to synthesize the accompaniment audio with the human voice audio recorded based on the accompaniment audio to obtain the target audio of the song work;
[0051] In the case where the call result returned by the operating system indicates that the audio synthesizer successfully synthesizes the target audio, the target audio is checked for integrity using the human voice audio, and during the integrity check of the target audio, the generation progress of the song work is displayed on the song work recording interface;
[0052] When the target audio passes the integrity check, a work preview interface of the song work is displayed; the work preview interface is used to guide the saving or publishing of the song work.
[0053] The method, device, computer equipment, storage medium and computer program product for generating the above-mentioned song works are as follows: first, the system calls its own audio synthesizer to synthesize the accompaniment audio and the recorded vocal audio to form the target audio; when the synthesis is successful, the vocal audio is used to perform integrity detection on the target audio; during this process, the system updates the generation progress of the song works in real time and displays it on the recording interface to ensure that the user can intuitively understand the progress; if the target audio passes the integrity detection, the system will automatically display the work preview interface to guide the user to save or publish operations. This technical solution effectively improves the efficiency of song creation and improves the user experience. It makes up for the deficiencies of the system's own audio synthesis function through integrity detection, improves the success rate of synthesized works based on the system audio, ensures the integrity and availability of the synthesized works, effectively avoids the problem of bringing a bad experience to users due to abnormal works not being able to play normally, and improves the accuracy of the audio synthesis results. BRIEF DESCRIPTION OF THE DRAWINGS
[0054] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the related technologies, the drawings required for use in the embodiments or the related technical descriptions are 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 paying creative work.
[0055] Figure 1 A diagram of an application environment of a method for generating a song work in one embodiment;
[0056] Figure 2 A schematic diagram of a flow chart of a method for generating a song work in one embodiment;
[0057] Figure 3 A schematic diagram of a flow chart of a method for generating a song work in another embodiment;
[0058] Figure 4 The whole flow chart of the method for generating a song work in one embodiment is as follows;
[0059] Figure 5A schematic diagram of the format of an audio file of a song work in a method for generating a song work in one embodiment;
[0060] Figure 6 A schematic diagram of the location of content in a file that needs to be detected in a method for generating a song work in one embodiment;
[0061] Figure 7 is a structural block diagram of a device for generating a song work in one embodiment;
[0062] Figure 8 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0063] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0064] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards of relevant countries and regions.
[0065] In one embodiment, Figure 1 As shown, a method for generating a song work is provided. This embodiment takes the method applied to a terminal as an example for explanation. It can be understood that the method can also be applied to a server, and can also be applied to a system including a terminal and a server, and is implemented through the interaction between the terminal and the server. In this embodiment, the method includes the following steps:
[0066] S201, in response to a song work generation instruction, calls the audio synthesizer provided in the operating system to synthesize the accompaniment audio with the vocal audio recorded based on the accompaniment audio to obtain the target audio of the song work.
[0067] Among them, song works refer to multimedia works related to the audio, video or lyrics of a song. For example, the user's voice and accompaniment can be synthesized, and synchronized video and lyrics subtitles can be added to obtain an audio and video work. Correspondingly, the song work generation instruction is a program instruction for generating a song work. For example, the user triggers the instruction by clicking the "work generation" button displayed in the terminal.
[0068] Among them, the system refers to the operating system of the device where the program software for audio processing is installed, that is, the operating system of the device implementing this method, and the audio synthesizer refers to the audio synthesis function of the system. For example, the program software is a karaoke software, and the karaoke software is installed in a terminal. The operating system of the terminal is an IOS operating system. The operating system has an audio synthesis function of an audio synthesizer, which can execute the audio synthesis function in response to the call of the program software and feedback the call result after synthesis.
[0069] The accompaniment audio refers to the accompaniment of a certain musical work, the vocal audio refers to the user's audio recorded by the terminal in the scenario where the accompaniment audio is played synchronously, and the target audio is the audio synthesized by the vocals and the accompaniment. Specifically, the music accompaniment and the vocal audio recorded by the user following the music accompaniment are synthesized to obtain the synthesized target audio. In this case, the target audio can be the audio of the user singing a song with accompaniment.
[0070] S202, when the call result returned by the operating system indicates that the audio synthesizer successfully synthesizes the target audio, the target audio is checked for integrity using human voice audio, and during the integrity check of the target audio, the generation progress of the song work is displayed on the song work recording interface.
[0071] The successful synthesis of the target audio means that the calling result of the audio synthesis task is that the audio synthesis is successful. Specifically, after the audio synthesizer completes the audio synthesis task, the synthesis result is fed back to the caller as a callback result.
[0072] Among them, the integrity check can include checking various contents of the target audio, such as audio parameters and audio content. Generally, the integrity check process is related to the progress of song generation. However, the progress of song generation actually includes multiple progress, such as audio synthesis progress, integrity check progress, re-synthesis progress, and progress of generating song from audio and video.
[0073] In order to enhance the user experience in song creation, the embodiment of the present application integrates multiple progresses into one progress, namely, the progress of song generation. The advantage of such a setting is that the user does not need to understand many technical details such as whether the audio synthesis is called or not, whether the audio synthesis is successful or not, whether the audio detection is passed or not, and only needs to pay attention to whether the song is finally generated successfully, that is, the technical implementation process of audio synthesis, detection, and re-synthesis is imperceptible to the user. When the progress is completed, it indicates that the song has been successfully produced completely and accurately, rather than just the audio synthesis success or the audio detection success, which greatly improves the user experience in producing song works.
[0074] S203, when the target audio passes the integrity check, displaying a work preview interface of the song work.
[0075] Among them, the work preview interface is used to guide the saving or publishing of song works. Generally, the generated song works can be previewed in the work preview interface, for example, the final generated audio and video works can be played; in addition, the work preview interface also includes controls for saving song works and publishing song works, which are used to guide users to implement trigger operations to choose whether to publish and save the generated song works. Exemplarily, after the user previews the work and confirms that the work is generated correctly, he can click the draft save or work publish button.
[0076] The method, device, computer equipment, storage medium and computer program product for generating the above-mentioned song works are as follows: first, the system calls its own audio synthesizer to synthesize the accompaniment audio and the recorded vocal audio to form the target audio; when the synthesis is successful, the vocal audio is used to perform integrity detection on the target audio; during this process, the system updates the generation progress of the song works in real time and displays it on the recording interface to ensure that the user can intuitively understand the progress; if the target audio passes the integrity detection, the system will automatically display the work preview interface to guide the user to save or publish operations. This technical solution effectively improves the efficiency of song creation and improves the user experience. It makes up for the deficiencies of the system's own audio synthesis function through integrity detection, improves the success rate of synthesized works based on the system audio, ensures the integrity and availability of the synthesized works, effectively avoids the problem of bringing a bad experience to users due to abnormal works not being able to play normally, and improves the accuracy of the audio synthesis results.
[0077] In one embodiment, the target audio is tested for integrity using human voice audio, including: determining at least one content to be tested in the target audio; determining the content position of the content to be tested based on the audio metadata of the target audio; the content position represents the relative address of the content to be tested in the audio file of the target audio; obtaining first audio data corresponding to the content position from the audio file of the target audio, and obtaining second audio data corresponding to the content position from the audio file of the human voice audio; and determining that the target audio passes the integrity test when the audio fingerprints between the first audio data and the second audio data are consistent.
[0078] Among them, the number of contents to be detected in the target audio is at least one, and generally, multiple contents to be detected can be set. The contents to be detected can be represented by time, such as the contents to be detected are the contents from the 1st second to the 5th second, the contents from the 20th second to the 25th second, and so on. Correspondingly, the content position is the relative address of the content to be detected in the audio file of the target audio, specifically the address relative to the start address of the audio file of the target audio. Since it is necessary to perform consistency detection between the target audio and the human voice audio used to record the target audio, the content position is used to read audio data from the audio file, including reading the audio data of the content to be detected from the audio file of the target audio, and also including reading the audio data of the content to be detected from the audio file of the human voice audio.
[0079] The audio metadata is non-audio information related to the audio file, indicating the structure and properties of the audio file. In a specific implementation, the metadata includes duration, channel data, bit rate and sampling rate, etc. These parameters can be used to calculate the content position of the content to be detected.
[0080] The first audio data is audio data corresponding to the target audio at the content position; the second audio data is audio data corresponding to the human voice audio at the content position.
[0081] Exemplarily, the first audio data and the second audio data are obtained by reading the relative address represented by the content position, and then the audio fingerprints of the first audio data and the second audio data are extracted respectively, and then it is determined whether the audio fingerprints of the first audio data and the second audio data are consistent. If they are consistent, it indicates that the characteristics of the human voice in the synthesized target audio are consistent with the characteristics of the human voice audio before synthesis, indicating that the characteristic information of the human voice is maintained during the synthesis process, and the synthesis result can retain the timbre and expressiveness of the original singer, so that the audio synthesis is considered successful; it can be understood that the present scheme sets the sign that the target audio synthesis is correct, that is, the human voice characteristics of the first audio data and the second audio data are consistent.
[0082] In this embodiment, by determining the content to be detected and its content location in the target audio, extracting the first audio data and the second audio data, and using the audio fingerprint for consistency comparison, the success of the audio synthesis is verified. This solution ensures that the synthesized human voice audio features are consistent with the original audio, guarantees the sound quality and expressiveness, and enables the final generated audio work to retain the singer's timbre, ensures the accuracy of the audio integrity test, and further improves the reliability of audio synthesis.
[0083] In one embodiment, before the step of determining the content location of the content to be detected based on the audio metadata of the target audio, the method also includes: obtaining the audio metadata of the target audio, and detecting whether various audio parameters recorded in the audio metadata are normal; when the various audio parameters are detected normally, executing the step of determining the content location of the content to be detected based on the audio metadata of the target audio.
[0084] The audio parameters recorded in the audio metadata include duration, channel data, bit rate, and sampling rate. Duration refers to the total time of audio playback, channel data indicates the audio configuration such as mono or stereo, bit rate reflects the sound quality and compression level, and sampling rate is the number of samples per second. Verifying the accuracy of audio metadata can ensure that the quality of the audio file meets expectations, thereby improving playback effects and user experience.
[0085] Exemplarily, when performing integrity check on the target audio, the various audio parameters recorded in the audio metadata are first checked to ensure that the parameters are complete and compliant, so as to facilitate the subsequent calculation of the content location; if the audio parameters recorded in the audio metadata are incomplete or incorrect, the integrity check fails and the audio needs to be re-synthesized.
[0086] In this embodiment, the audio metadata of the target audio is first obtained, and its various parameters such as duration, channel data, bit rate and sampling rate are tested to ensure that they are normal and compliant; after confirming that the parameters are correct, the location of the content to be detected is determined based on the audio metadata; the quality of the audio file is effectively guaranteed, the accuracy of subsequent integrity detection is improved, and it is convenient to ensure the accuracy of subsequent content location calculation and audio data detection process.
[0087] In one embodiment, the content to be detected includes: the start content of the target audio, the end content of the target audio, and at least one content in the target audio except the start content and the end content.
[0088] The content to be detected includes fixed detection content and random detection content, the fixed detection content includes start content and end content, and the random detection content can be determined by randomly determining content segments in other content except the fixed detection content. At least one content in the target audio except the start content and the end content refers to the random detection content.
[0089] Exemplarily, the detection of audio content is mainly divided into fixed content detection and random content detection. The fixed part is the start and end positions of the audio where problems are most likely to occur, and the middle part is subjected to random sampling detection.
[0090] In this embodiment, by determining the fixed detection content and the random detection content in sequence, stable detection of locations prone to problems is ensured, and the amount of data actually detected is reduced by random sampling, thereby improving the efficiency of integrity detection while taking into account detection accuracy.
[0091] In one embodiment, the content location of the content to be detected is determined based on the audio metadata of the target audio, including: obtaining the start time and end time corresponding to the content to be detected in the target audio; determining the relative address of the start data packet in the audio file of the target audio based on the start time, sampling rate and the number of audio frames included in the data packet; determining the relative address of the end data packet in the audio file of the target audio based on the end time, sampling rate and the number of audio frames included in the data packet.
[0092] The audio file of the target audio includes a plurality of data packets arranged in sequence, and the audio metadata includes the sampling rate of the target audio and the number of audio frames included in the data packet. Specifically, the sampling rate can be recorded as sample, and the number of audio frames included in the data packet can be recorded as framesPerPacket, which indicates the number of audio frames contained in a data packet in the format of the target audio. For example, if a data packet includes N frames, the value of framesPerPacket is N.
[0093] The start data packet is the data packet containing the content to be detected corresponding to the start time; and the end data packet is the data packet containing the content to be detected corresponding to the end time.
[0094] It should be noted that the start time and end time of the content to be detected in the target audio refer to the relative time in the audio. For example, the total audio length of a song may be 3 minutes, and the content to be detected may be the audio content corresponding to the 10th second to the 20th second. In this case, the start time may be the 10th second and the content duration may be 10 seconds. Therefore, it can be determined that the end time of the content to be detected in the target audio is the 20th second.
[0095] In one embodiment, the start time and end time set for the content to be detected can be directly obtained. In another embodiment, the end time corresponding to the content to be detected in the target audio is determined according to the start time corresponding to the content to be detected in the target audio. Exemplarily, it is known that the start time of the content to be detected is startTime and the detection duration is duration, and the end time of the content to be detected endTime=startTime+duration can be calculated. Then, using the sampling rate sample in the metadata and the number of frames of the data packet framesPerPacket, the relative addresses of the data packets corresponding to startTime and endTime in the audio file of the target audio are calculated respectively (including the relative address startFilePos of the start data packet in the audio file of the target audio and the relative address endTime of the end data packet in the audio file of the target audio), which is the content position of the content to be detected.
[0096] In this embodiment, the start time and end time corresponding to the content to be detected in the target audio are first obtained, and the relative addresses of the data packets corresponding to the start time and end time in the audio file of the target audio are calculated respectively, and used as the content position, thereby improving the calculation efficiency of the content position.
[0097] In one embodiment, the relative address of the start data packet in the audio file of the target audio is determined according to the start time, the sampling rate and the number of audio frames included in the data packet, including: obtaining the sorting position of the start data packet in the audio file according to the start time, the sampling rate and the number of audio frames included in the data packet; using an offset position function to map the sorting position of the start data packet in the audio file to the relative address of the start data packet in the streaming media data area; obtaining the relative address of the start data packet in the audio file of the target audio according to the relative address of the streaming media data area in the audio file of the target audio and the relative address of the start data packet in the streaming media data area;
[0098] In one embodiment, the relative address of the end data packet in the audio file of the target audio is determined based on the end time, sampling rate and the number of audio frames included in the data packet, including: obtaining the sorting position of the end data packet in the audio file based on the end time, sampling rate and the number of audio frames included in the data packet; using an offset position function to map the sorting position of the end data packet in the audio file to the relative address of the end data packet in the streaming media data area; obtaining the relative address of the end data packet in the audio file of the target audio based on the relative address of the streaming media data area in the audio file of the target audio and the relative address of the end data packet in the streaming media data area.
[0099] The audio file of the target audio includes a header information area and a streaming media data area; a plurality of data packets are sequentially arranged in the streaming media data area.
[0100] For example, the start time is startTime, the end time is endTime, the sampling rate is sample, and the number of audio frames included in the data packet is framesPerPacket; the calculation process of the sorting position of the start data packet and the end data packet in the audio file can be:
[0101] startPacket = startTime * sample / framesPerPacket;
[0102] endPacket = endTime * sample / framesPerPacket;
[0103] Wherein, startPacket is the sorting position of the start data packet in the audio file, and endPacket is the sorting position of the end data packet in the audio file.
[0104] The offset position function refers to a function used to obtain the offset position of the data packet of the content to be detected in the streaming media data area (also called the streaming media data segment), which can be recorded as outDataByteOffset(). The parameter of the offset position function is startPacket or endPacket. That is, startPacket and endPacket are passed as parameters to the offset position function to obtain the relative address startSegment of the start data packet in the streaming media data area and the relative address endSegment of the end data packet in the streaming media data area, as shown below:
[0105] startSegment = outDataByteOffset(startPacket);
[0106] endSegment = outDataByteOffset(endPacket).
[0107] After calculating startSegment and endSegment, the relative address startFilePos of the start data packet in the target audio file and the relative address endFilePos of the end data packet in the target audio file can be calculated based on the relative address of the streaming media data area in the target audio file. The details are as follows:
[0108] startFilePos = mdatOffset + startSegment;
[0109] endFilePos = mdatOffset + endSegment.
[0110] Among them, the relative address of the streaming media data area in the audio file of the target audio is also called the offset value of the streaming media data segment in the audio file of the target audio, which can be recorded as mdatOffset. Specifically, mdatOffset is a parameter recorded in the audio metadata, and mdatOffset can be obtained by parsing the audio metadata. It should be noted that the content position of the content to be detected is jointly determined by startFilePos and endFilePos. Specifically, the specific meaning of the content position is the position between the relative address corresponding to startFilePos and the relative address corresponding to endFilePos.
[0111] In this embodiment, the sorting positions of the start data packet and the end data packet in the audio file are calculated through the start time, end time, sampling rate and number of audio frames included in the data packet; then, the sorting position is mapped to the relative address of the data packet in the streaming media data area using an offset position function, and finally, the relative address of the start data packet in the audio file of the target audio is obtained based on the relative address of the streaming media data area in the audio file of the target audio; by mapping the sorting position to the relative address, the precise positioning of the content to be detected is ensured, thereby ensuring the accuracy of the integrity detection.
[0112] In one embodiment, the method also includes: when the call result indicates that the audio synthesizer synthesis fails, or the target audio fails to pass the integrity check, returning to the step of calling the audio synthesizer provided by the operating system to synthesize the accompaniment audio with the vocal audio recorded based on the accompaniment audio to obtain the target audio required for the song work.
[0113] In this embodiment, whether the audio synthesizer fails to synthesize or the target audio fails to pass the integrity test, it indicates that there is an abnormality in the synthesized audio. According to data statistics on synthesis abnormalities, 95% of synthesis abnormalities can be overcome by re-synthesis. Therefore, when there is an abnormality in the synthesized audio, re-synthesis is preferably used to repair the abnormality.
[0114] Specifically, when there is an abnormality in the first or first few synthesized audio, it is preferred to perform the audio synthesis again silently, where silence means that the user does not need to be aware of the synthesis process, and the user can only see that the progress bar has not reached 100% and the song work has not been successfully generated.
[0115] In this embodiment, when it is detected that the audio synthesizer fails to synthesize or the target audio fails to pass the integrity test, the accompaniment audio and the vocal audio recorded based on the accompaniment are re-synthesized by calling the audio synthesizer provided by the operating system; in this process, based on the statistical results of previous synthesis anomalies, the silent mode is preferentially selected for audio synthesis to ensure that the user is not disturbed during the synthesis process, which can effectively improve the synthesis success rate.
[0116] In one embodiment, the method further includes: recording the number of times the audio synthesizer is not successfully called to synthesize the target audio; when the number meets a preset number threshold, generating a device restart prompt message to instruct the device to restart.
[0117] Among them, unsuccessful calling of the audio synthesizer may mean that the audio synthesizer has a callback result of synthesis failure after synthesis, and the number of times is the number of synthesis failures. Generally, the preset number threshold may be once, twice, etc.
[0118] For example, when the audio synthesizer is not successfully called to synthesize the target audio for the first time, it is identified as a system synthesis failure, and the synthesis is silently retried. If the synthesis fails again for the second time, the user is guided to restart the device, and the operation log is reported to the background for the developer to locate the problem.
[0119] In this embodiment, the number of unsuccessful calls to the audio synthesizer to synthesize the target audio is recorded and a preset number threshold is set to monitor the number of unsuccessful calls. When the conditions are met, the device is instructed to restart, thereby avoiding the waste of computing resources in the scenario of repeated unsuccessful synthesis. The device is restarted to overcome system anomalies and improve the success rate of audio synthesis.
[0120] In one embodiment, the method also includes: saving the target audio in response to a draft save operation for the song work; when the operating system is idle, using all audio data in the saved target audio as third audio data, and using all audio data in the vocal audio as fourth audio data; and determining that the target audio passes the integrity check when the audio fingerprints between the third audio data and the fourth audio data are consistent.
[0121] The third audio data is all the audio data in the target audio, and the fourth audio data is all the audio data in the recorded audio.
[0122] Exemplarily, in order to further improve the accuracy of the detection results, based on the current function, if the user chooses to save the draft after recording the audio, all detections can be performed asynchronously when the system is idle.
[0123] In this embodiment, by identifying the user's draft saving operation, all audio data are compared when the system is idle, thereby ensuring the accuracy of audio data detection.
[0124] In another embodiment, Figure 3 As shown, a method for generating a song work is provided, comprising the following steps:
[0125] S301, in response to the song work generation instruction, calling the audio synthesizer provided by the operating system to synthesize the accompaniment audio with the human voice audio recorded based on the accompaniment audio to obtain the target audio of the song work;
[0126] S302, when the call result returned by the operating system indicates that the audio synthesizer successfully synthesizes the target audio, determining at least one content to be detected in the target audio;
[0127] S303, obtaining audio metadata of the target audio, and detecting whether various audio parameters recorded in the audio metadata are normal;
[0128] S304, when the detection of various audio parameters is normal, determining the content position of the content to be detected according to the audio metadata of the target audio;
[0129] S305, obtaining first audio data corresponding to the content position from the audio file of the target audio, and obtaining second audio data corresponding to the content position from the audio file of the human voice audio; if the audio fingerprints of the first audio data and the second audio data are consistent, determining that the target audio passes the integrity test;
[0130] S306, during the integrity detection of the target audio, displaying the generation progress of the song work on the song work recording interface;
[0131] S307, when the target audio passes the integrity test, displaying a work preview interface of the song work;
[0132] S308, when the calling result indicates that the audio synthesizer fails to synthesize, or the target audio fails to pass the integrity check, returns to the step of calling the audio synthesizer provided by the operating system to synthesize the accompaniment audio with the vocal audio recorded based on the accompaniment audio to obtain the target audio required for the song work.
[0133] It should be noted that the specific limitations of the above steps can be found in the specific limitations of a method for generating a song work above, which will not be repeated here.
[0134] In the prior art, under a certain terminal operating system (such as iOS system), when recording songs and synthesizing works, the program software for audio processing (such as karaoke software) can use the audio synthesizer provided by the system to synthesize the human voice and accompaniment into an audio file. However, when the system fluctuates or is abnormal, it may result in the system callback result being a successful synthesis, but the actual synthesized work is abnormal.
[0135] According to the data analysis results for the above problem, the probability of the above problem is 0.06%. Since the system audio synthesizer is a black box implementation, it is impossible to solve this problem by modifying its implementation.
[0136] If you use a third-party synthesis tool (such as FFmpeg, Fast Forward Mpeg, an open source program tool for recording or converting digital audio or video), it will not be subject to the black box limitation, but the size of the application installation package will be significantly increased. At the same time, since the system's internal hardware acceleration and optimization cannot be used, the speed of audio synthesis will be significantly reduced.
[0137] The data analysis results show that there are three main situations in which the system callback synthesis is successful but the work is abnormal: (1) the audio metadata of the work is lost, resulting in the work being unable to be played; (2) the audio metadata of the work is correct, but the data segment corresponding to the audio file is lost, the duration can be displayed but it cannot be played; (3) the audio metadata of the work is correct, but the data segment corresponding to the audio file is abnormal, and the played sound is abnormal.
[0138] Among them, song recording refers to the ability to support users to record singing while listening to the accompaniment of the song; song recording synthesis refers to the synthesis of the original vocals and accompaniment data recorded by the user into a complete audio work; audio metadata refers to the storage of various parameter information of audio files, including audio bit rate, sampling rate, duration, channels and other information.
[0139] Based on this, the present application embodiment provides a method for generating a song work, as shown below: Figures 4 to 6 , a method for generating a song work is described in detail with a specific embodiment. It is worth noting that the following description is only an exemplary description and not a specific limitation of the application.
[0140] The embodiment of the present application provides a method for generating a song work, also known as a completeness detection scheme for synthesizing recorded songs based on the iOS system. In the technical scheme provided by the method for generating the song work provided by the present application, a work integrity detection is performed again when the system synthesis callback is successful to ensure that the synthesized work is complete and available. First, the audio metadata of the work is detected to see if it is normal (work duration, sampling rate, etc.). If it is normal, the data content detection is performed. The detection method is divided into fixed and random content detection, and the beginning and ending content that are prone to problems are fixedly detected. Due to the difference in the recorded songs, the generated sound data in the middle part also differs, so a random sampling is performed. The detection method is to obtain part of the sound data of the work and compare the audio fingerprint with the mixed data of the original human voice and accompaniment to determine whether the sound before and after synthesis is consistent. Only when all the tests are passed can the work be recognized as complete and available. If there is a problem in any process, it is identified as a system synthesis failure, and the synthesis is silently retried. At present, more than 95% of the exceptions can be solved again. If the synthesis fails again, the user is guided to restart the device and report the operation log to the background for the developer to locate the problem.
[0141] On the product side, a method for generating a song work provided in an embodiment of the present application can be applied to the preview and publishing page of the recording function of a certain karaoke program software. When the user chooses to save or publish an audio file, when the system calls back that the work is successfully synthesized, another integrity check is performed to ensure that the work is complete and valid.
[0142] The overall flow chart of a method for generating a song work provided in an embodiment of the present application is as follows: Figure 4 As shown, specifically including:
[0143] a. The user synthesizes the accompaniment audio with the human voice audio recorded based on the accompaniment audio. When the system calls back that the synthesis is successful, a complete detection is performed. The specific complete detection process is described in detail in steps b, c, d, and e.
[0144] b. First, check whether the audio metadata in the synthesized target audio is normal. By decoding the audio metadata, reconfirm the obtained parameters (such as duration, channel data, bit rate, sampling rate, etc.) to ensure that the parameter quantity, data format and data value range of each parameter are consistent with expectations.
[0145] c. After confirming that the audio metadata detection is normal, the audio content can be detected. The detection is mainly divided into fixed content detection and random content detection. The fixed content detection part includes the audio start and end positions where problems are most likely to occur. The random content detection part is also called the middle part of the audio, that is, random sampling detection is required in the middle part.
[0146] d. In the process of detecting audio content, the detection method is to use the audio fingerprint comparison technology commonly used in the industry to obtain the human voice audio before synthesis and the corresponding position of the target audio after synthesis to perform audio fingerprint comparison to detect whether the voiceprint is consistent.
[0147] e. If any of the above steps fails the test, silent resynthesis is preferred. Silent means that the synthesis process does not need to be perceived by the user. For example, when resynthesis is required, the user can only see that the progress bar has not reached 100%, and the song has not been successfully generated. At the same time, the resynthesis task is being carried out synchronously.
[0148] It should be noted that, from the analysis of online statistical data, 95% of users can resolve exceptions by resynthesis when they occur. If the synthesis fails during the resynthesis process, the current operating system is generally abnormal. At this time, the user needs to be guided to restart the system for recovery.
[0149] In the above step b, the detailed implementation principle of audio metadata detection includes: It can be seen from the data analysis results that a large proportion of abnormal work playback is caused by abnormal audio metadata. By detecting the audio header data, a large part of the problems can be found.
[0150] Audio file format Figure 5 As shown, specifically, the audio file of the target audio includes two parts: header information and streaming media data segment, where the header information is the audio metadata of the target audio, and the streaming media data segment is the specific content data of the target audio. More specifically, the audio metadata synthesized by the iOS system is at the front of the file, and its maximum size will not exceed 5% of the total file size, so it can very efficiently parse out the audio metadata (including duration, sampling rate, channel data, bit depth, etc.), and compare it with the expected value to confirm whether it is consistent with the expected value.
[0151] In the above step c, the detailed implementation principle of the acquisition and detection method of the detection content includes:
[0152] Through the audio metadata of the work, we can obtain the audio sampling rate sampleRate, the number of audio frames framesPerPacket included in the audio data packet, and the start time startTime and detection duration of the selected detection range. We can calculate the audio packet position startPacket corresponding to the detection start time. The formula is as follows:
[0153] startPacket = startTime * sample / framesPerPacket;
[0154] Combined with the offset value mdatOffset of the streaming media data segment in the audio metadata and the function outDataByteOffset() (the function name is platform-related and is only used as a reference here) used by the audio streaming media to obtain the offset position of the specified audio package in the data segment, the start position startFilePos of the content position corresponding to the content to be detected in the file can be determined.
[0155] Among them, the streaming media data segment (also known as the streaming media data area) refers to the logical block used to store media data in a digital audio file, and is a unit of measurement used to characterize the segmentation characteristics of an audio file.
[0156] The process of determining the content position corresponding to the content to be detected in the file can be expressed by the following formula:
[0157] startFilePos = mdatOffset + outDataByteOffset(startPacket);
[0158] Similarly, determine the end position of the content to be detected in the file. The formula is as follows:
[0159] endPacket = (startTime+duration)* sample / framesPerPacket;
[0160] endFilePos = mdatOffset + outDataByteOffset(endPacket);
[0161] Based on the above calculations:
[0162] The content position of the content to be detected can be expressed as [startFilePos, endFilePos].
[0163] Through the above formula, we can obtain the location information list of all the content that needs to be detected in the file (including fixed detection content and random detection content). The location of the content that needs to be detected in the file is as follows: Figure 6 As shown, in Figure 6In the example, the position of the starting fixed detection point can be expressed as [startFilePos1, endFilePos1], the position of the ending fixed detection point can be expressed as [startFilePos2, endFilePos2], the position of the random detection point 1 can be expressed as [startFilePos3, endFilePos3], the position of the random detection point 2 can be expressed as [startFilePos4, endFilePos4], and the position of the random detection point N can be expressed as [startFilePosM, endFilePosM].
[0164] After obtaining the location information of all data segments that need to be detected, audio data is obtained from the synthesized work through the location information, and the audio fingerprint extraction and comparison technology commonly used in the industry is used to detect whether the sounds at corresponding positions before and after synthesis are consistent.
[0165] In the above step e, the process of detecting anomaly handling includes:
[0166] If the target audio in the song is detected to be incorrect, it is necessary to automatically try to recover it to minimize the impact on the user. Through online data analysis of the karaoke program software, it is generally recognized as a success that the synthesis anomaly is caused by system fluctuations, and 95% of users can successfully synthesize the correct work when they try again. In addition, 5% of users are due to system anomalies, and the user needs to be guided to restart the device to recover. Therefore, in the technical solution of the present application, when an abnormality is detected in the synthesized work, the synthesis will be silently retried once. When the retry fails to synthesize the correct work, the user will be guided to restart the device, and the abnormal log will be uploaded to the background server and provided to the developer for analysis and optimization.
[0167] The method for generating a song work provided by the embodiment of the present application improves the success rate of synthesizing works based on iOS system audio, and ensures that the synthesized works are complete and usable. It effectively avoids the problem of bringing a bad experience to users due to abnormal works being unable to be played. At the same time, there is no need to introduce a third-party synthesis tool, which avoids the increase in the size of the application and the slow synthesis speed of the work.
[0168] The embodiment of the present application provides a method for generating a song work. After it is put online in the karaoke program software, the abnormal playback report caused by the incomplete synthesis of the work is reduced by 95%. At the same time, the technical solution of the present application is based on audio metadata inspection and content sampling inspection, and the detection speed is very fast, which greatly improves the user experience.
[0169] In some other embodiments, the random content detection part of the solution of the present application is based on sampling inspection. In order to further improve the accuracy of the detection results, the following optimizations can be made on the basis of the current functions: (1) If the user chooses to directly upload the audio file to publish the work after synthesis, no inspection will be performed; (2) If the user chooses to save the draft, all inspections can be performed asynchronously when the system is idle, and if there is a problem with the detection, silent re-synthesis will be performed.
[0170] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0171] Based on the same inventive concept, the embodiment of the present application also provides a song work generation device for implementing the song work generation method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in the embodiments of one or more song work generation devices provided below can refer to the limitations of the song work generation method above, and will not be repeated here.
[0172] In one embodiment, Figure 7 As shown, a device for generating a song work is provided, including: a target audio synthesis module 701, an integrity verification module 702, and a work preview interface display module 703, wherein:
[0173] The target audio synthesis module 701 is used to respond to the song work generation instruction and call the audio synthesizer provided by the operating system to synthesize the accompaniment audio with the human voice audio recorded based on the accompaniment audio to obtain the target audio of the song work;
[0174] The integrity check module 702 is used to use the human voice audio to perform integrity check on the target audio when the call result returned by the operating system indicates that the audio synthesizer successfully synthesizes the target audio, and during the integrity check of the target audio, display the generation progress of the song work on the song work recording interface;
[0175] The work preview interface display module 703 is used to display the work preview interface of the song work when the target audio passes the integrity detection; the work preview interface is used to guide the saving or publishing of the song work.
[0176] In one embodiment, the device is used to: determine at least one content to be detected in the target audio; determine the content position of the content to be detected based on the audio metadata of the target audio; the content position represents the relative address of the content to be detected in the audio file of the target audio; obtain first audio data corresponding to the content position from the audio file of the target audio, and obtain second audio data corresponding to the content position from the audio file of the human voice audio; when the audio fingerprints between the first audio data and the second audio data are consistent, determine that the target audio passes the integrity test.
[0177] In one embodiment, the device is used to: obtain audio metadata of the target audio, and detect whether various audio parameters recorded in the audio metadata are normal; when the various audio parameters are detected normally, perform the step of determining the content location of the content to be detected based on the audio metadata of the target audio.
[0178] In one embodiment, the device is used to: obtain the start time and end time corresponding to the content to be detected in the target audio; determine the relative address of the start data packet in the audio file of the target audio according to the start time, the sampling rate and the number of audio frames included in the data packet; the start data packet is the data packet where the content to be detected corresponding to the start time is located; determine the relative address of the end data packet in the audio file of the target audio according to the end time, the sampling rate and the number of audio frames included in the data packet; the end data packet is the data packet where the content to be detected corresponding to the end time is located.
[0179] In one embodiment, the device is used to: obtain the sorting position of the start data packet in the audio file according to the start time, the sampling rate and the number of audio frames included in the data packet; use an offset position function to map the sorting position of the start data packet in the audio file to the relative address of the start data packet in the streaming data area; obtain the relative address of the start data packet in the audio file of the target audio according to the relative address of the streaming data area in the audio file of the target audio and the relative address of the start data packet in the streaming data area; obtain the sorting position of the end data packet in the audio file according to the end time, the sampling rate and the number of audio frames included in the data packet; use an offset position function to map the sorting position of the end data packet in the audio file to the relative address of the end data packet in the streaming data area; obtain the relative address of the end data packet in the audio file of the target audio according to the relative address of the streaming data area in the audio file of the target audio and the relative address of the end data packet in the streaming data area.
[0180] In one embodiment, the device is used to: when the call result indicates that the audio synthesizer has failed to synthesize, or the target audio has not passed the integrity check, return to the step of calling the audio synthesizer provided by the operating system to synthesize the accompaniment audio with the vocal audio recorded based on the accompaniment audio to obtain the target audio required for the song work.
[0181] In one embodiment, the device is used to: record the number of times the audio synthesizer is not successfully called to synthesize the target audio; when the number meets a preset number threshold, generate a device restart prompt message to instruct the device to restart.
[0182] In one embodiment, the device is used to: save the target audio in response to a draft save operation for a song work; when the operating system is idle, use all audio data in the saved target audio as third audio data, and use all audio data in the vocal audio as fourth audio data; and determine that the target audio passes the integrity check when the audio fingerprints between the third audio data and the fourth audio data are consistent.
[0183] Each module in the above-mentioned song work generation device can be implemented in whole or in part by software, hardware and their combination. Each of the above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the corresponding operations of each of the above modules.
[0184] In one embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as follows: Figure 8As shown. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit and an input device. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface, the display unit and the input device are connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be realized through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, a method for generating a song work is realized. The display unit of the computer device is used to form a visually visible picture, which can be a display screen, a projection device or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covering the display screen, or a button, trackball or touchpad set on the computer device shell, or an external keyboard, touchpad or mouse.
[0185] Those skilled in the art will understand that Figure 8 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0186] In one embodiment, a computer device includes a memory and a processor. The memory stores a computer program. When the processor executes the computer program, the steps in the above method embodiments are implemented.
[0187] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.
[0188] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.
[0189] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory, ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.
[0190] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0191] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be construed as limiting the scope of the present application. It should be noted that, for a person of ordinary skill in the art, several modifications and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A method for generating a song work, characterized in that: The method comprises: In response to the song work generation instruction, the audio synthesizer provided by the operating system is called to synthesize the accompaniment audio with the human voice audio recorded based on the accompaniment audio to obtain the target audio of the song work; In the case where the call result returned by the operating system indicates that the audio synthesizer successfully synthesizes the target audio, the target audio is checked for integrity using the human voice audio, and during the integrity check of the target audio, the generation progress of the song work is displayed on the song work recording interface; When the target audio passes the integrity check, a work preview interface of the song work is displayed; the work preview interface is used to guide the saving or publishing of the song work.
2. The method according to claim 1, characterized in that: The using the human voice audio to perform integrity detection on the target audio includes: Determining at least one content to be detected in the target audio; Determine the content location of the content to be detected according to the audio metadata of the target audio; the content location represents the relative address of the content to be detected in the audio file of the target audio; Acquire the first audio data corresponding to the content position from the audio file of the target audio, and acquire the second audio data corresponding to the content position from the audio file of the human voice audio; When the audio fingerprints of the first audio data and the second audio data are consistent, it is determined that the target audio passes the integrity check.
3. The method according to claim 2, characterized in that Before the step of determining the content location of the to-be-detected content according to the audio metadata of the target audio, the method further includes: Acquire the audio metadata of the target audio, and detect whether various audio parameters recorded in the audio metadata are normal; In the case that the detection of each audio parameter is normal, the step of determining the content location of the content to be detected based on the audio metadata of the target audio is performed.
4. The method according to claim 2, characterized in that: The content to be detected includes: the start content of the target audio, the end content of the target audio, and at least one content in the target audio except the start content and the end content.
5. The method according to claim 2, characterized in that: The audio file of the target audio includes a plurality of data packets arranged in sequence, the audio metadata includes a sampling rate of the target audio and a number of audio frames included in the data packet; and determining the content position of the content to be detected according to the audio metadata of the target audio includes: Obtain the start time and end time corresponding to the content to be detected in the target audio; Determine the relative address of the start data packet in the audio file of the target audio according to the start time, the sampling rate and the number of audio frames included in the data packet; the start data packet is the data packet containing the content to be detected corresponding to the start time; Determine the relative address of the end data packet in the audio file of the target audio according to the end time, the sampling rate and the number of audio frames included in the data packet; the end data packet is the data packet containing the content to be detected corresponding to the end time; The relative address of the start data packet in the audio file of the target audio and the relative address of the end data packet in the audio file of the target audio are the content locations of the content to be detected.
6. The method according to claim 5, characterized in that The audio file of the target audio includes a header information area and a streaming media data area; the multiple data packets are sequentially arranged in the streaming media data area; Determining the relative address of the start data packet in the audio file of the target audio according to the start time, the sampling rate, and the number of audio frames included in the data packet includes: According to the start time, the sampling rate and the number of audio frames included in the data packet, the sorting position of the start data packet in the audio file is obtained; the sorting position of the start data packet in the audio file is mapped to the relative address of the start data packet in the streaming media data area by using an offset position function; according to the relative address of the streaming media data area in the audio file of the target audio and the relative address of the start data packet in the streaming media data area, the relative address of the start data packet in the audio file of the target audio is obtained; Determining the relative address of the end data packet in the audio file of the target audio according to the end time, the sampling rate, and the number of audio frames included in the data packet includes: The sorting position of the end data packet in the audio file is obtained according to the end time, the sampling rate and the number of audio frames included in the data packet; the sorting position of the end data packet in the audio file is mapped to the relative address of the end data packet in the streaming media data area by using an offset position function; the relative address of the end data packet in the audio file of the target audio is obtained according to the relative address of the streaming media data area in the audio file of the target audio and the relative address of the end data packet in the streaming media data area.
7. The method according to claim 2, characterized in that The method further comprises: When the calling result indicates that the audio synthesizer fails to synthesize, or the target audio fails to pass the integrity check, the step of returning to the step of calling the audio synthesizer provided by the operating system to synthesize the accompaniment audio with the vocal audio recorded based on the accompaniment audio to obtain the target audio required for the song work.
8. The method according to claim 7, characterized in that The method further comprises: Record the number of times the audio synthesizer is not successfully called to synthesize the target audio; When the number of times meets a preset number threshold, a device restart prompt message is generated to instruct the device to restart.
9. The method according to claim 2, characterized in that: The method further comprises: In response to a draft saving operation for the song work, saving the target audio; When the operating system is idle, all the audio data in the saved target audio is used as the third audio data, and all the audio data in the human voice audio is used as the fourth audio data; In a case where the audio fingerprints between the third audio data and the fourth audio data are consistent, it is determined that the target audio passes the integrity check.
10. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 9 are implemented.
11. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 9 are implemented.
12. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 9 are implemented.
Citation Information
Patent Citations
Audio processing method and mobile terminal
CN105208189A
Audio fingerprint identification method and device, terminal and storage medium
CN110992983A
Video detection method and device, electronic equipment and storage medium
CN113591530A
Song creation method and related equipment
CN113838445A
Method and Apparatus for Automating the Mixing of Multi-Track Digital Audio
US20070044643A1