Song recording method, electronic equipment and computer readable storage medium

By starting the recording engine in advance during the song recording process and downloading data segments in parallel, the problem of long wait time is solved, the user experience and performance are improved, and recording operations are realized while downloading accompaniment audio data.

CN119271839APending Publication Date: 2025-01-07TENCENT MUSIC ENTERTAINMENT TECH (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411373748.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-29
Publication Date
2025-01-07

AI Technical Summary

Technical Problem

During the song recording process, users need to wait for the accompaniment audio data to be downloaded before starting the recording engine, resulting in a long wait time and affecting the user experience.

Method used

When the metadata download of the accompaniment audio data is completed, the song recording engine is started, and the recording operation is performed while continuing to download the accompaniment audio data. The file memory mapping technology is used to improve read and write efficiency and reduce waiting time.

Benefits of technology

By starting the recording engine in advance and downloading data segments in parallel, the time to enter the song recording is significantly reduced, and the user experience is improved, especially on poor performance devices to avoid lag issues.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119271839A_ABST
    Figure CN119271839A_ABST
Patent Text Reader

Abstract

The invention discloses a song recording method, electronic equipment and a computer readable storage medium, and the method comprises the steps: receiving a recording instruction of a target song, and controlling the downloading of accompaniment audio data of the target song; in the downloading process of the accompaniment audio data, when metadata in the accompaniment audio data is obtained through downloading, starting a song recording engine based on the metadata; and when the song recording engine is started, carrying out song recording operation on the accompaniment audio data obtained by downloading by utilizing the song recording engine. According to the method and the device, the time for waiting for song recording is shortened, and the song recording speed is increased.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of audio processing, and more specifically, to a song recording method, an electronic device, and a computer-readable storage medium. Background Art

[0002] In the song recording scheme in the related art, it is often necessary to start the song recording engine after the accompaniment audio data is downloaded, which causes the user to start singing and wait for a long time for the song to be recorded, and the user experience is poor.

[0003] Therefore, how to reduce the time of waiting to enter song recording is a technical problem that those skilled in the art need to solve. Summary of the invention

[0004] The purpose of the present application is to provide a song recording method, an electronic device and a computer-readable storage medium, which reduce the waiting time for entering song recording.

[0005] To achieve the above-mentioned purpose, the first aspect of the present application provides a song recording method, comprising:

[0006] Receiving a recording instruction of a target song, and controlling the downloading of accompaniment audio data of the target song;

[0007] During the downloading process of the accompaniment audio data, when metadata in the accompaniment audio data is obtained, a song recording engine is started based on the metadata;

[0008] When the song recording engine is started, the song recording engine is used to perform a song recording operation on the downloaded accompaniment audio data.

[0009] Before the song recording operation is performed on the downloaded accompaniment audio data using the song recording engine, the method further includes:

[0010] Acquire a first download speed of the accompaniment audio data, and determine a first expected playback speed of the accompaniment audio data;

[0011] Determining whether the first download speed is greater than or equal to the first expected playback speed;

[0012] If yes, then the step of using the song recording engine to perform a song recording operation on the downloaded accompaniment audio data is entered;

[0013] If not, the first preloaded data size is calculated based on the file size of the accompaniment audio data, the accompaniment duration and the first download speed. When the size of the downloaded data of the accompaniment audio data excluding the metadata reaches the first preloaded data size, the step of using the song recording engine to perform a song recording operation on the downloaded accompaniment audio data is entered.

[0014] Wherein, determining the first expected playing speed of the accompaniment audio data comprises:

[0015] The ratio of the file size of the accompaniment audio data to the accompaniment duration is determined as the first expected playback speed.

[0016] The step of calculating the first preloaded data size according to the file size of the accompaniment audio data, the accompaniment duration and the first download speed includes:

[0017] Determine the parallel download file size according to the product of the accompaniment duration of the accompaniment audio data and the first download speed;

[0018] The difference between the file size of the accompaniment audio data and the size of the parallel download file is calculated, and the first preloaded data size is set to be greater than or equal to the difference.

[0019] Among them, it also includes:

[0020] When a recording instruction of a target position is received, a second download speed of the accompaniment audio data is obtained, a second expected playback speed is determined according to a target file size and a target accompaniment duration, and a second preloaded data size is calculated according to the target file size, the target accompaniment duration and the second download speed; wherein the target file size is the file size after the target position in the accompaniment audio data, and the target accompaniment duration is the accompaniment duration after the target position;

[0021] comparing the second download speed with the second expected playback speed, the size of the downloaded data after the target position with the second preloaded data size;

[0022] If the second download speed is greater than or equal to the second expected playback speed, and / or the downloaded data size after the target position is greater than or equal to the second preloaded data size, the song recording operation is performed starting from the target position using the song recording engine for the downloaded accompaniment audio data.

[0023] After comparing the second download speed with the second expected playback speed, the size of the downloaded data after the target position with the size of the second preloaded data, the method further includes:

[0024] If the second download speed is less than the second expected playback speed, and the size of the downloaded data after the target position is less than the second preloaded data size, then starting a countdown of a preset time length, and starting downloading from the target position of the accompaniment audio data;

[0025] When the countdown of the preset time length ends, determining whether the size of the downloaded data after the target position is greater than or equal to the second preloaded data size;

[0026] If yes, then using the song recording engine to start the song recording operation from the target position for the downloaded accompaniment audio data;

[0027] If not, after waiting for the accompaniment audio data to be downloaded, the song recording engine is used to start the song recording operation from the target position for the downloaded accompaniment audio data.

[0028] The song recording operation is performed on the downloaded accompaniment audio data using the song recording engine, including:

[0029] Continue to download the accompaniment audio data to the buffer area so that the song recording engine obtains the streaming data of the accompaniment audio data from the buffer area based on the file memory mapping technology, and performs song recording operations based on the streaming data.

[0030] The song recording operation is performed based on the streaming data, including:

[0031] Decapsulating the streaming data to obtain a compressed audio packet, decompressing the compressed audio packet to obtain an original audio packet, and converting the original audio packet into a linear pulse code modulated audio;

[0032] Collect human voice audio, and synthesize the human voice audio and the linear pulse code modulation audio at corresponding positions to obtain recorded audio.

[0033] After the original audio packet is converted into a linear pulse code modulated audio, the method further includes:

[0034] Processing the linear pulse code modulation audio with a preset algorithm to obtain a target accompaniment audio; wherein the preset algorithm processing includes noise reduction processing and / or pitch-up and pitch-down processing;

[0035] Accordingly, the human voice audio and the linear pulse code modulation audio are synthesized at corresponding positions to obtain recorded audio, including:

[0036] The human voice audio and the target accompaniment audio are synthesized at corresponding positions to obtain recorded audio.

[0037] To achieve the above-mentioned purpose, the second aspect of the present application provides an electronic device, including:

[0038] Memory for storing computer programs;

[0039] A processor is used to implement the steps of the song recording method as described above when executing the computer program.

[0040] To achieve the above-mentioned purpose, the third aspect of the present application provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the song recording method as described above are implemented.

[0041] To achieve the above objectives, the fourth aspect of the present application provides a computer program product, including a computer program, which implements the steps of the above song recording method when executed by a processor.

[0042] It can be seen from the above scheme that a song recording method provided by the present application includes: receiving a recording instruction of a target song, controlling the downloading of accompaniment audio data of the target song; during the downloading process of the accompaniment audio data, when the metadata in the accompaniment audio data is obtained by downloading, starting a song recording engine based on the metadata; when the song recording engine is started, using the song recording engine to perform a song recording operation on the downloaded accompaniment audio data.

[0043] The song recording method provided by the present application can start the song recording engine to start song recording when the metadata of the accompaniment audio data is downloaded. During the user's singing, the accompaniment audio data is continuously downloaded while the song recording engine performs the song recording operation, thereby realizing song recording while downloading the accompaniment audio data. Since the file size of the metadata of the accompaniment audio data is much smaller than the file size of the complete accompaniment audio data, the song recording is started when the metadata is downloaded, which reduces the waiting time for entering the song recording and improves the speed of entering the song recording. The present application also discloses an electronic device and a computer-readable storage medium, which can also achieve the above technical effects.

[0044] It should be understood that the foregoing general description and the following detailed description are exemplary only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following is a brief introduction to the drawings required for use in the embodiments or the prior art descriptions. 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. The drawings are used to provide a further understanding of the present disclosure and constitute a part of the specification. Together with the following specific implementation methods, they are used to explain the present disclosure, but do not constitute a limitation to the present disclosure. In the drawings:

[0046] Figure 1 An architecture diagram of a song recording system provided in an embodiment of the present application;

[0047] Figure 2 A flowchart of a song recording method provided in an embodiment of the present application;

[0048] Figure 3 A schematic diagram of an audio decoder provided in an embodiment of the present application;

[0049] Figure 4 A schematic diagram of a song recording method provided in an embodiment of the present application;

[0050] Figure 5 A flowchart of another song recording method provided in an embodiment of the present application;

[0051] Figure 6 A flowchart of a song recording method in an application embodiment provided by the present application;

[0052] Figure 7 A schematic diagram showing the startup time consumption of an application embodiment provided by the present application in comparison with related technologies;

[0053] Figure 8 A structural diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0054] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0055] In order to facilitate understanding of the song recording method provided by the present application, the song recording system used by the present application is introduced below. Figure 1 , which shows an architecture diagram of a song recording system provided by an embodiment of the present application, such as Figure 1As shown, it includes a server 10 and a terminal 20.

