Audio data loading method, electronic device and storage medium

By obtaining the network and playback speed of the audio files, calculating the data to be loaded and optimizing the loading strategy, the problem of time-consuming and secondary buffering in traditional karaoke scenes is solved, and the user experience of singing in seconds and low buffering is achieved.

CN114093338BActive Publication Date: 2025-08-19TENCENT MUSIC ENTERTAINMENT TECH (SHENZHEN) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111390982.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-22
Publication Date
2025-08-19
Estimated Expiration
2041-11-22

AI Technical Summary

Technical Problem

In traditional song-calling and song recording scenarios, the download process of audio files is limited by the network environment and equipment performance, which results in the first loading taking a long time, the user waits for a long time, and secondary buffering is prone to occur during the singing recording process.

Method used

By obtaining the network speed and playback speed of the audio file, calculate the audio data to be loaded, and start playing and recording when the network speed is less than or equal to the playback speed, or start recording after loading only the header file of the audio file when the network speed is faster, reducing the time-consuming and the probability of secondary buffering.

Benefits of technology

The second singing effect in the karaoke scene is achieved, reducing the time-consuming sing, and significantly reducing the probability of secondary buffering during the recording process, improving the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114093338B_ABST
    Figure CN114093338B_ABST
Patent Text Reader

Abstract

The embodiment of the present application discloses an audio data loading method, electronic device, and storage medium, wherein the method includes: obtaining the current network speed of the terminal and calculating the playback speed of the audio file to be downloaded; if the current network speed of the terminal is less than or equal to the playback speed, then calculating the length of the audio data to be downloaded based on the length of the audio file, the current network speed, and the duration of the audio file, and after downloading this part of the audio data, starting the recording engine for recording; if the current network speed of the terminal is greater than the playback speed, then the recording engine can be started for recording after the header file of the audio file is loaded. By using the embodiment of the present application, the time consumption of singing in the karaoke scene can be reduced, and the probability of secondary buffering during the recording process can be reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to an audio data loading method, electronic device, and storage medium. Background Art

[0002] In a traditional song request and recording scenario, a user clicks on the song they want to record, and the electronic device starts loading multiple audio files related to the song. Only after all the audio files are loaded can the playback engine be started to play the accompaniment (and / or the original vocals), and the recording engine be started to record the song. In other words, only after all the audio files are loaded can the accompaniment (and / or the original vocals) be played and the song be recorded simultaneously / in parallel.

[0003] Therefore, before recording, several audio files need to be downloaded in advance, and the download process is often limited by factors such as the user's actual network environment and device performance, which results in a long initial loading time and a long waiting time for the user. Summary of the Invention

[0004] The embodiments of the present application provide an audio data loading method, an electronic device, and a storage medium, which can reduce the time consumption of song requesting in a karaoke scene and reduce the probability of secondary buffering during the recording process.

[0005] In a first aspect, an embodiment of the present application provides a method for loading audio data, the method comprising:

[0006] Obtain a first network speed associated with loading an audio file, and obtain a playback speed of the audio file;

[0007] If the first network speed is less than or equal to the playback speed, determining first audio data to be loaded from the audio file according to the length of the audio file, the first network speed, and the duration of the audio file, and loading the first audio data, where the first audio data is all or part of the audio data in the audio file;

[0008] After the first audio data is loaded, the playback engine is started to play the first audio data and the recording engine is started to record the user's singing data based on the played first audio data, and output the recording page.

[0009] In conjunction with the first aspect, in one possible implementation, before obtaining a first network speed related to loading the audio file and obtaining a playback speed of the audio file, the method further includes:

[0010] Acquiring multiple dimensional information, the multiple dimensional information including an average dwell time of a first page, a second network speed, and a historical secondary buffering confidence, wherein the first page is a page before the recording page, and the second network speed is a network speed collected by a global racing module;

[0011] The multiple dimensional information is input into a classifier for classification, and the classifier is used to process the multiple dimensional information and output classification results;

[0012] If the classification result output by the classifier is the first loading mode, the steps of obtaining a first network speed related to the loading of the audio file and obtaining a playing speed of the audio file are performed.

[0013] In conjunction with the first aspect, in one possible implementation, the method further includes:

[0014] If the classification result output by the classifier is the second loading method, all the audio data in the audio file are loaded. After all the audio data in the audio file are loaded, the playback engine is started to play all the audio data and the recording engine is started to record the user's singing data based on all the audio data played.

[0015] In conjunction with the first aspect, in one possible implementation, obtaining the playback speed of the audio file includes:

[0016] In response to a download instruction for the audio file, loading a header file of the audio file;

[0017] Parse the header file to obtain the playback speed of the audio file.

[0018] In conjunction with the first aspect, in one possible implementation, obtaining a first network speed related to loading of the audio file includes:

[0019] Obtain a third network speed and a fourth network speed, where the third network speed is the network speed collected by the global speed racing module, and the fourth network speed is the download speed of the header file;

[0020] If the absolute difference between the third network speed and the fourth network speed is less than or equal to a first threshold, determining the fourth network speed as the first network speed;

[0021] If the absolute difference between the third network speed and the fourth network speed is greater than a second threshold, weighted processing is performed on the third network speed and the fourth network speed to obtain the first network speed.

[0022] In conjunction with the first aspect, in one possible implementation, determining the first audio data to be loaded in the audio file according to the length of the audio file, the first network speed, and the duration of the audio file includes:

[0023] Determine a first predicted position as a difference between a length of the audio file and a product of the first network speed and a duration of the audio file;

[0024] The audio data from the first audio frame of the audio file to the first prediction position in the audio file is determined as the first audio data.

[0025] In conjunction with the first aspect, in a possible implementation, the audio file includes a backing vocal stream audio file and an original vocal stream audio file;

[0026] The length of the audio file includes the length of the accompaniment stream audio file and the length of the original singer stream audio file, and the duration of the audio file includes the length of the accompaniment stream audio file and the length of the original singer stream audio file;

[0027] The step of determining the first predicted position by calculating a difference between the length of the audio file and a product of the first network speed and the duration of the audio file includes:

[0028] Determine the second predicted position by the difference between the length of the accompaniment stream audio file and the product of the first network speed and the duration of the accompaniment stream audio file;

[0029] Determine the third predicted position by calculating the difference between the length of the original singing stream audio file and the product of the first network speed and the duration of the original singing stream audio file;

[0030] If the second predicted position is less than or equal to the third predicted position, determining the third predicted position as the first predicted position;

