Audio recording method and device, equipment and storage medium

By capturing and splicing the data stream of the audio played by the terminal, it is possible to record clear audio without external playback, solving the problem of time-consuming and labor-intensive audio file acquisition in the existing technology, and improving the efficiency of audio file acquisition.

CN118538240APending Publication Date: 2024-08-23GUANGZHOU KUGOU COMP TECH CO LTD +1
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202310169456.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-02-23
Publication Date
2024-08-23

AI Technical Summary

Technical Problem

In the existing technology, users need to obtain audio files before processing, such as obtaining lyrics or pitch analysis. As a result, obtaining audio files consumes time and energy and cannot be obtained easily and quickly.

Method used

By capturing at least two pieces of data in the data stream of the audio played by the terminal, identifying the repeated parts of the data, and splicing the data according to the position of the repeated parts, the internally recorded audio is obtained, and a method of recording clear audio without external playback is achieved.

Benefits of technology

The audio file acquisition operation is simplified, the acquisition efficiency is improved, external noise interference is avoided, the recorded audio is clearer, and the user does not need to find and download the original audio file.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118538240A
    Figure CN118538240A
Patent Text Reader

Abstract

The invention discloses an audio recording method and device, equipment and a storage medium, and relates to the field of audio processing. The method comprises the following steps: when an audio is played, capturing at least two segments of data in a data stream required by the terminal for playing the audio; identifying a data repetition part of the at least two segments of data; and according to the position of the data repetition part, splicing the at least two segments of data to obtain internal recording audio. The method can simplify the acquisition operation of the audio file and improve the acquisition efficiency of the audio file.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of audio processing, and in particular to an audio recording method, apparatus, device and storage medium. Background Art

[0002] In related technologies, users need to obtain audio files before they can process the audio files, such as obtaining the lyrics of a song and performing pitch analysis. For example, when a player customizes a pitch game, the player needs to first download the audio file and then upload the audio file to the pitch game. Only then can the pitch game analyze the pitch of the audio file and generate the corresponding pitch game. For another example, when a user wants to identify the lyrics of a song, he needs to first determine the title of the song, then download the song audio, and input it into the audio recognition software to identify and obtain the lyrics of the song; or go to the browser to find the relevant lyrics based on the song title, and copy or write down the lyrics by hand.

[0003] It can be seen that obtaining audio files will consume a lot of time and energy of users, and it is impossible to obtain audio files simply and quickly. Summary of the Invention

[0004] The embodiments of the present application provide an audio recording method, apparatus, device, and storage medium, which can simplify the operation of obtaining audio files and improve the efficiency of obtaining audio files. The technical solution is as follows.

[0005] According to one aspect of the present application, there is provided an audio recording method, which is executed by a terminal and includes:

[0006] When playing audio, capturing at least two segments of data in a data stream required by the terminal to play the audio;

[0007] identifying a data duplication portion of the at least two segments of data;

[0008] According to the location of the repeated portion of the data, the at least two segments of data are spliced ​​together to obtain internally recorded audio.

[0009] According to another aspect of the present application, an audio recording device is provided, the device comprising:

[0010] A capture module, configured to capture at least two segments of data in a data stream required by the terminal for playing the audio when the audio is played;

[0011] an identification module, configured to identify a data duplication portion of the at least two segments of data;

[0012] The splicing module is used to splice the at least two segments of data according to the location of the repeated part of the data to obtain the internal recorded audio.

[0013] According to another aspect of the present application, a computer device is provided, comprising: a processor and a memory, wherein the memory stores at least one instruction, at least one program, a code set, or an instruction set, and the at least one instruction, the at least one program, the code set, or the instruction set is loaded and executed by the processor to implement the audio recording method described above.

[0014] According to another aspect of the present application, a computer-readable storage medium is provided, wherein the storage medium stores at least one instruction, at least one program, code set or instruction set, and the at least one instruction, the at least one program, the code set or instruction set is loaded and executed by a processor to implement the audio recording method described above.

[0015] According to another aspect of the embodiments of the present disclosure, a computer program product or computer program is provided, comprising computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the audio recording method provided in the aforementioned optional implementation.

[0016] The beneficial effects of the technical solutions provided in the embodiments of the present application include at least:

[0017] By capturing at least two segments of data from the data of the audio played by the terminal, the audio data of the audio played by the terminal is directly obtained, and according to the repeated parts of the data in the at least two segments of data captured, the order and splicing position of the at least two segments of data are identified, and then the at least two segments of data are spliced ​​together to obtain a complete internally recorded audio. The internally recorded audio recorded by this method does not require the terminal to play the audio externally. It only needs the terminal to play the audio to capture the data of the audio played from inside the terminal. The data contains pure terminal audio played without external noise. Compared with recording audio with a microphone, this method can record clearer terminal audio played, avoiding the influence of external sounds on the internally recorded audio. In addition, this method does not require the user to search for and download the original audio file of the terminal audio played, and can quickly obtain the audio file through internal recording, which simplifies the operation of obtaining the audio file and improves the efficiency of obtaining the audio file. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0019] Figure 1 is a block diagram of a computer device provided by an exemplary embodiment of the present application;

[0020] Figure 2 is a method flow chart of an audio recording method provided by another exemplary embodiment of the present application;

[0021] Figure 3 is a method flow chart of an audio recording method provided by another exemplary embodiment of the present application;

[0022] Figure 4 is a schematic diagram of an audio recording method provided by another exemplary embodiment of the present application;

[0023] Figure 5 is a schematic diagram of an audio recording method provided by another exemplary embodiment of the present application;

[0024] Figure 6 is a schematic diagram of an audio recording method provided by another exemplary embodiment of the present application;

[0025] Figure 7 is a schematic diagram of an audio recording method provided by another exemplary embodiment of the present application;

[0026] Figure 8 is a schematic diagram of an audio recording method provided by another exemplary embodiment of the present application;

[0027] Figure 9 is a method flow chart of an audio recording method provided by another exemplary embodiment of the present application;

[0028] Figure 10 is a method flow chart of an audio recording method provided by another exemplary embodiment of the present application;

[0029] Figure 11 is a block diagram of an audio recording device provided by another exemplary embodiment of the present application;

[0030] Figure 12 is a structural diagram of a server provided by another exemplary embodiment of the present application;

[0031] Figure 13 is a block diagram of a terminal provided by another exemplary embodiment of the present application. DETAILED DESCRIPTION

[0032] In order to make the objectives, technical solutions and advantages of this application clearer, the implementation methods of this application will be further described in detail below with reference to the accompanying drawings.

[0033] Figure 1A schematic diagram of a computer device 101 provided in an exemplary embodiment of the present application is shown. The computer device 101 may be a terminal or a server.

[0034] The terminal may include at least one of a digital camera, a smartphone, a laptop computer, a desktop computer, a tablet computer, a smart speaker, a smart robot, and a smart wearable device. Optionally, the terminal may also be a device with an audio system, such as MP3 (Moving Picture Experts Group Audio Layer III), MP4 (Moving Picture Experts Group 4), a speaker, a smart speaker, an in-vehicle computer, headphones, or a smart home device.

[0035] Exemplarily, an operating system runs on the terminal. The operating system may be an Android operating system. The operating system provides an audio visualization interface capable of capturing partial data from a data stream played by the terminal. The audio visualization interface can perform audio visualization tasks based on the captured partial data.

[0036] Alternatively, a plug-in or software may be running on the terminal, which has the ability to capture part of the data in the data stream played by the terminal. Optionally, the operating system may be a derivative operating system developed based on the Android operating system. Of course, the operating system may also be a Windows operating system, an iOS operating system, or another operating system. Of course, this is not limited to this.

[0037] In an optional implementation, the audio recording method provided in this application can be applied to an application with a recording function, which can be: a music player program, a video player program, a short video player program, an audio editing program, a video editing program, an audio recording program, a video recording program, a social program, a life service program, a shopping program, a live broadcast program, a forum program, an information program, a life program, an office program, etc. Optionally, a client of the application is installed on the terminal.

[0038] For example, an audio recording program is stored on the terminal. When the client needs to use the audio recording method provided in the embodiment of the present application, the client can run the audio recording program to complete the audio recording. For example, the audio recording process can be completed by the terminal or by the terminal and the server.

[0039] The terminal and the server are connected to each other through a wired or wireless network.

[0040] The terminal includes a first memory and a first processor. An audio recording program is stored in the first memory; the audio recording program is called and executed by the first processor to implement the audio recording method provided in the present application. The first memory may include but is not limited to the following: Random Access Memory (RAM), Read Only Memory (ROM), Programmable Read-Only Memory (PROM), Erasable Programmable Read-Only Memory (EPROM), and Electrically Erasable Programmable Read-Only Memory (EEPROM).

[0041] The first processor may be composed of one or more integrated circuit chips. Optionally, the first processor may be a general-purpose processor, such as a central processing unit (CPU) or a network processor (NP). Optionally, the first processor may implement the audio recording method provided by the present application by running a program or code.

[0042] The server includes a second memory and a second processor. The second memory stores an audio recording program; the audio recording program is invoked by the second processor to implement the audio recording method provided herein. Optionally, the second memory may include, but is not limited to, RAM, ROM, PROM, EPROM, and EEPROM. Optionally, the second processor may be a general-purpose processor, such as a CPU or NP.

[0043] Figure 2 A flowchart of an audio recording method provided by an exemplary embodiment of the present application is shown. The method can be executed by a terminal and includes the following steps.

[0044] Step 210: When playing audio, capture at least two segments of data in the data stream required by the terminal for playing the audio.

[0045] Exemplarily, in response to receiving a recording instruction, at least two segments of data in a data stream corresponding to the audio being played by the terminal are captured.

[0046] For example, if a second application on a terminal is playing audio, the second application transmits the audio data stream to the terminal's audio playback circuit. At this point, if a first application receives a recording instruction, the first application can capture data from the data stream. For example, if the first application captures a segment of data at a time, multiple captures can yield multiple segments of data. Of course, the terminal itself can also play the audio through a player, which is also reasonable.