[0056] The terminal 20 may include a fixed terminal such as a PC (Chinese full name: Personal Computer, English full name: Personal Computer) and a mobile terminal such as a mobile phone, and is used to collect human voice audio.

[0057] The server 10 includes a song recording engine for downloading accompaniment audio data and realizing song recording. Specifically, it receives a recording instruction of a target song and controls the start of downloading the accompaniment audio data of the target song; during the downloading process of the accompaniment audio data, when metadata in the accompaniment audio data is obtained, the song recording engine is started based on the metadata; when the song recording engine is started, the song recording operation is performed on the downloaded accompaniment audio data using the song recording engine.

[0058] Terminal 20 is also used to output recorded audio.

[0059] The embodiment of the present application discloses a song recording method, which reduces the waiting time for entering song recording.

[0060] See also Figure 2 , a flowchart of a song recording method provided in an embodiment of the present application, such as Figure 2 As shown, including:

[0061] S101: receiving a recording instruction of a target song, and controlling to start downloading the accompaniment audio data of the target song;

[0062] In a specific implementation, when a user clicks on the recording of a target song, it is determined whether the accompaniment audio data of the target song is cached. If there is a cache, the song recording engine is directly started based on the cached accompaniment audio data to start recording the target song. If there is no cache, the accompaniment audio data is downloaded and the downloaded data is parsed. When downloading the accompaniment audio data, the metadata of the accompaniment audio data is first downloaded, including metadata for starting the song recording engine (such as accompaniment duration, sampling rate, number of channels, etc.) and other metadata.

