Audio data processing method and device, terminal and storage medium

By capturing and identifying data segments of played audio on the terminal, and performing related functions to achieve internal audio recording, it solves the problem of external volume and environmental noise affecting audio recording, improves the recording effect, and enhances the user experience.

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

Patent Information

Application Number
CN202310169413.1
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, the audio recording effect is poor due to the influence of external volume and environmental noise during audio recording, especially when wearing headphones, it is impossible to record the audio of the episode.

Method used

By capturing the data segments of played audio on the terminal, identifying them to obtain acoustic characteristic information and audio type information, and performing related functions based on this information, such as virtual object display, audio denoising, listening to songs, etc., to achieve internal audio recording to improve the recording effect.

Benefits of technology

No matter how the external environment and volume change, the terminal can efficiently record audio internally, provide high-quality audio recording services, and enhance user experience through virtual objects and sound effects.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118538236A
    Figure CN118538236A
Patent Text Reader

Abstract

The embodiment of the invention discloses an audio data processing method and device, a terminal and a storage medium, and belongs to the technical field of computers. The method comprises the following steps: when an audio is played, capturing a data segment which is being played in a data stream required by a terminal for playing the audio; identifying the data segment to obtain an identification result of the data segment, the identification result comprising at least one of acoustic characteristic information and audio type information; and based on the identification result, executing a target function, the target function including a function related to audio. When the terminal plays the audio, the playing data segment can be recorded, and the target function can be realized through the recorded data segment. The audio recording is not influenced by the external environment and the playing volume, so that the audio recording effect is improved, and the target function can provide better service.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of computer technology, and in particular to an audio data processing method, device, terminal and storage medium. Background Art

[0002] With the development of computer technology, applications provide more and more functions, such as audio processing. When a user uses an application on a terminal to watch a TV series and finds that the episode in the TV series is very nice, and wants to know the name of the episode, he can open the song recognition function of another application. The other application records the sound through the microphone of the terminal, recognizes the recording, obtains the name of the episode, and displays it to the user.

[0003] However, the above solution can only be implemented when the audio is played outwardly. If the user wears headphones to watch the TV series, the audio of the interlude cannot be recorded; even if the audio is played outwardly, it will be affected by the volume of the audio playback and the ambient noise, and the audio cannot be recorded clearly, and the audio recording effect is poor. Summary of the invention

[0004] The embodiments of the present application provide an audio data processing method, device, terminal and storage medium, which improve the audio recording effect. The technical solution is as follows:

[0005] In one aspect, a method for processing audio data is provided, the method comprising:

[0006] When playing audio, capturing the data segment being played in the data stream required by the terminal to play the audio;

[0007] Identify the data segment to obtain an identification result of the data segment, wherein the identification result includes at least one of acoustic characteristic information and audio type information;

[0008] Based on the recognition result, a target function is executed, wherein the target function includes: a function related to audio.

[0009] In another aspect, an audio data processing device is provided, the device comprising:

[0010] A collection module, used for capturing the data segment being played in the data stream required by the terminal to play the audio when the audio is played;

[0011] an identification module, configured to identify the data segment and obtain an identification result of the data segment, wherein the identification result includes at least one of acoustic characteristic information and audio type information;

[0012] A processing module is used to execute a target function based on the recognition result, wherein the target function includes: a function related to audio.

[0013] In one possible implementation, the acquisition module is used to call the audio visualization interface to capture the data segment being played in the data stream required by the terminal to play the audio. The initial function of the audio visualization interface is different from the target function, and the initial function is to acquire a data segment of a specified amount of data to visualize the waveform of the data segment.

[0014] In a possible implementation, the acquisition module is used to capture the data segment being played in the data stream required by the terminal to play the audio multiple times according to a preset capture frequency;

[0015] A processing module is used to determine target audio type information based on the audio type information of the multiple data segments; and execute the target function based on the target audio type information.

[0016] In one possible implementation, the processing module is used to determine the audio type information with the highest frequency of occurrence among the audio type information of the multiple data segments as the target audio type information; or, the audio type information of the data segment includes the probability that the data segment belongs to multiple audio types; based on the audio type information of the multiple data segments, the probabilities corresponding to the multiple audio types are accumulated to obtain the target audio type information; or, the audio type information of the multiple data segments is weighted averaged to obtain the target audio type information.

[0017] In one possible implementation, the processing module is used to execute the step of determining target audio type information based on the audio type information of the multiple data segments after the audio type information of the multiple data segments meets a stability condition; or, after the number of the multiple data segments reaches a target number, execute the step of determining target audio type information based on the audio type information of the multiple data segments.

[0018] In a possible implementation, the stability condition includes at least one of:

[0019] The number of identical audio type information reaches a first number;

[0020] A second number of consecutive audio type information are the same.

[0021] In a possible implementation, the target function is a virtual object display function; and the processing module is used to display a virtual object that matches at least one of the acoustic characteristic information and the audio type information.

[0022] In a possible implementation, the processing module is configured to perform at least one of the following:

[0023] When the acoustic characteristic information includes a musical instrument type, displaying a virtual musical instrument matching the musical instrument type;

[0024] When the audio type information includes at least one of a decade and a genre, displaying a virtual character whose virtual clothing matches at least one of the decade and the genre;

[0025] When the acoustic characteristic information includes timbre, displaying a virtual character that matches the timbre, wherein the timbre is used to indicate whether the singer is a man, a woman, or a child;

[0026] When the acoustic characteristic information includes audio energy, a virtual object having at least one of a color and a size matching the audio energy is displayed.

[0027] In a possible implementation, the processing module is further configured to perform at least one of the following:

[0028] Controlling the virtual object to perform a preset singing action or playing action;

[0029] Controlling the virtual object to perform a singing action or a playing action matching at least one of the acoustic characteristic information and the audio type information;

[0030] controlling the virtual object to perform a dance movement matching at least one of the acoustic characteristic information and the audio type information;

[0031] The virtual object is controlled to move in a random direction and bounce back after hitting the border of the current interface.

[0032] In a possible implementation, the processing module is further configured to perform at least one of the following:

[0033] When the audio type information includes at least one of the decade and the genre, controlling the virtual object to perform a dance move matching at least one of the decade and the genre;

[0034] When the acoustic characteristic information includes audio energy, controlling the virtual object to perform dance movements at a speed matching the audio energy;

[0035] When the audio type information includes emotion information, the virtual object is controlled to perform dance movements matching the emotion information.

[0036] In a possible implementation, the target function is a dynamic image display function; and the processing module is used to display a dynamic image whose dynamic changes match the acoustic characteristic information.

[0037] In a possible implementation manner, the acoustic characteristic information includes audio energy; and the processing module is configured to perform at least one of the following:

[0038] displaying an image of a record rotating at a speed matching the energy of the audio;

[0039] Displays a dynamic wallpaper that changes speed matching the energy of the audio.

[0040] In one possible implementation, the acoustic characteristic information includes pitch, and the target function is a pitch recognition function; the processing module is used to control a microphone to record and obtain recorded audio; perform pitch recognition on the recorded audio to obtain the pitch of the recorded audio; based on the pitch of the data segment and the pitch of the recorded audio, perform pitch recognition on the recorded audio to obtain a pitch recognition result, and the pitch recognition result is used to indicate the matching of the pitch of the recorded audio with the pitch of the data segment.

[0041] In a possible implementation, the processing module is further configured to perform at least one of the following:

[0042] Displaying a sing-along option on the upper layer of the current interface, and in response to a selection operation of the sing-along option, executing the step of controlling a microphone to record and obtain recorded audio;

[0043] The pitch recognition result is displayed on the upper layer of the current interface.

[0044] In a possible implementation, the identification module is further used to perform instrument identification on the recorded audio to obtain the instrument type of the recorded audio;

[0045] The processing module is further used to display the virtual musical instrument corresponding to the musical instrument type on the upper layer of the current interface.

[0046] In a possible implementation, the target function is an audio denoising function; the processing module is used to control a microphone to record and obtain recorded audio; and based on the acoustic characteristic information, denoise the recorded audio.

[0047] In a possible implementation, the processing module is configured to perform at least one of the following:

[0048] The acoustic characteristic information includes the frequency range of the data segment, and the audio signal whose frequency in the recorded audio does not belong to the frequency range is deleted;

[0049] The acoustic characteristic information includes timbre, and based on the timbre, the recorded audio is denoised so that the timbre of the recorded audio is consistent with the data segment.

[0050] In a possible implementation, the target function is a song recognition function; the processing module is used to query the target audio to which the data segment belongs from a database based on the recognition result; and display the audio identifier of the target audio.

[0051] In a possible implementation, the processing module is used to query multiple candidate audios matching the recognition result from the database based on the recognition result; and compare the data segment with the multiple candidate audios to obtain the target audio to which the data segment belongs.

[0052] In a possible implementation, the target function is a scene adding function; and the processing module is used to add a virtual scene matching the recognition result.

[0053] In a possible implementation, the processing module is configured to perform at least one of the following:

[0054] Adding a virtual scene matching the recognition result in the border area of ​​the current interface;

[0055] The audio type information includes emotion information, and a virtual scene with a style matching the emotion information is added to the target application.

[0056] In a possible implementation, the target function is a sound effect adding function; and the processing module is used to play the sound effect matching the recognition result during the audio playback process.

[0057] In a possible implementation, the processing module is configured to perform at least one of the following:

[0058] Playing an environmental sound effect that matches the recognition result;

[0059] Play the action sound effect that matches the recognition result.

[0060] In a possible implementation manner, the target function is a recommendation function; and the processing module is configured to perform at least one of the following:

[0061] recommending multimedia data matching the recognition result;

[0062] A game application matching the recognition result is recommended.

[0063] In a possible implementation, the processing module is used to recommend a game application whose background audio matches the recognition result; or recommend a game application whose game type matches the recognition result.

[0064] In a possible implementation, the acoustic characteristic information includes an audio quality parameter, and the target function is an audio quality detection function; and the processing module is used to display an audio quality detection result based on the audio quality parameter.

[0065] In a possible implementation manner, the processing module is used to display the audio quality detection result including the audio quality parameter; or determine the quality level of the audio quality parameter and display the audio quality detection result including the quality level.

[0066] In one possible implementation, the acquisition module is used to execute the step of capturing the data segment currently being played in the data stream required by the terminal to play the audio in response to the start-up operation of the target function; or, once every first time period, execute the step of capturing the data segment currently being played in the data stream required by the terminal to play the audio.

[0067] In a possible implementation, the identification module is configured to perform at least one of the following:

[0068] The acoustic characteristic information of the data segment includes audio energy, and the values ​​of multiple sampling points of the data segment are counted to obtain the audio energy of the data segment; or,

[0069] The acoustic characteristic information of the data segment includes pitch, performing autocorrelation analysis on the data segment to obtain a fundamental frequency of the data segment, and determining the pitch of the data segment based on the fundamental frequency;

[0070] The acoustic characteristic information of the data segment includes an audio quality parameter, obtaining a cumulative mean normalized difference function value of the data segment, and determining the audio quality parameter of the data segment based on a difference between the cumulative mean normalized difference function value and a first threshold, wherein the first threshold represents a proportion of non-periodic signal power in approximately periodic signal power;

[0071] Obtain the increment or derivative of the logarithmic scaled Mel-spectrogram, the logarithmic scaled Mel-spectrogram, and the average characteristic spectrum of the harmonic components and the percussion components of the data segment, call the audio classification model to classify the increment or derivative of the logarithmic scaled Mel-spectrogram, the logarithmic scaled Mel-spectrogram, and the average characteristic spectrum of the harmonic components and the percussion components, and obtain the recognition result of the data segment.

[0072] In a possible implementation, the audio is audio played by a target application, or the audio is audio played by a target webpage;

[0073] The target function includes: an audio-related function provided by the first application.

[0074] On the other hand, a terminal is provided, comprising a processor and a memory, wherein the memory stores at least one program code, and the at least one program code is loaded and executed by the processor to implement the operations performed in the audio data processing method as described in the above aspects.

[0075] On the other hand, a computer-readable storage medium is provided, in which at least one program code is stored. The at least one program code is loaded and executed by a processor to implement the operations performed in the audio data processing method described in the above aspects.

[0076] On the other hand, a computer program product is provided, wherein at least one program code is stored in the computer program product, and the at least one program code is loaded and executed by a processor to implement the operations performed in the audio data processing method of the above embodiment.

[0077] In the audio data processing method, device, terminal, storage medium and program product provided in the embodiments of the present application, when the terminal plays audio, the data segment being played can be recorded internally, and the target function is achieved through the internally recorded data segment. Since the audio internal recording is not affected by the external environment and the playback volume, the audio recording effect is improved, so that the target function can provide a better service. BRIEF DESCRIPTION OF THE DRAWINGS

[0078] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0079] Figure 1 It is a schematic diagram of an implementation environment provided by an embodiment of the present application;

[0080] Figure 2 is a flowchart of an audio data processing method provided by an embodiment of the present application;

[0081] Figure 3 is a flowchart of an audio data processing method provided by an embodiment of the present application;

[0082] Figure 4 is a flow chart of collecting data segments through an audio visualization interface provided by an embodiment of the present application;

[0083] Figure 5 is a flowchart of a training audio classification model provided in an embodiment of the present application;

[0084] Figure 6is a flowchart of an audio data processing method provided by an embodiment of the present application;

[0085] Figure 7 is a flowchart of an audio data processing method provided by an embodiment of the present application;

[0086] Figure 8 is a flowchart of an audio data processing method provided by an embodiment of the present application;

[0087] Fig. 9 is a flowchart of an audio data processing method provided by an embodiment of the present application;

[0088] Fig.10 is a flowchart of an audio data processing method provided by an embodiment of the present application;

[0089] Fig.11 is a flowchart of an audio data processing method provided by an embodiment of the present application;

[0090] Fig.12 is a flowchart of an audio data processing method provided by an embodiment of the present application;

