Audio recording method, device and electronic equipment

CN114944171BActive Publication Date: 2024-11-05BEIJING ZITIAO NETWORK TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210629081.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-06-06
Publication Date
2024-11-05
Estimated Expiration
2042-06-06

AI Technical Summary

Technical Problem

The smart terminal operating system does not support audio recording played by certain channels, which causes the audio content played by these channels to be unable to be recorded, affecting the recording effect.

Method used

By obtaining the path type of the currently playing audio, if it is an unsupported path type, copy the audio data for conversion processing, convert it to audio data of the path type supported by the operating system, and record it using the corresponding audio recording rules. The specific methods include creating a data recording module and a decoder, copying and parsing audio data, and sending it to a data processing path for recording.

Benefits of technology

It realizes accurate recording of audio playback through the operating system that does not support audio recording, and improves the recording integrity of audio content played by smart terminals.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114944171B_ABST
    Figure CN114944171B_ABST
Patent Text Reader

Abstract

The present disclosure relates to an audio recording method, device and electronic device, and to the field of data processing technology, wherein the method comprises: first obtaining the type of channel currently used for playing audio; if the channel type is the first channel type, then copying the first type of audio data currently played in the channel of the first channel type for conversion processing to obtain the second type of audio data, wherein the channel of the second channel type corresponding to the second type of audio data is a channel that the operating system already supports audio internal recording; then, according to the second type of audio data, audio recording is performed using the audio recording rules corresponding to the second channel type. By applying the technical solution of the present disclosure, the audio played in those channels that the operating system does not support audio internal recording can be accurately recorded, thereby improving the recording integrity of the audio content played by the smart terminal.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of data processing technology, and in particular to an audio recording method, device and electronic device. Background Art

[0002] With the development of technology, the functions of smart terminals (such as smart TVs, smart phones, tablets, etc.) are becoming more and more powerful. Users often need to record the content played by smart terminals. However, when recording the screen, users not only record the ambient sound through the microphone, but also the sound currently playing on the smart terminal.

[0003] At present, the inventor has found that although the operating system of the smart terminal already supports internal recording of system audio, it only supports recording audio played through specific channels, and does not support internal recording of audio played through certain channels. As a result, in actual use, some audio playback content can be recorded, while some audio playback content cannot be recorded, which in turn affects the audio recording effect. Summary of the invention

[0004] In view of this, the present disclosure provides an audio recording method, device and electronic device, the main purpose of which is to improve the current technical problem that the audio content played on certain channels cannot be recorded because the operating system of the smart terminal does not support the internal recording of audio played on these channels.

[0005] In a first aspect, the present disclosure provides an audio recording method, comprising:

[0006] Get the channel type used by the current audio playback;

[0007] If the channel type is the first channel type, the first type of audio data currently being played on the channel of the first channel type is copied for conversion processing to obtain second type of audio data, wherein the channel of the second channel type corresponding to the second type of audio data is a channel that the operating system already supports audio internal recording;

[0008] Audio recording is performed according to the second type of audio data using an audio recording rule corresponding to the second path type.

[0009] Optionally, before converting the copy of the first type of audio data currently played in the channel of the first channel type, the method further comprises:

[0010] Creating a data recording module and a decoder corresponding to the first type of audio data;

[0011] The copying of the first type of audio data currently played in the channel of the first channel type is converted and processed, including:

[0012] The first type of audio data is copied by the data recording module, and the copied first type of audio data is parsed into the second type of audio data by the decoder.

[0013] Optionally, before performing audio recording according to the second type of audio data using an audio recording rule corresponding to the second path type, the method further includes:

[0014] Create data processing pipelines;

[0015] The step of performing audio recording according to the second type of audio data using an audio recording rule corresponding to the second path type includes:

[0016] The second type of audio data is sent to the data processing channel, and audio recording is performed using an audio recording rule corresponding to the second channel type.

[0017] Optionally, the sending the second type of audio data to the data processing channel and performing audio recording using an audio recording rule corresponding to the second channel type includes:

[0018] The second type of audio data of the data processing path is passed to a hardware abstraction layer for providing audio output to a remote end through a target thread, so that the second type of audio data is sent to an audio recording module for audio recording.

[0019] Optionally, the first path type is an AudioFlingerOffload path type, and the second path type is an AudioFlingerMixer path type;

[0020] The first type of audio data is original audio data, and the second type of audio data is PCM audio data;