[0063] S102: during the downloading process of the accompaniment audio data, when metadata in the accompaniment audio data is obtained, a song recording engine is started based on the metadata;

[0064] In a specific implementation, when it is parsed that the metadata for starting the song recording engine has been downloaded, or all metadata in the accompaniment audio data has been downloaded, the song recording engine is started using the metadata that has been downloaded for starting the song recording engine.

[0065] S103: When the song recording engine is started, the song recording engine is used to perform a song recording operation on the downloaded accompaniment audio data.

[0066] In a specific implementation, when the song recording engine is started, the accompaniment audio data continues to be downloaded while the song recording engine is used to perform song recording operations based on the downloaded accompaniment audio data, thereby achieving song recording while downloading the accompaniment audio data.

[0067] As a feasible implementation mode, the song recording operation is performed on the downloaded accompaniment audio data using the song recording engine, including: continuing to download the accompaniment audio data to a cache area, so that the song recording engine obtains the streaming data of the accompaniment audio data from the cache area based on the file memory mapping technology, and performs the song recording operation based on the streaming data.

[0068] It is understandable that since the streaming data of the accompaniment audio data is cached through files, if the song recording engine directly reads and writes the streaming data of the accompaniment audio data through files, it will lead to increased performance consumption and cause lag problems in some devices with poor performance. Therefore, using file memory mapping technology in the buffer improves the file reading and writing efficiency, ensuring that devices with poor performance will not experience lag problems during song recording.

[0069] As a feasible implementation mode, a song recording operation is performed based on the streaming data, including: decapsulating the streaming data to obtain a compressed audio package, decompressing the compressed audio package to obtain an original audio package, and converting the original audio package into a linear pulse code modulated audio; collecting human voice audio, and synthesizing the human voice audio and the linear pulse code modulated audio at corresponding positions to obtain recorded audio.