[0031] If the second predicted position is greater than the third predicted position, the second predicted position is determined as the first predicted position.

[0032] In combination with the first aspect, in a possible implementation, the method also includes: if the first network speed is greater than the playback speed, after loading the header file of the audio file, downloading other audio data of the audio file except the header file and starting the playback engine in parallel to play the other audio data and starting the recording engine to record the user's singing data based on the other audio data played.

[0033] In a second aspect, an embodiment of the present application provides an audio data loading device, the audio data loading device comprising:

[0034] A first acquisition module is used to acquire a first network speed related to loading of an audio file and a playback speed of the audio file;

[0035] a determination module, configured to determine first audio data based on the length of the audio file, the first network speed, and the duration of the audio file when the first network speed is less than or equal to the playback speed, the first audio data being all or part of the audio data in the audio file;

[0036] A loading module, configured to load the first audio data;

[0037] The startup module is used to start the playback engine to play the first audio data after the first audio data is loaded, and to start the recording engine to record the user's singing data based on the played first audio data, and output the recording page.

[0038] In combination with the second aspect, in a possible implementation, the device also includes: a second acquisition module, used to obtain multiple dimensional information, the multiple dimensional information including the average residence time of the first page, the second network speed, and the historical secondary buffering confidence, the first page is the page before the recording page, and the second network speed is the network speed collected by the global racing module; a classification module, used to input the multiple dimensional information into a classifier for classification, and the classifier is used to process the multiple dimensional information and output a classification result; the above-mentioned first acquisition module is specifically used to obtain the first network speed related to the loading of the audio file and obtain the playback speed of the audio file when the classification result output by the classifier is the first loading mode.

[0039] In combination with the second aspect, in a possible implementation method, the above-mentioned loading module is specifically used to load all the audio data in the audio file when the classification result output by the classifier is the second loading method; the above-mentioned starting module is used to start the playback engine to play all the audio data after all the audio data in the audio file is loaded, and to start the recording engine to record the user's singing data based on all the audio data played.

[0040] In combination with the second aspect, in a possible implementation, the above-mentioned loading module is used to load the header file of the audio file in response to a download instruction for the audio file; the device also includes a parsing module for parsing the header file to obtain the playback speed of the audio file.

[0041] In conjunction with the second aspect, in one possible implementation, the first acquisition module includes an acquisition unit, a first determination unit, and a weighted processing unit. The acquisition unit is configured to acquire a third network speed and a fourth network speed, where the third network speed is the network speed collected by the global racing module and the fourth network speed is the download speed of the header file; the first determination unit is configured to determine the fourth network speed as the first network speed when the absolute difference between the third network speed and the fourth network speed is less than or equal to a first threshold; and the weighted processing unit is configured to perform weighted processing on the third network speed and the fourth network speed to obtain the first network speed when the absolute difference between the third network speed and the fourth network speed is greater than a second threshold.

[0042] In combination with the second aspect, in one possible implementation, the above-mentioned determination module includes: a second determination unit, used to determine the difference between the length of the audio file and the product obtained by multiplying the first network speed by the duration of the audio file as the first predicted position; and a third determination unit, used to determine the audio data in the audio file from the first audio frame of the audio file to the first predicted position as the first audio data.

[0043] In conjunction with the second aspect, in one possible implementation, the audio file includes a backing vocals stream audio file and an original vocals stream audio file, the length of the audio file includes the length of the backing vocals stream audio file and the length of the original vocals stream audio file, and the duration of the audio file includes the length of the backing vocals stream audio file and the length of the original vocals stream audio file. The second determining unit is specifically configured to:

[0044] The difference between the length of the accompaniment stream audio file and the product obtained by multiplying the first network speed by the duration of the accompaniment stream audio file is determined as the second prediction position; the difference between the length of the original singing stream audio file and the product obtained by multiplying the first network speed by the duration of the original singing stream audio file is determined as the third prediction position; if the second prediction position is less than or equal to the third prediction position, the third prediction position is determined as the first prediction position; if the second prediction position is greater than the third prediction position, the second prediction position is determined as the first prediction position.

[0045] In combination with the second aspect, in a possible implementation method, the above-mentioned startup module is also used to, when the first network speed is greater than the playback speed, download other audio data of the audio file except the header file after loading the header file of the audio file, and start the playback engine in parallel to play the other audio data and start the recording engine to record the user's singing data based on the other audio data played.

[0046] In a third aspect, an embodiment of the present application provides an electronic device comprising: a processor, a memory, and a network interface; the processor is connected to the memory and the network interface, wherein the network interface is used to provide network communication functions, the memory is used to store program code, and the processor is used to call the program code to execute the audio data loading method as described in the first aspect above.

[0047] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program, and the computer program includes program instructions. When the program instructions are executed by a processor, the audio data loading method in the first aspect described above is executed.

[0048] The embodiment of the present application obtains a first network speed related to the loading of an audio file and a playback speed of the audio file. If the first network speed is less than or equal to the playback speed, the first audio data to be loaded in the audio file is determined based on the length of the audio file, the first network speed, and the duration of the audio file. After loading the first audio data, the playback engine is started to play the first audio data and the recording engine is started to record the user's singing data based on the played first audio data, and a recording page is output. This can reduce the time spent on singing in a karaoke singing scene and reduce the probability of secondary buffering during the recording process, presenting a reliable and stable singing-in-second effect and improving the user experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0049] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. 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 any creative work.

[0050] Figure 1 This is a flowchart of the audio data loading method provided in an embodiment of the present application;

[0051] Figure 2 is a schematic diagram of the second predicted position and the third predicted position provided in an embodiment of the present application;

[0052] Figure 3 This is another flowchart of the audio data loading method provided in an embodiment of the present application;

[0053] Figure 4 Schematic diagram of a method for loading audio data in a karaoke scene provided by an embodiment of the present application;

[0054] Figure 5ASchematic diagram of the recording mode selection interface provided in an embodiment of the present application;

[0055] Figure 5B is a schematic diagram of a secondary buffer interface provided in an embodiment of the present application;

[0056] Figure 6 Schematic diagram of the structure of the audio data loading device provided in an embodiment of the present application;

[0057] Figure 7 It is a structural diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

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

[0059] In the description of this application, words such as "first" and "second" are used only to distinguish different objects and do not limit the quantity or execution order. Moreover, words such as "first" and "second" do not necessarily mean different. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product, or device that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units that are not listed, or may optionally include other steps or units inherent to the process, method, product, or device.