[0091] Fig.13 is a flowchart of an audio data processing method provided by an embodiment of the present application;

[0092] Fig.14 is a flowchart of an audio data processing method provided by an embodiment of the present application;

[0093] Fig.15 is a structural schematic diagram of an audio data processing device provided in an embodiment of the present application;

[0094] Fig.16 A schematic diagram of the structure of a terminal provided in an embodiment of the present application;

[0095] Fig.17 It is a structural diagram of a server provided in an embodiment of the present application. DETAILED DESCRIPTION

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

[0097] It is understood that the terms "first", "second", "third", "fourth", "fifth", "sixth", etc. used in this application may be used herein to describe various concepts, but unless otherwise specified, these concepts are not limited by these terms. These terms are only used to distinguish one concept from another. For example, a first application may be referred to as a second application, and a second application may be referred to as a first application without departing from the scope of this application.

[0098] The terms "each", "multiple", "at least one", "any", etc. used in this application include one, two or more than two, multiple include two or more than two, each refers to each of the corresponding multiple, and any refers to any one of the multiple. For example, multiple data segments include 3 data segments, and each refers to each video in the 3 data segments, and any refers to any one of the 3 data segments, which can be the first, the second, or the third.

[0099] It should be noted that the information (including but not limited to user device information, user personal information, etc.), data (including but not limited to data used for analysis, stored data, displayed data, etc.) and signals involved in this application are all authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards of relevant countries and regions.

[0100] The audio data processing method provided in the embodiment of the present application is executed by a terminal. Optionally, terminal 101 is a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart home appliance, a smart watch, etc., but is not limited to this. Optionally, the terminal runs an operating system and multiple applications. In some embodiments, the multiple applications include an audio processing program. When the terminal plays audio, the audio processing program can collect the data segment being played through the audio visualization interface of the operating system, and the audio processing program identifies the data segment to obtain the recognition result of the data segment, and based on the recognition result, execute the target function. The target function can be a virtual object display function, a dynamic image display function, a pitch recognition function, a song recognition function, a sound effect addition function, etc. The embodiment of the present application does not limit the target function, and the target function includes functions related to audio.

[0101] Figure 1 is a schematic diagram of an implementation environment provided by an embodiment of the present application. Figure 1 , the implementation environment includes a terminal 101 and a server 102. The terminal 101 and the server 102 are connected via a wireless or wired network.

[0102] The server 102 is a server that provides services for the audio processing function. Optionally, the server 102 is a server, or a server cluster composed of several servers, or a cloud computing service center. Of course, the server 102 can also include other functional servers to provide more comprehensive and diversified services.

[0103] In some embodiments, the target function is a song identification function. The terminal 101 sends a data segment and a recognition result to the server 102. The server 102 determines the audio identifier of the audio to which the data segment belongs based on the data segment and the recognition result, and returns the audio identifier to the terminal 101.

[0104] Figure 2 is a flowchart of an audio data processing method provided by an embodiment of the present application. The present application embodiment is executed by a terminal. Figure 2 , the method comprising:

[0105] 201. When playing audio, the terminal captures the data segment being played in the data stream required by the terminal for playing the audio.

[0106] The terminal can play audio through any application, any web page, or a built-in playback component of the terminal. Therefore, when playing audio in the above step 201, it can be when an application on the terminal plays audio, when a web page on the terminal plays audio, or when a playback component plays audio. The embodiment of the present application does not limit this.

[0107] Taking the target application playing audio as an example, when the target application plays audio, the audio data stream flows from the target application via the operating system to the speaker of the terminal. Therefore, the terminal can capture the data segment at any stage in the transmission process of the data stream, and the embodiment of the present application does not limit this. Among them, the data segment can be regarded as an audio clip. Among them, the target application can be any application installed by the terminal, and the embodiment of the present application does not limit the target application.

[0108] In a possible implementation, the terminal captures data segments through an audio visualization interface. The audio visualization interface is a software interface. In some embodiments, the audio visualization interface is an interface provided by an operating system, and the operating system may be an Android system. The initial function of the audio visualization interface is to collect data segments of a specified amount of data to visualize the waveform of the data segment. For example, the audio visualization interface is a visualizer interface in an Android system. In an embodiment of the present application, the terminal only uses the audio visualization interface to collect data segments of a specified amount of data, and there is no limitation on whether the audio visualization interface visualizes the waveform of the data segment.

[0109] The specified data amount is limited by the authority of the audio visualization interface and is a very small amount of data. For example, the specified data amount is 1KB (Kilobyte). In some embodiments, the data segment is PCM (Pulse Code Modulation) data. The audio visualization interface collects 1KB of PCM data at a preset sampling rate, wherein 1KB can accommodate approximately 20 milliseconds of PCM data, that is, the duration of the data segment is approximately 20 milliseconds.

[0110] 202. The terminal identifies the data segment and obtains an identification result of the data segment, where the identification result includes at least one of acoustic characteristic information and audio type information.

[0111] The terminal can use any audio recognition method to identify the data segment, and the embodiment of the present application does not limit the audio recognition method. The recognition result of the data segment is used to describe the characteristics of the data segment. The recognition result includes at least one of acoustic characteristic information and audio type information. Among them, the acoustic characteristic information is used to represent information about the properties of the sound itself. Optionally, the acoustic characteristic information includes at least one of audio energy, pitch, timbre, audio quality parameters or instrument type. The audio type information is used to indicate the type to which the data segment belongs under artificially set standards. Optionally, the audio type information includes at least one of age, genre or emotional information. The embodiment of the present application does not limit the recognition result.

[0112] 203. The terminal executes a target function based on the recognition result, where the target function includes: a function related to audio.

[0113] The data segment obtained by the embodiment of the present application is difficult for human ears to distinguish when played due to its low sampling rate and short duration. Therefore, the data segment is not suitable for playback. For this reason, the embodiment of the present application identifies the data segment to obtain at least one of the acoustic characteristic information and audio type information of the data segment, and realizes the target function based on at least one of the acoustic characteristic information and audio type information.

[0114] In some embodiments, the data segment is captured through an audio visualization interface. The target function is a function related to audio and different from the original function of the audio visualization interface. In other words, the terminal uses the audio visualization interface to collect data segments, but the collected data segments are not used to realize the function of visualizing the waveform of the data segment, but to realize other functions.

[0115] Optionally, the target function includes at least one of a virtual object display function, a dynamic image display function, a pitch recognition function, an audio denoising function, a song identification function, a scene adding function, a sound effect adding function, a recommendation function or an audio quality detection function. The embodiment of the present application does not limit the target function.

[0116] In some embodiments, the target function is a function provided by the first application. The first application and the target application may be the same application or different applications, which is not limited in the embodiments of the present application.

[0117] In some embodiments, the target application may be a designated application, and the first application has established a cooperative relationship with the operator of the target application. The first application may provide services corresponding to the target function when the target application plays audio. In some embodiments, the target application is an application that is currently playing audio, so that the first application may provide services corresponding to the target function related to audio based on the audio being played when an application is currently playing audio. Optionally, the first application is another application different from the target application. The first application may be any audio processing application, and the embodiments of the present application do not limit the first application. In some embodiments, the terminal performs steps 201 to 203 above by running the first application.

[0118] The audio data processing method provided in the embodiment of the present application can record the data segment being played when the terminal plays audio, and realize the target function through the recorded data segment. Since the audio recording is not affected by the external environment and the playback volume, the audio recording effect is improved, so that the target function can provide a better service.

[0119] It should be noted that the target function can be any function, and the embodiment of the present application does not limit the target function. Figure 3 The illustrated embodiment is exemplified by taking the target function as a virtual object display function as an example.

[0120] Figure 3 is a flowchart of an audio data processing method provided by an embodiment of the present application. Figure 3 , the embodiment of the present application is executed by a terminal, and the method includes:

[0121] 301. When playing audio, the terminal captures the data segment being played in the data stream required by the local end to play the audio.

[0122] It should be noted that the above step 301 is the same as the above step 201, and will not be described one by one here, only some supplementary explanations are given.

[0123] Next, the execution timing of the above step 301 is exemplarily described:

[0124] In a possible implementation, after the user turns on the target function, the terminal executes the solution provided by the embodiment of the present application. In response to the turning on operation of the target function, the step of capturing the data segment being played in the data stream required by the terminal for playing audio is executed.

[0125] For example, when the user is using the target application, he also wants the service provided by the target function of the first application. In this case, the user can turn on the target function in the first application, and then return to the target application. The first application will respond to the target function turning on operation, capture the data segment being played, identify the data segment, obtain the identification result of the data segment, and execute the target function based on the identification result.

[0126] In another possible implementation, the step of capturing the data segment being played in the data stream required by the terminal for playing the audio is performed once every first time period. The first time period can be any time period, for example, 1 second, 1 minute, etc., which is not limited in the embodiment of the present application.

[0127] In some embodiments, the above step 301 is performed by the first application, and the first application cannot know whether the terminal is playing audio. Therefore, the first application can perform the step of capturing the data segment being played in the data stream required for playing audio once every first duration. If the terminal is not playing audio, and the captured data segment is a data segment without a waveform, then continue to perform the step of capturing the data segment being played in the data stream required for playing audio once every first duration. If the terminal is playing audio, then the captured data segment is a data segment with a waveform, and then the step of capturing the data segment being played in the data stream required for playing audio by the terminal can be performed once every second duration. Among them, the second duration is less than the first duration, that is, when determining that the terminal is playing, the data segment being played by the application is collected more frequently. Among them, the second duration can be a preset duration, a duration determined by experience, or a user-defined duration, and the embodiment of the present application does not limit the second duration.

[0128] For example, when a user is using a target application, the first application may obtain a data segment that the target application is playing, identify the data segment, obtain an identification result of the data segment, and execute a target function based on the identification result.

[0129] It should be noted that in Figure 3 In the embodiment shown, the target function is a virtual object display function; Figure 6 In the embodiment shown, the target function is a dynamic image display function; Figure 7 In the embodiment shown, the target function is a pitch recognition function; Figure 8In the embodiment shown, the target function is an audio denoising function; Fig. 9 In the embodiment shown, the target function is to identify songs by listening to them; Fig.10 In the embodiment shown, the target function is a scene adding function; Fig.11 In the embodiment shown, the target function is a sound effect adding function; Fig.12 In the embodiment shown, the target function is a recommendation function; Fig.13 In the illustrated embodiment, the target function is an audio quality detection function.

[0130] Next, an exemplary description is given of how a terminal captures a data segment being played in a data stream required for playing audio.

[0131] In one possible implementation, the target function is a function provided by a first application, and the audio is the audio being played by the target application. Then, the first application sends a request to the target application, and the target application sends the data segment being played to the first application. In another possible implementation, when the target application plays the audio, the audio data stream flows from the target application to the speaker of the terminal via the operating system, so the terminal can capture the data segment at any stage of the data stream transmission process. Optionally, the terminal can capture the data segment through an audio visualization interface.

[0132] In some embodiments, the audio visualization interface is an interface provided by an operating system, and the operating system may be an Android system or a MAC (Macintosh) system, etc. The operating system is not limited in the embodiments of the present application. The initial function of the audio visualization interface is to collect a data segment of a specified amount of data to visualize the waveform of the data segment. For example, the audio visualization interface is a visualizer interface in an Android system.

[0133] In some embodiments, the process of capturing data segments through the audio visualization interface can be as follows: Figure 4 The terminal sends an audio acquisition request to the operating system through the first application. After receiving the audio acquisition request, the operating system calls the audio visualization interface, captures the data segment being played by the target application through the audio visualization interface, and returns the collected data segment to the first application.

[0134] Optionally, the audio acquisition request carries a program identifier of the target application, so that only the data segments being played by the target application are collected through the audio visualization interface of the operating system, while data segments being played by other applications are not collected.

[0135] Optionally, the audio acquisition request carries a sampling rate, thereby instructing the audio visualization interface to sample the data stream being played by the target application according to the sampling rate to obtain data segments.

[0136] Optionally, the audio acquisition request carries a callback frequency, thereby instructing the audio visualization interface to sample the data stream being played by the target application multiple times according to the callback frequency to obtain multiple data segments.

[0137] The embodiments of the present application are merely illustrative of the information carried in the audio acquisition request, and do not limit the information carried in the audio acquisition request.

[0138] 302. The terminal identifies the data segment and obtains an identification result of the data segment.

[0139] The embodiment of the present application exemplifies the method of “identifying a data segment and obtaining an identification result of the data segment”.

[0140] Among them, the recognition result includes at least one of acoustic characteristic information and audio type information. The embodiment of the present application first exemplifies the method of identifying the acoustic characteristic information of the data segment.

[0141] In a possible implementation, the acoustic characteristic information includes audio energy, and the audio energy is obtained by an RMS (Root Mean Square) algorithm. Optionally, the terminal identifies the data segment to obtain an identification result of the data segment, including: performing statistics on values ​​of multiple sampling points of the data segment to obtain the audio energy of the data segment.

[0142] The data segment is PCM data, and the PCM data includes values ​​of multiple sampling points, and the values ​​are used to represent the loudness corresponding to the sampling points. The values ​​of the multiple sampling points of the data segment are counted to obtain the audio energy of the data segment, including: taking the average value of the values ​​of the multiple sampling points of the data segment as the audio energy of the data segment; or taking the root mean square of the values ​​of the multiple sampling points of the data segment as the audio energy of the data segment. The root mean square of the values ​​of the multiple sampling points is the value obtained by taking the square root of the sum of the squares of the values ​​of the multiple sampling points divided by the number of the multiple sampling points.

[0143] In another possible implementation, the acoustic characteristic information includes pitch, and the pitch is obtained by a fundamental frequency detection algorithm. Optionally, the terminal identifies the data segment to obtain an identification result of the data segment, including: performing autocorrelation analysis on the data segment to obtain the fundamental frequency of the data segment; and determining the pitch of the data segment based on the fundamental frequency.

