Human voice audio storage method and device and storage medium
By estimating the amount of audio of the person to be recorded on the terminal and determining the storage location based on the available storage space, the problem of song recording failure caused by insufficient storage space when recording songs on mobile phones is solved, and a more stable song recording process is achieved.
Patent Information
- Application Number
- CN202510004750.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-02
- Publication Date
- 2025-05-13
AI Technical Summary
When recording songs on your mobile phone, how to reasonably store the audio of people to avoid the problem of failed recording songs.
By estimating the amount of data of the target song to be recorded, and combining the terminal's memory and the available storage space of the hard disk, it determines whether the storage location of the human voice audio is a hard disk or memory.
It effectively avoids song recording failure caused by insufficient memory or hard disk storage space, and improves the stability and efficiency of song recording.
Smart Images

Figure CN119987659A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of audio technology, and in particular to a method, device and storage medium for human voice audio. Background Art
[0002] As people's spare time becomes richer, recording songs with mobile phones has become a popular form of entertainment. When using a mobile phone to record songs, the mobile phone collects the user's vocal audio through a microphone, stores the vocal audio, and then performs subsequent processing on the vocal audio.
[0003] However, how to properly store human voice audio has become a problem that needs to be solved urgently. Summary of the invention
[0004] The embodiment of the present application provides a method, device and storage medium for storing human voice audio, which can adaptively store human voice audio according to the device conditions. The technical solution is as follows:
[0005] In a first aspect, a method for storing human voice audio is provided, the method comprising:
[0006] Obtain an estimated amount of vocal audio data to be recorded for a target song;
[0007] Acquire device information of the terminal, the device information including available storage space size of the memory and available storage space size of the hard disk;
[0008] If the device information meets the hard disk storage condition, the human voice audio collected during the recording of the target song is stored in the hard disk of the terminal;
[0009] If the device information meets the memory storage condition, the vocal audio collected during the recording of the target song is stored in the memory of the terminal.
[0010] In a second aspect, a device for storing human voice audio is provided, the device comprising:
[0011] An acquisition module, used to acquire an estimated data volume of the vocal audio to be recorded of the target song;
[0012] Acquire device information of the terminal, the device information including available storage space size of the memory and available storage space size of the hard disk;
[0013] A storage module, configured to store the vocal audio collected during the recording of the target song to the hard disk of the terminal if the device information meets the hard disk storage condition;
[0014] If the device information meets the memory storage condition, the vocal audio collected during the recording of the target song is stored in the memory of the terminal.
[0015] According to a third aspect, a computing device is provided, comprising a processor and a memory, wherein the memory stores at least one instruction, and the instruction is loaded and executed by the processor to implement the operations performed by the method for storing human voice audio as described in the first aspect and any possible implementation of the first aspect.
[0016] In a fourth aspect, a computer-readable storage medium is provided, wherein at least one instruction is stored in the storage medium, and the instruction is loaded and executed by a processor to implement the operations performed by the method for storing human voice audio as described in the first aspect and any possible implementation of the first aspect.
[0017] In a fifth aspect, a computer program product is provided, wherein at least one instruction is stored in the computer program product, and the instruction is loaded and executed by a processor to implement the operations performed by the method for storing human voice audio as described in the first aspect and any possible implementation of the first aspect.
[0018] The beneficial effects of the technical solution provided by this application are:
[0019] An embodiment of the present application provides a method for storing vocal audio. In the method, the terminal first estimates the data volume of the vocal audio to be recorded of the target song, and comprehensively determines whether the storage location of the vocal audio collected during the song recording is the hard disk or the memory, based on the available storage space size of the terminal's memory, the available storage space size of the hard disk, and the estimated data volume of the vocal audio to be recorded. In this way, the vocal audio is adaptively stored according to the device status of the terminal, which can effectively avoid the problem of song recording failure caused by insufficient memory or hard disk storage space. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0021] Figure 1 This is a flow chart of a method for storing human voice audio provided by an embodiment of the present application;
[0022] Figure 2 is a schematic diagram of an interface of a music application provided in an embodiment of the present application;
[0023] Figure 3is a schematic diagram of an interface of a music application provided in an embodiment of the present application;
[0024] Figure 4 is a schematic diagram of a memory mapping provided in an embodiment of the present application;
[0025] Figure 5 This is a flow chart of a method for storing human voice audio provided by an embodiment of the present application;
[0026] Figure 6 It is a schematic diagram of the structure of a device for storing human voice audio provided in an embodiment of the present application;
[0027] Figure 7 is a schematic diagram of the structure of a terminal provided in an embodiment of the present application;
[0028] Figure 8 It is a structural diagram of a server provided in an embodiment of the present application. DETAILED DESCRIPTION
[0029] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below with reference to the accompanying drawings.
[0030] An embodiment of the present application provides a method for generating drum audio, which can be implemented by a terminal, and the terminal can be a mobile phone, a tablet computer, a desktop computer, a laptop computer, etc.
[0031] The terminal may be installed with a music application, and the music application may have a song recording function. The user may start the song recording function to record the song. After the song recording starts, the terminal plays the accompaniment audio of the song, and the user sings. The terminal collects the vocal audio sung by the user and stores the vocal audio for subsequent synthesis, scoring and other processing. When storing the vocal audio, the vocal audio usually needs to occupy a large storage space. For example, under the conditions of dual channels, 16 sampling bits, and a sampling rate of 48000Hz, 10 minutes of vocal audio is collected, and the data volume is about 110MB. If the terminal's memory is directly used for storage, the storage space occupied by the music application in the memory may increase significantly. When the available storage space in the memory is insufficient, the system may force the end and exit the music application, causing the program to crash. If the terminal's hard disk is directly used for storage, since the read and write performance of the hard disk is worse than the read and write performance of the memory, when the processor performance is weak, the problem of recording jams may occur. In addition, when the available storage space of the hard disk is insufficient, the vocal audio cannot be stored, resulting in the problem of song recording failure.
[0032] In response to the above problems, an embodiment of the present application provides a method for storing vocal audio, in which the terminal first estimates the data volume of the vocal audio to be recorded of the target song, and combines the available storage space size of the terminal's memory, the available storage space size of the hard disk, and the estimated data volume of the vocal audio to be recorded, to comprehensively determine whether the storage location of the vocal audio collected during this recording process is the hard disk or the memory. In this way, the vocal audio is adaptively stored according to the device status of the terminal, which can effectively avoid the problem of song recording failure caused by insufficient memory or hard disk storage space. The method for storing vocal audio provided by this embodiment is described below.
[0033] See also Figure 1 The method for storing human voice audio provided by the embodiment of the present application may include the following steps:
[0034] Step 101: Obtain an estimated amount of data of the vocal audio to be recorded of the target song.
[0035] In implementation, the terminal may be installed with a music application, and a sing-along option is displayed on the main interface of the music application. After the user clicks the sing-along option, the music application displays a song selection interface. Figure 2 As shown, in the song recording interface, there may be a song list, and a song recording option is displayed for each song in the song list. The user can select the song recording option corresponding to the target song, and then the music application displays the song recording interface of the target song. Figure 3 As shown, the song recording interface displays the song title, singer, lyrics and other information of the target song, and may also display an option to start recording the song. After the user selects the option to start recording the song, the music application displays the singing interface and the user may start singing.
[0036] This step 101 can be executed after the terminal detects the selection operation of the song recording option corresponding to the target song, or it can be executed after the terminal detects the selection operation of the song recording start option. The embodiment of the present application does not limit this, and it only needs to be executed before storing the user's vocal audio.
[0037] The terminal can obtain the song duration of the target song, the sampling rate (samples) used to record the human voice audio, the sampling bit depth (bit) and the number of channels (channel). Among them, the song duration of the target song can be obtained from the server. The sampling rate, sampling bit depth and number of channels for recording human voice can be set by the user or configured by default by relevant personnel, and the embodiments of the present application do not limit this.
[0038] Then, the terminal calculates the estimated data volume of the human voice audio to be recorded according to the song duration of the target song, the sampling rate, sampling bit depth and number of channels used for recording the human voice audio. Exemplarily, the calculation formula is shown in the following formula (1):
[0039] voicesSize=(samples × bit × channel × duration) / 8 (1)
[0040] Among them, voicesSize is the estimated data size of the human voice audio to be recorded.
[0041] Step 102: Obtain device information of the terminal.
[0042] The device information includes the available storage space size of the terminal's memory and the available storage space size of the terminal's hard disk. In implementation, the terminal can read the device information of the device, and the device information can include the available storage space size and the available storage space size of the terminal's hard disk.
[0043] Step 103: If the device information meets the hard disk storage conditions, the vocal audio collected during the recording of the target song is stored in the hard disk of the terminal.
[0044] In practice, there may be multiple hard disk storage conditions, and several of them are listed below for illustration:
[0045] Hard disk storage condition one: If the available storage space of the hard disk is larger than the estimated data volume of the human voice audio to be recorded, it is determined that the hard disk storage condition is met.
[0046] Hard disk storage condition 2: In order to avoid abnormal boundary values caused by fluctuations in system resource usage, a preset hard disk buffer volume can be configured for the hard disk. The preset hard disk buffer volume can be configured by relevant personnel according to different models and can be maintained by the server, as shown in Table 1 below:
[0047] Table 1
[0048] model Default hard disk buffer size Model A Default hard disk buffer size 1 Model B Default hard disk buffer size 2 Model C Default hard disk buffer size 3 …… ……
[0049] The terminal may send the model of the device to the server to obtain the corresponding preset hard disk buffer size (fileBufferSize) from the server.
[0050] The terminal calculates the sum of the estimated data volume of the human voice audio and the preset hard disk buffer capacity. If the available storage space of the hard disk is larger than the sum of the estimated data volume of the human voice audio to be recorded and the preset hard disk buffer capacity, it is determined that the hard disk storage condition is met.
[0051] Hard disk storage condition three: Even if the hard disk is used to store the human voice audio, the song recording engine itself needs to occupy the storage space of the memory. If the available storage space of the memory is not enough to store the song recording engine, then the song recording cannot be performed normally. Therefore, it can be determined whether the size of the available storage space of the memory is greater than the memory usage of the song recording engine. If the size of the available storage space of the memory is greater than the memory usage of the song recording engine, then continue to execute any of the above hard disk storage conditions one or two.
[0052] Hard disk storage condition 4: In order to avoid abnormal boundary values caused by fluctuations in system resource usage, a preset memory buffer amount can be configured for the memory. The preset memory buffer amount can be configured by relevant personnel according to different models and can be maintained by the server, as shown in Table 2 below:
[0053] Table 2
[0054] model Default memory buffer size Model A Default memory buffer size 1 Model B Default memory buffer size 2 Model C Default memory buffer size 3 …… ……
[0055] The terminal can send the model of the device to the server to obtain the corresponding preset memory buffer size (memeoryBufferSize) from the server. Here, the preset hard disk buffer size and the preset memory buffer size can be obtained from the server at the same time or separately, and this embodiment of the application does not limit this.
[0056] The terminal can calculate the sum of the memory occupancy of the song recording engine and the preset memory buffer capacity corresponding to the terminal, and then determine whether the available storage space of the memory is greater than the sum of the memory occupancy of the song recording engine and the preset memory buffer capacity corresponding to the terminal. If the available storage space of the memory is greater than the sum of the memory occupancy of the song recording engine and the preset memory buffer capacity corresponding to the terminal, continue to execute any of the above-mentioned hard disk storage conditions one or two.
[0057] Hard disk storage condition five: Since the reading and writing of the hard disk requires high processor performance, it is possible to first determine whether the processor performance meets the requirements. Specifically, the terminal can obtain the performance parameter threshold of the processor, obtain the performance parameters of the processing of the device, and compare the performance parameters of the processing of the device with the performance parameter threshold to determine whether the processor meets the performance requirements. When the processor meets the performance requirements and the device information meets any of the above-mentioned hard disk storage bar one, hard disk storage bar two, hard disk storage bar three, and hard disk storage bar four, it is determined that the terminal's device information meets hard disk storage condition five.
[0058] Here, the performance parameter of the processor may include at least one of the main frequency, cache, available bandwidth of the interface with the hard disk, processor occupancy, etc. The performance parameter threshold may be a threshold for each performance parameter, which may be pre-configured in the installation package of the music application, or maintained by the server and obtained by the terminal from the server when needed.
[0059] In actual implementation, any of the above hard disk storage conditions can be used for judgment. After the judgment is passed, the vocal audio collected during the recording process of the target song can be stored in the hard disk of the terminal.
[0060] Step 104: If the device information meets the memory storage condition, the vocal audio collected during the recording process of the target song is stored in the terminal's memory.
[0061] In implementation, there may be multiple memory storage conditions, several of which are exemplarily listed below for illustration:
[0062] Memory storage condition one: The terminal can calculate the sum of the estimated data volume of the human voice audio to be recorded and the memory occupancy of the song recording engine. If the available storage space of the memory is larger than the sum of the estimated data volume of the human voice audio to be recorded and the memory occupancy of the song recording engine, it is determined that the memory storage condition is met.
[0063] Hard disk storage condition 2: In order to avoid abnormal boundary values caused by fluctuations in system resource usage, a preset memory buffer can be configured for the memory. The preset memory buffer can be configured by relevant personnel according to different models and can be maintained by the server. The terminal can send the model of the device to the server to obtain the corresponding preset hard disk buffer from the server.
[0064] The terminal calculates the estimated data volume of human voice audio, the memory occupancy of the song recording engine and the preset memory buffer capacity. If the available storage space of the memory is larger than the sum of the estimated data volume of human voice audio, the memory occupancy of the song recording engine and the preset memory buffer capacity, it is determined that the memory storage conditions are met.
[0065] In actual implementation, any of the above-mentioned memory storage conditions can be used for judgment. After the judgment is passed, the vocal audio collected during the recording process of the target song can be stored in the memory.
[0066] In a possible implementation, considering that the read and write speed of the memory is faster than that of the hard disk, the above step 104 may be performed preferentially, and if the memory storage condition is met, there is no need to perform the above step 103.
[0067] In another possible implementation, considering that the storage space of the memory is small, if the storage space of the memory is too large, it may cause the program to crash. Therefore, the above step 103 can be executed first, and if the hard disk storage conditions are met, there is no need to execute the above step 104.
[0068] In another possible implementation, for terminals with different performances, the execution order of the above steps 103 and 104 may also be different. Specifically, the processing may be as follows:
[0069] The terminal may send a device type determination request to the server, wherein the device type determination request carries configuration information of the terminal, and the configuration information includes the model and system version of the terminal.
[0070] After receiving the device type determination request sent by the terminal, the server can obtain the configuration information carried in the device type determination request, and determine the device type of the terminal according to the correspondence between the configuration information and the device type, where the device type includes high-performance devices and low-performance devices. The correspondence between the configuration information and the device type can be shown in Table 3 below:
[0071] Table 3
[0072] model System version Device Type Model A System Version 01 High-performance equipment Model A System Version 02 Low performance devices Model B System version 11 High-performance equipment Model C System version 22 Low performance devices …… …… ……
[0073] After determining the device type of the terminal, the server may return device type indication information to the terminal, wherein the device type indication information is used to indicate the device type of the terminal. For example, if the device type indication information is 1, it indicates that the device type is a high-performance device, indicating that the performance of the terminal is higher than the preset condition; if the device type indication information is 0, it indicates that the device type is a low-performance device, indicating that the performance of the terminal is not higher than the preset condition.
[0074] After receiving the device type indication information, if the terminal determines that the device type indicated by the device type indication information is a high-performance device, the above step 103 may be performed first, and if the hard disk storage condition is not met in the above step 103, the above step 104 may be performed. If the hard disk storage condition is met in the above step 103, the above step 104 does not need to be performed.
[0075] If it is determined that the device type indicated by the device type indication information is a low-performance device, the above step 104 can be performed first, and if the memory storage condition is not met in the above step 104, the above step 103 is continued to be performed. If the memory storage condition is met in the above step 104, the above step 103 does not need to be performed again.
[0076] In another possible implementation, if the device information does not meet the hard disk storage condition in the above step 103, nor does it meet the memory storage condition in the above step 104, a device prompt is performed and the song recording application is closed. The device prompt is used to prompt the user that the storage space of the terminal does not meet the song recording requirement. The specific prompt method can be one or more prompt methods such as displaying prompt text, prompt animation, prompt voice, etc., which is not limited in the embodiment of the present application.
[0077] In a possible implementation, when the human voice audio collected during the recording of the target song is stored in the hard disk, it can be stored in a memory mapping manner, which can improve the reading and writing efficiency of the human voice audio. Memory mapping can be as follows Figure 4 As shown. When recording a song, the terminal can calculate the estimated data volume of the human voice audio to be recorded. The estimated data volume is fixed. Under this condition, the memory mapping technology can play the greatest efficiency. By mapping the hard disk file to the memory, the direct read and write operation of the file content is realized, avoiding tedious data copying and improving the efficiency of file reading and writing. Through this technology, the read and write efficiency of human voice audio during the recording process is improved by 77.6%, which is basically consistent with the performance of the human voice storage solution in memory.
[0078] In a possible implementation, the music application can provide users with a vocal data encryption function to protect the user's personal information security. The user can choose to turn on the vocal data encryption function. When the vocal data encryption function is turned on, the terminal can encrypt the vocal audio collected during the recording of the target song before storing it, and then store the encrypted vocal audio to the hard disk or memory.
[0079] The encryption algorithm can be configured by the user, or can be configured by default by relevant technicians, or can be configured by relevant technicians to configure multiple optional encryption algorithms, and the user can select one of them. The specific encryption algorithm is not limited in the embodiments of this application.
[0080] In this implementation, when reading the human voice audio, the terminal can first read the encrypted human voice audio, and then use the encryption algorithm to decrypt it with the decryption algorithm corresponding to the encryption algorithm to obtain the unencrypted human voice audio.
[0081] An embodiment of the present application provides a method for storing vocal audio. In the method, the terminal first estimates the data volume of the vocal audio to be recorded of the target song, and comprehensively determines whether the storage location of the vocal audio collected in the current recording process is the hard disk or the memory, based on the available storage space size of the terminal's memory, the available storage space size of the hard disk, and the estimated data volume of the vocal audio to be recorded. In this way, the vocal audio is adaptively stored according to the device status of the terminal, which can effectively avoid the problem of song recording failure caused by insufficient memory or hard disk storage space.
[0082] See also Figure 5 The embodiment of the present application provides a method for storing human voice audio. In the method, when a user clicks a song recording option, the terminal obtains song information and calculates the estimated data volume of the human voice audio to be recorded and the memory usage of the song recording engine during the song recording process. Then, the terminal obtains device information to determine whether the terminal is a low-performance device.
[0083] If the terminal is a low-performance device, determine whether the terminal's memory is sufficient. If the terminal's memory is sufficient, use the terminal's memory to store the voice audio to be recorded. If the terminal's memory is insufficient, determine whether the terminal's hard disk is sufficient. If the terminal's hard disk is sufficient, continue to determine whether the processor meets the requirements. If the processor meets the requirements, use the terminal's hard disk to store the voice audio to be recorded. If the terminal's hard disk is insufficient or the processor performance does not meet the requirements, the user is prompted with the error reason and the song recording fails.
[0084] If the terminal is a high-performance device, determine whether the terminal's hard disk is sufficient. If the hard disk is sufficient, continue to determine whether the processor meets the requirements. If the processor meets the requirements, use the terminal's hard disk to store the voice audio to be recorded. If the terminal's hard disk is not enough, or the processor performance does not meet the requirements, determine whether the terminal's memory is sufficient. If the terminal's memory is sufficient, use the terminal's memory to store the voice audio to be recorded. If the terminal's memory is insufficient, the user is prompted with the cause of the error, and the song recording fails.
[0085] After confirming to use the terminal's memory or hard disk to store the vocal audio to be recorded, start recording the song.
[0086] Based on the same technical concept, the embodiment of the present application also provides a device for storing human voice audio, which can be a terminal, such as Figure 6 As shown, the device includes an acquisition module 510 and a storage module 520, wherein:
[0087] An acquisition module 510 is used to acquire an estimated data volume of the human voice audio to be recorded of the target song;
[0088] Acquire device information of the terminal, the device information including available storage space size of the memory and available storage space size of the hard disk;
[0089] The storage module 520 is used to store the vocal audio collected during the recording of the target song to the hard disk of the terminal if the device information meets the hard disk storage condition; if the device information meets the memory storage condition, store the vocal audio collected during the recording of the target song to the memory of the terminal.
[0090] In one possible implementation, the storage module 520 is used to: obtain the device type indication information of the terminal and the preset hard disk buffer capacity of the terminal; if the device type indication information indicates that the performance of the terminal is higher than the preset conditions and the available storage space size of the hard disk is larger than the sum of the estimated data volume of the human voice audio to be recorded and the preset hard disk buffer capacity, then determine that the device information meets the hard disk storage conditions, and store the human voice audio collected during the recording of the target song to the hard disk of the terminal.
[0091] In a possible implementation, the storage module 520 is used to: obtain device type indication information of the terminal, memory usage of the song recording engine, and preset memory buffer capacity of the terminal;
[0092] If the device type indication information indicates that the performance of the terminal is no higher than the preset conditions and the available storage space of the memory is greater than the sum of the memory occupancy of the song recording engine, the preset memory buffer capacity and the estimated data volume of the human voice audio to be recorded, it is determined that the device information meets the memory storage conditions, and the human voice audio collected during the recording of the target song is stored in the memory of the terminal.
[0093] In a possible implementation, the storage module 520 is also used to: if the device information does not meet the hard disk storage condition and does not meet the memory storage condition, then a device prompt is performed, wherein the device prompt is used to prompt the user that the storage space of the terminal does not meet the song recording requirements.
[0094] In a possible implementation, the storage module 520 is used to store the vocal audio collected during the recording of the target song in the hard disk of the terminal by using a memory mapping method.
[0095] In a possible implementation, the storage module 520 is used to: encrypt the vocal audio collected during the recording of the target song when the vocal data encryption function is turned on, and store the encrypted vocal audio to the hard disk of the terminal;
[0096] The storing of the vocal audio collected during the recording of the target song into the memory of the terminal includes: when the vocal data encryption function is turned on, the vocal audio collected during the recording of the target song is encrypted, and the encrypted vocal audio is stored in the memory of the terminal.
[0097] In a possible implementation, the acquisition module 510 is used to: obtain the song duration of the target song and the sampling rate, sampling bit depth and number of channels used for recording the vocal audio; and calculate the estimated data volume of the vocal audio to be recorded based on the song duration, the sampling rate, sampling bit depth and number of channels used for recording the vocal audio.
[0098] An embodiment of the present application provides a method for storing vocal audio. In the method, the terminal first estimates the data volume of the vocal audio to be recorded of the target song, and comprehensively determines whether the storage location of the vocal audio collected in the current recording process is the hard disk or the memory, based on the available storage space size of the terminal's memory, the available storage space size of the hard disk, and the estimated data volume of the vocal audio to be recorded. In this way, the vocal audio is adaptively stored according to the device status of the terminal, which can effectively avoid the problem of song recording failure caused by insufficient memory or hard disk storage space.
[0099] It should be noted that: the human voice audio storage device provided in the above embodiment only uses the division of the above functional modules as an example when storing human voice audio. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the terminal is divided into different functional modules to complete all or part of the functions described above. In addition, the human voice audio storage device provided in the above embodiment and the human voice audio storage method embodiment belong to the same concept. The specific implementation process is detailed in the method embodiment and will not be repeated here.
[0100] Figure 7 The structure block diagram of a terminal 600 provided by an exemplary embodiment of the present application is shown. The terminal 600 may be a portable mobile terminal, such as a smart phone, a tablet computer, an MP3 player (Moving Picture Experts Group Audio Layer III), an MP4 player (Moving Picture Experts Group Audio Layer IV), a laptop computer or a desktop computer. The terminal 600 may also be called a user device, a portable terminal, a laptop terminal, a desktop terminal or other names.
[0101] Typically, the terminal 600 includes a processor 601 and a memory 602 .
[0102] The processor 601 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 601 may be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). The processor 601 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a CPU (Central Processing Unit); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 601 may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 601 may also include an AI (Artificial Intelligence) processor, which is used to process computing operations related to machine learning.
[0103] The memory 602 may include one or more computer-readable storage media, which may be non-transitory. The memory 602 may also include high-speed random access memory and non-volatile memory, such as one or more disk storage devices and flash memory storage devices.
[0104] In some embodiments, the terminal 600 may further optionally include: a peripheral device interface 603 and at least one peripheral device. The processor 601, the memory 602 and the peripheral device interface 603 may be connected via a bus or a signal line. Each peripheral device may be connected to the peripheral device interface 603 via a bus, a signal line or a circuit board. Specifically, the peripheral device includes: at least one of a radio frequency circuit 604, a display screen 605, a camera assembly 606, an audio circuit 607, a positioning assembly 608 and a power supply 609.
[0105] In some embodiments, the terminal 600 further includes one or more sensors 610 , including but not limited to: an acceleration sensor 611 , a gyroscope sensor 612 , a pressure sensor 613 , a fingerprint sensor 614 , an optical sensor 615 , and a proximity sensor 616 .
[0106] Those skilled in the art will understand that Figure 7The structure shown in the figure does not constitute a limitation on the terminal 600, and the terminal 600 may include more or less components than those shown in the figure, or combine some components, or adopt a different component arrangement.
[0107] Figure 8 1 is a schematic diagram of the structure of a server provided in an embodiment of the present application. The server 1000 may have relatively large differences due to different configurations or performances, and may include one or more processors (central processing units, CPU) 1001 and one or more memories 1002, wherein the memory 1002 stores at least one instruction, and the at least one instruction is loaded and executed by the processor 1001 to implement the methods provided in the above-mentioned various method embodiments. Of course, the computing device may also have components such as a wired or wireless network interface, a keyboard, and an input and output interface for input and output, and the computing device may also include other components for implementing device functions, which will not be described in detail here.
[0108] In an exemplary embodiment, a computer-readable storage medium is also provided, such as a memory including instructions, and the instructions can be executed by a processor in a terminal to complete the method of storing human voice audio in the above embodiment. The computer-readable storage medium can be non-transitory. For example, the computer-readable storage medium can be a ROM (Read-Only Memory), a RAM (Random Access Memory), a CD-ROM (Compact Disc Read-Only Memory), a magnetic tape, a floppy disk, and an optical data storage device, etc.
[0109] In an exemplary embodiment, a computer program product is further provided. The computer program product stores at least one instruction, and the instruction is loaded and executed by a processor to implement the operations performed by the method for storing human voice audio in the above embodiment.
[0110] It should be noted that the information (including but not limited to user device information, user personal information, etc.), data (including but not limited to data used for analysis, stored data, displayed data, etc.) and signals (including but not limited to signals transmitted between user terminals and other devices, etc.) involved in this application are all authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards of relevant countries and regions. For example, the human voice audio involved in this application is obtained with full authorization.
[0111] A person skilled in the art will understand that all or part of the steps to implement the above embodiments may be accomplished by hardware or by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a disk or an optical disk, etc.
[0112] In this application, the words such as "first" and "second" are used to distinguish the same or similar items with basically the same effects and functions. It should be understood that there is no logical or temporal dependency between "first" and "second", nor is the quantity and execution order limited. It should also be understood that although the following description uses the terms first, second, etc. to describe various elements, these elements should not be limited by the terms. These terms are only used to distinguish one element from another. For example, without departing from the scope of various examples, the first threshold value can be referred to as the second threshold value, and similarly, the second threshold value can be referred to as the first threshold value. The first threshold value and the second threshold value can both be collectively referred to as threshold values, and in some cases, can be separate and different threshold values.
[0113] The term "at least one" in this application means one or more, and the term "plurality" in this application means two or more.
[0114] The above description is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed in the present application, and these modifications or replacements should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A method for storing human voice audio, characterized in that: The method is applied to a terminal, and the method includes: Obtain an estimated amount of vocal audio data to be recorded for a target song; Acquire device information of the terminal, the device information including available storage space size of the memory and available storage space size of the hard disk; If the device information meets the hard disk storage condition, the human voice audio collected during the recording of the target song is stored in the hard disk of the terminal; If the device information meets the memory storage condition, the vocal audio collected during the recording of the target song is stored in the memory of the terminal.
2. The method according to claim 1, characterized in that If the device information satisfies the hard disk storage condition, storing the human voice audio collected during the recording of the target song to the hard disk of the terminal includes: Acquire device type indication information of the terminal and a preset hard disk buffer capacity of the terminal; If the device type indication information indicates that the performance of the terminal is higher than the preset conditions and the available storage space of the hard disk is larger than the sum of the estimated data volume of the human voice audio to be recorded and the preset hard disk buffer capacity, it is determined that the device information meets the hard disk storage conditions, and the human voice audio collected during the recording of the target song is stored on the hard disk of the terminal.
3. The method according to claim 1, characterized in that If the device information satisfies the memory storage condition, the human voice audio collected during the recording of the target song is stored in the memory of the terminal, including: Obtaining device type indication information of the terminal, memory usage of a song recording engine, and preset memory buffer capacity of the terminal; If the device type indication information indicates that the performance of the terminal is no higher than the preset conditions and the available storage space of the memory is greater than the sum of the memory occupancy of the song recording engine, the preset memory buffer capacity and the estimated data volume of the human voice audio to be recorded, it is determined that the device information meets the memory storage conditions, and the human voice audio collected during the recording of the target song is stored in the memory of the terminal.
4. The method according to claim 1, characterized in that: The method further comprises: If the device information does not meet the hard disk storage condition and does not meet the memory storage condition, a device prompt is performed, wherein the device prompt is used to prompt the user that the storage space of the terminal does not meet the song recording requirement.
5. The method according to claim 1, characterized in that The step of storing the vocal audio collected during the recording of the target song to the hard disk of the terminal includes: The human voice audio collected during the recording process of the target song is stored in the hard disk of the terminal by using a memory mapping method.
6. The method according to claim 1, characterized in that The storing of the vocal audio collected during the recording of the target song to the hard disk of the terminal includes: encrypting the vocal audio collected during the recording of the target song when the vocal data encryption function is turned on, and storing the encrypted vocal audio to the hard disk of the terminal; The storing of the vocal audio collected during the recording of the target song into the memory of the terminal includes: when the vocal data encryption function is turned on, the vocal audio collected during the recording of the target song is encrypted, and the encrypted vocal audio is stored in the memory of the terminal.
7. The method according to any one of claims 1 to 6, characterized in that The step of obtaining an estimated data volume of the to-be-recorded vocal audio of the target song includes: Obtain the song duration of the target song and the sampling rate, sampling bit depth and number of channels used for recording vocal audio; The estimated data volume of the vocal audio to be recorded is calculated based on the song duration, the sampling rate used for the recorded vocal audio, the sampling bit depth and the number of channels.
8. A computing device, characterized in that The computing device includes a processor and a memory, wherein the memory stores at least one instruction, and the instruction is loaded and executed by the processor to implement the operations performed by the method for storing human voice audio according to any one of claims 1 to 7.
9. A computer-readable storage medium, characterized in that: The storage medium stores at least one instruction, which is loaded and executed by the processor to implement the operations performed by the method for storing human voice audio as described in any one of claims 1 to 7.
10. A computer program product, characterized in that The computer program product stores at least one instruction, which is loaded and executed by a processor to implement the operations performed by the method for storing human voice audio according to any one of claims 1 to 7.