[0060] In this application, words such as "exemplary" or "for example" are used to indicate examples, illustrations, or descriptions. Any embodiment or design described in this application as "exemplary," "for example," or "for example" should not be construed as being preferred or advantageous over other embodiments or designs. Rather, the use of words such as "exemplary," "for example," or "for example" is intended to present the relevant concepts in a concrete way.

[0061] It should be understood that in this application, "when", "if" and "if" all mean that the device will perform corresponding processing under certain objective circumstances, and do not limit the time. It does not require that the device must perform a judgment action when it is implemented, nor does it mean that there are other limitations.

[0062] Elements used in the singular herein are intended to mean "one or more" rather than "one and only one" unless specifically stated otherwise.

[0063] To facilitate understanding, this application first briefly introduces some of the terms involved in this application. The "song request time" refers to the total time from the user's initial request to the actual singing of the song. The "first buffering time" refers to the time it takes for the streaming media to enter the playback state after downloading some data. The "secondary buffering" refers to the process of streaming media downloading data in real time and providing it to the player, and then buffering the data during playback if there is insufficient data.

[0064] In this application, "load" and "download" have the same meaning, that is, inputting programs, data, etc. from one computer system into another computer system, and the two can be used interchangeably.

[0065] The audio data loading method provided in the embodiment of the present application can be applied to the karaoke scene. Because the karaoke scene involves two processes, playback and recording, and these two processes can usually be executed in parallel, an extremely low secondary buffering rate is required in the karaoke scene. The embodiment of the present application obtains the current network speed of the terminal and calculates the playback speed of the audio file to be downloaded; if the current network speed of the terminal is less than or equal to the playback speed, the length of the audio data to be downloaded is calculated based on the length of the audio file, the current network speed and the duration of the audio file. After downloading this part of the audio data, the recording engine can be started for recording; if the current network speed of the terminal is greater than the playback speed, the recording engine can be started for recording after the header file of the audio file is loaded. Not only can the karaoke scene's song-ordering time be reduced to seconds, but it can also ensure extremely low secondary buffering behavior during the recording process, which can greatly improve the user's recording experience.

[0066] The technical solution provided in this application is described in detail below with reference to the accompanying drawings.

[0067] See also Figure 1 , Figure 1 This is a flow chart of the audio data loading method provided by the embodiment of the present application. Figure 1 As shown, the audio data loading method includes but is not limited to the following steps:

[0068] S101: The electronic device obtains a first network speed related to loading of an audio file, and obtains a playing speed of the audio file.

[0069] In some feasible implementations, when the electronic device receives a download instruction from the user for a certain audio file, such as an instruction triggered by the user clicking to record a certain song, in response to the download instruction, the header file of the audio file (that is, the audio file corresponding to this song) is loaded. The electronic device can collect the current network speed through the global racing module and determine the collected network speed as the first network speed. Alternatively, after the electronic device loads the header file of the audio file, it obtains the time used to load the header file (that is, the download time) and the length of the header file, and determines the quotient obtained by dividing the length of the header file by the time used to load the header file as the first network speed. For example, if the length of the header file is 200kb (kilobytes) and the time used to load the header file is 2s (seconds), then the first network speed is 200 / 2=100kb / s. Of course, if the quotient obtained by dividing the length of the header file by the time used to load the header file is not an integer, the value after rounding the quotient (or rounding, etc.) can also be used as the first network speed, and this embodiment of the application is not limited to this. It should be understood that the "first network speed" mentioned in the embodiment of the present application can also be understood as the predicted download speed (of the audio file).

[0070] Among them, the header file of the audio file includes the length information of the header file. After loading the header file of the audio file, the electronic device can parse the header file to obtain the length of the header file contained in the header file. Alternatively, the length of the header file of the audio file is a fixed value or a preset value, such as 200kb. Alternatively, when the electronic device loads the header file of the audio file, it records the length when the header file is loaded. It should be understood that the "length" mentioned in the embodiment of the present application can refer to size, and the unit is bit (bit), byte (byte), kilobyte (kb), etc.

[0071] After loading the header file of the audio file, the electronic device can also parse the header file of the audio file to obtain the length and duration of the audio file contained in the header file. Because audio files are usually played at a constant speed, the electronic device can divide the length of the audio file by the duration of the audio file to obtain the quotient as the playback speed of the audio file. Specifically, the playback speed of the audio file can be expressed as the following formula (1-1).

[0072] playerSpeed=fileLength / duration........................(1-1)

[0073] In the above formula (1-1), playerSpeed represents the playback speed of the audio file, fileLength represents the length of the audio file, and duration represents the duration of the audio file.

[0074] In some feasible embodiments, when an electronic device receives a user's download instruction for an audio file, it loads the header file of the audio file in response to the download instruction. The electronic device may collect the current network speed through a global speed-competition module and determine the collected network speed as a third network speed. After loading the header file of the audio file, the electronic device may obtain the time taken to load the header file and parse the header file to obtain the length of the header file contained in the header file. The electronic device divides the header file length by the time taken to load the header file (i.e., the download duration) to obtain the quotient as a fourth network speed. The electronic device may calculate the absolute difference between the third network speed and the fourth network speed. If the absolute difference between the third network speed and the fourth network speed is less than or equal to a first threshold, indicating that the third network speed is not much different from the fourth network speed, the fourth network speed is determined as the first network speed. This is because the network speed collected by the global speed-competition module is a global reference value for multiple applications currently running on the electronic device, that is, the total download speed of the multiple applications currently running; while the fourth network speed is calculated based on the length of the audio file header file and the download duration of the header file, and is closer to the download speed obtained for the audio file itself. For example, assuming the first threshold is 50 kb / s, when the absolute difference between the third network speed and the fourth network speed is less than or equal to 50 kb / s, the fourth network speed is determined as the first network speed.

[0075] If the absolute difference between the third network speed and the fourth network speed is greater than or equal to the second threshold, indicating that the third network speed and the fourth network speed differ significantly, the sum of the third network speed multiplied by the first weighting coefficient and the fourth network speed multiplied by the second weighting coefficient is determined as the first network speed. This is because when the third network speed and the fourth network speed differ significantly, it means that the download speed of the electronic device is mainly affected by the network environment, etc., so it is necessary to comprehensively consider the two network speeds to obtain a predicted network speed (download speed), namely the first network speed. For example, assuming that the second threshold is 300kb / s, the first weighting coefficient is 20%, and the second weighting coefficient is 80%. When the absolute difference between the third network speed and the fourth network speed is greater than or equal to 300kb / s, the sum of the third network speed multiplied by 20% and the fourth network speed multiplied by 80% is determined as the first network speed.