[0047] It is understandable that the first application program collects data from the data stream with the authorization of the terminal user.

[0048] The above example only uses the second application currently playing audio on the terminal. Of course, the terminal can also have multiple applications currently playing audio, and then multiple applications will transmit audio data streams to the terminal's audio playback circuit. Depending on the recording settings, the first application can capture data from the data stream of the application specified by the recording settings, or the first application can capture data from the total data stream, where the total data stream is obtained by superimposing the data streams of multiple currently playing applications.

[0049] For example, the amount of data captured by the terminal at one time can be customized. The amount of data captured by the terminal at one time has a maximum value, for example, the maximum value is 1 kB (kilobytes). The user can set the amount of data to any value less than the maximum value.

[0050] It should be noted that the amount of data captured by the terminal at one time is very small. The longest audio of this amount of data is only 20ms. When playing 20ms of audio data, the user cannot hear any melody and can only perceive noise. Therefore, in the relevant technology, the audio data collected in this way cannot be used to play to the user, but can only be used for visualization processing, that is, for audio visualization. Audio visualization is to generate audio visual images frame by frame based on audio data, for example, to generate the spectral rhythm effect of music. The duration of a frame in an animation is usually 20ms. Therefore, the 20ms of audio data captured by the terminal at one time is just used to generate a frame of audio visual image.

[0051] However, in the process of implementing this application, the inventor discovered that through this data capture method, data can be directly captured from the data stream of the audio played by the terminal. The data only contains the audio played by the terminal and is not mixed with noise outside the terminal. Therefore, the method provided in the embodiment of this application is based on this data capture capability of the terminal to realize internal audio recording, so that the audio data obtained by internal recording is only the audio played by the terminal.

[0052] Furthermore, the audio recording method provided by the embodiment of the present application allows recording of the audio played by the terminal without the terminal having to play the audio externally. Since this recording method directly captures data from the data stream of the audio played by the terminal, the method can capture the data regardless of whether the audio of the data stream is played externally through the speaker. Therefore, even if the user adjusts the volume to 0 or plays audio with headphones, it will not affect the internal audio recording, and the terminal can record the internally recorded audio.

[0053] Exemplarily, the audio played by the terminal can be any type of audio, for example, at least one of music, article recitation audio, video audio, call audio, application prompt sound, and system prompt sound. The audio can also be a mixture of audio played by multiple applications. As long as the audio is being played by the terminal, the terminal can capture the audio data from the audio data stream.

[0054] Exemplarily, because the amount of data that a terminal can capture at one time is limited, for example, the amount of data that the terminal can capture at one time is a first amount of data, and according to a preset sampling rate, the duration of the audio data collected by the first amount of data is a first duration. Ignoring delay, assuming that the terminal starts capturing data at a first time, obtains a segment of data captured at a second time, and the duration from the first time to the second time is the first duration, then the segment of data captured by the terminal is the audio data of the audio played by the terminal from the first time to the second time.

[0055] For example, the terminal calls an audio visualization interface to capture the data in the data stream required for audio playback. Because the audio visualization interface is used for visualization, audio visualization only requires a small amount of audio data. For example, a single frame of visualization requires only 20ms of audio. Therefore, the audio visualization interface only needs to capture a very small amount of data at a time.

[0056] Of course, the above example only shows a single capture performed by the terminal. The terminal can initiate multiple captures between the first and second times. For example, the terminal can initiate a capture at time 1, another at time 2, and another at time 3, with time 1 being earlier than time 2, which is earlier than time 3, and which is earlier than time 4. The capture initiated at time 1 captures the first segment of data at time 4, the capture initiated at time 2 captures the second segment of data at time 5, and the capture initiated at time 3 captures the third segment of data at time 6. The durations from time 1 to time 4, time 2 to time 5, and time 3 to time 6 are all the first duration, and the data volumes of the first, second, and third segments are all the first volume. The first segment of data is the audio data played by the terminal from time 1 to time 3, the second segment of data is the audio data played by the terminal from time 2 to time 5, and the third segment of data is the audio data played by the terminal from time 3 to time 6. It can be seen that the audio recorded in these three segments overlaps in time, and therefore contains data duplication.

[0057] Exemplarily, the embodiment of the present application can be executed by a first application on the terminal, and the first application has an audio recording function. The first application can be at least one of an audio recording program, a video recording program, an audio processing program, a video processing program, a live broadcast application, a music game program, an audio analysis program, a social application, and a shopping application. Using the audio recording method provided in the embodiment of the present application, the audio data played by the application (including the first application and other applications other than the first application) can be obtained by audio recording, which is convenient for performing subsequent processing of the audio data.

[0058] For example, when a user uses the audio recording function of the first application, the first application can use the method provided in the embodiment of the present application to record the audio. Optionally, in response to the operation of triggering the recording start control (or in response to receiving a recording instruction), at least two segments of data in the data stream required by the terminal to play the audio are captured.

[0059] Exemplarily, in response to triggering an operation of a recording start control (or in response to receiving a recording instruction), a recording authorization interface is displayed, and in response to receiving an authorization operation on the recording authorization interface (or in response to receiving an authorization instruction), at least two segments of data in a data stream required by the terminal for playing audio are captured. And / or, in response to triggering an operation of a recording start control (or in response to receiving a recording instruction), a first application sends a recording authorization request to at least one application currently playing audio, and in response to receiving authorization instructions from all of the at least one application, at least two segments of data in a data stream required by the terminal for playing audio are captured.

[0060] Step 220: Identify data duplication between at least two data segments.

[0061] For example, since the terminal captures very little data at a time (the audio duration is very short), if you want to obtain all the data of the audio played by the terminal within a period of time, the terminal needs to capture data multiple times at a high frequency to ensure that the audio data within this period is not missing. However, due to the high frequency of capture, there will be data duplication in the data obtained from two consecutive captures.

[0062] In an optional embodiment, there may be a delay between the end of a capture and the time it receives the captured data, and the delay may vary between captures. This may result in the terminal receiving the data captured earlier. For example, the first capture may end at a first time, and the second capture may end at a second time, with the first time being earlier than the second time. In other words, the first data captured in the first capture is chronologically prior to the second data captured in the second capture. However, the terminal receives the second data before the first data. In this case, if each data segment is spliced ​​together based on the time at which the terminal received each data segment, splicing errors will obviously occur.

[0063] Taking the above into consideration, the method provided in this embodiment determines the order of each data segment by identifying the repeated parts of at least two data segments. After deduplicating the repeated data, the data can be spliced ​​in the determined order.

[0064] Exemplarily, the terminal can identify repeated data portions by sorting at least two segments of data according to the acquisition time of the at least two segments of data (the time when the terminal obtains the data), using a small segment of data at the head of the later sampled data as a search sample, and searching the earlier sampled data for the same portion as the search sample data. If found, the later sampled data can be spliced ​​with the earlier sampled data, and the splicing position can be the searched repeated data portion (the two repeated data portions are aligned and then spliced). Since the two segments of data have repeated data, the repeated data portion in the earlier sampled data can be deleted, and then the later sampled data can be spliced ​​according to the splicing position (the earlier sampled data after deleting the repeated data portion is spliced ​​with the head of the later sampled data). The repeated data in the later sampled data can also be deleted, and then the remaining portion can be spliced ​​to the end of the earlier sampled data. Among them, the earlier sampled data is the data acquired earlier, and the later sampled data is the data acquired later.

[0065] Step 230: splice at least two segments of data according to the location of the repeated portion of the data to obtain the internally recorded audio.

[0066] For example, when the terminal cannot accurately obtain the playback time / sampling time of each data segment, the terminal can determine the time sequence of each data segment and the repeated position of the two data segments (the location of the repeated data segments) based on the repeated data portions in at least two data segments. The two data segments can be spliced ​​together based on the repeated data portions. In this way, by traversing the repeated data portions in at least two data segments, the at least two data segments can be spliced ​​into a complete data segment. This complete data segment is the audio data (internal recorded audio) of the audio played by the terminal during the recording time.

[0067] For example, the terminal may splice each acquired data with the previous data (pre-sampled data) in real time. Alternatively, the terminal may splice the acquired at least two data segments together after the recording is completed.

[0068] For example, when the terminal splices data in real time, it can apply the spliced ​​audio data in real time. For example, each time the terminal splices a segment of data, it reports the splicing result to the server. Alternatively, each time the terminal splices a segment of data, it transmits the splicing result to the live broadcast application in real time, achieving synchronization with the audio played by the live broadcast terminal.

[0069] Exemplarily, the step of splicing data can be performed by the terminal or by the server. For example, the terminal reports the acquired data to the server, which splices at least two segments of data to obtain the internally recorded audio. Alternatively, the terminal splices at least two segments of data to obtain the internally recorded audio, and then the terminal can report the internally recorded audio to the server.

[0070] In another optional embodiment, when the terminal obtains a piece of data, it can also obtain the playback time of this piece of data. The terminal can then sequentially splice at least two pieces of data together based on the start playback time of each piece of data to obtain the internally recorded audio. In other words, the terminal splices at least two pieces of data together based on the time sequence to obtain the internally recorded audio.

[0071] In summary, the method provided in this embodiment directly obtains the audio data of the terminal audio playback by capturing at least two segments of data from the data stream of the terminal audio playback, identifies the order and splicing position of the at least two segments of data based on the repeated parts of the captured at least two segments of data, and then splices the at least two segments of data together to obtain a complete internally recorded audio. The internally recorded audio recorded by this method does not require the terminal to play the audio externally. It only needs the terminal to play the audio to capture the audio playback data from inside the terminal. The data contains pure terminal audio playback without external noise. Compared with audio recording with a microphone, this method can record clearer terminal audio playback and avoid the influence of external sounds on the internally recorded audio.

[0072] During the implementation of this application, the inventors also discovered that when the collected data is played back, the user cannot hear any information, and the internally recorded audio, spliced ​​together according to the collection time, contains a lot of noise and cannot be heard clearly by the user. However, the method provided in this embodiment can determine the order of each data segment based on the repeated parts between the data, even if the terminal cannot accurately obtain the playback time of each data segment. After deduplication of the repeated parts, the internally recorded audio can be obtained by splicing each data segment according to the order, thus solving the problem of fragmented data being too fragmented to be spliced ​​together.