[0144] In some embodiments, the correspondence between the fundamental frequency and the pitch is as follows, and the terminal determines the pitch of the data segment based on the fundamental frequency and the correspondence.

[0145] Where f is the fundamental frequency. log2 is the logarithmic function with base 2.

[0146] In some embodiments, autocorrelation function, difference function, cumulative mean normalized difference function, etc. can be used to perform autocorrelation analysis on the data segment. The embodiment of the present application only uses the autocorrelation function to perform autocorrelation analysis on the data segment as an example for illustrative explanation.

[0147] The autocorrelation function is expressed as:

[0148] Among them, r t [τ] represents the autocorrelation function value, which is used to represent the correlation between x[n] and x[n+τ]. x[n] represents the time domain signal of the audio in the t+1 time period, and W is used to represent the window size for performing an autocorrelation operation. In the embodiment of the present application, the length of a data segment is the window size for performing an autocorrelation operation.

[0149] Indicates the basic period of a data segment.

[0150] All τ values ​​within the target range are exhaustively enumerated, and the τ value corresponding to the maximum autocorrelation function value is determined as the basic period, and the reciprocal of the basic period is determined as the fundamental frequency. The value range and value interval of the τ value can be set by a technician or determined based on experience, and the embodiments of the present application do not limit this.

[0151] In another possible implementation, the acoustic characteristic information includes an audio quality parameter. The audio quality parameter is used to represent the degree of signal periodicity of the data segment. If the degree of signal periodicity of the data segment is high, then the audio quality of the data segment is good, and if the degree of signal periodicity of the data segment is low, then the audio quality of the data segment is poor. The embodiment of the present application determines the audio quality parameter by a cumulative mean normalized difference function. Optionally, the terminal identifies the data segment and obtains an identification result of the data segment, including: obtaining a cumulative mean normalized difference function value of the data segment, and determining the audio quality parameter of the data segment based on the difference between the cumulative mean normalized difference function value and a first threshold value, wherein the first threshold value represents the proportion of non-periodic signal power in the approximately periodic signal power.

[0152] Among them, the cumulative mean normalized difference function is expressed as:

[0153]

[0154] Where d′ t[τ] represents the cumulative mean standard deviation function value, which changes with the change of time τ. In the above step, obtaining the cumulative mean standard deviation function value of the data segment means obtaining the minimum cumulative mean standard deviation function value of the data segment, and comparing the minimum cumulative mean standard deviation function value with the first threshold. Wherein, Used to represent the difference function of a data segment, where i can be τ, when i is τ, d[i] is d[τ]; i can also be j, when i is j, d[i] is d[j].

[0155] In some embodiments, the terminal determines the audio quality parameter of the data segment based on the difference between the cumulative mean normalized difference function value and the first threshold, including: if the cumulative mean normalized difference function value is greater than the first threshold, that is, the difference between the cumulative mean normalized difference function value and the first threshold is positive, then the audio quality parameter is inversely proportional to the difference, and the larger the difference is, the lower the audio quality represented by the audio quality parameter; or, if the cumulative mean normalized difference function value is less than the first threshold, that is, the difference between the cumulative mean normalized difference function value and the first threshold is negative, then the audio quality parameter is inversely proportional to the difference, and the smaller the difference is, the higher the audio quality represented by the audio quality parameter.

[0156] The audio quality parameter may be a quality score or a quality level, and the embodiment of the present application does not limit the audio quality parameter.

[0157] It should be noted that the above three identification methods are merely exemplary of the identification methods of acoustic characteristic information and are not limiting. In other embodiments, the terminal may also identify acoustic characteristic information through a machine learning method.

[0158] In a possible implementation, the data segment is identified by a machine learning method to obtain an identification result. The identification result includes at least one of acoustic characteristic information and audio type information. The acoustic characteristic information includes at least one of audio energy, pitch, timbre, audio quality parameter or instrument type. The audio type information includes at least one of age, genre or emotion information.

[0159] In some embodiments, the terminal identifies the data segment to obtain the identification result, including: classifying the data segment through an audio classification model to obtain the identification result of the data segment.

[0160] In some embodiments, the audio classification model recognizes the spectrogram of the audio to obtain the recognition result of the audio. Optionally, the terminal classifies the data segment through the audio classification model to obtain the recognition result of the data segment, including: performing a fast Fourier transform on the audio to obtain the spectrogram of the audio, inputting the spectrogram into the audio classification model, and classifying the spectrogram through the audio classification model to obtain the recognition result of the data segment.

[0161] In other embodiments, the audio classification model recognizes the logarithmic scaled Mel spectrum of the audio to obtain the audio recognition result. The terminal classifies the data segment through the audio classification model to obtain the recognition result of the data segment, including: performing Fourier transform on the time domain signal of the data segment to obtain the frequency domain signal, filtering the obtained frequency domain signal using the filter group corresponding to the Mel frequency scale to obtain the Mel spectrum; logarithmically scaling the Mel spectrum to obtain the logarithmic scaled Mel spectrum; inputting the logarithmic scaled Mel spectrum into the audio classification model, and classifying the logarithmic scaled Mel spectrum through the audio classification model to obtain the recognition result of the data segment.

[0162] In other embodiments, in order to enable the audio classification model to more accurately classify the recognition results, the audio classification model can also be trained together with a logarithmic scaled Mel-spectrogram, an increment or derivative of the logarithmic scaled Mel-spectrogram, and an average characteristic spectrum of harmonic components and percussion components. Among them, the average characteristic spectrum of the harmonic components and the percussion components can more prominently represent the characteristics of the data segment, and the increment or derivative of the logarithmic scaled Mel-spectrogram can better represent the dynamic characteristics of the audio signal, and can assist the audio classification model to better identify emotional information. Therefore, after adding the increment or derivative of the logarithmic scaled Mel-spectrogram, the average characteristic spectrum of the harmonic components and the percussion components, the audio classification model can learn more features and obtain more accurate recognition results.

[0163] Among them, the increment of the logarithmic scaled Mel spectrum graph is obtained by taking the first-order difference of the logarithmic scaled Mel spectrum graph as the increment of the logarithmic scaled Mel spectrum graph. The derivative of the logarithmic scaled Mel spectrum graph is obtained by taking the second-order difference of the logarithmic scaled Mel spectrum graph as the derivative of the logarithmic scaled Mel spectrum graph. The average characteristic spectrum of the harmonic component and the percussion component is obtained by determining the frequency range of the harmonic component, dividing the data segment into the harmonic component and the percussion component based on the frequency range and the mask function, and performing weighted averaging on the harmonic component and the percussion component to obtain the average characteristic spectrum of the harmonic component and the percussion component.

[0164] like Figure 5As shown, the data segment is converted into a logarithmic scaled Mel spectrogram, an increment or derivative of the logarithmic scaled Mel spectrogram, an average characteristic spectrum of harmonic components and percussion components. Wherein, the total number of frames (columns) of the data segment is defined as 64, and the total number of bands (rows) of each frame is defined as 64. Therefore, the logarithmic scaled Mel spectrogram, the increment or derivative of the logarithmic scaled Mel spectrogram, the average characteristic spectrum of harmonic components and percussion components are all 64*64 audio feature graphs. The logarithmic scaled Mel spectrogram, the increment or derivative of the logarithmic scaled Mel spectrogram, the average characteristic spectrum of harmonic components and percussion components are synthesized into a 64*64*3 feature graph, which is input into the audio classification model, and the audio classification model is trained. Subsequently, based on the trained audio classification model, the recognition result of the data segment is obtained.

[0165] 303. The terminal displays a virtual object that matches at least one of the acoustic characteristic information and the audio type information.

[0166] When the terminal displays a virtual object that matches at least one of the acoustic characteristic information and the audio type information, it may first pop up in the middle of the screen and then move to a corner of the current interface, such as the upper left corner, the upper right corner, the lower left corner, or the lower corner, etc., which is not described in the embodiments of the present application. In some embodiments, the user may also drag the virtual object to move the virtual object to any position. In some embodiments, the user may also enlarge or reduce the virtual object to any size.

[0167] When the terminal displays a virtual object, it only partially blocks the current interface to reduce the impact on normal viewing or use of the current interface. The virtual object can be any virtual person, virtual animal, virtual plant, virtual building, virtual environment, virtual character, etc. The embodiment of the present application does not limit the virtual object.

[0168] In a possible implementation manner, the terminal displays a virtual object that matches at least one of the acoustic characteristic information and the audio type information, including at least one of the following:

[0169] (1) When the acoustic characteristic information includes a musical instrument type, a virtual musical instrument matching the musical instrument type is displayed.

[0170] For example, when the instrument type is trumpet, a virtual trumpet is displayed on the upper layer of the current interface; for another example, when the instrument type is suona, a virtual suona is displayed on the upper layer of the current interface; when the instrument type is guzheng, a virtual guzheng is displayed on the upper layer of the current interface.

[0171] (2) When the audio type information includes at least one of a decade and a genre, a virtual character whose virtual costume matches at least one of the decade and the genre is displayed.

[0172] The decades included in the audio type information may be 1980s, 1990s, 2000s, 2010s, 2020s, etc. The genres included in the audio type information may be country, classical, rock, hip-hop, etc.

[0173] For example, if the audio type information includes the 1990s, a virtual character wearing clothing from the 1990s is displayed. For another example, if the audio type information includes the genre of rock, a virtual character wearing rock clothing is displayed. For another example, if the audio type information includes the 1990s and the genre of rock is rock, a virtual character wearing rock clothing from the 1990s is displayed.

[0174] (3) When the acoustic characteristic information includes timbre, a virtual character matching the timbre is displayed, and the timbre is used to indicate whether the singer is a man, a woman, or a child.

[0175] For example, if the music included in the acoustic characteristic information is used to indicate that the singer is a male, a virtual character of male gender will be displayed; for another example, if the music included in the acoustic characteristic information is used to indicate that the singer is a female, a virtual character of female gender will be displayed; for another example, if the music included in the acoustic characteristic information is used to indicate that the singer is a child, a virtual character whose age falls within the child range will be displayed.

[0176] (4) When the acoustic characteristic information includes audio energy, a virtual object having at least one of a color and a size matching the audio energy is displayed.

[0177] In the embodiment of the present application, audio energy may correspond to color. For example, audio energy corresponds to purple, blue, cyan, green, yellow, orange, and red in order from low to high. For another example, audio energy corresponds to purple, blue, cyan, green, yellow, orange, and red in order from high to low.

[0178] The audio energy may also correspond to the size, and the audio energy is positively correlated with the size, that is, the higher the audio energy, the larger the size of the virtual object.

[0179] It should be noted that the virtual object displayed in the embodiment of the present application and matching at least one of the acoustic characteristic information and the audio type information may be static or dynamic, and the embodiment of the present application does not limit this. Another point that needs to be explained is that there may be a corresponding relationship between the virtual object and at least one of the acoustic characteristic information and the audio type information, and the terminal displays the virtual object matching at least one of the acoustic characteristic information and the audio type information based on the corresponding relationship.

[0180] In a possible implementation manner, after the terminal displays a virtual object matching at least one of the acoustic characteristic information and the audio type information, the method further includes any one of the following:

[0181] (1) Control the virtual object to perform preset singing or playing actions.

[0182] In some embodiments, the virtual object is a virtual character, and the virtual character is controlled to perform a preset singing action. The preset singing action is an action imitating a person singing. In other embodiments, the virtual object is a virtual musical instrument, and the virtual musical instrument is controlled to perform a preset playing action. The preset playing action is an action imitating the playing of a musical instrument.

[0183] For example, the playing action of the virtual guzheng is the action of plucking the strings, and virtual notes can also float out from the plucked strings.

[0184] (2) Controlling the virtual object to perform a singing action or a playing action that matches at least one of the acoustic characteristic information and the audio type information.

[0185] In some embodiments, when the audio type information includes at least one of an era and a genre, the virtual object is controlled to perform a singing action in which the singing posture matches at least one of the era and the genre.

[0186] For example, if the genre included in the audio type information is rock, then the virtual object is controlled to hold a virtual guitar and shake the upper body. For another example, if the genre included in the audio type information is hip-hop, then the virtual object is controlled to hold a microphone to the mouth with one hand and make a hip-hop gesture with the other hand.

[0187] In some embodiments, when the acoustic characteristic information includes audio energy, the virtual object is controlled to perform a singing action or a playing action according to a movement amplitude that matches the audio energy.

[0188] The higher the audio energy, the more exciting the audio sounds. Therefore, the audio energy may be positively correlated with the amplitude of the action. That is, the higher the audio energy, the larger the amplitude of the action. The performance action may be preset, and the singing action may be preset or determined based on any one of emotion, era or genre.

[0189] In some embodiments, when the audio type information includes emotional information, the virtual object is controlled to perform singing movements matching the emotional information.

[0190] The emotional information may be at least one of sadness, happiness, calmness, anger, etc., and the present embodiment of the application does not limit the emotional information. When a singer sings songs with different emotions, he or she usually makes different singing movements, and the emotions expressed by the singing movements are the same as the emotions expressed by the songs. Therefore, after obtaining the emotional information of the data segment, the present embodiment of the application can control the virtual object to perform the singing movement of the same emotion.

[0191] For example, when the audio type information is cheerful, the virtual object can be controlled to perform a singing action that looks cheerful. For another example, when the audio type information is sad, the virtual object can be controlled to perform a singing action that looks sad.

[0192] It should be noted that the above embodiments may be combined arbitrarily, and the embodiments of the present application do not limit this.

[0193] (3) Controlling the virtual object to perform a dance move that matches at least one of the acoustic characteristic information and the audio type information.

[0194] In an embodiment of the present application, when playing audio, the virtual object can be controlled to perform dance movements that match at least one of the acoustic characteristic information and audio type information of the played audio, which is equivalent to controlling the virtual object to dance with the audio.