[0070] In the specific implementation, Figure 3 As shown, the audio decoder decodes data in the form of a data stream. The specific data can be local cached data or streaming data downloaded in real time from the network. The audio decapsulator in the audio decoder decapsulates the read data to obtain a compressed audio package. The audio decoder in the audio converter decompresses the compressed audio package to obtain the original audio package. The audio converter then converts the original audio package into PCM (Pulse Code Modulation) audio for use by the song recording engine.

[0071] As a feasible implementation mode, after converting the original audio package into linear pulse code modulated audio, it also includes: performing preset algorithm processing on the linear pulse code modulated audio to obtain target accompaniment audio; wherein the preset algorithm processing includes noise reduction processing and / or pitch-up and down processing; correspondingly, synthesizing the human voice audio and the linear pulse code modulated audio at corresponding positions to obtain recorded audio, including: synthesizing the human voice audio and the target accompaniment audio at corresponding positions to obtain recorded audio.

[0072] In the specific implementation, Figure 4 As shown, the downloader downloads the accompaniment audio data and caches it into the buffer. The codec uses the file memory mapping technology to read the PCM audio of the accompaniment audio data into the codec buffer, processes the PCM audio with preset algorithms such as noise reduction and pitch up / down, and then plays the processed accompaniment audio, synthesizing it with the collected vocal audio at the corresponding position to obtain the complete recorded audio.

[0073] The song recording method provided by the embodiment of the present application can start the song recording engine to start song recording when the metadata of the accompaniment audio data is downloaded. During the singing process of the user, the accompaniment audio data is continuously downloaded while the song recording operation of the song recording engine is performed, so that the song recording is performed while the accompaniment audio data is downloaded. Since the file size of the metadata of the accompaniment audio data is much smaller than the file size of the complete accompaniment audio data, the song recording is started when the metadata is downloaded, which reduces the waiting time for entering the song recording and improves the speed of entering the song recording.

[0074] The embodiment of the present application discloses a song recording method. Compared with the above embodiment, this embodiment further explains and optimizes the technical solution. Specifically:

[0075] See also Figure 5 , a flowchart of another song recording method provided in an embodiment of the present application, such as Figure 5 As shown, including:

[0076] S201: receiving a recording instruction of a target song, and controlling to start downloading the accompaniment audio data of the target song;

[0077] S202: during the downloading process of the accompaniment audio data, when metadata in the accompaniment audio data is obtained, a song recording engine is started based on the metadata;

[0078] S203: When the song recording engine is started, a first download speed of the accompaniment audio data is obtained, and a first expected playback speed of the accompaniment audio data is determined;

[0079] In a specific implementation, when the song recording engine is started, the current download speed of the accompaniment audio data, that is, the first download speed, is obtained according to the current network request, and the first expected playback speed of the accompaniment audio data is determined according to the file size of the accompaniment audio data and the accompaniment duration.

[0080] As a feasible implementation manner, the determining of the first expected playback speed of the accompaniment audio data includes: determining the ratio of the file size of the accompaniment audio data to the accompaniment duration as the first expected playback speed. In a specific implementation, the calculation formula of the expected playback speed is: playSpeed ​​= fileSize / fileDuration, playSpeed ​​is the first expected playback speed, fileSize is the file size of the accompaniment audio data, and fileDuration is the accompaniment duration of the accompaniment audio data.

[0081] S204: Determine whether the first download speed is greater than or equal to the first expected playback speed; if so, proceed to S207; if not, proceed to S205;

[0082] S205: Calculating the preloaded data size according to the file size of the accompaniment audio data, the accompaniment duration and the first download speed;

[0083] S206: Continue downloading the accompaniment audio data, and determine whether the size of the downloaded data of the accompaniment audio data excluding the metadata reaches the first preloaded data size; if so, enter S207; if not, re-enter S206;

[0084] S207: Utilize the song recording engine to perform a song recording operation on the downloaded accompaniment audio data.

[0085] In a specific implementation, it is determined whether the first download speed of the accompaniment audio data is greater than or equal to the first expected playback speed. If so, it means that smooth playback of the accompaniment audio can be achieved without preloading, and no secondary caching occurs, and step S206 is performed directly.