[0073] Illustratively, an embodiment of the present application also provides a method for splicing data.

[0074] Figure 3 The flowchart of the audio recording method provided by an exemplary embodiment of the present application is shown. The method can be executed by a terminal. Figure 2 In the illustrated embodiment, step 210 includes step 211 , step 220 includes steps 221 to 223 , and step 230 includes step 231 .

[0075] Step 211: When playing audio, call the audio visualization interface to capture at least two segments of data in the data stream required by the terminal to play the audio.

[0076] Exemplarily, the terminal calls the audio visualization interface once to capture one segment of data, and the at least two segments of data are captured by the terminal calling the audio visualization interface at least twice.

[0077] Exemplarily, the terminal calls the audio visualization interface and captures at least two segments of data in the data stream required by the terminal for playing audio according to a preset capture frequency; wherein data duplication exists between the two adjacently sampled segments of data.

[0078] Exemplarily, the terminal calls an audio visualization interface to obtain audio data played by the terminal. The audio visualization interface is an interface provided by the operating system for collecting audio data of a preset duration for performing audio visualization tasks. This data is audio data of the preset duration collected through the audio visualization interface. The terminal repeats the previous call step at a preset capture frequency to obtain at least two segments of data, where the time interval of the preset capture frequency is less than or equal to the preset duration. The preset duration can be adjusted by setting the amount of data obtained with each call.

[0079] Exemplarily, the terminal or the first application repeatedly calls the audio visualization interface according to a preset capture frequency and obtains the data returned by the audio visualization interface. That is, the terminal or the first application can obtain the segment data currently played by the terminal in real time.

[0080] For example, when a user uses the audio recording function of a first application, the first application can use the method provided in the embodiments of the present application to record audio. Optionally, in response to an operation triggering a recording start control (or in response to receiving a recording instruction), the audio visualization interface is repeatedly called at a preset capture frequency to obtain at least two segments of data.

[0081] Exemplarily, in response to triggering an operation of a recording start control (or in response to receiving a recording instruction), a recording authorization interface is displayed. In response to receiving an authorization operation on the recording authorization interface, the audio visualization interface is repeatedly called at a preset capture frequency to obtain at least two segments of data. And / or, in response to triggering an operation of a recording start control, the first application sends a recording authorization request to at least one application currently playing audio. In response to receiving authorization instructions from all of the at least one application, the audio visualization interface is repeatedly called at a preset capture frequency to obtain at least two segments of data.

[0082] For example, the audio visualization interface is an API (Application Programming Interface) provided by the terminal's operating system. Through the audio visualization interface, the audio data currently being played by the terminal can be collected from the operating system level. That is, the collected audio data can be the audio currently being played by any application on the terminal, or, when multiple applications are playing audio simultaneously, the collected audio data is the mixed audio played by multiple applications.

[0083] For example, the audio visualization interface may be a Visualizer interface, or the audio visualization interface may be a Visualizer.getWaveForm interface, wherein the preset acquisition duration needs to be greater than (Visualizer.getSamplingRate() / 1000) / Visualizer.getCaptureSizeRange()[1].

[0084] Exemplarily, the audio visualization interface is used to collect audio data currently being played in the audio playback circuit of the terminal, and the collected data is PCM (Pulse Code Modulation) data.

[0085] Exemplarily, the audio visualization interface is used to collect audio data from the audio playback circuit of the input terminal. Figure 4As shown, if all applications running on the terminal need to play audio, the audio data will flow through the operating system, be transmitted to the audio playback circuit, and then be played out through the speakers in the audio playback circuit. When the first application calls the audio visualization interface 301, the operating system can return the currently playing audio data to the first application through the audio visualization interface.

[0086] Exemplarily, the data collected by the audio visualization interface may be PCM audio data, or the audio data may be audio data in other audio formats.

[0087] Exemplarily, the data collected by the audio visualization interface is audio data that has been adjusted by the operating system. Alternatively, the data collected by the audio visualization interface is audio data that has not been adjusted by the operating system. After other applications output audio data, the operating system can process the audio data according to user settings or default settings, and transmit the processed audio data to the audio playback circuit for playback. The data collected by the audio visualization interface can then be the original audio data output by the application, or audio data that has been adjusted by the operating system.

[0088] For example, if the operating system can adjust audio data based on the volume set by the user, the data collected by the audio visualization interface can be audio data after the volume adjustment or audio data before the volume adjustment. When the audio visualization interface is used to collect data before the volume adjustment, the terminal can record audio data currently being played by the application in a muted state. In this case, the volume of the data collected by the audio visualization interface is the default volume output by the application.

[0089] For example, the audio visualization interface is originally used to perform audio visualization tasks. In audio visualization tasks, the operating system opens the audio visualization interface, allowing applications to collect audio data of a preset duration through the audio visualization interface. The applications then process the audio data to achieve audio visualization. For example, the application performs a Fourier transform on the collected audio signal to generate a spectrogram, thereby generating a music spectrum animation effect.

[0090] For example, since the audio visualization interface is used to implement audio visualization, and audio visualization uses frame-by-frame data to produce frame-by-frame visualization images, the amount of data collected by the audio visualization interface is relatively small. For example, it can only collect 1kB or less of data. Therefore, the audio duration of a piece of data is only 20 milliseconds (ms) or less. Based on the audio visualization interface for audio visualization, an embodiment of the present application provides an audio recording method that, by calling the audio visualization interface at high frequency, collects the audio currently played by the terminal in real time and in a fragmented manner, and then splices the complete audio based on the large number of collected data fragments.

[0091] For example, the audio visualization interface captures audio instantly. Ignoring interface call delays, if a first application calls the audio visualization interface at a first moment, the data returned by the audio visualization interface is the data played by the terminal from the first moment to the second moment, where the duration from the first moment to the second moment is equal to the preset duration (e.g., 20ms) for audio capture by the audio visualization interface.

[0092] For example, in order to record the complete internal audio, the time interval of the preset capture frequency needs to be less than or equal to the preset duration. For example, when the preset duration is 20ms, the time interval of the preset capture frequency needs to be less than 20ms, and the preset capture frequency needs to be higher than 50Hz.

[0093] For example, if the preset capture frequency is 100Hz and the preset duration is 20ms, the terminal will call the audio visualization interface every 10ms, and each call will obtain 20ms of data. Assuming that the terminal calls the audio visualization interface at time 0, the first call will obtain data from 0-20ms, the second call will obtain data from 10-30ms, the third call will obtain data from 20-40ms, and so on.

[0094] Exemplarily, in response to receiving an operation to trigger an audio internal recording end control (or in response to receiving a recording end instruction), calling the audio visualization interface is stopped.

[0095] Exemplarily, when calling the audio visualization interface, the first application can also indicate the application that needs to be recorded. For example, if the first application calls the audio visualization interface and carries the audio session identifier (audioSessionId) of the second application, the operating system will return the data currently played by the second application to the first application, so that targeted audio recording can be achieved to avoid interference from audio of other applications (for example, there is a message prompt tone when recording music). Of course, when calling the audio visualization interface, the first application can indicate the recorded mixed audio (the mixed data of all audio currently being played) without carrying the application identifier (that is, audioSessionId is 0). If the value of the audio session identifier is 0, the audio that is a mixture of the audio currently being played by all applications can be recorded.

[0096] In another optional embodiment, the audio visualization interface may be an audio visualization interface provided by another application (e.g., a third application) for performing audio visualization. Alternatively, the audio visualization interface may be an interface provided by another application or an operating system for collecting audio data of a preset duration.

[0097] In another optional embodiment, the functions of the above-mentioned audio visualization interface can also be implemented by using a plug-in or a program. That is, a first plug-in or a first program is called to capture at least two segments of data in the data stream required for the terminal to play audio.

[0098] In another optional embodiment, a user can schedule a recording time. For example, a recording time scheduling operation is received, where the recording time scheduling operation includes setting the recording time from a first time to a second time. At the first time, the first application begins to call the audio visualization interface to collect data at a preset capture frequency until the second time ends. During the first to second time periods, the first application can obtain multiple segments of data by calling the audio visualization interface at a high frequency.

[0099] Exemplarily, the data obtained through the audio visualization interface may correspond to a start playback time, which may be the time when the first application calls the audio visualization interface, or the start playback time may be the actual playback start time of the data returned by the audio visualization interface. Alternatively, the start playback time may be the acquisition time of the first audio data of the data returned by the audio visualization interface. Based on the start playback time and the duration of the data (preset duration), the time corresponding to each audio data in the data can be determined. The start playback time may be the local time (for example, Beijing time) or the recording time of this recording (the time when recording starts is 0).

[0100] Alternatively, each audio data in the data corresponds to a playback time, and the playback time may be the actual playback time of each audio data in the data returned by the audio visualization interface, or the playback time may be the data acquisition time of each audio data in the data returned by the audio visualization interface.

[0101] Exemplarily, in response to the user turning on recording, if the user turns on microphone recording and system internal recording at the same time, the terminal will also turn on the microphone while executing step 210, and record the microphone audio through the microphone. It should be noted that microphone recording and the audio recording method provided in the embodiment of the present application are two completely independent recording methods. The two recording methods do not interfere with each other when executed at the same time, and the two recording methods each generate a recording file (microphone audio and internal recording audio). The microphone audio and the internal recording audio are two audio files. When generating the final recorded audio, the microphone audio and the internal recording audio can be synthesized to obtain the recorded audio. Alternatively, two audio files, the microphone audio and the internal recording audio, can be obtained after the recording is completed.

[0102] In one embodiment, if the terminal turns on the external speaker mode, the microphone audio will also be mixed with the sound of the internally recorded audio. At this time, if you want to obtain pure terminal external audio, you can subtract the internally recorded audio from the microphone audio to obtain pure terminal external audio, for example, pure human voice audio, or pure ambient noise.