[0195] In some embodiments, when the audio type information includes at least one of a decade and a genre, the virtual object is controlled to perform a dance move matching at least one of the decade and the genre.

[0196] The dance styles of different eras are different, so the embodiments of the present application can control the virtual object to perform dance movements that match the era. In addition, the dance styles of different genres of music are also different, so the embodiments of the present application can also control the virtual object to perform dance movements that match the genre.

[0197] For example, if the genre is classical music, the virtual object can be controlled to perform classical dance movements. For another example, if the genre is jazz music, the virtual object can be controlled to perform jazz dance movements.

[0198] In some embodiments, when the acoustic characteristic information includes audio energy, the virtual object is controlled to perform dance movements at a speed matching the audio energy.

[0199] The higher the audio energy, the more exciting the audio sounds. Therefore, the audio energy may be positively correlated with the amplitude of the movement. That is, the higher the audio energy, the larger the amplitude of the movement. The dance movement may be preset or determined based on any one of emotion, era or genre.

[0200] In some embodiments, when the audio type information includes emotional information, the virtual object is controlled to perform dance moves matching the emotional information.

[0201] The emotional information may be at least one of sadness, happiness, calmness, anger, etc., and the present embodiment of the application does not limit the emotional information. When dancers dance to songs with different emotions, they usually make different dance moves, and the emotions expressed by the dance moves are the same as the emotions expressed by the songs. Therefore, after obtaining the emotional information of the data segment, the present embodiment of the application can control the virtual object to perform the dance moves of the same emotion.

[0202] For example, when the audio type information is cheerful, the virtual object can be controlled to perform a dance movement that looks cheerful. For another example, when the audio type information is sad, the virtual object can be controlled to perform a dance movement that looks sad.

[0203] It should be noted that the above embodiments may be combined arbitrarily, and the embodiments of the present application do not limit this.

[0204] (4) Control the virtual object to move in a random direction and bounce back after hitting the border of the current interface.

[0205] The moving speed of the virtual object may be preset or determined based on the recognition result. In some embodiments, the acoustic characteristic information includes audio energy; and controlling the virtual object to move in a random direction includes: controlling the virtual object to move at a speed matching the audio energy.

[0206] It should be noted that in the embodiments of the present application, when controlling a virtual object to perform a corresponding action, it can be achieved by playing an animation of the virtual object performing the corresponding action. Among them, the terminal stores the correspondence between the animation of the virtual object performing the action and the recognition result. The terminal can determine the corresponding animation based on the correspondence and the recognition result of the data segment, and play the corresponding animation. Of course, the terminal can also be achieved by controlling the virtual object to perform the corresponding action in real time through the three-dimensional rendering model of the virtual object. The terminal can store the correspondence between the action control data of the virtual object and the recognition result. The terminal can determine the corresponding action control data based on the correspondence and the recognition result of the data segment, and control the virtual object to perform the corresponding action based on the action control data. The embodiment of the present application does not limit the method of controlling the virtual object to perform the corresponding action.

[0207] Another point that needs to be explained is that the embodiment of the present application can repeatedly execute the above steps 301 to 303, so as to display the corresponding virtual object and control the virtual object to perform the corresponding action according to the real-time data segment.

[0208] The audio data processing method provided in the embodiment of the present application can record the data segment being played when the terminal plays audio, and realize the target function through the recorded data segment. Since the audio recording is not affected by the external environment and the playback volume, the audio recording effect is improved, so that the target function can provide a better service.

[0209] In addition, the embodiment of the present application can also display virtual objects matching the recognition results on the upper layer of the current interface, thereby increasing the interest of the interface display. Furthermore, the virtual objects can be controlled to perform actions according to the recognition results, thereby further increasing the interest of the interface display.

[0210] It should be noted that the target function in the embodiment of the present application may be any function related to audio. Figure 6 The embodiment shown is exemplified by taking the target function as a dynamic image display function as an example.

[0211] Figure 6 is a flowchart of an audio data processing method provided in an embodiment of the present application. The embodiment of the present application is exemplified by taking the execution subject as a terminal. Figure 6 As shown, the method includes:

[0212] 601. When playing audio, the terminal captures the data segment being played in the data stream required by the terminal to play the audio.

[0213] The above step 601 is the same as the above step 301 and will not be described in detail here.

[0214] 602. The terminal identifies the data segment and obtains an identification result of the data segment, where the identification result includes acoustic characteristic information.

[0215] The above step 602 is the same as the above step 301 and will not be described in detail here.

[0216] 603. The terminal displays a dynamic image that dynamically changes and matches the acoustic characteristic information.

[0217] The dynamic image may be any dynamic image, for example, the dynamic image is a record image, a dynamic wallpaper, etc.

[0218] In one possible implementation, the dynamic image is a record image. The record image rotates when displayed to simulate the behavior of a phonograph playing a record. In another possible implementation, the dynamic image may be a dynamic wallpaper.

[0219] In some embodiments, the acoustic characteristic information includes audio energy. The terminal displays a dynamic image that dynamically changes and matches the acoustic characteristic information, including: displaying a record image whose rotation speed matches the audio energy. The rotation speed is positively correlated with the audio energy. The higher the audio energy, the faster the rotation speed, and the lower the audio energy, the slower the rotation speed. The change of the dynamic wallpaper is preset, and the terminal only changes the rotation speed based on the audio energy.

[0220] The album image can be displayed on the upper layer of the current interface of the target application, or it can be displayed on the upper layer of the current interface of the target application, or it can be displayed on the upper layer of the interface all the time without changing with the switching of the interface.

[0221] In some embodiments, the terminal displays a dynamic image whose dynamic changes match the acoustic characteristic information, including: displaying a dynamic wallpaper whose change speed matches the audio energy. The change speed is positively correlated with the audio energy. The higher the audio energy, the faster the change speed, and the lower the audio energy, the slower the change speed. The change of the dynamic wallpaper is preset, and the terminal only changes the change speed based on the audio energy.

[0222] In some embodiments, the dynamic wallpaper may be a lock screen wallpaper, and only after the terminal locks the screen will the above steps 601 to 603 be executed to display the dynamic wallpaper. In other embodiments, the dynamic wallpaper may be the screen wallpaper of the terminal, and only when the terminal displays the screen wallpaper will the above steps 601 to 603 be executed to display the dynamic wallpaper.

[0223] It should be noted that the embodiments of the present application only take the dynamic image as a spectrum diagram or a dynamic wallpaper as an example to exemplify the method of "displaying a dynamic image that dynamically changes and matches the recognition result", and do not limit this.

[0224] It should be noted that the embodiment of the present application can repeatedly execute the above steps 601 to 603, so that the terminal can continuously update the dynamic image based on the real-time data segment.

[0225] The audio data processing method provided in the embodiment of the present application can record the data segment being played when the terminal plays audio, and realize the target function through the recorded data segment. Since the audio recording is not affected by the external environment and the playback volume, the audio recording effect is improved, so that the target function can provide a better service.

[0226] Furthermore, the embodiment of the present application can also display dynamic images that dynamically change and match the acoustic characteristic information, thereby increasing the interest of the interface display.

[0227] It should be noted that the target function in the embodiment of the present application may be any function related to audio. Figure 7 The embodiment shown is exemplified by taking the target function as the pitch recognition function.

[0228] Figure 7 is a flowchart of an audio data processing method provided in an embodiment of the present application. The embodiment of the present application is exemplified by taking the execution subject as a terminal. Figure 7 As shown, the method includes:

[0229] 701. When playing audio, the terminal captures the data segment being played in the data stream required by the terminal to play the audio.

[0230] The above step 701 is the same as the above step 301 and will not be described in detail here.

[0231] 702. The terminal performs pitch recognition on the data segment to obtain the pitch of the data segment.

[0232] The above step 702 can refer to the method of obtaining the pitch in the above step 302, which will not be described in detail here.

[0233] 703. The terminal controls the microphone to record and obtains recorded audio.

[0234] In some embodiments, the user first turns on the pitch recognition function, and only after the user turns on the pitch recognition function will the terminal execute steps 701 to 705. Optionally, the pitch recognition function is a function provided by the first application, and the terminal responds to the start-up operation of the pitch recognition function in the first application, and displays the first mode option and the second mode option, wherein the first mode option is to record the audio of other applications internally, and perform pitch recognition on the recorded audio obtained by the microphone recording and the audio of other applications; the second mode option is to perform pitch recognition on the recorded audio obtained by the microphone recording and the audio of the first application. The terminal responds to the selection operation of the first mode option and executes the above steps 701 to 705.

[0235] It should be noted that when the user turns on the pitch recognition function in the first application, the target application may be playing audio or may not be playing audio yet. After the user turns on the pitch recognition function, the second application is opened and the audio is played through the second application. This embodiment of the application is not limited to this.

[0236] In some embodiments, when the terminal plays audio, a sing-along option is displayed on the upper layer of the current interface, and in response to the selection of the sing-along option, a step of controlling the microphone to record and obtain the recorded audio is executed. Optionally, in response to the selection of the sing-along option, the terminal executes steps 702 to 705. Optionally, the sing-along option is an option provided by the first application.

[0237] It should be noted that after the pitch recognition function is turned on, the above steps 701 to 702 and steps 703 to 704 can be executed simultaneously, so that the terminal performs pitch recognition on the latest data segment and the latest recorded audio.

[0238] 704. The terminal performs pitch recognition on the recorded audio to obtain the pitch of the recorded audio.

[0239] It should be noted that the above step 704 is the same as the above step 702 and will not be described in detail here.

[0240] 705. The terminal performs pitch recognition on the recorded audio based on the pitch of the data segment and the pitch of the recorded audio to obtain a pitch recognition result, where the pitch recognition result is used to indicate a match between the pitch of the recorded audio and the pitch of the data segment.

[0241] In some embodiments, the acquired data segment and recorded audio are both real-time data, and the corresponding durations of the data segment and the recorded audio are very short, so a data segment and a recorded audio acquired at one time correspond to only one pitch. Optionally, the terminal performs pitch recognition on the recorded audio based on the pitch of the data segment and the pitch of the recorded audio to obtain a pitch recognition result, including: determining the pitch recognition result based on the similarity between the pitch of the data segment and the pitch of the recorded audio.

[0242] Optionally, determining the pitch recognition result based on the similarity between the pitch of the data segment and the pitch of the recorded audio includes: using the similarity as the pitch recognition result. For example, if the similarity between the pitch of the data segment and the pitch of the recorded audio is 90%, the pitch recognition result is 90 points.

[0243] Optionally, based on the similarity between the pitch of the data segment and the pitch of the recorded audio, a pitch recognition result is determined, including: determining the pitch level corresponding to the similarity in the corresponding relationship as the pitch recognition result, the corresponding relationship including multiple pitch levels and a similarity value range corresponding to each pitch level.

[0244] For example, in the first correspondence, when the pitch level is perfect, the corresponding similarity ranges from 90% to 100%, when the pitch level is passed, the corresponding similarity ranges from 60% to 90%, and when the pitch level is not passed, the corresponding similarity ranges from 0% to 60%. When the similarity between the pitch of the data segment and the pitch of the recorded audio is 85%, the pitch recognition result is passed.

[0245] In other embodiments, the acquired data segment and recorded audio may correspond to multiple pitches, and the recognition result includes multiple pitches and the time period corresponding to each pitch; the terminal performs pitch recognition on the recorded audio based on the pitch of the data segment and the pitch of the recorded audio, and obtains the pitch recognition result, including: for the time period corresponding to each pitch in the data segment, based on the similarity between the pitch corresponding to the time period in the data segment and the pitch belonging to the same time period in the recorded audio, determining the pitch recognition result corresponding to the time period.

[0246] For example, the recognition result of the data segment includes: pitch 1, the time period to which pitch 1 belongs is 0 milliseconds to 5 milliseconds, and pitch 2, the time period to which pitch 2 belongs is 5 milliseconds to 20 milliseconds. The recognition result of the recorded audio includes: pitch 1, the time period to which pitch 1 belongs is 0 milliseconds to 8 milliseconds, and pitch 2, the time period to which pitch 2 belongs is 8 milliseconds to 20 milliseconds. Then the similarity of the time period from 0 milliseconds to 5 milliseconds is 100%, the similarity of pitch 1 and pitch 2 is 80%, and the similarity of the time period from 5 milliseconds to 20 milliseconds is: 80%*(8-5) / 15+100%*(20-8) / 15=96%.

[0247] Optionally, based on the similarity between the pitch corresponding to the time period in the data segment and the pitch belonging to the same time period in the audio recording, determining the pitch recognition result corresponding to the time period includes: using the similarity as the pitch recognition result corresponding to the time period. For example, if the similarity of the time period from 0 milliseconds to 5 milliseconds is 100%, then the pitch recognition result of the time period from 0 milliseconds to 5 milliseconds is 90 points.

[0248] Optionally, based on the similarity between the pitch corresponding to the time period in the data segment and the pitch belonging to the same time period in the recorded audio, the pitch recognition result corresponding to the time period is determined, including: determining the pitch level corresponding to the similarity in the first corresponding relationship as the pitch recognition result of the time period, the first corresponding relationship including multiple pitch levels and the similarity value range corresponding to each pitch level.

[0249] 706. The terminal displays the pitch recognition result on the upper layer of the current interface.

[0250] In some embodiments, the current interface can be any interface, that is, no matter whether the interface currently displayed by the terminal is the interface of the first application, the interface of the target application, the interface of other applications, or the screen interface of the terminal, the pitch recognition result can be displayed on the upper layer.

[0251] In other embodiments, the data segment is a data segment being played by the target application. The terminal displays the pitch recognition result on the upper layer of the current interface, including: the terminal displays the pitch recognition result on the upper layer of the current interface of the target application. In other words, the pitch recognition result will only be displayed when the current interface displayed by the terminal is an interface provided by the target application. Among them, the current interface of the target application can be an interface for playing audio, or it can be other interfaces of the target application, which is not limited in the embodiments of the present application.