[0086] If the download speed of the accompaniment audio data is less than the first expected playback speed, it means that the accompaniment audio needs to be preloaded to ensure smooth playback of the accompaniment audio without secondary caching. The first preloaded data size is calculated according to the file size of the accompaniment audio data, the accompaniment duration and the first download speed. As a feasible implementation, the first preloaded data size is calculated according to the file size of the accompaniment audio data, the accompaniment duration and the first download speed, including: determining the parallel download file size according to the product of the accompaniment duration of the accompaniment audio data and the first download speed; calculating the difference between the file size of the accompaniment audio data and the parallel download file size, and setting the first preloaded data size to be greater than or equal to the difference. In a specific implementation, the calculation formula for the first preloaded data size is: expectDownloadSize = fileSize - downloadSpeed×fileDuration, downloadSpeed ​​is the first download speed of the accompaniment audio data, downloadSpeed×fileDuration is the parallel download file size, and expectDownloadSize is the difference between the file size of the accompaniment audio data and the parallel download file size. The first preloaded data size is set to be greater than or equal to the difference, that is, when the size of the downloaded data of the accompaniment audio data excluding metadata is greater than or equal to the difference, step S206 is performed.

[0087] As a preferred implementation, it also includes: when receiving a recording instruction for a target position, obtaining a second download speed of the accompaniment audio data, determining a second expected playback speed according to a target file size and a target accompaniment duration, and calculating a second preloaded data size according to the target file size, the target accompaniment duration and the second download speed; wherein the target file size is the file size after the target position in the accompaniment audio data, and the target accompaniment duration is the accompaniment duration after the target position; comparing the second download speed with the second expected playback speed, the size of the downloaded data after the target position with the second preloaded data size; if the second download speed is greater than or equal to the second expected playback speed, and / or the size of the downloaded data after the target position is greater than or equal to the second preloaded data size, then The song recording engine is used to perform a song recording operation on the downloaded accompaniment audio data from the target position; if the second download speed is less than the second expected playback speed, and the size of the downloaded data after the target position is less than the second pre-loaded data size, a countdown of a preset duration is started, and downloading is started from the target position of the accompaniment audio data; when the countdown of the preset duration ends, it is determined whether the size of the downloaded data after the target position is greater than or equal to the second pre-loaded data size; if so, the song recording engine is used to perform a song recording operation on the downloaded accompaniment audio data from the target position; if not, after waiting for the download of the accompaniment audio data to be completed, the song recording engine is used to perform a song recording operation on the downloaded accompaniment audio data from the target position.

[0088] In a specific implementation, when the user manually selects to play the accompaniment at the designated target position, if the current download speed of the accompaniment audio data, i.e., the second download speed, is greater than or equal to the second expected playback speed, then the song recording operation can be started directly from the target position without preloading. The second expected playback speed is the ratio between the file size after the target position in the accompaniment audio data and the accompaniment time after the target position. If the second download speed is less than the second expected playback speed, it is necessary to determine whether there is enough downloaded accompaniment audio after the target position to achieve smooth playback, that is, to determine whether the size of the downloaded data after the target position is greater than or equal to the second preloaded data size.

[0089] If the size of the downloaded data after the target position is greater than or equal to the second preloaded data size, it means that the accompaniment audio downloaded after the target position can be played smoothly, and the song recording operation starts from the target position.

[0090] If the size of the downloaded data after the target position is less than the second preloaded data size, but there is a pre-accompaniment audio before the target position, the pre-accompaniment audio is played. If there is no pre-accompaniment audio, a countdown of a preset length is started, and a countdown UI effect is added to the user interface to reduce the user's perception of secondary buffering. At the same time, downloading will be prioritized from the target position. When the countdown ends, if the size of the downloaded data after the target position is greater than or equal to the second preloaded data size, the song recording operation is started from the target position. If the size of the downloaded data after the target position is less than the second preloaded data size, indicating that the user's current network environment is very poor, then a direct blocking prompt is selected to prompt the user, and the download progress (percentage) of the accompaniment audio data is displayed in the user interface. The song recording is not allowed to resume until all the accompaniment audio data has been downloaded. The song recording operation is started from the target position to avoid multiple secondary bufferings causing pauses and bringing a worse experience to the user.

[0091] It can be seen that before starting the song recording operation, this embodiment determines whether preloading is required based on the download speed and expected playback speed of the accompaniment audio data, thereby ensuring smooth playback of the accompaniment audio and improving the user experience during the song recording process.