[0021] The data recording module is a PatchRecord module, and the data processing path is a PatchTrack path.

[0022] Optionally, the step of passing the second type of audio data of the data processing path to a hardware abstraction layer for providing audio output to a remote end through a target thread so as to send the second type of audio data to an audio recording module for audio recording specifically includes:

[0023] The PatchTrack channel is used to pass the PCM audio data to the RemoteSubmix HAL through the MixerThread, so that the PCM audio data is sent to the AudioRecord module for audio recording.

[0024] Optionally, copying the first type of audio data by the data recording module, and parsing the copied first type of audio data into the second type of audio data by the decoder specifically includes:

[0025] The original audio data is copied through the PatchRecord module, and the copied original audio data is parsed into the PCM audio data through the MediaCodec decoder.

[0026] In a second aspect, the present disclosure provides an audio recording device, comprising:

[0027] An acquisition module, configured to acquire a channel type used by the currently playing audio;

[0028] a processing module configured to copy the first type of audio data currently played on the channel of the first type of channel for conversion processing if the channel type is the first channel type, wherein the channel of the second type of channel type corresponding to the second type of audio data is a channel that the operating system already supports audio internal recording;

[0029] The recording module is configured to perform audio recording according to the second type of audio data using an audio recording rule corresponding to the second channel type.

[0030] In a third aspect, the present disclosure provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the audio recording method described in the first aspect.

[0031] In a fourth aspect, the present disclosure provides an electronic device, including a storage medium, a processor, and a computer program stored on the storage medium and executable on the processor, wherein the processor implements the audio recording method described in the first aspect when executing the computer program.

[0032] By means of the above technical scheme, the present disclosure provides an audio recording method, device and electronic device. Compared with the current prior art, the present disclosure can effectively improve the technical problem that the audio content played by these channels cannot be recorded because the operating system of the smart terminal does not support the internal recording of the audio played by certain channels. Specifically, the channel type used for the currently played audio can be obtained. If the first channel type is used (the operating system does not support the internal recording of the audio played by the channel of this channel type), the first type of audio data currently played by the channel of the first channel type can be copied for conversion processing to obtain the second type of audio data, wherein the channel of the second channel type corresponding to the second type of audio data is the channel that the operating system already supports audio internal recording. Then, according to the second type of audio data, the audio recording rules corresponding to the second channel type are used to perform audio recording. By applying the technical scheme of the present disclosure, the audio played by those channels that the operating system does not support audio internal recording can be accurately recorded, thereby improving the recording integrity of the audio content played by the smart terminal.

[0033] The above description is only an overview of the technical solution of the present disclosure. In order to more clearly understand the technical means of the present disclosure, it can be implemented according to the contents of the specification. In order to make the above and other purposes, features and advantages of the present disclosure more obvious and easy to understand, the specific implementation methods of the present disclosure are listed below. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.

[0035] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0036] Figure 1 A schematic diagram showing a flow chart of an audio recording method provided by an embodiment of the present disclosure;

[0037] Figure 2 A schematic diagram showing a flow chart of another audio recording method provided by an embodiment of the present disclosure;

[0038] Figure 3 A schematic diagram showing a flow chart of another audio recording method provided by an embodiment of the present disclosure;

[0039] Figure 4 A schematic diagram of a process flow of an application example provided by an embodiment of the present disclosure is shown;

[0040] Figure 5 A schematic diagram showing an application scenario provided by an embodiment of the present disclosure;

[0041] Figure 6 A schematic structural diagram of an audio recording device provided by an embodiment of the present disclosure is shown. DETAILED DESCRIPTION

[0042] The embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. It should be noted that the embodiments and features in the embodiments of the present disclosure can be combined with each other without conflict.

[0043] In order to improve the current technical problem that the audio content played by some channels cannot be recorded because the operating system of the smart terminal does not support the internal recording of the audio played by these channels. This embodiment provides an audio recording method, such as Figure 1 As shown, it can be applied to the end side of a smart terminal (such as a smart TV, a smart phone, a tablet computer, etc.), and the method includes:

[0044] Step 101: Obtain the channel type used for currently playing audio.

[0045] The operating system of the smart terminal can use at least one channel to play audio content. For this embodiment, the channel type corresponding to the channel can be obtained to determine whether the channel type is the first channel type (the operating system does not support the internal recording of audio played by the channel of the channel type). If the channel type is not the first channel type, it means that the operating system can normally record the audio played through the channel (a channel other than the first channel type); and if the channel type is the first channel type, the process shown in step 102 can be executed.