[0076] The first threshold value and the second threshold value may be the same or different.

[0077] It should be understood that the real-time network speed changes frequently and is affected by the current network environment, operator, content delivery network (CDN) deployment, background download module, etc. If the first network speed is not accurate enough, secondary buffering may occur during the recording process, or the time consumption of singing on demand may be increased, so the accuracy of the first network speed is very critical. Therefore, in the embodiment of the present application, when the absolute difference between the third network speed and the fourth network speed is less than or equal to the first threshold, the fourth network speed is directly used as the first network speed; when the absolute difference between the third network speed and the fourth network speed is greater than or equal to the second threshold, the third network speed and the fourth network speed are comprehensively considered and the weighted value is used as the first network speed. This can more accurately predict the network speed of the subsequent loading of the audio file, thereby reducing the deviation in the subsequent calculation, such as improving the accuracy of the subsequent prediction of the secondary buffer position.

[0078] S102: If the first network speed is less than or equal to the playback speed, the electronic device determines first audio data to be loaded in the audio file according to the length of the audio file, the first network speed, and the duration of the audio file, and loads the first audio data.

[0079] In some feasible implementations, when the above-mentioned first network speed is less than or equal to the above-mentioned playback speed, it means that the speed of loading the above-mentioned audio file during the playback process is slower than the playback speed of the above-mentioned audio file, and secondary buffering may occur. Therefore, the electronic device can determine the difference between the length of the audio file and the product obtained by multiplying the first network speed by the duration of the audio file as the first predicted position. Specifically, the first predicted position can be calculated by the following formula (1-2). Here, the first predicted position can be understood as the position where the audio file may be sent for secondary buffering. It should be understood that the "position" mentioned in the embodiment of the present application is not a physical / geographical location, but refers to a time node in the audio file.

[0080] expectDownloadPos=length-(downspeed*duration)............(1-2)

[0081] Wherein, expectDownloadPos represents the first predicted position, that is, the position where secondary buffering may occur in the audio file, length represents the length of the audio file, downspeed represents the first network speed, that is, the predicted download speed of the audio file, and duration represents the duration of the audio file.

[0082] The electronic device may determine the audio data in the audio file from the first audio frame of the audio file to the first predicted position as the first audio data. Alternatively, the electronic device may determine the audio data in the audio file from the first audio frame of the audio file to any position greater than the first predicted position as the first audio data. The electronic device may then load the first audio data.

[0083] It should be understood that in order to minimize latency, the first audio data in the embodiment of the present application may be audio data starting from the first audio frame of the audio file to the first predicted position. Of course, the first audio data may also be audio data starting from the first audio frame of the audio file to any position greater than the first predicted position.

[0084] It can be seen that the embodiment of the present application calculates the first predicted position, that is, predicts the position in the audio file where secondary buffering may occur, and loads the audio file from the beginning to the first predicted position in advance (before starting the recording engine and the playback engine). This can reduce the probability of secondary buffering during playback and improve the confidence of secondary buffering, thereby improving the user experience in the recording and singing scenario.

[0085] In some feasible implementations, the above-mentioned audio file may include one or more audio files. Specifically, the above-mentioned audio file may include a backing vocal stream audio file and an original vocal stream audio file. Accordingly, the length of the audio file includes the length of the backing vocal stream audio file and the length of the original vocal stream audio file, and the duration of the audio file includes the duration of the backing vocal stream audio file and the duration of the original vocal stream audio file. Similarly, the electronic device may determine the difference between the length of the backing vocal stream audio file and the product obtained by multiplying the first network speed by the duration of the backing vocal stream audio file as the second predicted position. The electronic device may also determine the difference between the length of the original vocal stream audio file and the product obtained by multiplying the first network speed by the duration of the original vocal stream audio file as the third predicted position. If the second predicted position is less than or equal to the third predicted position, it means that the time required to load the audio data from the first audio frame of the original vocal stream audio file to the third predicted position is longer than the time required to load the audio data from the first audio frame of the backing vocal stream audio file to the second predicted position, and the electronic device then determines the third predicted position as the first predicted position. If the second predicted position is greater than the third predicted position, it means that the time required to load the audio data from the first audio frame of the accompaniment stream audio file to the second predicted position is longer than the time required to load the audio data from the first audio frame of the original song stream audio file to the third predicted position. Then the electronic device determines the second predicted position as the first predicted position.

[0086] The embodiment of the present application uses the longer predicted position in the original singer stream audio file and the accompaniment stream audio file as the final predicted position where secondary buffering may occur, and loads this part of the audio data in advance. This can reduce the probability of secondary buffering occurring during the playback of the original singer stream and the accompaniment stream, improve the confidence of secondary buffering, and thus improve the user experience in the recording scenario.

[0087] For example, see Figure 2 , Figure 2 Schematic diagram of the second predicted position and the third predicted position provided in the embodiment of the present application. Figure 2 As shown, assuming that the second predicted position of the accompaniment stream audio file is 12s and the third predicted position of the original singer stream audio file is 10s, if the second predicted position is greater than the third predicted position, the second predicted position is determined as the first predicted position, that is, the first predicted position is 12s, and the first audio data includes the audio data of the accompaniment stream audio file from 0s to 12s and the audio data of the original singer stream audio file from 0s to 12s. The electronic device loads the audio data of the accompaniment stream audio file from 0s to 12s and the audio data of the original singer stream audio file from 0s to 12s respectively.

[0088] S103, after the first audio data is loaded, the electronic device plays the first audio data based on the recording interface and records the user's singing data.

[0089] In some feasible implementations, after the electronic device has loaded the above-mentioned first audio data, the electronic device can start the recording engine to record the singing data of the first audio data, and can also start the playback engine to play the first audio data at the same time / in parallel. Alternatively, after the electronic device has loaded the above-mentioned first audio data, when the electronic device receives a recording instruction triggered by the user, it starts the recording engine to record and starts the playback engine to play. It should be noted that before or at the same time as the first audio data is played, a recording interface can be displayed. Playing the first audio data based on the recording interface means that while the playback engine is used to play the first audio data, the recording interface can synchronously display relevant information of the first audio data, such as lyrics information, song sound effect information, etc. Recording singing data based on the recording interface means that while the recording engine is used to record singing data, the recording interface can synchronously display information related to the recording situation, such as recording progress, recording effects, etc.

[0090] The electronic device may load the first audio data in a manner including but not limited to: loading the first audio data using a network speed channel that supports multiple channels, resuming the transmission from a breakpoint, and transmitting the data in fragments.