[0252] Among them, when the terminal displays the pitch recognition result on the upper layer of the current interface, the pitch recognition result can be displayed in the middle position of the current interface so that the user can quickly see the pitch recognition result; the pitch recognition result can also be displayed in a corner of the current interface to reduce the obstruction of the current interface by the pitch recognition result.

[0253] It should be noted that when the user sings along, he can sing along by singing or by playing a musical instrument, which is not limited in the embodiments of the present application. In some embodiments, the user sings along by playing a musical instrument. The method also includes: performing instrument identification on the recorded audio to obtain the instrument type of the recorded audio; and displaying a virtual instrument corresponding to the instrument type in the upper layer of the current interface.

[0254] The terminal can identify the musical instrument of the recorded audio through the audio classification model in the above step 302, or compare the recorded audio with the stored musical instrument audio corresponding to different musical instrument types, and determine the musical instrument type corresponding to the musical instrument audio with the highest similarity to the recorded audio as the musical instrument type of the recorded audio. The specific method of musical instrument identification is not limited in the embodiment of the present application.

[0255] The virtual instrument may be displayed in the middle of the current interface so that the user can quickly see the virtual instrument; the virtual instrument may also be displayed in a corner of the current interface to reduce the obstruction of the current interface by the virtual instrument.

[0256] The audio data processing method provided in the embodiment of the present application can record the data segment being played when the terminal plays audio, and realize the target function through the recorded data segment. Since the audio recording is not affected by the external environment and the playback volume, the audio recording effect is improved, so that the target function can provide better service.

[0257] Furthermore, the embodiment of the present application can also sing along with the audio played in the target application through the first application. This is equivalent to adding a sing-along function to the target application, improving the cooperation between applications and making the functions of the application more flexible.

[0258] It should be noted that the target function in the embodiment of the present application may be any function related to audio. Figure 8 The embodiment shown is exemplified by taking the target function as an audio denoising function.

[0259] Figure 8 is a flowchart of an audio data processing method provided in an embodiment of the present application. The embodiment of the present application is exemplified by taking the execution subject as a terminal. Figure 8 As shown, the method includes:

[0260] 801. When playing audio, the terminal captures the data segment being played in the data stream required by the terminal for playing the audio.

[0261] The above step 801 is the same as the above step 301 and will not be described in detail here.

[0262] 802. The terminal identifies the data segment and obtains acoustic characteristic information of the data segment.

[0263] The above step 802 is the same as the above step 302 and will not be described in detail here.

[0264] 803. The terminal controls the microphone to record and obtains the recorded audio.

[0265] The above step 803 is the same as the above step 703, and will not be described in detail here.

[0266] 804. The terminal denoises the recorded audio based on the acoustic characteristic information.

[0267] In the embodiment of the present application, the data segments being played are collected through the audio visualization interface. Due to the limitations of the audio visualization interface itself, the sampling rate is low when collecting data segments, and the continuity between the data segments collected each time is poor. Therefore, for some scenes requiring higher precision, it is not suitable to process based on the collected data segments. To this end, for some scenes requiring higher precision, the embodiment of the present application provides a method of recording through a microphone, denoising the recorded audio through the data segments, and processing based on the denoised recorded audio.

[0268] Next, the process of denoising recorded audio based on acoustic characteristic information is exemplified.

[0269] In some embodiments, when recording through a microphone, there may be noise. The frequency range of the noise may be different from the frequency range of the audio being played. Optionally, the acoustic characteristic information includes the frequency range of the data segment, and the audio signal in the recorded audio whose frequency does not belong to the frequency range is deleted.

[0270] In other embodiments, when recording through a microphone, there may be ambient sound. For example, the target application is playing song A, but the recorded audio of the microphone includes not only song A but also the voice of the user speaking. Given that the timbre of the singer in song A is different from the timbre of the user, denoising can be performed based on the timbre. Optionally, the acoustic characteristic information includes timbre, and based on the timbre, the recorded audio is denoised so that the timbre of the recorded audio is consistent with the data segment. For example, the audio signals corresponding to other timbres in the recorded audio that are different from the timbre are deleted.

[0271] After denoising the recorded audio, the similarity between the recorded audio and the audio being played is already quite high, and the recorded audio recorded by the microphone has good integrity. Therefore, in some scenarios with high precision requirements, processing can be performed based on the denoised recorded audio.

[0272] The audio data processing method provided in the embodiment of the present application can record the data segment being played when the terminal plays audio, and realize the target function through the recorded data segment. Since the audio recording is not affected by the external environment and the playback volume, the audio recording effect is improved, so that the target function can provide a better service.

[0273] Furthermore, the embodiment of the present application can also denoise the recorded audio through data segments, so that the recorded audio recorded by the microphone also has high accuracy, and the integrity of the recorded audio recorded by the microphone is high. Therefore, the denoised recorded audio can be applied to audio processing scenarios with high precision requirements, thereby improving the scope of application of audio processing.

[0274] It should be noted that the target function in the embodiment of the present application may be any function related to audio. Fig. 9 The embodiment shown is illustrated by taking the target function of identifying songs by listening as an example.

[0275] Fig. 9 is a flowchart of an audio data processing method provided in an embodiment of the present application. The embodiment of the present application is exemplified by taking the execution subject as a terminal. Fig. 9 As shown, the method includes:

[0276] 901. When playing audio, the terminal captures the data segment being played in the data stream required by the terminal for playing the audio.

[0277] The above step 901 is the same as the above step 301 and will not be described in detail here.

[0278] 902. The terminal identifies the data segment and obtains an identification result of the data segment.

[0279] The above step 902 is the same as the above step 302, and will not be described in detail here.

[0280] 903. Based on the recognition result, the terminal searches the database for the target audio to which the data segment belongs.

[0281] Among them, the database is a database for storing audio. The database not only stores the audio, but also stores the audio identifier corresponding to the audio, the description information corresponding to the audio, etc. The embodiment of the present application does not limit the database.

[0282] In a possible implementation, the terminal may first perform a preliminary screening based on the recognition result, and then perform a fine screening based on the data segment. Optionally, based on the recognition result, the terminal queries a database for multiple candidate audios that match the recognition result; compares the data segment with the multiple candidate audios to obtain the target audio to which the data segment belongs.

[0283] For example, the recognition result may be an audio style. The terminal may first select multiple candidate audios with the same audio style as the data segment from the database based on the description information corresponding to the audio in the database, and then compare the data segment with each candidate audio one by one, and determine the candidate audio with the highest similarity as the target audio to which the data segment belongs.

[0284] Among them, the data segment is a relatively short data segment, and the audio in the database is a complete audio. Therefore, when the data segment is compared with each candidate audio one by one, the data segment is compared with the data segments of different time periods in the candidate audio one by one, and the similarity corresponding to the candidate audio is the highest similarity among the similarities corresponding to the data segments of different time periods in the candidate audio.

[0285] 904. The terminal displays the audio identifier of the target audio.

[0286] The audio identifier is an identifier used to identify a unique audio. Optionally, the audio identifier may be a name, number, etc. of the audio. The embodiment of the present application does not limit the audio identifier.

[0287] It should be noted that the embodiment of the present application is only illustrative of the example of the terminal displaying the audio identification, and in another embodiment, other information such as the author of the target audio can also be displayed, and the embodiment of the present application does not limit this.

[0288] The audio data processing method provided in the embodiment of the present application can record the data segment being played when the terminal plays audio, and realize the target function through the recorded data segment. Since the audio recording is not affected by the external environment and the playback volume, the audio recording effect is improved, so that the target function can provide a better service.

[0289] In addition, the embodiment of the present application can also use the first application to identify the music played by the target application, thereby improving the flexibility of identifying the music. In addition, the initial screening is performed based on the recognition results of the data segment, which greatly reduces the amount of audio recognition calculations and improves the efficiency of identifying the music.

[0290] It should be noted that the target function in the embodiment of the present application may be any function related to audio. Fig.10 The illustrated embodiment is exemplified by taking the target function as the scene adding function as an example.

[0291] Fig.10 is a flowchart of an audio data processing method provided in an embodiment of the present application. The embodiment of the present application is exemplified by taking the execution subject as a terminal. Fig.10 As shown, the method includes:

[0292] 1001. When playing audio, the terminal captures the data segment being played in the data stream required by the terminal for playing the audio.

[0293] The above step 1001 is the same as the above step 301 and will not be described in detail here.

[0294] 1002. The terminal identifies the data segment and obtains an identification result of the data segment, where the identification result includes at least one of acoustic characteristic information and audio type information.

[0295] The above step 1002 is the same as the above step 302 and will not be described in detail here.

[0296] 1003. The terminal adds a virtual scene matching the recognition result.

[0297] Among them, the virtual scene can be a scene composed of any one or more virtual elements such as virtual characters, virtual animals, virtual plants, virtual environments, etc., and the embodiments of the present application do not limit the virtual scene. In the embodiments of the present application, a virtual scene matching the recognition result can be added to further render the emotional atmosphere brought by the audio and improve the user experience.

[0298] In a possible implementation, the terminal adds a virtual scene matching the recognition result, including at least one of the following:

[0299] (1) Add a virtual scene that matches the recognition result to the border area of ​​the current interface.

[0300] In order to prevent the virtual scene from blocking too many interfaces, which would significantly affect the normal use of the interface, the embodiment of the present application only adds the virtual scene in the border area, where the border area of ​​the interface is the area around the interface.

[0301] Optionally, adding a virtual scene matching the recognition result in the border area of ​​the current interface includes: adding a virtual scene matching the recognition result around the current interface; or, adding a virtual scene matching the recognition result in a corner of the current interface; or, adding a virtual scene matching the recognition result at two opposite corners of the current interface; or, adding a virtual scene matching the recognition result in the upper left corner and the upper right corner of the current interface; or, adding a virtual scene matching the recognition result in the lower left corner and the lower right corner of the current interface. The embodiment of the present application does not limit the position of the virtual scene in the border area.

[0302] (2) Audio type information includes emotional information, and a virtual scene with a style matching the emotional information is added.

[0303] Since the embodiment of the present application adds a virtual scene matching the audio type information in order to further render the emotional atmosphere brought by the audio, therefore, a virtual scene whose style matches the emotional information of the data segment can be added.

[0304] For example, if the emotional information is sadness, you can add a virtual scene of wind and rain, a virtual scene of cloudy days, etc. For another example, if the emotional information is calm, you can add a virtual scene of spring flowers blooming for the target application.

[0305] In some embodiments, a correspondence between emotional information and virtual scenes is established, and the style of the virtual scene corresponding to the emotional information matches the emotional information. Based on the correspondence, the terminal obtains the virtual scene corresponding to the emotional information of the data segment and displays the virtual scene.

[0306] The audio data processing method provided in the embodiment of the present application can record the data segment being played when the terminal plays audio, and realize the target function through the recorded data segment. Since the audio recording is not affected by the external environment and the playback volume, the audio recording effect is improved, so that the target function can provide a better service.

[0307] Furthermore, the embodiments of the present application may also add a virtual scene. Since the style of the virtual scene matches the emotional information of the data segment, the virtual scene can further render the emotional atmosphere brought by the audio, thereby increasing the richness and interest of the displayed content and improving the user experience.

[0308] It should be noted that the target function in the embodiment of the present application may be any function related to audio. Fig.11 The illustrated embodiment is exemplified by taking the target function as the sound effect adding function as an example.

[0309] Fig.11 is a flowchart of an audio data processing method provided in an embodiment of the present application. The embodiment of the present application is exemplified by taking the execution subject as a terminal. Fig.11 As shown, the method includes:

[0310] 1101. When playing audio, the terminal captures the data segment being played in the data stream required by the terminal for playing the audio.

[0311] The above step 1101 is the same as the above step 301 and will not be described in detail here.

[0312] 1102. The terminal identifies the data segment and obtains an identification result of the data segment, where the identification result includes at least one of acoustic characteristic information and audio type information.

[0313] The above step 1102 is similar to step 302 and will not be described in detail here.

[0314] 1103. During the process of playing the audio, the terminal plays the sound effect that matches the recognition result.

[0315] The sound effects may be environmental sound effects or action sound effects. Environmental sound effects refer to sound effects such as wind, rain, thunder, bird calls, and water flow, and action sound effects refer to footsteps, sword swings, and cannon fire. The present application embodiment does not limit the sound effects.

[0316] In a possible implementation, playing the sound effect that matches the recognition result includes at least one of the following: playing the environmental sound effect that matches the recognition result; playing the action sound effect that matches the recognition result.

[0317] Optionally, the recognition result includes audio type information, the audio type information includes emotional information, and the terminal plays a sound effect whose sound effect atmosphere matches the emotional information. In some embodiments, the terminal stores a correspondence between emotional information and sound effects, and the sound effect corresponding to the emotional information is a sound effect whose sound effect atmosphere matches the emotional information. The terminal adds the sound effect based on the emotional information and the correspondence. For example, when the emotional information is sad, the corresponding sound effect may be wind, rain, thunder, etc.

[0318] For example, when a user is watching a TV series, if the recognition result is sadness, a mixed sound effect of wind, rain and thunder can be played, which is equivalent to adding a mixed sound effect of wind, rain and thunder to the TV series being played, making the emotion that the TV series wants to express more prominent and improving the user's experience of watching the TV series.

[0319] Optionally, a correspondence between the recognition result and the sound effect is established. After the terminal obtains the recognition result of the data segment, it obtains the sound effect corresponding to the recognition result from the correspondence and plays the sound effect.

[0320] The audio data processing method provided in the embodiment of the present application can record the data segment being played when the terminal plays audio, and realize the target function through the recorded data segment. Since the audio recording is not affected by the external environment and the playback volume, the audio recording effect is improved, so that the target function can provide a better service.

[0321] Furthermore, the embodiment of the present application may also add sound effects. Since the atmosphere rendered by the sound effects matches the emotional information of the data segment, the sound effects may further render the emotional atmosphere brought by the data segment, thereby improving the user experience.