[0046] Step 102: If the channel type used for currently playing audio is the first channel type, the first type of audio data currently played in the channel of the first channel type is copied and converted to obtain the second type of audio data.

[0047] The second type of audio data may be audio data different from the first type of audio data, and the second type of path corresponding to the second type of audio data may be a path that the operating system already supports audio internal recording. For example, the second type of audio data may be played through the path of the second path type, and the path of the second path type may be a path that the operating system already supports audio internal recording.

[0048] Step 103: Perform audio recording according to the second type of audio data obtained by the conversion process using an audio recording rule corresponding to the second channel type.

[0049] In this embodiment, since the channel of the second channel type is a channel that the operating system already supports audio internal recording, the audio recording rule corresponding to the second channel type can be used to perform audio recording based on the second type audio data obtained through the conversion process.

[0050] It should be noted that the audio recording method provided in this embodiment is different from the audio recording method using a microphone (the microphone records ambient sound. If the sound played by the smart terminal is not played outwardly, then the effect of the microphone recording the played audio will be very poor). It is to record the sound played by the smart terminal. Even if the sound played by the smart terminal is not played outwardly (such as playing through headphones or earpiece mode, etc.), the currently playing sound can be accurately recorded.

[0051] Compared with the current prior art, this embodiment can effectively improve the technical problem that the audio content played by these channels cannot be recorded because the operating system of the smart terminal does not support the internal recording of the audio played by certain channels. Specifically, the channel type used for the currently played audio can be obtained. If the first channel type is used (that is, the operating system does not support the internal recording of the audio played by the channel of this channel type), the first type of audio data currently played by the channel of the first channel type can be copied for conversion processing to obtain the second type of audio data, wherein the channel of the second channel type corresponding to the second type of audio data is the channel that the operating system already supports the internal recording of audio. Then, according to the second type of audio data, the audio recording rules corresponding to the second channel type are used to record the audio. By applying the technical solution of this embodiment, the audio played by those channels that the operating system does not support the internal recording of audio can be accurately recorded, which improves the recording integrity of the audio content played by the smart terminal.

[0052] Further, as a refinement and extension of the above embodiment, in order to fully illustrate the specific implementation process of the method of this embodiment, this embodiment provides the following Figure 2 The specific method shown includes:

[0053] Step 201: Obtain the channel type currently used by the smart terminal to play audio.

[0054] Step 202: If the channel type used for currently playing audio is the first channel type, create a data recording module and a data processing channel, and create a decoder corresponding to the first type of audio data.

[0055] Step 203: copy the first type of audio data through the data recording module, and parse the copied first type of audio data into second type of audio data through the decoder.

[0056] Step 204: Send the second type of audio data to the data processing channel, and perform audio recording using an audio recording rule corresponding to the second channel type.

[0057] In this embodiment, the first type of audio data may be audio data currently played in a channel of the first channel type, and the data recording module may be used to copy the first type of audio data currently played in the channel of the first channel type, and obtain the second type of audio data by processing through a decoder corresponding to the first type of audio data, and send the second type of audio data to the data processing channel. For this embodiment, the data processing channel may be used to perform audio recording using an audio recording rule corresponding to the second channel type.

[0058] Optionally, step 204 may specifically include: passing the second type of audio data of the data processing path to a hardware abstraction layer for providing audio output to the remote end through the target thread, so as to send the second type of audio data to the audio recording module for audio recording. Through this optional method, the audio played by those paths whose operating system does not support audio internal recording can be accurately recorded, thereby improving the recording integrity of the audio content played by the smart terminal.

[0059] For example, to illustrate Figure 2 In the implementation process of the method shown, taking the operating system as an intelligent terminal using the Android operating system as an example, the first channel type can be the audio data entity AudioFlingerOffload (the playback thread used in AudioFlinger is the OffloadThread thread) channel type, and the second channel type can be the AudioFlingerMixer (the playback thread used in AudioFlinger is the MixerThread thread) channel type; the first type of audio data can be original audio data, and the second type of audio data can be pulse code modulation data (Pulse Code Modulation, PCM) audio data; the data recording module can be the PatchRecord module, and the data processing channel can be the PatchTrack channel. Correspondingly, as Figure 3 As shown, the following method is given:

[0060] Step 301: Obtain the channel type currently used by the smart terminal of the Android operating system to play audio.