[0091] Optionally, after the electronic device starts the recording engine to record, it can concurrently download other audio data in the above audio file except the first audio data in the background. In other words, the electronic device can concurrently download the remaining audio data in the background during the recording and playback process.

[0092] In the embodiment of the present application, the electronic device does not need to download the entire audio file. Instead, it only needs to download a very small amount of audio data (i.e., the first audio data) to allow the user to start recording a song. The remaining audio data is downloaded concurrently in the background at high speed by fully utilizing the interaction time between pages and the time to play the previously downloaded audio data. This can reduce the time consumed in karaoke scenes, thereby achieving the effect of singing in seconds and improving the user's recording experience. In addition, by predicting the location where secondary buffering may occur during the recording process, a portion of the data (i.e., the first audio data) is loaded in advance (before starting the recording process), which can reduce the probability of secondary buffering during the recording process.

[0093] See also Figure 3 , Figure 3 This is another flowchart of the audio data loading method provided in the embodiment of the present application. Figure 3 As shown, the audio data loading method includes but is not limited to the following steps:

[0094] S301, the electronic device obtains multiple dimensional information, which includes the average stay time of the first page, the second network speed, and the historical secondary buffering confidence. The first page is the page before the recording page, and the second network speed is the network speed collected by the global racing module.

[0095] S302: The electronic device inputs the multiple dimensional information into a classifier for classification. The classifier is used to process the multiple dimensional information and output classification results.

[0096] In some feasible implementations, the user clicks on the audio file (or song) that he wants to record on the electronic device. At this time, the electronic device can obtain the average stay time of the user on the first page, the second network speed (or real-time network speed) currently collected by the global racing module, and the historical secondary buffering confidence in response to the click operation. The first page is the page before the recording page. In the embodiment of the present application, the first page is called the front page. For example, the first page is the selection page of the recording mode. The average stay time of the user on the first page here refers to the average stay time of the user on the front page several times in the past. The electronic device can input the average stay time, the second network speed, and the historical secondary buffering confidence into the classifier for processing to obtain the classification result output by the classifier. The historical secondary buffering confidence here is the probability of secondary buffering occurring when the electronic device meets the average stay time and the second network speed according to the historical records.

[0097] The classifier is a trained classification model that processes dimensional information and outputs classification results. This classifier uses a naive Bayesian model to perform binary classification on the input dimensional information and output the classification results. The average duration of stay can be a range, and the second network speed can also be a range.

[0098] In other words, the above steps S301 and S302 can also be described as follows: when the user clicks on a karaoke song, the classifier obtains a strategy conclusion based on the user's current dimensional information (stay duration interval x, real-time network speed interval y, historical secondary buffering confidence z), and determines whether to use the normal loading strategy or the streaming media loading strategy based on the strategy conclusion output by the classifier. If the streaming media loading strategy is used, the next stage is entered, such as executing the following step S304. If the normal loading strategy is used, the following step S303 is executed.

[0099] In some feasible implementations, during the training process, the electronic device may obtain a certain amount of sample data, such as the average dwell time of the front page and the real-time network speed (collected by the global speed competition module). The electronic device may divide the average dwell time of the front page and the real-time network speed into intervals to reduce the amount of sample data. Optionally, the length of the interval can be adjusted. For example, the average dwell time of the front page is divided into intervals of 1 second, and intervals such as (0-1s], (1s-2s], (2s-3s], (3s-4s], and (4s and above) are obtained. The real-time network speed is divided into intervals of 300 kb / s, and intervals such as (0-300 kb / s], (300 kb / s-600 kb / s], (600 kb / s-900 kb / s], (900 kb / s-1200 kb / s], (1200 kb / s-1500 kb / s], and (1500 kb / s and above) are obtained. The electronic device can obtain a training sample set, and the training sample set includes multiple training samples. A training sample includes An average dwell time (interval) of the front page, a real-time network speed (interval), and a historical secondary buffer confidence. It should be understood that the initial value of the historical secondary buffer confidence is 0. The electronic device uses the training samples in the training sample set to train the naive Bayes model to obtain a trained classifier. Among them, the electronic device will update the local historical secondary buffer confidence after each training sample is trained, and the updated historical secondary buffer confidence can be used as the historical secondary buffer confidence in the next training sample. For example, the historical secondary buffer confidence is 1 / 2. If no secondary buffering occurs during a sample training process, the historical secondary buffer confidence will be updated to 1 / 3.

[0100] S303, if the classification result output by the classifier is the second loading method, the electronic device loads all the audio data in the audio file. After all the audio data in the audio file are loaded, the playback engine is started to play all the audio data and the recording engine is started to record the user's singing data based on all the played audio data.

[0101] In some feasible implementations, if the classification result output by the above-mentioned classifier is the second loading mode (i.e., the normal loading mode), the electronic device can directly load all the audio data in the audio file, and after all the audio data in the audio file is loaded, start the playback engine to play all the audio data and start the recording engine to record the user's singing data based on all the audio data played.

[0102] S304: If the classification result output by the classifier is the first loading mode (ie, streaming media loading mode), the electronic device obtains a first network speed related to the loading of the audio file and obtains a playback speed of the audio file.

[0103] S305: If the first network speed is less than or equal to the playback speed, the electronic device determines first audio data to be loaded in the audio file according to the length of the audio file, the first network speed, and the duration of the audio file, and loads the first audio data.

[0104] S306, after the first audio data is loaded, the electronic device starts the playback engine to play the first audio data and starts the recording engine to record the user's singing data based on the played first audio data, and outputs the recording page.

[0105] In some feasible implementations, the implementation of steps S304 to S306 in the embodiment of the present application can refer to the aforementioned Figure 1 The implementation of steps S101 to S103 will not be described in detail here.

[0106] In some feasible implementations, since the network speed changes frequently and is affected by the network environment, operator, CDN deployment, other background download modules, etc. at the time, secondary buffering may still occur even if the first audio data has been loaded in advance. Therefore, if the electronic device detects that secondary buffering occurs during the recording process or the playback process, the electronic device can pause the recording engine and the playback engine, and output a buffering interface to remind the user to wait for the audio file to be loaded. When the audio file is loaded to a certain position (for example, from the current position (here is the position where secondary buffering occurs) to a certain length of time (such as 15s or 10s, etc.)), the electronic device can restore the recording engine and the playback engine to continue recording and playing. It should be understood that if no secondary buffering occurs during the recording process or the playback process, the recording and singing will continue.