[0322] It should be noted that the target function in the embodiment of the present application may be any function related to audio. Fig.12 The illustrated embodiment is exemplified by taking the target function as a recommendation function as an example.

[0323] Fig.12 is a flowchart of an audio data processing method provided in an embodiment of the present application. The embodiment of the present application is exemplified by taking the execution subject as a terminal. Fig.12 As shown, the method includes:

[0324] 1201. When playing audio, the terminal captures the data segment being played in the data stream required by the local end to play the audio.

[0325] The above step 1201 is the same as the above step 301 and will not be described in detail here.

[0326] 1202. The terminal identifies the data segment and obtains an identification result of the data segment, where the identification result includes at least one of acoustic characteristic information and audio type information.

[0327] The above step 1202 is the same as the above step 302 and will not be described in detail here.

[0328] 1203. The terminal recommends multimedia data matching the recognition result.

[0329] The multimedia data may be any form of multimedia data such as songs, TV series, movies, pictures, etc. The embodiments of the present application do not limit the multimedia data.

[0330] Taking the example that the recognition result includes audio type information, and the audio type information includes an emotion type, the terminal can recommend multimedia data of the same emotion type. Taking the example that the recognition result includes acoustic characteristic information, and the acoustic characteristic information includes an instrument type, multimedia data introducing instruments of the same instrument type can be recommended. Taking the example that the recognition result includes audio type information, and the audio type information includes a decade, multimedia data of the same decade can be recommended.

[0331] For example, when a user listens to suona pure music through the target application, a suona-related movie may be recommended to the user through the first application.

[0332] In some embodiments, when the terminal recommends multimedia data matching the recognition result, the name, link, etc. of the multimedia data may be displayed. The embodiment of the present application does not limit the recommendation method.

[0333] 1204. The terminal recommends a game application matching the recognition result.

[0334] It should be noted that the above steps 1203 and 1204 are optional execution steps, which can be executed or not executed according to actual needs, and the embodiments of the present application do not limit this.

[0335] In a possible implementation, recommending a game application that matches the recognition result includes: recommending a game application whose background audio matches the recognition result.

[0336] In some embodiments, the recognition result includes audio type information, which may be an audio identifier of the audio to which the data segment belongs, and the recommended game application whose background audio matches the recognition result is the recommended game application whose background audio is the same as the audio to which the data segment belongs. For example, if the user listens to song A through the target application, then the game application that uses song A as background audio is recommended to the user.

[0337] In some embodiments, the recognition result includes audio type information, which may be an audio style, and the recommended game application whose background audio matches the recognition result is a game application whose background audio has the same audio style as the data segment.

[0338] In another possible implementation, recommending a game application that matches the recognition result includes: recommending a game application whose game type matches the recognition result.

[0339] In some embodiments, the recognition result includes audio type information, and the audio type information is emotional information. The recommended game application whose game type matches the recognition result refers to the recommended game application whose game type matches the emotional information. For example, if the emotional information is cheerful, a cheerful game application is recommended to the user; for another example, if the emotional information is fighting, a fighting game application is recommended to the user.

[0340] In some embodiments, the recognition result includes acoustic characteristic information, which is audio energy, and the recommended game application whose game type matches the recognition result refers to the recommended game application whose game type matches the audio energy. For example, when the audio energy is high, combat-type games are recommended to the user. When the audio energy is low, games of the cultivation type are recommended to the user.

[0341] The audio data processing method provided in the embodiment of the present application can record the data segment being played when the terminal plays audio, and realize the target function through the recorded data segment. Since the audio recording is not affected by the external environment and the playback volume, the audio recording effect is improved, so that the target function can provide a better service.

[0342] Furthermore, the embodiments of the present application can also recommend multimedia data or game applications based on the played audio, thereby improving the flexibility and accuracy of the recommendation function.

[0343] It should be noted that the target function in the embodiment of the present application may be any function related to audio. Fig.13 The embodiment shown is exemplified by taking the target function as the quality detection function.

[0344] Fig.13 is a flowchart of an audio data processing method provided in an embodiment of the present application. The embodiment of the present application is exemplified by taking the execution subject as a terminal. Fig.13 As shown, the method includes:

[0345] 1301. When playing audio, the terminal captures the data segment being played in the data stream required by the terminal for playing the audio.

[0346] The above step 1301 is the same as the above step 301 and will not be described in detail here.

[0347] 1302. The terminal identifies the data segment and obtains an audio quality parameter of the data segment.

[0348] The above step 1302 may refer to the method for obtaining the audio quality parameter in the above step 302, which will not be described in detail here.

[0349] 1303. The terminal displays the audio quality detection result based on the audio quality parameter.

[0350] In a possible implementation, the terminal directly displays the audio quality parameter, which may be an audio quality score. The terminal displays the audio quality detection result based on the audio quality parameter, including: displaying the audio quality detection result including the audio quality parameter.

[0351] In another possible implementation, the terminal displays the audio quality, etc. The terminal displays the audio quality detection result based on the audio quality parameter, including: determining the quality level corresponding to the audio quality parameter, and displaying the audio quality detection result including the quality level.

[0352] In some embodiments, a correspondence between an audio quality parameter range and a quality level is established, and the quality level corresponding to the audio quality parameter range to which the audio quality parameter belongs is determined as the quality level corresponding to the audio quality parameter.

[0353] In some embodiments, the terminal displays the audio quality test result in the current interface. That is to say, no matter which application program's interface the terminal displays, or the display screen interface, the audio quality test result will be displayed in the interface. In other embodiments, the terminal displays the audio quality test result on the interface of the target application program, that is to say, the audio quality test result will be displayed only when the terminal displays the interface of the target application program. In other embodiments, the terminal displays the audio quality test result on the interface of the first application program. That is to say, the audio quality test result will be displayed only when the terminal displays the interface of the first application program. The embodiment of the present application does not limit the display mode of the audio quality test result.

[0354] The audio data processing method provided in the embodiment of the present application can record the data segment being played when the terminal plays audio, and realize the target function through the recorded data segment. Since the audio recording is not affected by the external environment and the playback volume, the audio recording effect is improved, so that the target function can provide a better service.

[0355] Furthermore, the embodiments of the present application can also detect the quality of the audio being played and present the audio quality parameters to the user so that the user can obtain more information about the audio.

[0356] It should be noted that the data segment captured by the terminal is a short data segment. If the acoustic characteristic information of the data segment is identified, the recognition result will be less affected by the short duration of the data segment and can still be recognized accurately. If the audio type information of the data segment is identified, the accuracy of the recognition result is relatively low. In order to obtain more accurate recognition results, you can also use Fig.14 The embodiment shown.

[0357] Fig.14 : is a flowchart of an audio data processing method provided in an embodiment of the present application. The embodiment of the present application is exemplified by taking the execution subject as a terminal. The method includes:

[0358] 1401. When playing audio, the terminal captures the data segment being played in the data stream required by the local end to play the audio.

[0359] In some embodiments, the terminal is preset with a capture frequency, and the terminal captures the data segment being played in the data stream multiple times according to the capture frequency to obtain multiple data segments.

[0360] In some embodiments, the terminal captures the data segment through the audio visualization interface. The terminal captures the data segment being played in the data stream required by the terminal to play the audio, including: the terminal captures the data segment being played in the data stream multiple times according to the capture frequency through the audio visualization interface.

[0361] 1402. The terminal identifies multiple data segments and obtains audio type information corresponding to the multiple data segments respectively.

[0362] The step 1402 may refer to the method of identifying the audio type information in the above step 302, which will not be described in detail here.

[0363] It should be noted that, in the above step 1402, after each data segment is obtained, the data segment is identified to obtain the audio type information of the data segment.

[0364] 1403. The terminal determines target audio type information based on the audio type information of multiple data segments.

[0365] In an embodiment of the present application, since the duration of a data segment is too short, the accuracy of the audio type information obtained by identifying a data segment is relatively low. In order to improve the accuracy of the audio type information, the terminal can refer to the audio type information of multiple data segments to infer more accurate audio type information of the audio currently being played.

[0366] If the audio type information of most of the data segments in the multiple data segments is the same, then the audio type information is likely to be the accurate audio type information of the audio being played. Therefore, the accurate audio type information can be determined by the distribution of the audio type information of the multiple data segments. In a possible implementation, the terminal determines the target audio type information based on the audio type information of the multiple data segments, including: determining the audio type information with the highest frequency in the audio type information of the multiple data segments as the target audio type information.

[0367] In another possible implementation, the audio type information of the data segment includes the probability that the data segment belongs to multiple audio types; for example, the audio type information of the data segment includes 70s, 30%; 80s, 20%; 90s, 50%. After each audio type information of a data segment is obtained, the probabilities corresponding to the above multiple audio types can be accumulated, and finally the audio type corresponding to the maximum probability is the correct audio type. Optionally, the terminal determines the target audio type information based on the audio type information of multiple data segments, including: based on the audio type information of multiple data segments, accumulating the probabilities corresponding to multiple audio types to obtain the target audio type information.

[0368] In another possible implementation, the terminal determines the target audio type information based on the audio type information of the multiple data segments, including: performing weighted averaging on the audio type information of the multiple data segments to obtain the target audio type information.

[0369] For example, the audio type information of the first data segment is from the 1980s, the audio type of the second data segment is from the 1990s, and the audio type of the third data segment is from the 1980s. The weighted average of 80, 90, and 80 is 83.3, and 83.3 is rounded to the nearest integer to get 80. The correct audio type information is from the 1980s.

[0370] Next, the execution timing of the above step 1403 is described:

[0371] In order to obtain accurate target audio type information by referring to the audio type information of multiple data segments, the above step 1403 can be performed after the recognition results of multiple data segments are stable, or after the number of data segments is large enough.

[0372] In one possible implementation, after the audio type information of multiple data segments meets the stability condition, a step of determining the target audio type information based on the audio type information of the multiple data segments is performed; or, after the number of multiple data segments reaches the target number, a step of determining the target audio type information based on the audio type information of the multiple data segments is performed. The target number is any number, and the embodiment of the present application does not limit the target number. Optionally, the target number is an empirical value; optionally, the target number is a user-defined value; optionally, the target number is a value set by a technician.

[0373] Optionally, the stability condition includes at least one of: the number of identical audio type information reaches a first number; a second number of consecutive audio type information are identical.

[0374] The first quantity and the second quantity may be any number, and the embodiment of the present application does not limit the first quantity and the second quantity.

[0375] 1404. The terminal executes a target function based on the target audio type information.

[0376] It should be noted that the embodiment of the present application only uses "after obtaining audio type information of multiple data segments, optimizing the audio type information based on the audio type information of the multiple data segments to obtain more accurate audio type information, and performing processing based on the more accurate audio type information" as an example to exemplify the acquisition of more accurate audio type information. In another embodiment, multiple data segments may be collected first, and the multiple data segments may be identified together to obtain a more accurate recognition result. Optionally, the step of capturing the data segment being played in the data stream required by the terminal to play the audio is repeated; until the number of collected data segments reaches the target number, the target number of data segments are identified to obtain the audio type information of the target number of data segments, and based on the audio type information of the target number of data segments, processing for achieving the target function is performed.

[0377] The audio data processing method provided in the embodiment of the present application can record the data segment being played when the terminal plays audio, and realize the target function through the recorded data segment. Since the audio recording is not affected by the external environment and the playback volume, the audio recording effect is improved, so that the target function can provide a better service.

[0378] Furthermore, multiple data segments can be obtained, the audio type information of each data segment can be identified, and relatively accurate audio type information of the currently playing audio can be inferred by referring to the audio type information of multiple data segments, thereby improving the accuracy of the recognition result.

[0379] Fig.15 is a structural diagram of an audio data processing device provided in an embodiment of the present application. Fig.15 , the device comprises:

[0380] The acquisition module 1501 is used to capture the data segment being played in the data stream required by the terminal for playing the audio when playing the audio;

[0381] The recognition module 1502 is used to recognize the data segment and obtain the recognition result of the data segment, wherein the recognition result includes at least one of acoustic characteristic information and audio type information;

[0382] The processing module 1503 is used to execute a target function based on the recognition result, wherein the target function includes: a function related to audio.

[0383] In one possible implementation, the acquisition module 1501 is used to call the audio visualization interface to capture the data segment being played in the data stream required to play the audio. The initial function of the audio visualization interface is different from the target function. The initial function is to acquire a data segment of a specified amount of data to visualize the waveform of the data segment.

[0384] In a possible implementation, the acquisition module 1501 is used to capture the data segment being played in the data stream required by the terminal for playing audio multiple times according to a preset capture frequency;

[0385] The processing module 1503 is used to determine target audio type information based on the audio type information of multiple data segments; and execute a target function based on the target audio type information.

[0386] In one possible implementation, the processing module 1503 is used to determine the audio type information that appears most frequently in the audio type information of multiple data segments as the target audio type information; or, the audio type information of the data segment includes the probability that the data segment belongs to multiple audio types; based on the audio type information of multiple data segments, the probabilities corresponding to the multiple audio types are accumulated to obtain the target audio type information; or, the audio type information of multiple data segments is weighted averaged to obtain the target audio type information.

[0387] In one possible implementation, the processing module 1503 is used to execute the step of determining the target audio type information based on the audio type information of the multiple data segments after the audio type information of the multiple data segments meets the stability condition; or, after the number of the multiple data segments reaches the target number, execute the step of determining the target audio type information based on the audio type information of the multiple data segments.

[0388] In a possible implementation, the stability condition includes at least one of:

[0389] The number of identical audio type information reaches a first number;

[0390] A second number of consecutive audio type information are the same.

[0391] In a possible implementation, the target function is a virtual object display function; the processing module 1503 is used to display a virtual object matching at least one of the acoustic characteristic information and the audio type information on an upper layer of the current interface.