[0061] Step 302: If the channel type used for the current audio playback is the AudioFlingerOffload channel type, a PatchRecord module and a PatchTrack channel are created, and a MediaCodec decoder corresponding to the original audio data is created.

[0062] Step 303: copy the original audio data through the PatchRecord module, and parse the copied original audio data into PCM audio data through the MediaCodec decoder.

[0063] Step 304: Send the PCM audio data to the PatchTrack channel.

[0064] Step 305: Use the PatchTrack channel to pass the PCM audio data to the RemoteSubmix HAL through the MixerThread, so as to send the PCM audio data to the AudioRecord module for audio recording.

[0065] At present, with the update of Android version, Android operating system can support system audio recording through AudioPlaybackCaptureAPI, but there are many restrictions. For example, it only supports recording PCM audio played through AudioFlingerMixer channel, and cannot record audio played through AudioFlingerOffload channel. As a result, in actual use, some playback can be recorded, but some cannot be recorded.

[0066] In order to solve the audio recording problem of the AudioFlingerOffload channel, the general method is to send the audio of the AudioFlingerOffload channel to the audio driver for decoding, and then read back the decoded PCM data. However, since the underlying driver is provided by the chip platform, the chip user cannot modify the underlying code, so this solution cannot be implemented.

[0067] Based on the technical solution provided in this embodiment, the recording of the audio in the AudioFlingerOffload path can be achieved without modifying the driver layer code.

[0068] For example, when the Android operating system plays audio through the AudioFlingerMixer channel, the PCM data is sent to the AudioFlingerMixer channel through AudioTrack (audio track) for audio playback, that is, sent to Track. The playback thread used in AudioFlinger is the MixerThread thread, which sends the PCM data to the Audio Hal (hardware abstraction layer) to achieve audio playback. During audio recording, the audio recording rules supported by the Android operating system can be used for audio recording.

[0069] In this embodiment, the PatchRecord creation logic is modified in the Android native process. When the AudioFlingerOffload channel is used to play audio, PatchRecord and PatchTrack are created, and a MediaCodec decoder corresponding to the original audio is created. The audio of the AudioFlingerOffload channel is copied through PatchRecord and sent to the MediaCodec decoder. After the original audio is parsed into PCM data, it is written to PatchTrack to implement the AudioFlingerOffload channel playback and recording function.

[0070] For example, Figure 4 As shown, the original audio data is sent to the AudioFlingerOffload channel through AudioTrack for audio playback, that is, sent to Track. The playback thread used in AudioFlinger is the OffloadThread thread, which sends the original audio data to the Audio Hal (Hardware Abstraction Layer) to achieve audio playback. During audio recording, the audio of the AudioFlingerOffload channel is copied through PatchRecord and sent to the MediaCodec decoder. After the original audio is parsed into PCM data, it is written to PatchTrack. The PCM audio data is passed to the RemoteSubmix HAL through the MixerThread through the PatchTrack channel, so that the PCM audio data can be sent to the AudioRecord module for audio recording.

[0071] In order to illustrate the specific implementation process of the above embodiments, the following application scenarios are given, but not limited to them:

[0072] For example, Figure 5 As shown in the figure, users can watch the video content played on the smart TV (Android system). If the user needs to record the content played on the smart TV, the user will not only record the ambient sound through the microphone when recording the screen, but also the sound currently played on the TV. Currently, with the update of the Android version, the AudioPlaybackCaptureAPI can support the recording of PCM audio played through the AudioFlingerMixer channel, but the audio played through the AudioFlingerOffload channel cannot be recorded, resulting in some playbacks being recorded but some not being recorded in actual use.

[0073] In order to solve the above problems, based on the method of this embodiment, the type of channel currently used by the smart TV to play audio can be obtained; if the type of channel currently used to play audio is the AudioFlingerOffload channel type, a PatchRecord module and a PatchTrack channel are created, and a MediaCodec decoder corresponding to the original audio data is created; then the original audio data can be copied through the PatchRecord module, and the copied original audio data can be parsed into PCM audio data through the MediaCodec decoder. Send the PCM audio data to the PatchTrack channel. Finally, the PatchTrack channel is used to pass the PCM audio data to the RemoteSubmix HAL through the MixerThread, so that the PCM audio data can be sent to the AudioRecord module for audio recording.