[0107] In some feasible implementations, when the electronic device has loaded the first audio data, if secondary buffering still occurs during the recording process or the playback process, the electronic device can determine the probability of secondary buffering as the secondary buffering confidence. For example, if 0.5% of users still experience secondary buffering when playing the audio file after loading the first audio data, then the secondary buffering confidence is 99.5%. Because the first network speed will affect the position where secondary buffering may occur in the audio file (i.e., the first predicted position mentioned above), and the first network speed is determined based on the aforementioned third network speed and the aforementioned fourth network speed. Therefore, when the secondary buffering confidence drops to a certain threshold, the electronic device adjusts the value of the first network speed by adjusting the weights of the third network speed and the fourth network speed (i.e., the weighting coefficient), thereby improving the secondary buffering confidence, that is, reducing the probability of secondary buffering during the recording process or the playback process.

[0108] S307, if the first network speed is greater than the playback speed, the electronic device downloads the other audio data of the audio file except the header file after loading the header file of the audio file, and starts the playback engine to play the other audio data and starts the recording engine to record the user's singing data based on the other audio data played in parallel.

[0109] In some feasible implementations, if the above-mentioned first network speed (i.e., the predicted download speed) is greater than the above-mentioned playback speed, it means that the speed of loading the above-mentioned audio file during the playback process is faster than the playback speed of the above-mentioned audio file, and no secondary buffering behavior will occur. Therefore, the electronic device can download the other audio data of the audio file except the header file after loading the header file of the audio file, and start the playback engine in parallel to play the other audio data and start the recording engine to record the user's singing data based on the other audio data played, and can also output the recording page in parallel / simultaneously. It should be understood that after the electronic device starts the recording engine for recording, it can concurrently download the audio data that has not been downloaded in the above-mentioned audio file in the background. That is to say, the electronic device can concurrently download the remaining audio data in the background during the recording and playback process.

[0110] Optionally, when the first network speed (i.e., the predicted download speed) is equal to the playback speed, the recording engine can be started directly after loading the header file of the audio file; or the first audio data to be loaded in the audio file can be determined based on the length of the audio file, the first network speed, and the duration of the audio file, and the first audio data can be loaded. After the first audio data is loaded, the recording engine can be started for recording. Specifically, when the first network speed (i.e., the predicted download speed) is equal to the playback speed, the operation performed by the electronic device can be determined according to the actual situation.

[0111] It can be seen that in the embodiment of the present application, when the download speed (i.e., the first network speed) is greater than the playback speed, after loading the header file of the above-mentioned audio file, the recording engine is directly started for recording, which can quickly enter the recording link and reduce the time spent on singing in the K song scene.

[0112] Optionally, the electronic device may also start the recording engine for recording after loading the header file of the audio file and waiting to receive a recording instruction.

[0113] In an embodiment of the present application, the electronic device reduces the probability of secondary buffering in the karaoke scenario by referring to the length of time the user stays on the front page, accurately evaluating the real-time network speed, historical secondary buffering confidence, and online adjusting relevant parameters (such as secondary buffering confidence) based on statistical data. By balancing the ratio of loading time and secondary buffering, the karaoke scenario can also apply the characteristics of real-time streaming media transmission, thereby reducing the time consumption of ordering songs in the karaoke scenario, reducing the probability of secondary buffering during the recording process, presenting a reliable and stable singing effect in seconds, and improving the user experience.

[0114] To better understand the technical solution provided by the embodiment of the present application, the audio data loading method provided by the embodiment of the present application is illustrated below by an example.

[0115] In one example, the audio data loading method provided in the embodiment of the present application is applied in a karaoke scene. Figure 4 , Figure 4 Schematic diagram of the method for loading audio data in a karaoke scene provided by an embodiment of the present application. Figure 4 As shown, the user selects the audio file that he wants to record on the electronic device, clicks the karaoke control (such as the karaoke button, karaoke icon, etc.), and the electronic device enters the Figure 5A The recording mode selection interface shown (i.e. the first page mentioned above). Figure 5A As shown, Figure 5A This is a schematic diagram of the recording mode selection interface provided in an embodiment of the present application. Figure 5A The recording mode selection interface includes but is not limited to one or more of the following: return control 401, audio file 402, practice singing mode 403, lyrics part 404, audio and video switching control 405, start solo control 406, chorus mode 407, solo mode 408, and fragment singing mode 409. It should be understood that Figure 5A This is just an example. In actual implementation, the recording mode selection interface may include more content than Figure 5A The content shown can also be less than Figure 5A The content shown in this application does not limit the specific implementation of the recording mode selection interface.

[0116] On the other hand, the electronic device obtains the user's dimensional information (such as the average duration of the previous several visits to the front page (i.e., the recording mode selection interface), the real-time network speed, the confidence level of the previous secondary buffering, etc.), and inputs the dimensional information into the strategy generation module (i.e., the classifier) for strategy judgment. If the strategy conclusion output by the strategy generation module is normal loading (i.e., the second loading method), the electronic device can directly load all the audio data in the audio file selected by the user, and after all the audio data in the audio file is loaded, start the recording engine to record. If the strategy conclusion output by the strategy generation module is a stream (media) loading strategy (i.e., the first loading method), the electronic device begins loading the accompaniment stream audio file and the original singer stream audio file, and simultaneously parses the header file of the accompaniment stream audio file and the header file of the original singer stream audio file. If the header file parsing fails, the electronic device reloads the accompaniment stream audio file and the original singer stream audio file. If the header file parsing is successful, the duration of the accompaniment stream audio file, the length of the accompaniment stream audio file, the length of the original singer stream audio file, and the duration of the original singer stream audio file can be obtained. When the header file is parsed successfully, the electronic device determines whether the audio file is loaded into the predicted secondary buffer position (i.e., the first predicted position). If loaded into the predicted secondary buffer position, the electronic device starts the recording engine to record the song and starts the playback engine to play the accompaniment synchronously.

[0117] If secondary buffering occurs during recording, it means that a secondary buffering event has occurred. The electronic device calls the interface to output the following: Figure 5B The secondary buffering interface shown in the figure pauses the recording engine and the playback engine at the same time to wait for the download data to be ready, and prompts the user to wait for the audio data of the audio file to be loaded. After the download is completed, the recording engine and the playback engine are restored to their working state and the recording continues. Figure 5B As shown, Figure 5B It is a schematic diagram of the secondary buffer interface provided in an embodiment of the present application. Figure 5B The secondary buffering interface includes, but is not limited to, one or more of the following: progress percentage 502, progress bar 503, loading text control 504, loading icon 501, etc. The progress percentage 502 and progress bar 503 are used to display the progress of loading the audio file, while the loading text control 504 and loading icon 501 prompt the user that the audio file is loading. Of course, if secondary buffering does not occur during the recording process, karaoke continues normally.