[0103] In another embodiment, if the terminal turns on the external speaker mode and the microphone audio contains the sound of the internally recorded audio, the microphone audio can be used to fill the gaps in the internally recorded audio. For example, if a call to the audio visualization interface fails and no data within a certain period of time is obtained, the audio data of this period in the microphone audio can be used to fill in the missing data portion of the internally recorded audio to complete the internally recorded audio. Alternatively, after denoising the microphone audio, the audio data of this period in the denoised microphone audio can be filled in the missing data portion of the internally recorded audio. In this way, both the clarity and integrity of the internally recorded audio can be guaranteed.

[0104] Step 221 : For at least two segments of data, use the first header data of the later sampled data as a search sample.

[0105] Exemplarily, to search for duplicate data between at least two data segments, the first x bytes of the rear sampled data may be selected as the search sample. That is, the first header data includes data from the first byte to the xth byte of the rear sampled data, where x is a positive integer. Alternatively, x may be 16, in which case the first header data is the first 16 bytes of the rear sampled data.

[0106] The search sample is used to find data repetitions in other data (previous sampled data) in at least two segments of data.

[0107] The at least two data segments can be divided into first-sampled data and last-sampled data based on the order of acquisition time. It should be noted that first-sampled data and last-sampled data are relative concepts. For example, the first data segment is the first-sampled data of the second data segment, the second data segment is the last-sampled data of the first data segment, and the third data segment is the first-sampled data of the third data segment.

[0108] For example, the length of the first header data affects search efficiency and accuracy. If the length is too long, repeated data may not be found, while if the length is too short, the wrong repeated data may be found. Therefore, the inventors have experimentally verified that when the data size of each segment is 1kB, the search effect is better when the first 16 bytes of the sampled data are used as the search sample.

[0109] Step 222: Determine target data that is the same as the search sample data from the first sampled data.

[0110] Exemplarily, the first header data of the later sampled data is used to search for the same data portion (target data) in the earlier sampled data.

[0111] For example, the first sampled data here may be a segment of data sampled before the second sampled data. Alternatively, the first sampled data may be a segment of data obtained by splicing at least one segment of data sampled before the second sampled data.

[0112] Exemplarily, the prior sampled data includes: first prior sampled data adjacent to the subsequent sampled data; and second prior sampled data not adjacent to the subsequent sampled data; when the target data does not exist in the first prior sampled data, the target data is determined from the second prior sampled data, wherein the second prior sampled data is collected earlier than the first prior sampled data.

[0113] For example, since at least two pieces of data are sampled, the sampled data may contain errors or deviations. The criteria for determining data identity here may be: 100% data identity, or a data identity rate exceeding a preset value, such as 99%, 98%, etc.

[0114] For example, different sampling start times for the same data may result in completely different sampled data. For example, for a string of data "1 2 3 4 5 6 7 8 9 10," if sampling begins at the first time, the data segment obtained may be "1 3 5 7 9," while if sampling begins at the second time, the data segment obtained may be "2 4 6 8 10." It can be seen that the data obtained from the two sampling segments are completely different, but in fact, they should be different sampling portions of the repeated data. Therefore, a method for determining data similarity can also be: fitting the search sample to obtain a first fitting curve, fitting the first sampled data to obtain a second fitting curve, calculating the similarity between the first fitting curve and each candidate curve segment in the second fitting curve, and determining the data segment corresponding to the candidate curve segment with the highest similarity as the target data. The candidate curve can be intercepted from the second fitting curve based on a time window, where the length of the time window is equal to the length of the first fitting curve.

[0115] Step 223 , determining the second header data of the later sampled data as the data repetition portion; the data length of the second header data is equal to the data length from the target data to the tail of the first sampled data.

[0116] Exemplarily, after the target data is searched, the length of the data overlap portion is determined based on the length from the target data location to its tail in the first sampled data, and then the data overlap portion is deleted from the later sampled data based on the length of the data overlap portion.

[0117] Exemplarily, when the target data is found in the second online sampled data, the data after the second header data is deleted from the subsequent sampled data and the data is concatenated with the tail of the second previous sampled data.

[0118] For example, to further improve the accuracy of identifying duplicate data, a third data portion of the first sampled data may be intercepted. The third data portion is the entire data from the target data to the end of the first sampled data, including the target data. The data overlap ratio between the third data portion and the second header data is calculated. If the data overlap ratio is greater than a first value, the second header data is determined to be a duplicate data portion. The first value can be set arbitrarily, for example, 99%, 98%, or 95%.

[0119] Step 231 : Concatenate the data after deleting the second header data in the later sampled data with the tail of the earlier sampled data.

[0120] Exemplarily, the second header data in the later sampled data is deleted to remove the repeated data in the first sampled data and the later sampled data, and then the remaining data after the deletion is spliced ​​to the end of the first sampled data.

[0121] Exemplarily, duplicate portions of data of at least two segments of data are deduplicated.

[0122] Exemplarily, if the time interval of the preset capture frequency is less than the preset duration, then two adjacent data in at least two data segments have a data repetition portion, or at least two data segments have a time overlap portion.

[0123] In an optional embodiment, the terminal can identify duplicate portions based on whether the audio data is identical. The terminal obtains a spliced ​​audio segment, where the spliced ​​audio segment is obtained by splicing the first n segments of at least two data segments, where n is a positive integer; and deletes the overlapping portion of the data in the n+1th segment that overlaps with the spliced ​​audio segment, thereby obtaining the deduplicated n+1th segment of data.

[0124] Exemplarily, the terminal may determine the first x bytes of the n+1th segment of at least two data segments, where x is a positive integer; determine the target data in the spliced ​​audio that overlaps with the first x bytes; determine the byte length L of the duplicated portion of the data based on the number of bytes from the first byte of the target data to the last byte of the spliced ​​audio, where L is a positive integer; and delete the first L bytes of the n+1th segment of data to obtain the deduplicated n+1th segment of data. Exemplarily, x may be a value greater than 16.

[0125] For example, Figure 5As shown, for a piece of collected data 302, the first x bytes of data 302 are taken as a search sample; the search sample is searched from the sequence of spliced ​​audio to determine the length L of the repeated data (the repeated part of the data) (the repeated data are from the position of the first byte searched to the end of the spliced ​​audio sequence); the repeated data in data 302 (from the beginning to the position of length L) are removed to obtain the valid data of data 302; the valid data is appended to the spliced ​​audio to obtain a new spliced ​​audio; and the next piece of data is spliced ​​in the same way as described above.

[0126] For example, the spliced ​​audio has 100 bytes and the data to be spliced ​​has 20 bytes. When the 1st to 5th bytes of the data to be spliced ​​are the same as the 91st to 95th bytes of the spliced ​​audio, delete the 1st to 10th bytes of the data to be spliced ​​to obtain the deduplicated data (the 11th to the 20th bytes), and then add the deduplicated data to the end of the spliced ​​audio, and finally get 110 bytes.

[0127] For example, to improve search efficiency, the search can be started from the end of the spliced ​​audio, and the search data range is equal to the amount of data in a segment. For example, if the spliced ​​audio includes 100 bytes, the segment includes 10 bytes, and the search sample is 5 bytes, then the search is first performed to see if bytes 95 to 100 of the spliced ​​audio are the same as the search sample, then bytes 94 to 99 are searched, then bytes 93 to 98 are searched, then bytes 92 to 97 are searched, then bytes 91 to 96 are searched, then bytes 90 to 95 are searched, and the search ends here.

[0128] In another optional embodiment, the terminal can identify the repeated part based on the playback time. Each audio data in the data corresponds to a playback time. The terminal obtains the spliced ​​audio, which is obtained by splicing the first n segments of data in at least two segments of data, where n is a positive integer; deletes the part of the n+1 segment of data that overlaps with the spliced ​​audio time to obtain the deduplicated n+1 segment of data. The deduplicated n+1 segment of data is spliced ​​to the end of the spliced ​​audio to obtain a new spliced ​​audio. Repeat the above steps to splice the next segment of data.

[0129] For example, if the spliced ​​audio is spliced ​​to 200ms and the data to be spliced ​​is from 160ms to 220ms, then delete the 160ms to 200ms portion of the data to be spliced, leaving the portion from 201ms to 220ms. The remaining portion is spliced ​​to the end of the spliced ​​audio, and the new spliced ​​audio is spliced ​​to 220ms.

[0130] Exemplarily, at least two deduplicated segments of data are sequentially spliced ​​together to obtain internally recorded audio.

[0131] Exemplarily, deduplication may be performed by removing the same portion of audio data, or by removing the portion having the same playback time, or by removing the portion having the same audio data and the same time.

[0132] Exemplarily, deduplication is to remove the portion of the data with a later time that is repeated with the data with a previous time, that is, retain the repeated portion of the data with a previous time. Of course, deduplication can also be to remove the portion of the data with a previous time that is repeated with the data with a later time, that is, retain the repeated portion of the data with a later time.

[0133] Exemplarily, the deduplicated n+1th segment of data is spliced ​​to the end of the spliced ​​audio to obtain new spliced ​​audio; let n be equal to n+1 and repeat the steps of "obtaining the spliced ​​audio, deleting the overlapping part of the n+1th segment of data that overlaps with the spliced ​​audio", and sequentially splice at least two segments of data to obtain the internally recorded audio.

[0134] For example, Figure 6 As shown, data 1, data 2, data 3, and data 4 arranged in sequence are obtained through the audio visualization interface, among which data 1 and data 2 have overlapping part 1, data 2 and data 3 have overlapping part 2, and data 3 and data 4 have overlapping part 3; the overlapping part is deleted from the latter data, the overlapping part 1 is deleted from data 2, the overlapping part 2 is deleted from data 3, and the overlapping part 3 is deleted from data 4; then data 1 is spliced ​​with the remaining data 2, 3, and 4 to obtain the internally recorded audio.

[0135] In an optional embodiment, if the target data cannot be found in the first sampled data, the terminal can first place the later sampled data at the end of the data list and then join the other data. After the other data is joined, the terminal can then try to search for the same data portion using the search pattern of the later sampled data. In other words, if the target data cannot be found in the first sampled data, the order of the later sampled data is adjusted to place it at the end, and the terminal will repeat the cycle of trying to join the later data in the order.