[0092] An application example provided by the present application is described below. Figure 6 As shown, the following steps are included: the user clicks to start singing, and it is determined whether there is a cache; if so, the song recording engine is directly started, if not, the accompaniment is downloaded. If the download fails, the download failure is processed. It is determined whether the audio metadata is parsed, if so, the song recording engine is started, if not, the accompaniment data is continued to be parsed, and the accompaniment download is continued. After starting the song recording engine, the accompaniment is decoded. It is determined whether the accompaniment data is sufficient, if not, a secondary buffering process is performed, and if so, the accompaniment is played and recorded. It is determined whether the recording is interpreted and, if not, the step of whether the accompaniment data is sufficient is re-entered, if so, it is determined whether the accompaniment is downloaded, if so, the song recording is ended, if not, a secondary buffering process is performed.

[0093] In the accompaniment audio data, metadata only accounts for less than 5% of the total file size. This embodiment supports streaming download of the accompaniment by modifying the song recording engine. You only need to download the metadata of the accompaniment audio file and start the song recording engine to start recording the song. During the song recording process, the data segment (the most time-consuming link) is downloaded in parallel, which greatly reduces the user's waiting time for song recording. Figure 7 As shown, the startup time in the related art is T=T1+T2+T3, and the startup time in this embodiment is T=T1+T3.

[0094] A song recording device provided in an embodiment of the present application is introduced below. The song recording device described below and the song recording method described above can be referred to each other. The song recording device includes:

[0095] A control module, used for receiving a recording instruction of a target song, and controlling the start of downloading the accompaniment audio data of the target song;

[0096] A starting module, used for starting a song recording engine based on metadata in the accompaniment audio data when metadata in the accompaniment audio data is obtained during the downloading process of the accompaniment audio data;

[0097] The first recording module is used to utilize the song recording engine to perform a song recording operation on the downloaded accompaniment audio data when the song recording engine is started.

[0098] The song recording device provided by the embodiment of the present application can start the song recording engine to start song recording when the metadata of the accompaniment audio data is downloaded. During the singing process of the user, the accompaniment audio data is continuously downloaded while the song recording engine performs the song recording operation, so that the song recording is performed while the accompaniment audio data is downloaded. Since the file size of the metadata of the accompaniment audio data is much smaller than the file size of the complete accompaniment audio data, the song recording is started when the metadata is downloaded, which reduces the waiting time for entering the song recording and improves the speed of entering the song recording.

[0099] Based on the above embodiment, as a preferred implementation, it also includes:

[0100] A first determining module, used for acquiring a first download speed of the accompaniment audio data and determining a first expected playback speed of the accompaniment audio data;

[0101] A first judgment module is used to judge whether the first download speed is greater than or equal to the first expected playback speed; if so, the workflow of the recording module is entered; if not, the workflow of the calculation module is entered;

[0102] A calculation module is used to calculate a first preloaded data size according to the file size of the accompaniment audio data, the accompaniment duration and the first download speed, and enter the workflow of the recording module when the size of the downloaded data of the accompaniment audio data excluding the metadata reaches the first preloaded data size.

[0103] Based on the above embodiment, as a preferred implementation mode, the first determining module is specifically used to: determine the ratio of the file size of the accompaniment audio data to the accompaniment duration as the first expected playback speed.

[0104] Based on the above embodiment, as a preferred implementation mode, the first calculation module is specifically used to: determine the parallel download file size according to the product of the accompaniment duration of the accompaniment audio data and the first download speed; calculate the difference between the file size of the accompaniment audio data and the parallel download file size, and set the first preloaded data size to be greater than or equal to the difference.

[0105] Based on the above embodiment, as a preferred implementation, it also includes:

[0106] A second determination module is used for, when receiving a recording instruction of a target position, obtaining a second download speed of the accompaniment audio data, and determining a second expected playback speed according to a target file size and a target accompaniment duration; wherein the target file size is a file size after the target position in the accompaniment audio data, and the target accompaniment duration is a accompaniment duration after the target position;

[0107] A comparison module, used for comparing the second download speed with the second expected playback speed, the size of the downloaded data after the target position with the second preloaded data size; if the second download speed is greater than or equal to the second expected playback speed, and / or the size of the downloaded data after the target position is greater than or equal to the second preloaded data size, then entering the workflow of the second recording module; if the second download speed is less than the second expected playback speed, and the size of the downloaded data after the target position is less than the second preloaded data size, then entering the workflow of the opening module;