[0392] In a possible implementation, the processing module 1503 is configured to perform at least one of the following:

[0393] When the acoustic characteristic information includes a musical instrument type, displaying a virtual musical instrument matching the musical instrument type;

[0394] When the audio type information includes at least one of a decade and a genre, displaying a virtual character whose virtual clothing matches at least one of the decade and the genre;

[0395] When the acoustic characteristic information includes timbre, a virtual character matching the timbre is displayed, and the timbre is used to indicate whether the singer is a man, a woman, or a child;

[0396] When the acoustic characteristic information includes audio energy, a virtual object having at least one of a color and a size matching the audio energy is displayed.

[0397] In a possible implementation, the processing module 1503 is further configured to perform at least one of the following:

[0398] Controlling a virtual object to perform a preset singing action or playing action;

[0399] Controlling the virtual object to perform a singing action or a playing action matching at least one of the acoustic characteristic information and the audio type information;

[0400] controlling the virtual object to perform a dance move matching at least one of the acoustic characteristic information and the audio type information;

[0401] Control the virtual object to move in a random direction and bounce back after hitting the border of the current interface.

[0402] In a possible implementation, the processing module 1503 is further configured to perform at least one of the following:

[0403] When the audio type information includes at least one of a decade and a genre, controlling the virtual object to perform a dance move whose dance posture matches at least one of the decade and the genre;

[0404] When the acoustic characteristic information includes audio energy, controlling the virtual object to perform dance movements at a speed matching the audio energy;

[0405] When the audio type information includes emotional information, the virtual object is controlled to perform dance moves matching the emotional information.

[0406] In a possible implementation, the target function is a dynamic image display function; the processing module 1503 is used to display a dynamic image whose dynamic changes match the acoustic characteristic information.

[0407] In a possible implementation, the acoustic characteristic information includes audio energy; the processing module 1503 is configured to perform at least one of the following:

[0408] Record image showing rotation speed matched to audio energy;

[0409] A dynamic wallpaper whose display changes speed to match the energy of the audio.

[0410] In one possible implementation, the acoustic characteristic information includes pitch, and the target function is a pitch recognition function; the processing module 1503 is used to control the microphone to record and obtain recorded audio; perform pitch recognition on the recorded audio to obtain the pitch of the recorded audio; based on the pitch of the data segment and the pitch of the recorded audio, perform pitch recognition on the recorded audio to obtain a pitch recognition result, and the pitch recognition result is used to indicate the matching of the pitch of the recorded audio with the pitch of the data segment.

[0411] In a possible implementation, the processing module 1503 is further configured to perform at least one of the following:

[0412] Displaying a sing-along option on the upper layer of the current interface, and in response to a selection operation of the sing-along option, executing the step of controlling a microphone to record and obtaining recorded audio;

[0413] The pitch recognition result is displayed on the upper layer of the current interface.

[0414] In a possible implementation, the identification module 1502 is further used to perform instrument identification on the recorded audio to obtain the instrument type of the recorded audio;

[0415] The processing module 1503 is further used to display the virtual musical instrument corresponding to the musical instrument type on the upper layer of the current interface.

[0416] In a possible implementation, the target function is an audio denoising function; the processing module 1503 is used to control the microphone to record and obtain recorded audio; and denoise the recorded audio based on the acoustic characteristic information.

[0417] In a possible implementation, the processing module 1503 is configured to perform at least one of the following:

[0418] The acoustic characteristic information includes the frequency range of the data segment, and the audio signal whose frequency does not belong to the frequency range is deleted from the recorded audio;

[0419] The acoustic characteristic information includes timbre, and based on the timbre, the recorded audio is denoised so that the timbre of the recorded audio is consistent with the data segment.

[0420] In a possible implementation, the target function is a song recognition function; the processing module 1503 is used to query the target audio to which the data segment belongs from the database based on the recognition result; and display the audio identifier of the target audio.

[0421] In a possible implementation, the processing module 1503 is used to query a database for multiple candidate audios matching the recognition result based on the recognition result; and compare the data segment with the multiple candidate audios to obtain the target audio to which the data segment belongs.

[0422] In a possible implementation, the target function is a scene adding function; the processing module 1503 is used to add a virtual scene matching the recognition result to the target application.

[0423] In a possible implementation, the processing module 1503 is configured to perform at least one of the following:

[0424] Add a virtual scene matching the recognition result to the border area of ​​the current interface;

[0425] The audio type information includes emotional information, and a virtual scene whose style matches the emotional information is added.

[0426] In a possible implementation, the target function is a sound effect adding function; the processing module 1503 is used to play the sound effect matching the recognition result during the audio playback process.

[0427] In a possible implementation, the processing module 1503 is configured to perform at least one of the following:

[0428] Play the ambient sound effects that match the recognition results;

[0429] Play the action sound effect that matches the recognition result.

[0430] In a possible implementation, the target function is a recommendation function; the processing module 1503 is configured to perform at least one of the following:

[0431] Recommend multimedia data matching the recognition results;

[0432] Recommend game applications that match the recognition results.

[0433] In a possible implementation, the processing module 1503 is used to recommend a game application whose background audio matches the recognition result; or recommend a game application whose game type matches the recognition result.

[0434] In a possible implementation, the acoustic characteristic information includes an audio quality parameter, and the target function is an audio quality detection function; the processing module 1503 is used to display the audio quality detection result based on the audio quality parameter.

[0435] In a possible implementation, the processing module 1503 is configured to display the audio quality detection result including the audio quality parameter; or determine the quality level of the audio quality parameter and display the audio quality detection result including the quality level.

[0436] In one possible implementation, the acquisition module 1501 is used to execute the step of capturing the data segment being played in the data stream required by the terminal for playing audio in response to the start-up operation of the target function; or, once every first time period, execute the step of capturing the data segment being played in the data stream required by the terminal for playing audio.

[0437] In a possible implementation, the identification module 1502 is configured to perform at least one of the following:

[0438] The acoustic characteristic information of the data segment includes audio energy, and the values ​​of multiple sampling points of the data segment are counted to obtain the audio energy of the data segment; or,

[0439] The acoustic characteristic information of the data segment includes pitch, and the data segment is subjected to autocorrelation analysis to obtain the fundamental frequency of the data segment, and the pitch of the data segment is determined based on the fundamental frequency;

[0440] The acoustic characteristic information of the data segment includes an audio quality parameter, obtaining a cumulative mean normalized difference function value of the data segment, and determining the audio quality parameter of the data segment based on a difference between the cumulative mean normalized difference function value and a first threshold, wherein the first threshold represents a proportion of the non-periodic signal power in the approximately periodic signal power;

[0441] The increment or derivative of the logarithmic scaled Mel spectrogram, the logarithmic scaled Mel spectrogram, and the average characteristic spectrum of the harmonic component and the percussion component of the data segment are obtained, and the audio classification model is called to classify the increment or derivative of the logarithmic scaled Mel spectrogram, the logarithmic scaled Mel spectrogram, and the average characteristic spectrum of the harmonic component and the percussion component to obtain the recognition result of the data segment.

[0442] In a possible implementation, the audio is the audio played by the target application, or the audio is the audio played by the target webpage;

[0443] The target functions include: audio-related functions provided by the first application.

[0444] The embodiment of the present application also provides a terminal. Fig.16 1 is a schematic diagram of a terminal structure provided in an embodiment of the present application. The terminal 1600 may be a portable mobile terminal, such as a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart home appliance, a smart watch, etc. The terminal 1600 may also be called a user device, a portable terminal, a laptop terminal, a desktop terminal, or other names.

[0445] The terminal 1600 includes a processor 1601 and a memory 1602 .

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

[0447] The memory 1602 may include one or more computer-readable storage media, which may be non-transitory. The memory 1602 may also include a high-speed random access memory, and a non-volatile memory, such as one or more disk storage devices, flash memory storage devices. In some embodiments, the non-transitory computer-readable storage medium in the memory 1602 is used to store at least one program code, which is used to be executed by the processor 1601 to implement the audio data processing method provided in the method embodiment of the present application.

[0448] In some embodiments, the terminal 1600 may also optionally include: a peripheral device interface 1603 and at least one peripheral device. The processor 1601, the memory 1602 and the peripheral device interface 1603 may be connected via a bus or a signal line. Each peripheral device may be connected to the peripheral device interface 1603 via a bus, a signal line or a circuit board. Specifically, the peripheral device includes: at least one of a radio frequency circuit 1604, a display screen 1605, a camera assembly 1606, an audio circuit 1607, a positioning assembly 1608 and a power supply 1609.

[0449] The peripheral device interface 1603 may be used to connect at least one peripheral device related to I / O (Input / Output) to the processor 1601 and the memory 1602. In some embodiments, the processor 1601, the memory 1602, and the peripheral device interface 1603 are integrated on the same chip or circuit board; in some other embodiments, any one or two of the processor 1601, the memory 1602, and the peripheral device interface 1603 may be implemented on a separate chip or circuit board, which is not limited in this embodiment.

[0450] The radio frequency circuit 1604 is used to receive and transmit RF (Radio Frequency) signals, also known as electromagnetic signals. The radio frequency circuit 1604 communicates with the communication network and other communication devices through electromagnetic signals. The radio frequency circuit 1604 converts electrical signals into electromagnetic signals for transmission, or converts received electromagnetic signals into electrical signals. Optionally, the radio frequency circuit 1604 includes: an antenna system, an RF transceiver, one or more amplifiers, a tuner, an oscillator, a digital signal processor, a codec chipset, a user identity module card, etc. The radio frequency circuit 1604 can communicate with other terminals through at least one wireless communication protocol. The wireless communication protocol includes but is not limited to: the World Wide Web, a metropolitan area network, an intranet, various generations of mobile communication networks (2G, 3G, 4G and 20G), a wireless local area network and / or a WiFi (Wireless Fidelity) network. In some embodiments, the radio frequency circuit 1604 may also include circuits related to NFC (Near Field Communication), which is not limited in this application.

[0451] The display screen 1605 is used to display a UI (User Interface). The UI may include graphics, text, icons, videos, and any combination thereof. When the display screen 1605 is a touch display screen, the display screen 1605 also has the ability to collect touch signals on the surface or above the surface of the display screen 1605. The touch signal can be input to the processor 1601 as a control signal for processing. At this time, the display screen 1605 can also be used to provide virtual buttons and / or virtual keyboards, also known as soft buttons and / or soft keyboards. In some embodiments, the display screen 1605 can be one, set on the front panel of the terminal 1600; in other embodiments, the display screen 1605 can be at least two, respectively set on different surfaces of the terminal 1600 or in a folding design; in other embodiments, the display screen 1605 can be a flexible display screen, set on a curved surface or a folding surface of the terminal 1600. Even, the display screen 1605 can also be set to a non-rectangular irregular shape, that is, a special-shaped screen. The display screen 1605 can be made of materials such as LCD (Liquid Crystal Display) and OLED (Organic Light-Emitting Diode).

[0452] The camera assembly 1606 is used to capture images or videos. Optionally, the camera assembly 1606 includes a front camera and a rear camera. 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 1606 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.

[0453] The audio circuit 1607 may include a microphone and a speaker. The microphone is used to collect sound waves from the user and the environment, and convert the sound waves into electrical signals and input them into the processor 1601 for processing, or input them into the radio frequency circuit 1604 to achieve voice communication. For the purpose of stereo acquisition or noise reduction, there may be multiple microphones, which are respectively arranged at different parts of the terminal 1600. The microphone may also be an array microphone or an omnidirectional acquisition microphone. The speaker is used to convert the electrical signal from the processor 1601 or the radio frequency circuit 1604 into sound waves. The speaker may be a traditional film speaker or a piezoelectric ceramic speaker. When the speaker is a piezoelectric ceramic speaker, it can not only convert the electrical signal into sound waves audible to humans, but also convert the electrical signal into sound waves inaudible to humans for purposes such as ranging. In some embodiments, the audio circuit 1607 may also include a headphone jack.

[0454] The positioning component 1608 is used to locate the current geographical location of the terminal 1600 to implement navigation or LBS (Location Based Service). The positioning component 1608 can be based on the US GPS (Global Positioning System), China's Beidou system or Russia's Greiner positioning system and the European Union's Galileo positioning system.

[0455] The power supply 1609 is used to power various components in the terminal 1600. The power supply 1609 can be an alternating current, a direct current, a disposable battery, or a rechargeable battery. When the power supply 1609 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 charged through a wired line, and a wireless rechargeable battery is a battery charged through a wireless coil. The rechargeable battery can also be used to support fast charging technology.

[0456] In some embodiments, the terminal 1600 further includes one or more sensors 1610 , including but not limited to: an acceleration sensor 1611 , a gyroscope sensor 1612 , a pressure sensor 1613 , a fingerprint sensor 1614 , an optical sensor 1615 , and a proximity sensor 1616 .

[0457] The acceleration sensor 1611 can detect the magnitude of acceleration on the three coordinate axes of the coordinate system established by the terminal 1600. For example, the acceleration sensor 1611 can be used to detect the components of gravity acceleration on the three coordinate axes. The processor 1601 can control the display screen 1605 to display the user interface in a horizontal view or a vertical view according to the gravity acceleration signal collected by the acceleration sensor 1611. The acceleration sensor 1611 can also be used for collecting game or user motion data.

[0458] The gyro sensor 1612 can detect the body direction and rotation angle of the terminal 1600, and the gyro sensor 1612 can cooperate with the acceleration sensor 1611 to collect the user's 3D actions on the terminal 1600. The processor 1601 can implement the following functions based on the data collected by the gyro sensor 1612: motion sensing (such as changing the UI according to the user's tilt operation), image stabilization during shooting, game control, and inertial navigation.