[0136] Exemplarily, the terminal stores a data list, which is used to sequentially store at least two segments of data, and delete a segment of data from the data list after it is successfully spliced; when the target data that is the same as the search sample data cannot be determined from the first sampled data, the later sampled data is stored at the end of the data list; and according to the storage order of the data in the data list, a segment of data at the head of the data list is spliced.

[0137] In another optional embodiment, when the data to be spliced ​​(eg, the n+1th segment of data) does not overlap with the spliced ​​audio, the data may be spliced ​​based on the playback time of the audio data in the data.

[0138] Optionally, the n+1th segment of data corresponds to a first time, and the first time is the starting playback time of the terminal playing the n+1th segment of data; each byte in the spliced ​​audio corresponds to a playback time; when the n+1th segment of data does not overlap with the spliced ​​audio, and the spliced ​​audio does not have audio data at the first time, the n+1th segment of data is spliced ​​to the first time of the spliced ​​audio to obtain a new spliced ​​audio.

[0139] Exemplarily, the first sampling data and the second sampling data respectively correspond to time information; when the target data identical to the search sample data cannot be determined from the first sampling data, and there is no time overlap between the first sampling data and the second sampling data, the first sampling data and the second sampling data are spliced ​​according to the time information; wherein, after splicing, there is a data missing portion between the first sampling data and the second sampling data (data missing without time overlap).

[0140] For example, Figure 7 As shown, there is no overlapping audio data between data 303 and the spliced ​​audio (the audio data is the same), and data 303 is from 140ms to 160ms, and the spliced ​​audio is from 0ms to 120ms. There is no time overlapping between data 303 and the spliced ​​audio (or the spliced ​​audio has no audio data at the time corresponding to data 303). Then, data 303 is directly spliced ​​to the corresponding time point after the spliced ​​audio, that is, data 303 is spliced ​​to the position of 140ms to obtain new spliced ​​audio (0ms to 160ms). The new spliced ​​audio has no audio data (data missing part) from 120ms to 140ms.

[0141] Optionally, if the n+1th segment of data does not have any overlapping part with the spliced ​​audio, and the spliced ​​audio has audio data at the first time, delete the time overlapping part in the n+1th segment of data to obtain the deduplicated n+1th segment of data, and the time overlapping part includes the part where the spliced ​​audio and the n+1th segment of data overlap in time; splice the deduplicated n+1th segment of data to the end of the spliced ​​audio to obtain new spliced ​​audio.

[0142] Exemplarily, the first sampling data and the second sampling data respectively correspond to time information; when the target data identical to the search sample data cannot be determined from the first sampling data, and there is a time overlap between the first sampling data and the second sampling data, the data after the time overlap is deleted from the second sampling data and spliced ​​with the end of the first sampling data.

[0143] Exemplarily, when there is no matching part that overlaps with the first x bytes in the spliced ​​audio, and there is audio data in the spliced ​​audio at the first time, the byte length M of the part to be deleted is determined based on the number of bytes from the byte corresponding to the first time in the spliced ​​audio to the last byte of the spliced ​​audio, where M is a positive integer; delete the first M bytes of the n+1th segment of data to obtain the deduplicated n+1th segment of data; and splice the deduplicated n+1th segment of data to the end of the spliced ​​audio to obtain a new spliced ​​audio.

[0144] For example, Figure 8 As shown, there is no overlapping audio data between data 304 and the spliced ​​audio (the audio data are the same), and data 304 is from 100ms to 160ms, and the spliced ​​audio is from 0ms to 120ms. There is a time overlapping part between data 304 and the spliced ​​audio: 100ms to 120ms, then the time overlapping part in data 304 is deleted to obtain the deduplicated data 304: 120ms to 160ms, that is, the deduplicated data 304 is spliced ​​to the end of the spliced ​​audio to obtain the new spliced ​​audio (0ms to 160ms).

[0145] In an optional embodiment, when there are three or more data segments with the same time-repeating portion (the audio data is different at the same time), the audio data of the multiple time-repeating portions can be median and then spliced ​​onto the spliced ​​audio to reduce the audio acquisition error rate.

[0146] In summary, the method provided in this embodiment realizes internal audio recording by multiplexing the audio visualization interface. The integrity of the collected audio is ensured by calling the audio visualization interface at a high frequency. For repeated data, the data is first deduplicated and then spliced ​​to obtain complete internal audio recording. The clarity of the internal audio recording is improved and the impact of environmental noise on the internal audio recording is reduced. Moreover, using this method, even if the volume of the audio played by the terminal is very low, the terminal can still record the internal audio recording clearly and accurately, which greatly improves the recording effect of the internal audio recording.

[0147] The method provided in this embodiment is not limited to microphones and can capture audio played by the terminal even when the terminal lacks audio capture hardware. Furthermore, even if the terminal is connected to headphones and has no external audio player, the method provided in this embodiment can still capture internally recorded audio, greatly expanding the applicable scenarios for internal audio recording and reducing the hardware requirements for internal audio recording.

[0148] The method provided in this embodiment uses the first few bytes of the data to be spliced ​​as search samples to search for duplicate data within the spliced ​​audio, improving search efficiency. After finding duplicate data, the method then deletes the first few bytes of the data to be spliced ​​based on the number of bytes from the duplicate data to the end of the spliced ​​audio. This allows for rapid deduplication, efficient splicing, and improved audio recording efficiency.

[0149] The method provided in this embodiment can also deduplicate and splice audio data in time based on the start playback time or playback time of the data when the audio data comparison method cannot match the repeated part of the data, thereby improving the audio splicing efficiency and reducing the audio splicing error rate.

[0150] Illustratively, an embodiment of the present application also provides a method for completing missing audio data.

[0151] Figure 9 The flowchart of the audio recording method provided by an exemplary embodiment of the present application is shown. The method can be executed by a terminal. Figure 2 In the illustrated embodiment, step 230 also includes steps 241 to 244 .

[0152] Step 210: When playing audio, call the audio visualization interface to capture at least two segments of data in the data stream required by the terminal to play the audio.

[0153] Step 220: Identify data duplication between at least two data segments.

[0154] Step 230: splice at least two segments of data according to the location of the repeated portion of the data to obtain the internally recorded audio.

[0155] Illustratively, the methods of step 210 to step 230 may refer to the method provided in any of the above embodiments.

[0156] Step 241: intercept two reference audio segments that are adjacent to the data missing portion in the internally recorded audio.

[0157] Exemplarily, the internally recorded audio includes a data missing portion, where no audio data exists in the data missing portion. A data missing portion refers to a portion of the internally recorded audio where no audio data exists for a continuous period of time. Optionally, the internally recorded audio may have multiple data missing portions. This embodiment uses filling one data missing portion as an example for explanation; the same method can be used to fill other data missing portions.

[0158] For example, a data missing portion (or data blank portion) refers to a continuous period of time during which there is no audio data, or a continuous period of time during which the amount of audio data does not meet the requirement (or the sampling rate of the audio data during this period of time does not meet the requirement). In other words, all or part of the audio data is missing from the data missing portion.

[0159] Exemplarily, in order to improve the integrity of the internally recorded audio, it is necessary to fill in the audio data for the missing data portion. This embodiment utilizes a neural network model to predict the audio data of the missing data portion. The input data required for the prediction include: a reference audio segment before the missing data portion, a reference audio segment after the missing data portion, and the amount of missing data or the missing duration of the missing data portion. For example, if the missing data portion is 120ms to 160ms, then the reference audio before the missing data portion (100ms to 120ms) and the reference audio after the missing data portion (160ms to 170ms) can be taken. The neural network model is used to predict the audio data of the missing data portion based on the changing trend of the audio data before and after the missing data portion.

[0160] Exemplarily, the time lengths of the adjacent reference audios can be the same or different. For example, more audio before the first data missing part can be intercepted as reference audio so that the neural network model can learn the historical change trends and change characteristics of the internally recorded audio, so as to better predict the audio data of the data missing part.

[0161] Step 242: Obtain the amount of missing data in the data missing portion.

[0162] Exemplarily, the amount of missing data is used to indicate to the neural network model the amount of data that needs to be predicted.

[0163] Alternatively, the terminal may also obtain the missing duration of the data missing portion. The missing duration is used to indicate to the neural network model the time length of the first data missing portion that needs to be predicted.

[0164] Alternatively, the terminal may obtain the missing duration of the first data missing portion and the sampling rate of the audio data of the internally recorded audio, and use the missing duration, sampling rate, and the two preceding and following reference audio segments as input data for the model to predict the audio data of the first data missing portion.

[0165] In step 243 , the two reference audio segments and the amount of missing data are input into the audio prediction model to obtain predicted data, where the amount of the predicted data is equal to the amount of missing data.

[0166] The audio prediction model is a pre-trained neural network model. The neural network model can have any model structure. For example, the audio prediction model can use a convolutional neural network or a long short-term memory network (LSTM).

[0167] Among them, the two reference audios and the amount of missing data are the input data of the model, and the predicted data are the output data of the model.

[0168] Alternatively, two reference audio segments and missing duration are used as input data for the model, and the predicted data is used as output data for the model.

[0169] In step 244, the predicted data is filled into the missing data portion of the internally recorded audio to obtain the completed audio.

[0170] After using the audio prediction model to predict the audio data (predicted data) of the missing part of the first data, the predicted data can be used to fill the missing part of the first data, thereby making the internally recorded audio more complete and obtaining the completed audio.

[0171] To sum up, the method provided in this embodiment uses a neural network model to supplement the missing parts of the audio data in the internally recorded audio, thereby reducing the impact of the failure of the audio visualization interface call on the internally recorded audio and improving the data integrity and coherence of the internally recorded audio.

[0172] For example, an exemplary embodiment of recognizing subtitles or lyrics based on recorded audio is given.

[0173] Figure 10 A flowchart of an audio processing method provided by an exemplary embodiment of the present application is shown. The method can be executed by a terminal. The method includes the following steps.

[0174] Step 212: When it is detected that the user plays audio through headphones or at zero volume, at least two segments of data in the data stream required by the terminal to play the audio are captured.