[0118] In this way, the time spent on ordering songs in the karaoke scene can be reduced, the probability of secondary buffering during the recording process can be reduced, and the effect of singing in seconds can be achieved.

[0119] See also Figure 6 , Figure 6Schematic diagram of the structure of the audio data loading device provided in the embodiment of the present application. Figure 6 As shown, the audio data loading device includes:

[0120] A first acquisition module 11 is used to acquire a first network speed related to loading of an audio file and a playback speed of the audio file;

[0121] a determination module 12 for determining first audio data based on the length of the audio file, the first network speed, and the duration of the audio file when the first network speed is less than or equal to the playback speed, the first audio data being all or part of the audio data in the audio file;

[0122] A loading module 13, configured to load the first audio data;

[0123] The startup module 14 is used to start the playback engine to play the first audio data after the first audio data is loaded, and to start the recording engine to record the user's singing data based on the played first audio data, and output the recording page.

[0124] In some feasible implementations, the device further includes a second acquisition module 15 and a classification module 16. The second acquisition module 15 is configured to acquire multiple dimensional information, including the average dwell time of a first page, a second network speed, and a historical secondary buffering confidence, where the first page is the page before the recording page, and the second network speed is the network speed collected by the global racing module; the classification module 16 is configured to input the multiple dimensional information into a classifier for classification, and the classifier is configured to process the multiple dimensional information and output a classification result; the first acquisition module 11 is specifically configured to, when the classification result output by the classifier is the first loading mode, acquire the first network speed related to the loading of the audio file and acquire the playback speed of the audio file.

[0125] In some feasible implementations, the above-mentioned loading module 13 is also used to load all the audio data in the audio file when the classification result output by the classifier is the second loading mode; the above-mentioned starting module 14 is used to start the playback engine to play all the audio data after all the audio data in the audio file is loaded, and to start the recording engine to record the user's singing data based on all the audio data played.

[0126] In some feasible implementations, the device further includes a parsing module 17. The loading module 13 is configured to load a header file of the audio file in response to a download instruction for the audio file; the parsing module 17 is configured to parse the header file to obtain a playback speed of the audio file.

[0127] In some feasible implementations, the first acquisition module 11 includes an acquisition unit 111, a first determination unit 112, and a weighted processing unit 113. The acquisition unit 111 is configured to acquire a third network speed and a fourth network speed, where the third network speed is the network speed collected by the global speed racing module and the fourth network speed is the download speed of the header file; the first determination unit 112 is configured to determine the fourth network speed as the first network speed when the absolute difference between the third network speed and the fourth network speed is less than or equal to a first threshold; and the weighted processing unit 113 is configured to perform weighted processing on the third network speed and the fourth network speed to obtain the first network speed when the absolute difference between the third network speed and the fourth network speed is greater than a second threshold.

[0128] In some feasible implementations, the determination module 12 includes a second determination unit 121 and a third determination unit 122. The second determination unit 121 is configured to determine a difference between the length of the audio file and a product of the first network speed and the duration of the audio file as the first predicted position; and the third determination unit 122 is configured to determine audio data in the audio file from the first audio frame of the audio file to the first predicted position as the first audio data.

[0129] In some feasible implementations, the audio file includes a backing vocals stream audio file and an original vocals stream audio file, the length of the audio file includes the length of the backing vocals stream audio file and the length of the original vocals stream audio file, and the duration of the audio file includes the length of the backing vocals stream audio file and the length of the original vocals stream audio file. The second determining unit 121 is specifically configured to:

[0130] The difference between the length of the accompaniment stream audio file and the product obtained by multiplying the first network speed by the duration of the accompaniment stream audio file is determined as the second prediction position; the difference between the length of the original singing stream audio file and the product obtained by multiplying the first network speed by the duration of the original singing stream audio file is determined as the third prediction position; if the second prediction position is less than or equal to the third prediction position, the third prediction position is determined as the first prediction position; if the second prediction position is greater than the third prediction position, the second prediction position is determined as the first prediction position.

[0131] In some feasible implementations, the above-mentioned startup module 14 is also used to, when the first network speed is greater than the playback speed, download other audio data of the audio file except the header file after loading the header file of the audio file, and in parallel start the playback engine to play the other audio data and start the recording engine to record the user's singing data based on the other audio data played.

[0132] The first acquisition module 11, the determination module 12, the loading module 13, the startup module 14, the second acquisition module 15, the classification module 16, and / or the analysis module 17 may be one module, such as a processing module.

[0133] In a specific implementation, the above-mentioned audio data loading device can execute the above-mentioned Figure 1 、 Figure 3 or Figure 4 The implementation methods provided in each step of the implementation method provided realize the functions implemented in the above embodiments. For details, please refer to the above Figure 1 or Figure 3 The corresponding descriptions provided for each step in the method embodiment shown are not repeated here.

[0134] The audio data loading device of the embodiment of the present application obtains a first network speed related to the loading of the audio file and a playback speed of the audio file. If the first network speed is less than or equal to the playback speed, the first predicted position is determined according to the length of the audio file, the first network speed, and the duration of the audio file. The audio data from the first audio frame to the first predicted position in the audio file is determined as the first audio data, and then the first audio data is loaded. After the first audio data is loaded, the electronic device starts the playback engine to play the first audio data and starts the recording engine to record the user's singing data based on the played first audio data, and outputs the recording page. This can reduce the time consumption of singing in the karaoke scene, and at the same time reduce the probability of secondary buffering in the recording scene, presenting a reliable and stable singing effect in seconds, and improving the user experience.

[0135] See also Figure 7 , Figure 7 Schematic diagram of the structure of the electronic device provided in the embodiment of the present application. Figure 7 As shown, the electronic device 1000 in the embodiment of the present application may include: a processor 1001, a memory 1003. In addition, the image data processing device 1000 may also include at least one communication bus 1002. The communication bus 1002 is used to realize the connection and communication between these components. The memory 1003 may be a high-speed RAM memory or a non-volatile memory, such as at least one disk memory. The memory 1003 may optionally be at least one storage device located away from the aforementioned processor 1001. Figure 7 As shown, the memory 1003 as a computer-readable storage medium may include an operating system, a network communication module, a user interface module, and a device control application.

[0136] exist Figure 7 In the electronic device 1000 shown, the processor 1001 can be used to call the device control application stored in the memory 1003 to implement:

[0137] Obtain a first network speed associated with loading an audio file, and obtain a playback speed of the audio file;

[0138] If the first network speed is less than or equal to the playback speed, determining first audio data to be loaded from the audio file according to the length of the audio file, the first network speed, and the duration of the audio file, and loading the first audio data, where the first audio data is all or part of the audio data in the audio file;

[0139] After the first audio data is loaded, the playback engine is started to play the first audio data and the recording engine is started to record the user's singing data based on the played first audio data, and output the recording page.

[0140] It should be understood that the processor 1001 in the embodiment of the present application may be a central processing unit (CPU), and the processor may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.

[0141] The memory 1003 may include a read-only memory and a random access memory, and provides instructions and data to the processor 1001. A portion of the memory 1003 may also include a non-volatile random access memory. For example, the memory 1003 may also store device type information.

[0142] In a specific implementation, the electronic device 1000 described in the embodiment of the present application may execute the above Figure 1 ,or Figure 3 or Figure 4 The description of the audio data loading method in the corresponding embodiment can also be performed as described above. Figure 6 The description of the audio data loading device in the corresponding embodiment will not be repeated here. In addition, the description of the beneficial effects of adopting the same method will not be repeated here either.

[0143] In addition, it should be noted that: the embodiment of the present application further provides a computer-readable storage medium, and the computer-readable storage medium stores a computer program executed by the electronic device 1000 mentioned above, and the computer program includes program instructions. When the processor executes the program instructions, it can execute the above-mentioned Figure 1 ,or Figure 3 or Figure 4 The description of the audio data loading method in the corresponding embodiment can also be performed as described above. Figure 6 The description of the audio data loading device in the corresponding embodiment will not be repeated here. In addition, the description of the beneficial effects of adopting the same method will not be repeated here. For technical details not disclosed in the computer-readable storage medium embodiment involved in this application, please refer to the description of the method embodiment of this application.

[0144] Those skilled in the art will appreciate that all or part of the processes in the above-described method embodiments can be implemented by instructing related hardware through a computer program. The program can be stored in a computer-readable storage medium, and when executed, the program can include the processes in the above-described method embodiments. The storage medium can be a magnetic disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM).

[0145] The above description is merely a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in the present application, and such modifications or substitutions should be included in the scope of protection of the present application. Therefore, the scope of protection of the present application should be based on the scope of protection of the claims.

Claims

1. A method for loading audio data, characterized in that: include: Obtaining a first network speed associated with loading an audio file, and obtaining a playback speed of the audio file; If the first network speed is less than or equal to the playback speed, determining first audio data to be loaded in the audio file according to the length of the audio file, the first network speed, and the duration of the audio file, and loading the first audio data, wherein the first audio data is all or part of the audio data in the audio file. Determining the first audio data to be loaded in the audio file according to the length of the audio file, the first network speed, and the duration of the audio file includes: determining a difference between the length of the audio file and a product obtained by multiplying the first network speed by the duration of the audio file as a first predicted position; and determining audio data in the audio file from a first audio frame of the audio file to the first predicted position as the first audio data; After the first audio data is loaded, the first audio data is played based on the recording interface and the user's singing data is recorded.

2. The method according to claim 1, characterized in that Before obtaining the first network speed related to the loading of the audio file and obtaining the playback speed of the audio file, the method further includes: Acquiring multiple dimensional information, the multiple dimensional information including an average dwell time of a first page, a second network speed, and a historical secondary buffering confidence, wherein the first page is a page before the recording page, and the second network speed is a network speed collected by a global racing module; Inputting the multiple dimensional information into a classifier for classification, the classifier being used to process the multiple dimensional information and output classification results; If the classification result output by the classifier is the first loading mode, the steps of obtaining a first network speed related to the loading of the audio file and obtaining a playing speed of the audio file are performed.

3. The method according to claim 2, characterized in that The method further comprises: If the classification result output by the classifier is the second loading method, all the audio data in the audio file are loaded. After all the audio data in the audio file are loaded, all the audio data are played based on the recording interface and the user's singing data is recorded.

4. The method according to claim 1, wherein The obtaining the playback speed of the audio file includes: In response to a download instruction for the audio file, loading a header file of the audio file; The header file is parsed to obtain the playing speed of the audio file.

5. The method according to claim 1, wherein The obtaining of a first network speed related to loading of the audio file includes: Obtain a third network speed and a fourth network speed, wherein the third network speed is the network speed collected by the global speed racing module, and the fourth network speed is the download speed of the header file; If the absolute difference between the third network speed and the fourth network speed is less than or equal to a first threshold, determining the fourth network speed as the first network speed; If the absolute difference between the third network speed and the fourth network speed is greater than a second threshold, weighted processing is performed on the third network speed and the fourth network speed to obtain the first network speed.

6. The method according to claim 1, characterized in that The audio files include a backing vocals stream audio file and an original vocals stream audio file; The length of the audio file includes the length of the accompaniment stream audio file and the length of the original singing stream audio file, and the duration of the audio file includes the length of the accompaniment stream audio file and the length of the original singing stream audio file; Determining the first predicted position by the difference between the length of the audio file and the product of the first network speed multiplied by the duration of the audio file includes: Determine the second predicted position by the difference between the length of the accompaniment stream audio file and the product of the first network speed multiplied by the duration of the accompaniment stream audio file; Determine a third predicted position by calculating a difference between a length of the original singing stream audio file and a product of the first network speed and a duration of the original singing stream audio file; If the second predicted position is less than or equal to the third predicted position, determining the third predicted position as the first predicted position; If the second predicted position is greater than the third predicted position, the second predicted position is determined as the first predicted position.

7. The method according to any one of claims 1 to 4, characterized in that The method further comprises: If the first network speed is greater than the playback speed, after loading the header file of the audio file, other audio data of the audio file except the header file is downloaded and the other audio data is played in parallel based on the recording interface and the user's singing data is recorded.

8. An electronic device, characterized in that: include: processor, memory, and network interface; The processor is connected to the memory and the network interface, wherein the network interface is used to provide a network communication function, the memory is used to store program code, and the processor is used to call the program code to execute the method according to any one of claims 1 to 7.

9. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, wherein the computer program includes program instructions. When the program instructions are executed by a processor, the method according to any one of claims 1 to 7 is executed.

Citation Information

Patent Citations

  • Online multimedia file downloading method and device, and electronic device

    CN109067916A

  • Playing resource downloading method and device, equipment, storage medium and program product

    CN113395549A