[0108] An opening module, used for starting a countdown of a preset duration and starting downloading from the target position of the accompaniment audio data;

[0109] A second judgment module is used to judge whether the size of the downloaded data after the target position is greater than or equal to the second preloaded data size when the countdown of the preset time length ends; if so, enter the workflow of the second recording module; if not, wait until the download of the accompaniment audio data is completed, and then enter the workflow of the second recording module;

[0110] The second recording module is used to utilize the song recording engine to start the song recording operation from the target position for the downloaded accompaniment audio data.

[0111] On the basis of the above embodiments, as a preferred implementation mode, the first recording module is specifically used to: continue to download the accompaniment audio data to the cache area, so that the song recording engine obtains the streaming data of the accompaniment audio data from the cache area based on the file memory mapping technology, and performs song recording operations based on the streaming data.

[0112] Based on the above embodiments, as a preferred implementation mode, the first recording module is specifically used to: decapsulate the streaming data to obtain a compressed audio package, decompress the compressed audio package to obtain an original audio package, and convert the original audio package into a linear pulse code modulated audio; collect human voice audio, and synthesize the human voice audio and the linear pulse code modulated audio at corresponding positions to obtain recorded audio.

[0113] On the basis of the above embodiments, as a preferred implementation mode, the first recording module is specifically used to: perform preset algorithm processing on the linear pulse code modulation audio to obtain the target accompaniment audio; wherein the preset algorithm processing includes noise reduction processing and / or pitch up / down processing; synthesize the human voice audio and the target accompaniment audio at corresponding positions to obtain the recorded audio.

[0114] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.

[0115] The present application also provides an electronic device, see Figure 8 , a structural diagram of an electronic device provided in an embodiment of the present application, such as Figure 8 As shown, a processor 81 and a memory 82 may be included.

[0116] Among them, the processor 81 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 81 can 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 81 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 81 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 81 may also include an AI (Artificial Intelligence) processor, which is used to process computing operations related to machine learning.

[0117] The memory 82 may include one or more computer-readable storage media, which may be non-transitory. The memory 82 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 this embodiment, the memory 82 is at least used to store the following computer program 821, wherein, after the computer program is loaded and executed by the processor 81, it can implement the relevant steps in the song recording method performed by the electronic device side disclosed in any of the aforementioned embodiments. In addition, the resources stored in the memory 82 may also include an operating system 822 and data 823, etc., and the storage method may be temporary storage or permanent storage. Among them, the operating system 822 may include Windows, Unix, Linux, etc.

[0118] In some embodiments, the electronic device may further include a display screen 83 , an input / output interface 84 , a communication interface 85 , a sensor 86 , a power source 87 , and a communication bus 88 .

[0119] certainly, Figure 8 The structure of the electronic device shown does not constitute a limitation on the electronic device in the embodiments of the present application. In actual applications, the electronic device may include Figure 8 More or fewer components than shown, or combinations of certain components.

[0120] In another exemplary embodiment, a computer-readable storage medium including a computer program is also provided. When the computer program is executed by a processor, the steps of the song recording method performed by the electronic device in any of the above embodiments are implemented.

[0121] In another exemplary embodiment, a computer program product including a computer program is also provided. When the computer program is executed by a processor, the steps of the song recording method performed by the electronic device in any of the above embodiments are implemented.

[0122] The various embodiments in the specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments, and the same and similar parts between the various embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part description. It should be pointed out that for ordinary technicians in this technical field, without departing from the principles of this application, several improvements and modifications can be made to the present application, and these improvements and modifications also fall within the scope of protection of the claims of this application.

[0123] It should also be noted that, in this specification, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "comprise", "include" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the statement "comprises a ..." does not exclude the presence of other identical elements in the process, method, article or device including the element.

Claims

1. A song recording method, characterized in that: include: Receiving a recording instruction of a target song, and controlling the downloading of accompaniment audio data of the target song; During the downloading process of the accompaniment audio data, when metadata in the accompaniment audio data is obtained, a song recording engine is started based on the metadata; When the song recording engine is started, the song recording engine is used to perform a song recording operation on the downloaded accompaniment audio data.