[0074] Compared with the current existing technology, this embodiment can effectively improve the current technical problem that the audio content played by certain channels cannot be recorded because the operating system of the smart terminal does not support the internal recording of audio played by these channels. For example, AudioPlaybackCapture can be used to record the audio played by all channels, not just the audio played by the AudioFlingerMixer channel. The audio played by those channels whose operating system does not support audio internal recording can be accurately recorded, thereby improving the recording integrity of the audio content played by the smart terminal.

[0075] Further, as Figures 1 to 3 The specific implementation of the method shown in the embodiment provides an audio recording device, such as Figure 6 As shown, the device includes: an acquisition module 41, a processing module 42, and a recording module 43.

[0076] An acquisition module 41 is configured to acquire a channel type used by the currently playing audio;

[0077] The processing module 42 is configured to copy the first type of audio data currently played on the channel of the first type of channel for conversion processing if the channel type is the first channel type, wherein the channel of the second type of channel type corresponding to the second type of audio data is a channel that the operating system already supports audio internal recording;

[0078] The recording module 43 is configured to perform audio recording according to the second type of audio data using an audio recording rule corresponding to the second channel type.

[0079] In a specific application scenario, the device further includes: a creation module;

[0080] A creation module configured to create a data recording module and a decoder corresponding to the first type of audio data before the copy of the first type of audio data currently played in the channel of the first channel type is converted and processed;

[0081] Correspondingly, the processing module 42 is specifically configured to copy the first type of audio data through the data recording module, and parse the copied first type of audio data into the second type of audio data through the decoder.

[0082] In a specific application scenario, the creation module is further configured to create a data processing path before performing audio recording according to the second type of audio data using an audio recording rule corresponding to the second path type;

[0083] Correspondingly, the recording module 43 is specifically configured to send the second type of audio data to the data processing channel, and perform audio recording using an audio recording rule corresponding to the second channel type.

[0084] In a specific application scenario, the recording module 43 is further configured to pass the second type of audio data of the data processing path through the target thread to a hardware abstraction layer for providing audio output to a remote end, so as to send the second type of audio data to the audio recording module for audio recording.

[0085] In a specific application scenario, optionally, the first channel type is an AudioFlingerOffload channel type, and the second channel type is an AudioFlingerMixer channel type; the first type of audio data is original audio data, and the second type of audio data is PCM audio data; the data recording module is a PatchRecord module, and the data processing channel is a PatchTrack channel.

[0086] In a specific application scenario, the recording module 43 is further configured to use the PatchTrack path to pass the PCM audio data to the RemoteSubmix HAL through the MixerThread, so as to send the PCM audio data to the AudioRecord module for audio recording.

[0087] In a specific application scenario, the processing module 42 is further configured to copy the original audio data through the PatchRecord module, and parse the copied original audio data into the PCM audio data through the MediaCodec decoder.

[0088] It should be noted that for other corresponding descriptions of the functional units involved in the audio recording device provided in this embodiment, reference can be made to Figures 1 to 3 The corresponding description in will not be repeated here.

[0089] Based on the above Figures 1 to 3 The method shown in the embodiment also provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the above-mentioned Figures 1 to 3 The method shown.

[0090] Based on this understanding, the technical solution of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.), and includes a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods of various implementation scenarios of the present disclosure.

[0091] Based on the above Figures 1 to 3 The method shown, and Figure 6 In order to achieve the above-mentioned purpose, the embodiment of the present disclosure also provides an electronic device, such as a smart TV, a smart phone, a tablet computer, etc., which includes a storage medium and a processor; the storage medium is used to store a computer program; the processor is used to execute the computer program to achieve the above-mentioned Figures 1 to 3 The method shown.

[0092] Optionally, the above-mentioned physical device may also include a user interface, a network interface, a camera, a radio frequency (RF) circuit, a sensor, an audio circuit, a WI-FI module, etc. The user interface may include a display, an input unit such as a keyboard, etc., and the optional user interface may also include a USB interface, a card reader interface, etc. The network interface may optionally include a standard wired interface, a wireless interface (such as a WI-FI interface), etc.

[0093] Those skilled in the art will appreciate that the above-mentioned physical device structure provided in this embodiment does not constitute a limitation on the physical device, and may include more or fewer components, or a combination of certain components, or different arrangements of components.

[0094] The storage medium may also include an operating system and a network communication module. The operating system is a program that manages the hardware and software resources of the above-mentioned physical device, and supports the operation of the information processing program and other software and / or programs. The network communication module is used to realize the communication between the components inside the storage medium, and the communication with other hardware and software in the information processing physical device.