[0459] The pressure sensor 1613 can be set on the side frame of the terminal 1600 and / or the lower layer of the display screen 1602. When the pressure sensor 1613 is set on the side frame of the terminal 1600, it can detect the user's holding signal of the terminal 1600, and the processor 1601 performs left and right hand recognition or shortcut operation according to the holding signal collected by the pressure sensor 1613. When the pressure sensor 1613 is set on the lower layer of the display screen 1602, the processor 1601 controls the operability controls on the UI interface according to the user's pressure operation on the display screen 1605. The operability controls include at least one of a button control, a scroll bar control, an icon control, and a menu control.

[0460] The fingerprint sensor 1614 is used to collect the user's fingerprint, and the processor 1601 identifies the user's identity based on the fingerprint collected by the fingerprint sensor 1614, or the fingerprint sensor 1614 identifies the user's identity based on the collected fingerprint. When the user's identity is identified as a trusted identity, the processor 1601 authorizes the user to perform relevant sensitive operations, which include unlocking the screen, viewing encrypted information, downloading software, paying, and changing settings. The fingerprint sensor 1614 can be set on the front, back, or side of the terminal 1600. When a physical button or a manufacturer logo is set on the terminal 1600, the fingerprint sensor 1614 can be integrated with the physical button or the manufacturer logo.

[0461] The optical sensor 1615 is used to collect the ambient light intensity. In one embodiment, the processor 1601 can control the display brightness of the display screen 1605 according to the ambient light intensity collected by the optical sensor 1615. Specifically, when the ambient light intensity is high, the display brightness of the display screen 1605 is increased; when the ambient light intensity is low, the display brightness of the display screen 1605 is reduced. In another embodiment, the processor 1601 can also dynamically adjust the shooting parameters of the camera component 1606 according to the ambient light intensity collected by the optical sensor 1615.

[0462] The proximity sensor 1616, also called a distance sensor, is disposed on the front panel of the terminal 1600. The proximity sensor 1616 is used to collect the distance between the user and the front of the terminal 1600. In one embodiment, when the proximity sensor 1616 detects that the distance between the user and the front of the terminal 1600 is gradually decreasing, the processor 1601 controls the display screen 1605 to switch from the screen-on state to the screen-off state; when the proximity sensor 1616 detects that the distance between the user and the front of the terminal 1600 is gradually increasing, the processor 1601 controls the display screen 1605 to switch from the screen-off state to the screen-on state.

[0463] Those skilled in the art will understand that Fig.16 The structure shown in the figure does not constitute a limitation on the terminal 1600, and the terminal 1600 may include more or less components than those shown in the figure, or combine some components, or adopt a different component arrangement.

[0464] Fig.17 This is a schematic diagram of the structure of a server according to an exemplary embodiment. The server 1700 may have relatively large differences due to different configurations or performances, and may include one or more processors (Central Processing Units, CPU) 1701 and one or more memories 1702, wherein the memory 1702 stores at least one program code, and the at least one program code is loaded and executed by the processor 1701 to implement the methods provided by the above-mentioned various method embodiments. Of course, the server may also have components such as a wired or wireless network interface, a keyboard, and an input and output interface for input and output, and the server may also include other components for implementing device functions, which will not be described in detail here.

[0465] An embodiment of the present application further provides a computer-readable storage medium, in which at least one program code is stored. The at least one program code is loaded and executed by a processor to implement the operations performed in the audio data processing method of the above embodiment.

[0466] An embodiment of the present application further provides a computer program product, in which at least one program code is stored. The at least one program code is loaded and executed by a processor to implement the operations performed in the audio data processing method of the above embodiment.

[0467] A person skilled in the art will understand that all or part of the steps to implement the above embodiments may be accomplished by hardware or by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a disk or an optical disk, etc.

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

Claims

1. An audio data processing method, characterized in that: The method comprises: When playing audio, capturing the data segment being played in the data stream required by the terminal to play the audio; Identify the data segment to obtain an identification result of the data segment, wherein the identification result includes at least one of acoustic characteristic information and audio type information; Based on the recognition result, a target function is executed, wherein the target function includes: a function related to audio.

2. The method according to claim 1, characterized in that The capture terminal is for playing the data segment currently being played in the data stream required for playing the audio, including: An audio visualization interface is called to capture the data segment being played in the data stream required by the terminal to play the audio. The initial function of the audio visualization interface is different from the target function. The initial function is to collect data segments of a specified amount of data to visualize the waveform of the data segments.

3. The method according to claim 1, characterized in that The capture terminal is for playing the data segment currently being played in the data stream required for playing the audio, including: According to a preset capture frequency, the data segment being played in the data stream required by the terminal to play the audio is captured multiple times; The performing of the target function based on the recognition result includes: Determining target audio type information based on the audio type information of the plurality of data segments; Based on the target audio type information, the target function is executed.

4. The method according to claim 3, characterized in that The step of determining target audio type information based on the audio type information of the plurality of data segments comprises: Determine the audio type information with the highest frequency of appearance among the audio type information of the multiple data segments as the target audio type information; or, The audio type information of the data segment includes the probability that the data segment belongs to multiple audio types; based on the audio type information of the multiple data segments, the probabilities corresponding to the multiple audio types are accumulated to obtain the target audio type information; or, The audio type information of the multiple data segments is weighted averaged to obtain the target audio type information.

5. The method according to claim 3, characterized in that: The method further comprises: After the audio type information of the plurality of data segments meets the stability condition, a step of determining target audio type information based on the audio type information of the plurality of data segments is performed; or, After the number of the plurality of data segments reaches a target number, a step of determining target audio type information based on the audio type information of the plurality of data segments is performed.

6. The method according to claim 5, characterized in that The stability condition includes at least one of: The number of identical audio type information reaches a first number; A second number of consecutive audio type information are the same.

7. The method according to claim 1, characterized in that The target function is a virtual object display function; and executing the target function based on the recognition result includes: A virtual object matching at least one of the acoustic characteristic information and the audio type information is displayed.

8. The method according to claim 7, characterized in that The displaying of a virtual object matching at least one of the acoustic characteristic information and the audio type information comprises at least one of the following: When the acoustic characteristic information includes a musical instrument type, displaying a virtual musical instrument matching the musical instrument type; When the audio type information includes at least one of a decade and a genre, displaying a virtual character whose virtual clothing matches at least one of the decade and the genre; When the acoustic characteristic information includes timbre, displaying a virtual character that matches the timbre, wherein the timbre is used to indicate whether the singer is a man, a woman, or a child; When the acoustic characteristic information includes audio energy, a virtual object having at least one of a color and a size matching the audio energy is displayed.

9. The method according to claim 7, characterized in that: After displaying the virtual object matching at least one of the acoustic characteristic information and the audio type information, the method further includes any one of the following: Controlling the virtual object to perform a preset singing action or playing action; Controlling the virtual object to perform a singing action or a playing action matching at least one of the acoustic characteristic information and the audio type information; controlling the virtual object to perform a dance movement matching at least one of the acoustic characteristic information and the audio type information; The virtual object is controlled to move in a random direction and bounce back after hitting the border of the current interface.

10. The method according to claim 9, characterized in that The controlling the virtual object to perform a dance action matching at least one of the acoustic characteristic information and the audio type information comprises at least one of the following: When the audio type information includes at least one of the decade and the genre, controlling the virtual object to perform a dance move whose dance posture matches at least one of the decade and the genre; When the acoustic characteristic information includes audio energy, controlling the virtual object to perform dance movements at a speed matching the audio energy; When the audio type information includes emotion information, the virtual object is controlled to perform dance movements matching the emotion information.

11. The method according to claim 1, characterized in that: The target function is a dynamic image display function; and executing the target function based on the recognition result includes: A dynamic image is displayed whose dynamic changes match the acoustic characteristic information.

12. The method according to claim 11, characterized in that The acoustic characteristic information includes audio energy; the dynamic image showing dynamic changes matching the acoustic characteristic information includes at least one of the following: displaying an image of a record rotating at a speed matching the energy of the audio; Displays a dynamic wallpaper that changes speed to match the energy of the audio.

13. The method according to claim 1, characterized in that The acoustic characteristic information includes pitch, and the target function is a pitch recognition function; and executing the target function based on the recognition result includes: Control the microphone to record and obtain the recorded audio; Performing pitch recognition on the recorded audio to obtain the pitch of the recorded audio; Based on the pitch of the data segment and the pitch of the recorded audio, the recorded audio is subjected to pitch recognition to obtain a pitch recognition result, wherein the pitch recognition result is used to indicate the matching condition between the pitch of the recorded audio and the pitch of the data segment.

14. The method according to claim 13, characterized in that The method further comprises at least one of the following: Displaying a sing-along option on the upper layer of the current interface, and in response to a selection operation of the sing-along option, executing the step of controlling a microphone to record and obtain recorded audio; The pitch recognition result is displayed on the upper layer of the current interface.

15. The method according to claim 13, characterized in that The method further comprises: Performing instrument identification on the recorded audio to obtain the instrument type of the recorded audio; A virtual musical instrument corresponding to the musical instrument type is displayed on the upper layer of the current interface.

16. The method according to claim 13, characterized in that The target function is an audio denoising function; and executing the target function based on the recognition result includes: Control the microphone to record and obtain the recorded audio; Based on the acoustic characteristic information, the recorded audio is denoised.

17. The method according to claim 16, characterized in that The denoising of the recorded audio based on the acoustic characteristic information includes at least one of the following: The acoustic characteristic information includes the frequency range of the data segment, and the audio signal whose frequency in the recorded audio does not belong to the frequency range is deleted; The acoustic characteristic information includes timbre, and based on the timbre, the recorded audio is denoised so that the timbre of the recorded audio is consistent with the data segment.

18. The method according to claim 1, characterized in that The target function is a song recognition function; and executing the target function based on the recognition result includes: Based on the recognition result, querying the target audio to which the data segment belongs from a database; The audio identifier of the target audio is displayed.

19. The method according to claim 18, characterized in that The step of querying a database for a target audio to which the data segment belongs based on the recognition result includes: Based on the recognition result, querying the database for a plurality of candidate audios matching the recognition result; The data segment is compared with the multiple candidate audios to obtain the target audio to which the data segment belongs.

20. The method according to claim 1, characterized in that The target function is a scene adding function; and executing the target function based on the recognition result includes: A virtual scene matching the recognition result is added.

21. The method according to claim 20, characterized in that The adding of a virtual scene matching the recognition result includes at least one of the following: Adding a virtual scene matching the recognition result in the border area of ​​the current interface; The audio type information includes emotional information, and a virtual scene with a style matching the emotional information is added.

22. The method according to claim 1, characterized in that The target function is a sound effect adding function; and executing the target function based on the recognition result includes: During the playing of the audio, a sound effect matching the recognition result is played.

23. The method according to claim 22, characterized in that The playing of the sound effect matching the recognition result includes at least one of the following: Playing an environmental sound effect that matches the recognition result; Play the action sound effect that matches the recognition result.

24. The method according to claim 1, characterized in that The target function is a recommended function; and executing the target function based on the recognition result includes at least one of the following: recommending multimedia data matching the recognition result; A game application matching the recognition result is recommended.

25. The method according to claim 24, characterized in that The recommending a game application matching the recognition result includes: recommending a gaming application whose background audio matches the recognition result; or, A game application whose game type matches the recognition result is recommended.

26. The method according to claim 1, characterized in that The acoustic characteristic information includes an audio quality parameter, and the target function is an audio quality detection function; and executing the target function based on the recognition result includes: Based on the audio quality parameter, an audio quality detection result is displayed.

27. The method according to claim 26, characterized in that The step of displaying the audio quality detection result based on the audio quality parameter includes: displaying an audio quality detection result including the audio quality parameter; or, A quality level of the audio quality parameter is determined, and an audio quality detection result including the quality level is displayed.

28. The method according to claim 1, characterized in that The method further comprises: In response to the activation operation of the target function, executing the step of capturing the data segment being played in the data stream required by the terminal to play the audio; or, The step of capturing the data segment being played in the data stream required by the terminal to play the audio is performed once every first time period.

29. The method according to claim 1, characterized in that The identifying the data segment to obtain an identification result of the data segment includes at least one of the following: The acoustic characteristic information includes audio energy, and the values ​​of multiple sampling points of the data segment are counted to obtain the audio energy of the data segment; or, The acoustic characteristic information includes pitch, an autocorrelation analysis is performed on the data segment to obtain a fundamental frequency of the data segment, and the pitch of the data segment is determined based on the fundamental frequency; The acoustic characteristic information includes an audio quality parameter, obtaining a cumulative mean normalized difference function value of the data segment, and determining the audio quality parameter of the data segment based on a difference between the cumulative mean normalized difference function value and a first threshold, wherein the first threshold represents a proportion of the non-periodic signal power in the approximately periodic signal power; Obtain the increment or derivative of the logarithmic scaled Mel-spectrogram, the logarithmic scaled Mel-spectrogram, and the average characteristic spectrum of the harmonic components and the percussion components of the data segment, call the audio classification model to classify the increment or derivative of the logarithmic scaled Mel-spectrogram, the logarithmic scaled Mel-spectrogram, and the average characteristic spectrum of the harmonic components and the percussion components, and obtain the recognition result of the data segment.

30. The method according to claim 1, characterized in that The audio is the audio played by the target application, or the audio is the audio played by the target webpage; The target function includes: an audio-related function provided by the first application.

31. An audio data processing device, characterized in that: The device comprises: A collection module, used for capturing the data segment being played in the data stream required by the terminal to play the audio when the audio is played; an identification module, configured to identify the data segment and obtain an identification result of the data segment, wherein the identification result includes at least one of acoustic characteristic information and audio type information; A processing module is used to execute a target function based on the recognition result, wherein the target function includes: a function related to audio.

32. A terminal, characterized in that: The terminal includes a processor and a memory, wherein the memory stores at least one program code, and the at least one program code is loaded and executed by the processor to implement the operations performed in the audio data processing method according to any one of claims 1 to 30.

33. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores at least one program code, and the at least one program code is loaded and executed by the processor to implement the operations performed in the audio data processing method according to any one of claims 1 to 30.