[0175] Exemplarily, when it is detected that the terminal is currently in a headphone playing state, or when it is detected that the current playing volume of the terminal is 0, at least two segments of data in a data stream required by the terminal for playing audio are captured.

[0176] Exemplarily, in response to a recording instruction, the terminal obtains the current playback status; when the current playback status is headphone playback, the audio visualization interface is called to capture at least two segments of data in the data stream required by the terminal to play audio; when the playback status is a silent state, the audio visualization interface is called to capture at least two segments of data in the data stream required by the terminal to play audio.

[0177] Exemplarily, in response to a recording instruction, when the playback state is external (amplified through the terminal's speaker) and the volume is not 0, the terminal can call the audio visualization interface to capture data to generate internally recorded audio, or it can record audio through a microphone.

[0178] Exemplarily, the terminal can determine the recording mode according to the user settings. In response to the user's instruction to use the system internal recording mode for internal recording, the audio visualization interface is called to capture at least two segments of data in the data stream required by the terminal to play audio, and the at least two segments of data are spliced ​​to obtain the internally recorded audio. In response to the user's instruction to use the microphone for recording, the microphone is turned on to record the audio. In response to the user's instruction to use the system internal recording mode for internal recording and to record through the microphone at the same time; the audio visualization interface is called to capture at least two segments of data in the data stream required by the terminal to play audio, and the at least two segments of data are spliced ​​to obtain the internally recorded audio; and the microphone is turned on to record the audio.

[0179] Step 220: Identify data duplication between at least two data segments.

[0180] Step 230: splice at least two segments of data according to the location of the repeated portion of the data to obtain the internally recorded audio.

[0181] Step 251: Perform voice recognition on the internally recorded audio to obtain text information corresponding to the internally recorded audio.

[0182] Automatic Speech Recognition (ASR) technology is used to perform speech recognition on the internally recorded audio to obtain the text information corresponding to the internally recorded audio.

[0183] For example, an ASR algorithm is invoked to perform speech recognition on the internally recorded audio to obtain text information corresponding to the internally recorded audio. For example, the internally recorded audio is input into the ASR algorithm, which encodes and extracts features from the internally recorded audio to obtain speech features. The ASR algorithm then decodes the speech features to obtain predicted text (the text information corresponding to the internally recorded audio).

[0184] Exemplarily, after obtaining the text information, the terminal may automatically search for relevant information of the text information and display the relevant information.

[0185] For example, when the text information is lyrics, the song information corresponding to the lyrics is searched and displayed; when the text information is article content, the article information corresponding to the article content is searched and displayed.

[0186] Exemplarily, a search is performed in a song database based on text information for related songs. The song database stores one-to-one correspondences of: song information, song lyrics, and song audio files. The song information includes: song title, singer, composer, lyricist, arranger, producer, cover image, upload time, comment information, number of plays, number of favorites, and at least one type of information related to the song. Exemplarily, the text information is matched with the song lyrics. If the match is successful, the song information of the corresponding song is obtained. After the corresponding song is searched for based on the text information, an information card can be generated based on the song information corresponding to the song. The information card displays at least one type of song information about the song. The information card is displayed on the interface to remind the user of the relevant information of the song currently being played.

[0187] Exemplarily, related articles are searched in an article database based on text information. The article database stores one-to-one correspondences: article information and article text. The article information includes at least one information related to the article, such as the article title, author, literature inclusion, text content with the most citations, cover image, upload time, comment information, number of citations, number of favorites, etc. Exemplarily, the text information is matched with the article text, and if the match is successful, the article information of the corresponding article is obtained. After the corresponding article is searched for based on the text information, an information card can be generated based on the article information corresponding to the article, and the information card displays at least one article information of the article. The information card is displayed on the interface to remind the user of the relevant information of the article corresponding to the audio currently being played.

[0188] Exemplarily, a search is performed in a film and television database based on the text information for related film and television works. The database stores a one-to-one correspondence between the following: film and television work information, film and television work video files, and film and television work subtitles. The film and television work information includes at least one piece of information related to the film and television work, such as the film and television work title, director, cast, release date, cover image, commentary, number of views, and number of favorites. Exemplarily, the text information is matched with the film and television work subtitles. If the match is successful, the film and television work information for the corresponding film and television work is obtained. After the corresponding film and television work is searched based on the text information, an information card can be generated based on the film and television work information corresponding to the film and television work. The information card displays at least one piece of film and television work information for the film and television work. The information card is displayed on the interface to remind the user of the relevant information about the film and television work corresponding to the currently playing audio.

[0189] Exemplarily, the terminal may also generate a subtitle display file or a lyrics display file according to text information corresponding to the internally recorded audio.

[0190] Exemplarily, the audio played by the terminal may be played by a second application, and the second application may be a music player program or a video player program.

[0191] For example, the method provided in this embodiment can be executed by a first application, which can be an audio processing program. Using the method provided in this embodiment, the first application records audio played by a second application, obtaining internally recorded audio. Speech recognition is then performed on the internally recorded audio, and based on the speech recognition results, a corresponding subtitle display file or lyrics display file is generated. This allows the second application to complete the missing subtitle or lyrics file if the second application lacks subtitles or lyrics.

[0192] For example, the first application automatically generates a subtitle display file or a lyrics display file based on the text information corresponding to the recorded audio, and sends the subtitle display file or the lyrics display file to the second application. The second application can directly run the subtitle display file or the lyrics display file to display the corresponding subtitles or lyrics when playing the audio.

[0193] To sum up, the method provided in this embodiment can automatically capture the data of the audio played by the terminal when the user uses headphones or plays at zero volume, so that the user can record the audio played by the terminal without playing it externally, expanding the applicable scenarios of audio recording and improving audio recording efficiency.

[0194] The method provided in this embodiment can automatically obtain the audio file currently being played by the terminal through audio recording. After performing voice recognition on the audio file, the text information of the audio file can be obtained. Based on the text information, the database is searched for songs, articles, or film and television works associated with it, and then the relevant information of the song, article, or film and television work is obtained and displayed. This method can automatically identify songs, articles, or film and television works related to the audio when the user plays the audio. When the user is interested in the audio, the user can directly find content related to the audio through the relevant information automatically displayed by the terminal, thereby improving the user's information search efficiency.

[0195] The method provided in this embodiment can automatically generate corresponding subtitle files or lyrics files based on the recorded audio through internal audio recording. When a music player does not have a lyrics file for a song, this method can be used to quickly generate a lyrics file for that song. Running the lyrics file in the music player can then add the lyrics to the song. Alternatively, when a video player does not have a subtitle file for a movie, this method can be used to quickly generate a subtitle file. Running the subtitle file in the video player can display the corresponding subtitles while watching the movie. This method improves the efficiency of generating subtitle and lyrics files.

[0196] The following is an embodiment of the device of the present application. For details not described in detail in the embodiment of the device, reference can be made to the corresponding records in the above method embodiment, and no further details will be given herein.

[0197] Figure 11 A schematic diagram of the structure of an audio recording device provided by an exemplary embodiment of the present application is shown. The device can be implemented as all or part of a terminal through software, hardware, or a combination of both. The device includes:

[0198] The capture module 401 is configured to capture at least two segments of data in a data stream required by the terminal to play the audio when the audio is played;

[0199] An identification module 402 is configured to identify a data duplication portion of the at least two segments of data;

[0200] The splicing module 403 is used to splice the at least two segments of data according to the location of the repeated portion of the data to obtain the internally recorded audio.

[0201] In an optional embodiment, the capturing module 401 is configured to call an audio visualization interface to capture the at least two segments of data in a data stream required by the terminal to play the audio.

[0202] In an optional embodiment, the capture module 401 is configured to call an audio visualization interface to capture the at least two segments of data in the data stream required by the terminal to play the audio according to a preset capture frequency;

[0203] There is data duplication between two adjacent sampled data segments.

[0204] In an optional embodiment, the identification module 402 is configured to use the first header data of the later sampled data as a search sample for the at least two segments of data;

[0205] The identification module 402 is used to determine target data identical to the search sample data from the first sampled data;

[0206] The identification module 402 is configured to determine the second header data of the later sampled data as the data repetition portion; the data length of the second header data is equal to the data length from the target data to the tail of the first sampled data.

[0207] In an optional embodiment, the first sampling data includes: first previous sampling data adjacent to the second sampling data, and second previous sampling data not adjacent to the second sampling data;

[0208] The identification module 402 is configured to determine the target data from the second previous sampling data when the target data does not exist in the first previous sampling data.

[0209] In an optional embodiment, the splicing module 403 is configured to splice the data after deleting the second header data in the subsequent sampled data with the tail of the second prior sampled data.

[0210] In an optional embodiment, the terminal stores a data list, the data list being used to sequentially store the at least two pieces of data, and deleting a piece of data from the data list after it is successfully spliced;

[0211] The splicing module 403 is configured to store the subsequent sampled data at the end of the data list when the target data identical to the search sample data cannot be determined from the prior sampled data;

[0212] The splicing module 403 is used to splice a section of data at the head of the data list according to the storage order of the data in the data list.

[0213] In an optional embodiment, the first sampling data and the second sampling data respectively correspond to time information;

[0214] The splicing module 403 is configured to splice the first sampling data and the second sampling data according to the time information when the target data identical to the search sample data cannot be determined from the first sampling data and there is no time overlap between the first sampling data and the second sampling data;

[0215] After the splicing, there is data missing between the first sampling data and the second sampling data without time overlap.

[0216] In an optional embodiment, the first sampling data and the second sampling data respectively correspond to time information;

[0217] The splicing module 403 is used to, when target data identical to the search sample data cannot be determined from the first sampling data and there is a time overlap between the first sampling data and the second sampling data, delete the data after the time overlap from the second sampling data and splice it with the end of the first sampling data.

[0218] In an optional embodiment, the internally recorded audio includes a data missing portion; and the apparatus further includes:

[0219] The completion module 404 is configured to intercept two reference audio segments adjacent to the missing data portion in the internally recorded audio;

[0220] The completion module 404 is used to obtain the amount of missing data in the missing data portion;

[0221] The completion module 404 is configured to input the two reference audio segments and the amount of missing data into an audio prediction model to obtain predicted data, where the amount of the predicted data is equal to the amount of missing data;

[0222] The completion module 404 is configured to fill the missing data portion of the internally recorded audio with the predicted data to obtain completed audio.

[0223] In an optional embodiment, the device further comprises:

[0224] The capture module 401 is configured to capture at least two segments of data in a data stream required by the terminal to play the audio when detecting that the user is playing the audio through headphones or at zero volume;

[0225] The speech recognition module is used to perform speech recognition on the internally recorded audio to obtain text information corresponding to the internally recorded audio.

[0226] In an optional embodiment, the device further comprises:

[0227] A search module, for searching and displaying song information corresponding to the lyrics when the text information is lyrics;

[0228] The search module is used to search for and display article information corresponding to the article content when the text information is article content.

[0229] Figure 12 Schematic diagram of the structure of a server provided by one embodiment of the present application. Specifically, server 800 includes a central processing unit (CPU) 801, a system memory 804 including random access memory (RAM) 802 and read-only memory (ROM) 803, and a system bus 805 connecting system memory 804 and CPU 801. Server 800 also includes a basic input / output system (I / O system) 806 that facilitates information transmission between various components within the computer, and a mass storage device 807 for storing an operating system 813, application programs 814, and other program modules 815.

[0230] The basic input / output system 806 includes a display 808 for displaying information and an input device 809, such as a mouse and keyboard, for user account input. Both the display 808 and the input device 809 are connected to the central processing unit 801 via an input / output controller 810 connected to the system bus 805. The basic input / output system 806 may also include an input / output controller 810 for receiving and processing input from various other devices, such as a keyboard, mouse, or electronic stylus. Similarly, the input / output controller 810 also provides output to a display screen, printer, or other types of output devices.

[0231] The mass storage device 807 is connected to the central processing unit 801 via a mass storage controller (not shown) connected to the system bus 805. The mass storage device 807 and its associated computer-readable media provide non-volatile storage for the server 800. In other words, the mass storage device 807 may include computer-readable media (not shown) such as a hard disk or a CD-ROM drive.

[0232] Without loss of generality, computer-readable media may include computer storage media and communication media. Computer storage media include volatile and non-volatile, removable and non-removable media implemented by any method or technology for storing information such as computer-readable instructions, data structures, program modules or other data. Computer storage media include RAM, ROM, Erasable Programmable Read-Only Memory (EPROM), Electrically Erasable Programmable Read-Only Memory (EEPROM), flash memory or other solid-state memory technology, CD-ROM, Digital Versatile Disc (DVD) or other optical storage, tape cassettes, magnetic tape, disk storage or other magnetic storage devices. Of course, those skilled in the art will appreciate that computer storage media are not limited to the above-mentioned types. The above-mentioned system memory 804 and mass storage device 807 can be collectively referred to as memory.

[0233] According to various embodiments of the present application, the server 800 may also be connected to a remote computer on a network such as the Internet for operation. That is, the server 800 may be connected to the network 812 via the network interface unit 811 connected to the system bus 805, or the network interface unit 811 may be used to connect to other types of networks or remote computer systems (not shown).

[0234] The present application also provides a terminal, which includes a processor and a memory, wherein the memory stores at least one instruction, and the at least one instruction is loaded and executed by the processor to implement the audio recording method provided by each of the above method embodiments. It should be noted that the terminal can be as follows Figure 13 The terminal provided.

[0235] Figure 13 The following is a block diagram of a terminal 900 according to an exemplary embodiment of the present application. Terminal 900 may be a smartphone, tablet computer, MP3 player (Moving Picture Experts Group Audio Layer III), MP4 player (Moving Picture Experts Group Audio Layer IV), laptop computer, or desktop computer. Terminal 900 may also be referred to as a user account device, portable terminal, laptop terminal, desktop terminal, or other similar names.

[0236] Typically, the terminal 900 includes a processor 901 and a memory 902 .

[0237] The processor 901 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 901 may be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), or PLA (Programmable Logic Array). The processor 901 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 901 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 901 may also include an AI (Artificial Intelligence) processor, which is used to process computing operations related to machine learning.