2. The song recording method according to claim 1, characterized in that: Before using the song recording engine to perform a song recording operation on the downloaded accompaniment audio data, the method further includes: Acquire a first download speed of the accompaniment audio data, and determine a first expected playback speed of the accompaniment audio data; Determining whether the first download speed is greater than or equal to the first expected playback speed; If yes, then the step of using the song recording engine to perform a song recording operation on the downloaded accompaniment audio data is entered; If not, the first preloaded data size is calculated based on the file size of the accompaniment audio data, the accompaniment duration and the first download speed. When the size of the downloaded data of the accompaniment audio data excluding the metadata reaches the first preloaded data size, the step of using the song recording engine to perform a song recording operation on the downloaded accompaniment audio data is entered.

3. The song recording method according to claim 2, characterized in that: Determining the first expected playing speed of the accompaniment audio data comprises: The ratio of the file size of the accompaniment audio data to the accompaniment duration is determined as the first expected playback speed.

4. The song recording method according to claim 2, characterized in that: The calculating the first preloaded data size according to the file size of the accompaniment audio data, the accompaniment duration and the first download speed comprises: Determine the parallel download file size according to the product of the accompaniment duration of the accompaniment audio data and the first download speed; The difference between the file size of the accompaniment audio data and the size of the parallel download file is calculated, and the first preloaded data size is set to be greater than or equal to the difference.

5. The song recording method according to claim 1, characterized in that: Also includes: When a recording instruction of a target position is received, a second download speed of the accompaniment audio data is obtained, a second expected playback speed is determined according to a target file size and a target accompaniment duration, and a second preloaded data size is calculated according to the target file size, the target accompaniment duration and the second download speed; wherein the target file size is the file size after the target position in the accompaniment audio data, and the target accompaniment duration is the accompaniment duration after the target position; comparing the second download speed with the second expected playback speed, the size of the downloaded data after the target position with the second preloaded data size; If the second download speed is greater than or equal to the second expected playback speed, and / or the downloaded data size after the target position is greater than or equal to the second preloaded data size, the song recording operation is performed starting from the target position using the song recording engine for the downloaded accompaniment audio data.

6. The song recording method according to claim 5, characterized in that: After comparing the second download speed with the second expected playback speed, the size of the downloaded data after the target position with the size of the second preloaded data, the method further includes: If the second download speed is less than the second expected playback speed, and the size of the downloaded data after the target position is less than the second preloaded data size, then starting a countdown of a preset time length, and starting downloading from the target position of the accompaniment audio data; When the countdown of the preset time length ends, determining whether the size of the downloaded data after the target position is greater than or equal to the second preloaded data size; If yes, then using the song recording engine to start the song recording operation from the target position for the downloaded accompaniment audio data; If not, after waiting for the accompaniment audio data to be downloaded, the song recording engine is used to start the song recording operation from the target position for the downloaded accompaniment audio data.

7. The song recording method according to claim 1, characterized in that: The song recording engine is used to perform a song recording operation on the downloaded accompaniment audio data, including: Continue to download the accompaniment audio data to the buffer area so that the song recording engine obtains the streaming data of the accompaniment audio data from the buffer area based on the file memory mapping technology, and performs song recording operations based on the streaming data.

8. The song recording method according to claim 7, characterized in that: Performing a song recording operation based on the streaming data includes: Decapsulating the streaming data to obtain a compressed audio packet, decompressing the compressed audio packet to obtain an original audio packet, and converting the original audio packet into a linear pulse code modulated audio; Collect human voice audio, and synthesize the human voice audio and the linear pulse code modulation audio at corresponding positions to obtain recorded audio.

9. The song recording method according to claim 8, characterized in that: After converting the original audio packet into a linear pulse code modulated audio, the method further includes: Processing the linear pulse code modulation audio with a preset algorithm to obtain a target accompaniment audio; wherein the preset algorithm processing includes noise reduction processing and / or pitch-up and pitch-down processing; Accordingly, the human voice audio and the linear pulse code modulation audio are synthesized at corresponding positions to obtain recorded audio, including: The human voice audio and the target accompaniment audio are synthesized at corresponding positions to obtain recorded audio.

10. An electronic device, characterized in that: include: Memory for storing computer programs; A processor, used to implement the steps of the song recording method as claimed in any one of claims 1 to 9 when executing the computer program.

11. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, which, when executed, implements the steps of the song recording method as described in any one of claims 1 to 9.