[0095] Through the description of the above implementation methods, those skilled in the art can clearly understand that the present disclosure can be implemented by means of software plus a necessary general hardware platform, or by hardware. By applying the solution of this embodiment, compared with the current prior art, this embodiment can effectively improve the current technical problem that the audio content played by certain channels cannot be recorded because the operating system of the smart terminal does not support the internal recording of audio played by these channels, and can accurately record the audio played by those channels whose operating system does not support internal recording of audio, thereby improving the recording integrity of the audio content played by the smart terminal.

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

[0097] The above description is only a specific embodiment of the present disclosure, so that those skilled in the art can understand or implement the present disclosure. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present disclosure. Therefore, the present disclosure will not be limited to the embodiments described herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. An audio recording method, It is characterized in that include: Get the channel type used by the current audio playback; If the channel type is the first channel type, the first type of audio data currently being played on the channel of the first channel type is copied for conversion processing to obtain the second type of audio data, wherein the first channel type is a channel type for which the operating system does not support audio internal recording, and the channel of the second channel type corresponding to the second type of audio data is a channel for which the operating system already supports audio internal recording; performing audio recording according to the second type of audio data using an audio recording rule corresponding to the second path type; Before the copying of the first type of audio data currently being played in the channel of the first channel type is converted, the method further comprises: Creating a data recording module and a decoder corresponding to the first type of audio data; The copying of the first type of audio data currently played in the channel of the first channel type is converted and processed, including: The first type of audio data is copied through a data recording module, and the copied first type of audio data is parsed into the second type of audio data through a decoder.

2. The method according to claim 1, It is characterized in that Before performing audio recording according to the second type of audio data using an audio recording rule corresponding to the second path type, the method further includes: Create data processing pipelines; The step of performing audio recording according to the second type of audio data using an audio recording rule corresponding to the second path type includes: The second type of audio data is sent to the data processing channel, and audio recording is performed using an audio recording rule corresponding to the second channel type.

3. The method according to claim 2, It is characterized in that The sending the second type of audio data to the data processing path and performing audio recording using an audio recording rule corresponding to the second path type includes: The second type of audio data of the data processing path is passed to a hardware abstraction layer for providing audio output to a remote end through a target thread, so that the second type of audio data is sent to an audio recording module for audio recording.

4. The method according to claim 3, It is characterized in that When the audio recording method is applied in an Android system: The first path type is an AudioFlingerOffload path type, and the second path type is an AudioFlingerMixer path type; The first type of audio data is original audio data, and the second type of audio data is PCM audio data; The data recording module is a PatchRecord module, and the data processing path is a PatchTrack path.

5. The method according to claim 4, It is characterized in that The step of passing the second type of audio data of the data processing path to a hardware abstraction layer for providing audio output to a remote end through a target thread so as to send the second type of audio data to an audio recording module for audio recording specifically includes: The PatchTrack channel is used to pass the PCM audio data to RemoteSubmixHAL through MixerThread, so as to send the PCM audio data to the AudioRecord module for audio recording.

6. The method according to claim 4, It is characterized in that The step of copying the first type of audio data by the data recording module and parsing the copied first type of audio data into the second type of audio data by the decoder specifically includes: The original audio data is copied through the PatchRecord module, and the copied original audio data is parsed into the PCM audio data through the MediaCodec decoder.

7. An audio recording device, It is characterized in that include: An acquisition module, configured to acquire a channel type used by the currently playing audio; a processing module configured to, if the channel type is a first channel type, copy the first type of audio data currently played on the channel of the first channel type for conversion processing to obtain second type of audio data, wherein the first channel type is a channel type that the operating system does not support audio internal recording, and the channel of the second channel type corresponding to the second type of audio data is a channel that the operating system already supports audio internal recording; a recording module configured to perform audio recording according to the second type of audio data using an audio recording rule corresponding to the second channel type; The device also includes: a creation module; The creation module is configured to create a data recording module and a decoder corresponding to the first type of audio data before the copy of the first type of audio data currently played in the channel of the first channel type is converted and processed; The processing module is specifically configured to copy the first type of audio data through the data recording module, and parse the copied first type of audio data into the second type of audio data through the decoder.

8. A computer-readable storage medium having a computer program stored thereon, It is characterized in that When the computer program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.

9. An electronic device comprising a storage medium, a processor, and a computer program stored on the storage medium and executable on the processor, It is characterized in that When the processor executes the computer program, the method according to any one of claims 1 to 6 is implemented.