[0238] The memory 902 may include one or more computer-readable storage media, which may be non-transitory. The memory 902 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. In some embodiments, the non-transitory computer-readable storage medium in the memory 902 is used to store at least one instruction, which is used to be executed by the processor 901 to implement the audio recording method or audio recording method provided in the method embodiment of the present application.

[0239] In some embodiments, terminal 900 may optionally include a peripheral device interface 903 and at least one peripheral device. The processor 901, memory 902, and peripheral device interface 903 may be connected via a bus or signal lines. Each peripheral device may be connected to peripheral device interface 903 via a bus, signal lines, or circuit boards. Specifically, the peripheral device may include at least one of a radio frequency circuit 904, a display screen 905, a camera assembly 906, an audio circuit 907, a positioning assembly 908, and a power supply 909.

[0240] The peripheral device interface 903 can be used to connect at least one I / O (Input / Output)-related peripheral device to the processor 901 and the memory 902. In some embodiments, the processor 901, the memory 902, and the peripheral device interface 903 are integrated on the same chip or circuit board; in some other embodiments, any one or two of the processor 901, the memory 902, and the peripheral device interface 903 can be implemented on separate chips or circuit boards, which is not limited in this embodiment.

[0241] The RF circuit 904 is used to receive and transmit RF (Radio Frequency) signals, also known as electromagnetic signals. The RF circuit 904 communicates with communication networks and other communication devices via electromagnetic signals. The RF circuit 904 converts electrical signals into electromagnetic signals for transmission, or converts received electromagnetic signals into electrical signals. Exemplarily, the RF circuit 904 includes an antenna system, an RF transceiver, one or more amplifiers, a tuner, an oscillator, a digital signal processor, a codec chipset, a user account identity module card, and the like. The RF circuit 904 can communicate with other terminals via at least one wireless communication protocol. Such wireless communication protocols include, but are not limited to, the World Wide Web, metropolitan area networks, intranets, various generations of mobile communication networks (2G, 3G, 4G, and 5G), wireless local area networks, and / or WiFi (Wireless Fidelity) networks. In some embodiments, the RF circuit 904 may also include circuitry related to Near Field Communication (NFC), although this application does not limit this.

[0242] Display screen 905 is used to display a user interface (UI). This UI may include graphics, text, icons, videos, or any combination thereof. When display screen 905 is a touchscreen display, it is also capable of collecting touch signals on or above the surface of display screen 905. These touch signals can be input as control signals to processor 901 for processing. Display screen 905 can also be used to provide virtual buttons and / or a virtual keyboard, also known as soft buttons and / or a soft keyboard. In some embodiments, there can be a single display screen 905, located on the front panel of terminal 900. In other embodiments, there can be at least two display screens 905, located on different surfaces of terminal 900 or in a foldable design. In still other embodiments, display screen 905 can be a flexible display, located on a curved or foldable surface of terminal 900. Display screen 905 can also be configured as a non-rectangular, irregular shape, also known as a special-shaped screen. Display screen 905 can be made of materials such as LCD (Liquid Crystal Display) and OLED (Organic Light-Emitting Diode).

[0243] The camera assembly 906 is used to capture images or videos. Exemplarily, the camera assembly 906 includes a front camera and a rear camera. Typically, the front camera is arranged on the front panel of the terminal, and the rear camera is arranged on the back of the terminal. In some embodiments, there are at least two rear cameras, which are any one of a main camera, a depth of field camera, a wide-angle camera, and a telephoto camera, so as to realize the fusion of the main camera and the depth of field camera to realize the background blur function, the fusion of the main camera and the wide-angle camera to realize panoramic shooting and VR (Virtual Reality) shooting function or other fusion shooting functions. In some embodiments, the camera assembly 906 may also include a flash. The flash can be a monochrome temperature flash or a dual-color temperature flash. A dual-color temperature flash refers to a combination of a warm light flash and a cold light flash, which can be used for light compensation at different color temperatures.

[0244] The audio circuit 907 may include a microphone and a speaker. The microphone is used to collect sound waves from the user account and the environment, and convert the sound waves into electrical signals that are input into the processor 901 for processing, or input into the radio frequency circuit 904 to achieve voice communication. For the purpose of stereo sound collection or noise reduction, there can be multiple microphones, each located in different parts of the terminal 900. The microphone can also be an array microphone or an omnidirectional collection microphone. The speaker is used to convert electrical signals from the processor 901 or the radio frequency circuit 904 into sound waves. The speaker can be a traditional thin film speaker or a piezoelectric ceramic speaker. When the speaker is a piezoelectric ceramic speaker, it can not only convert electrical signals into sound waves audible to humans, but also convert electrical signals into sound waves inaudible to humans for purposes such as ranging. In some embodiments, the audio circuit 907 may also include a headphone jack.

[0245] Positioning component 908 is used to locate the current geographic location of terminal 900 to implement navigation or LBS (Location Based Service). Positioning component 908 can be a positioning component based on the US GPS (Global Positioning System), China's Beidou system, or Russia's Galileo system.

[0246] Power supply 909 is used to power various components in terminal 900. Power supply 909 can be AC ​​power, DC power, a disposable battery, or a rechargeable battery. When power supply 909 includes a rechargeable battery, the rechargeable battery can be a wired rechargeable battery or a wireless rechargeable battery. A wired rechargeable battery is a battery that is charged via a wired line, while a wireless rechargeable battery is a battery that is charged via a wireless coil. The rechargeable battery can also be used to support fast charging technology.

[0247] In some embodiments, the terminal 900 further includes one or more sensors 910 , including but not limited to: an acceleration sensor 911 , a gyroscope sensor 912 , a pressure sensor 913 , a fingerprint sensor 914 , an optical sensor 915 , and a proximity sensor 916 .

[0248] The accelerometer 911 can detect the magnitude of acceleration along the three coordinate axes of the coordinate system established by the terminal 900. For example, the accelerometer 911 can be used to detect the components of gravity acceleration along the three coordinate axes. The processor 901 can control the display screen 905 to display the user account interface in either a landscape or portrait view based on the gravity acceleration signal collected by the accelerometer 911. The accelerometer 911 can also be used to collect motion data for games or user accounts.

[0249] The gyroscope sensor 912 can detect the orientation and rotation angle of the terminal 900. It can also work with the accelerometer 911 to collect 3D motions of the user account on the terminal 900. Based on the data collected by the gyroscope sensor 912, the processor 901 can implement the following functions: motion sensing (for example, changing the UI based on the user account's tilt operation), image stabilization during shooting, game control, and inertial navigation.

[0250] The pressure sensor 913 can be set on the side frame of the terminal 900 and / or the lower layer of the display screen 905. When the pressure sensor 913 is set on the side frame of the terminal 900, it can detect the user account's grip signal on the terminal 900, and the processor 901 performs left and right hand recognition or shortcut operations based on the grip signal collected by the pressure sensor 913. When the pressure sensor 913 is set on the lower layer of the display screen 905, the processor 901 controls the operable controls on the UI interface based on the pressure operation of the user account on the display screen 905. Operable controls include at least one of button controls, scroll bar controls, icon controls, and menu controls.

[0251] The fingerprint sensor 914 is used to collect the fingerprint of the user account. The processor 901 identifies the identity of the user account based on the fingerprint collected by the fingerprint sensor 914, or the fingerprint sensor 914 identifies the identity of the user account based on the collected fingerprint. When the identity of the user account is identified as a trusted identity, the processor 901 authorizes the user account to perform relevant sensitive operations, such as unlocking the screen, viewing encrypted information, downloading software, making payments, and changing settings. The fingerprint sensor 914 can be set on the front, back, or side of the terminal 900. When a physical button or manufacturer logo is set on the terminal 900, the fingerprint sensor 914 can be integrated with the physical button or manufacturer logo.

[0252] The optical sensor 915 is used to detect ambient light intensity. In one embodiment, the processor 901 can control the display brightness of the display screen 905 based on the ambient light intensity detected by the optical sensor 915. Specifically, when the ambient light intensity is high, the display brightness of the display screen 905 is increased; when the ambient light intensity is low, the display brightness of the display screen 905 is decreased. In another embodiment, the processor 901 can also dynamically adjust the shooting parameters of the camera assembly 906 based on the ambient light intensity detected by the optical sensor 915.

[0253] Proximity sensor 916, also known as a distance sensor, is typically located on the front panel of terminal 900. Proximity sensor 916 is used to detect the distance between the user account and the front of terminal 900. In one embodiment, when proximity sensor 916 detects that the distance between the user account and the front of terminal 900 is gradually decreasing, processor 901 controls display screen 905 to switch from the screen-on state to the screen-off state. When proximity sensor 916 detects that the distance between the user account and the front of terminal 900 is gradually increasing, processor 901 controls display screen 905 to switch from the screen-off state to the screen-on state.

[0254] Those skilled in the art will understand that Figure 13 The structure shown in the figure does not constitute a limitation on the terminal 900, and the terminal 900 may include more or fewer components than shown in the figure, or combine certain components, or adopt a different component arrangement.

[0255] The memory also includes one or more programs, which are stored in the memory and include the one or more programs for performing the audio recording method provided in the embodiment of the present application.

[0256] The present application also provides a computer device, which includes: a processor and a memory, wherein the storage medium stores at least one instruction, at least one program, code set or instruction set, and the at least one instruction, at least one program, code set or instruction set is loaded and executed by the processor to implement the audio recording method provided by the above-mentioned method embodiments.

[0257] The present application also provides a computer-readable storage medium, which stores at least one instruction, at least one program, code set or instruction set. The at least one instruction, at least one program, code set or instruction set is loaded and executed by a processor to implement the audio recording method provided by the above-mentioned method embodiments.

[0258] The present application also provides a computer program product or computer program, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the audio recording method provided in the above optional implementation.

[0259] It should be understood that the term "plurality" used herein refers to two or more. "And / or" describes a relationship between associated objects, indicating that three possible relationships exist. For example, "A and / or B" can mean: A exists alone, A and B exist simultaneously, or B exists alone. The character " / " generally indicates an "or" relationship between the associated objects.

[0260] Those 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 a program to instruct the relevant hardware, and the program may be stored in a computer-readable storage medium, which may be a read-only memory, a disk, or an optical disk, etc.

[0261] The above are only optional embodiments of the present application and are not intended to limit the present application. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present application should be included in the scope of protection of the present application.

[0262] It should be noted that during the process of recording audio data, this application can display a prompt interface, pop-up window or output voice prompt information. The prompt interface, pop-up window or voice prompt information is used to remind the user that audio data is currently being recorded, so that this application only starts to execute the relevant steps of recording audio data after obtaining the user's confirmation operation on the prompt interface or pop-up window. Otherwise (that is, when the user's confirmation operation on the prompt interface or pop-up window is not obtained), the relevant steps of recording audio data are terminated, that is, the internal recorded audio is not obtained. In other words, the internal recorded audio collected by this application is collected with the user's consent and authorization, and the collection, use and processing of relevant data need to comply with the relevant laws, regulations and standards of relevant countries and regions.

Claims

1. An audio recording method, characterized in that: The method is executed by a terminal, and includes: When playing audio, capturing at least two segments of data in a data stream required by the terminal to play the audio; Identifying a data duplication portion of the at least two segments of data; According to the location of the repeated portion of the data, the at least two segments of data are spliced ​​to obtain the internally recorded audio.

2. The method according to claim 1, characterized in that The capturing of at least two segments of data in the data stream required by the terminal to play the audio includes: An audio visualization interface is called to capture the at least two segments of data in the data stream required by the terminal to play the audio.

3. The method according to claim 2, characterized in that The calling of the audio visualization interface to capture the at least two segments of data in the data stream required by the terminal to play the audio includes: Calling an audio visualization interface to capture the at least two segments of data in the data stream required by the terminal to play the audio according to a preset capture frequency; There is data duplication between two adjacent sampled data segments.

4. The method according to any one of claims 1 to 3, characterized in that: The step of identifying the data repetition part of the at least two segments of data comprises: For the at least two segments of data, using the first header data of the later sampled data as a search sample; Determine target data identical to the search sample data from the first sampled data; The second header data of the later sampled data is determined as the data repetition part; the data length of the second header data is equal to the data length from the target data to the tail of the earlier sampled data.

5. The method according to claim 4, characterized in that The first sampling data includes: first first sampling data adjacent to the second sampling data, and second first sampling data not adjacent to the second sampling data; The determining, from the first sampled data, target data identical to the search sample data comprises: When the target data does not exist in the first previous sampling data, the target data is determined from the second previous sampling data.

6. The method according to claim 5, characterized in that The step of splicing the at least two segments of data according to the location of the repeated portion of the data to obtain the internally recorded audio includes: The data after deleting the second header data in the later sampled data is concatenated with the tail of the second earlier sampled data.

7. The method according to claim 4, characterized in that The terminal stores a data list, the data list is used to sequentially store the at least two pieces of data, and delete a piece of data from the data list after it is successfully spliced; the method also includes: When the target data identical to the search sample data cannot be determined from the first sample data, storing the second sample data at the end of the data list; According to the storage order of the data in the data list, a segment of data located at the head of the data list is spliced.

8. The method according to claim 4, characterized in that The first sampling data and the second sampling data respectively correspond to time information; the method further includes: When the target data identical to the search sample data cannot be determined from the first sampled data, and there is no time overlap between the first sampled data and the second sampled data, splicing the first sampled data and the second sampled data according to the time information; After the splicing, there is data missing without time overlap between the first sampled data and the second sampled data.

9. The method according to claim 4, characterized in that The first sampling data and the second sampling data respectively correspond to time information; the method further includes: When the target data identical to the search sample data cannot be determined from the first sampled data, and there is a time overlap between the first sampled data and the second sampled data, the data after the time overlap is deleted from the second sampled data and concatenated with the end of the first sampled data.

10. The method according to any one of claims 1 to 3, characterized in that: The internally recorded audio includes a data missing portion; and the method further includes: Intercepting two reference audio segments in the internally recorded audio that are adjacent to and before the data-missing portion; Obtaining the amount of missing data in the data missing part; Inputting the two reference audios and the amount of missing data into an audio prediction model to obtain predicted data, wherein the amount of the predicted data is equal to the amount of missing data; The predicted data is filled into the missing data portion of the internally recorded audio to obtain the completed audio.

11. The method according to claim 1, characterized in that: When playing the audio, capturing at least two segments of data in the data stream required by the terminal to play the audio includes: When it is detected that the user plays audio through headphones or at zero volume, capturing at least two segments of data in a data stream required by the terminal to play the audio; After obtaining the internally recorded audio, the method further includes: Perform voice recognition on the internally recorded audio to obtain text information corresponding to the internally recorded audio.

12. The method according to claim 11, characterized in that: After performing voice recognition on the internally recorded audio to obtain text information corresponding to the internally recorded audio, the method further includes: When the text information is lyrics, searching for song information corresponding to the lyrics and displaying it; When the text information is article content, the article information corresponding to the article content is searched and displayed.

13. An audio recording device, characterized in that: The device comprises: A capture module, used for capturing at least two segments of data in a data stream required by the terminal for playing the audio when playing the audio; An identification module, used for identifying a data duplication portion of the at least two segments of data; The splicing module is used to splice the at least two segments of data according to the location of the repeated part of the data to obtain the internally recorded audio.

14. A computer device, characterized in that: The computer device includes: a processor and a memory, wherein the memory stores at least one instruction, at least one program, a code set or an instruction set, and the at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by the processor to implement the audio recording method as described in any one of claims 1 to 12.

15. A computer-readable storage medium, characterized in that: The storage medium stores at least one instruction, at least one program, a code set or an instruction set, and the at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by the processor to implement the audio recording method as described in any one of claims 1 to 12.

Citation Information

Cited By

  • Earphone control method and device, electronic equipment and storage medium

    CN118843036A