An audio recording method, device, electronic device, storage medium and product

By configuring resampling parameters to respond to recording requests, the system can flexibly process recorded audio data, solving the problem that a fixed sampling rate cannot meet the diverse needs of users, and achieving flexibility and effectiveness in recording.

CN122455035APending Publication Date: 2026-07-24HONOR DEVICE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
HONOR DEVICE CO LTD
Filing Date
2025-01-23
Publication Date
2026-07-24

AI Technical Summary

Technical Problem

The recording function of existing electronic devices uses a fixed sampling rate, which cannot meet the recording needs of users with different sampling rates, and lacks flexibility and effectiveness.

Method used

By responding to the recording request from the recording application, configuring resampling parameters, and resampling the audio signal collected by the microphone according to the audio parameters carried in the recording request, the recorded audio data that meets the user's needs is obtained.

Benefits of technology

It achieves flexibility and effectiveness in recording, can meet the recording needs of different sampling rates, and improves the adaptability and quality of recording.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122455035A_ABST
    Figure CN122455035A_ABST
Patent Text Reader

Abstract

The application discloses a recording method and device, electronic equipment, storage medium and product. The method comprises the following steps: in response to a recording request of a recording application in the electronic equipment, configuring a resampling parameter according to an audio parameter carried by the recording request; obtaining first audio data obtained by sampling audio signals collected by a microphone at a first sampling rate; resampling the first audio data according to a second sampling rate indicated by the resampling parameter to obtain recording audio data, and storing the recording audio data for the recording application. In this way, the recording can be flexibly sampled and processed, the recording audio data meeting different sampling rate requirements of a user is obtained, and the flexibility and effectiveness of the recording are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, specifically to the field of audio technology, and more particularly to a recording method, apparatus, electronic device, storage medium, and product. Background Technology

[0002] With the development of terminal technology, users' functional requirements for electronic devices are becoming increasingly diversified. To meet users' needs for audio recording, most electronic devices support recording functions. Currently, recording applications on electronic devices typically use a fixed sampling rate, such as 48kHz, which is not flexible enough and cannot meet users' recording needs for different sampling rates. Summary of the Invention

[0003] This application provides a recording method, apparatus, electronic device, storage medium, and product that can flexibly sample and process recordings.

[0004] In a first aspect, embodiments of this application provide a recording method, including:

[0005] In response to a recording request from a recording application in the electronic device, resampling parameters are configured based on the audio parameters carried in the recording request;

[0006] The first audio data is obtained by sampling the audio signal collected by the microphone according to the first sampling rate;

[0007] The first audio data is resampled according to the second sampling rate indicated by the resampling parameter to obtain recorded audio data, and the recorded audio data is stored for the recording application.

[0008] Secondly, embodiments of this application provide a recording device, including:

[0009] A configuration unit is configured to respond to a recording request from a recording application in the electronic device and configure resampling parameters according to the audio parameters carried in the recording request.

[0010] The acquisition unit is used to acquire the first audio data obtained by sampling the audio signal collected by the microphone according to the first sampling rate;

[0011] The resampling unit is used to resample the first audio data according to the second sampling rate indicated by the resampling parameters to obtain recorded audio data, and to store the recorded audio data for the recording application.

[0012] Thirdly, embodiments of this application provide an electronic device including a processor and a memory interconnected thereto, wherein the memory is used to store a computer program, and the processor is configured to invoke the computer program to execute the method described in the first aspect above.

[0013] Fourthly, embodiments of this application provide a computer-readable storage medium storing program instructions that, when executed, implement the method described in the first aspect above.

[0014] Fifthly, embodiments of this application provide a computer program product, the computer program product including program instructions, which, when executed by a processor, implement the method described in the first aspect above.

[0015] This application embodiment responds to a recording request from a recording application in an electronic device, configuring resampling parameters based on the audio parameters carried in the recording request. This allows for the resampling of the first audio data obtained by sampling the audio signal captured by the microphone at a first sampling rate, according to a second sampling rate indicated by the resampling parameters, to obtain recorded audio data that meets the recording request. This method allows for flexible sampling processing of recordings, obtaining recorded audio data that meets the user's different sampling rate requirements, thus improving the flexibility and effectiveness of recording. Attached Figure Description

[0016] To more clearly illustrate the technical solutions of the embodiments of this application, the drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0017] Figure 1 This is a schematic diagram of a recording scenario proposed in an embodiment of this application;

[0018] Figure 2 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application;

[0019] Figure 3 This is a schematic diagram of the software system architecture of an electronic device provided in an embodiment of this application;

[0020] Figure 4a This is a schematic diagram of the hierarchical structure of an electronic device provided in an embodiment of this application;

[0021] Figure 4b This is a schematic diagram of the hierarchical structure of another electronic device provided in an embodiment of this application;

[0022] Figure 5 A schematic flowchart illustrating a recording method provided in an embodiment of this application;

[0023] Figure 6 A flowchart illustrating another recording method provided in an embodiment of this application;

[0024] Figure 7 This is a schematic diagram of an audio parameter and data information setting interface provided in an embodiment of this application;

[0025] Figure 8 This is a schematic diagram of another audio parameter and data information setting interface provided in an embodiment of this application;

[0026] Figure 9 This is a schematic diagram of a recording process provided in an embodiment of this application;

[0027] Figure 10 A flowchart illustrating yet another recording method provided in an embodiment of this application;

[0028] Figure 11 This is a timing flowchart of a recording method provided in an embodiment of this application;

[0029] Figure 12 This is a schematic diagram of an interface for an electronic device to initiate a recording request, provided in an embodiment of this application;

[0030] Figure 13 This is a schematic diagram of an interface for setting calibration key vector parameters at the chip architecture layer, provided in an embodiment of this application.

[0031] Figure 14 This is a schematic diagram of the structure of a recording device provided in an embodiment of this application;

[0032] Figure 15 This is a schematic diagram of the structure of another electronic device provided in an embodiment of this application. Detailed Implementation

[0033] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.

[0034] It should be understood that, when used in this specification and the appended claims, the terms "comprising" and "including" indicate the presence of the described features, integrals, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or collections thereof.

[0035] It should also be understood that the terminology used in this specification is for the purpose of describing particular embodiments only and is not intended to limit the scope of the application. As used in this specification and the appended claims, the singular forms “a,” “an,” and “the” are intended to include the plural forms unless the context clearly indicates otherwise.

[0036] It should be noted that the concepts of "first," "second," "third," and "fourth" mentioned in this application specification are only used to distinguish different devices, modules, or units, and are not used to limit the order of functions performed by these devices, modules, or units or their interdependencies.

[0037] It should also be further understood that the term “and / or” as used in this application specification and the appended claims means any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.

[0038] In specific implementations, the electronic devices described in the embodiments of this application include, but are not limited to, other portable devices such as mobile phones, laptop computers, or tablet computers with touch surfaces (e.g., touchscreen displays and / or touchpads). It should also be understood that in some embodiments, the device is not a portable communication device, but a desktop computer with a touch surface (e.g., touchscreen displays and / or touchpads).

[0039] In this application, the reference to "embodiment" means that a specific feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.

[0040] This application proposes a recording scheme that configures resampling parameters in response to recording requests at different sampling rates, and resamples the acquired audio data based on the resampling parameters. This allows for flexible sampling processing of the recordings to obtain audio data with different sampling rates, solving the problem in the prior art where recording at a fixed sampling rate cannot obtain audio data with other sampling rates required by the user, thus improving the flexibility and effectiveness of recording.

[0041] In practical applications, this recording solution can be applied to any recording-related scenario, such as recording applications recording audio, communication applications sending voice or video messages, etc. Specifically, it can... Figure 1 For example, Figure 1This is a schematic diagram of a recording scenario proposed in an embodiment of this application, such as... Figure 1 The diagram shows a scenario where user 10 records audio using the recording application on electronic device 11.

[0042] The recording method proposed in this application can be executed by an electronic device, which may be a terminal device or a server. Before introducing the recording method provided in this application, the structure of the electronic device will be described first. For example, Figure 2 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application, such as... Figure 2 As shown, the electronic device 200 may include: a processor 210, an external memory interface 220, an internal memory 221, a universal serial bus (USB) interface 230, a charging management module 240, a power management module 241, a battery 242, antenna 1, antenna 2, a mobile communication module 250, a wireless communication module 260, an audio module 270, a speaker 270A, a receiver 270B, a microphone 270C, a headphone jack 270D, a sensor 280, buttons 290, a motor 291, an indicator 292, a camera 293, a display screen 294, and a subscriber identification module (SIM) card interface 295, etc. It is understood that the structure illustrated in this embodiment does not constitute a specific limitation on the electronic device 200. In other embodiments of this application, the electronic device 200 may include more or fewer components than illustrated, or combine certain components, or split certain components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.

[0043] Processor 210 may include one or more processing units, such as application processors (APs), modem processors, graphics processing units (GPUs), image signal processors (ISPs), controllers, video codecs, digital signal processors (DSPs), baseband processors, display processing units (DPUs), and / or neural network processing units (NPUs). Different processing units may be independent devices or integrated into one or more processors. In some embodiments, electronic device 200 may also include one or more processors 210. The controller may be the central nervous system and command center of electronic device 200. The controller can generate operation control signals based on instruction opcodes and timing signals to control instruction fetching and execution. Processor 210 may also include a memory for storing instructions and data. In some embodiments, the memory in processor 210 is a cache memory. This memory can store instructions or data that processor 210 has just used or is reusing. If processor 210 needs to reuse the instruction or data, it can directly retrieve it from the memory. This avoids repeated accesses, reduces the waiting time of the processor 210, and thus improves the efficiency of the electronic device 200 system.

[0044] In some embodiments, the processor 210 may include one or more interfaces. These interfaces may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc. The USB interface 230 is a USB-compliant interface, specifically a Mini USB interface, a Micro USB interface, a USB Type-C interface, etc. The USB interface 230 can be used to connect a charger to charge the electronic device 200, and can also be used for data transfer between the electronic device 200 and peripheral devices. It can also be used to connect headphones for audio playback.

[0045] It is understood that the interface connection relationships between the modules illustrated in the embodiments of the present invention are merely illustrative and do not constitute a structural limitation on the electronic device 200. In other embodiments of this application, the electronic device 200 may also employ different interface connection methods or combinations of multiple interface connection methods as described in the above embodiments.

[0046] The charging management module 240 receives charging input from a charger, which can be a wireless charger or a wired charger. While charging the battery 242, the charging management module 240 can also supply power to the electronic device 200 via the power management module 241.

[0047] The power management module 241 connects the battery 242, the charging management module 240, and the processor 210. The power management module 241 receives input from the battery 242 and / or the charging management module 240, providing power to the processor 210, internal memory 221, display screen 294, camera 293, and wireless communication module 260, etc. The power management module 241 can also monitor parameters such as battery capacity, battery cycle count, and battery health status (leakage current, impedance).

[0048] The wireless communication function of electronic device 200 can be implemented through antenna 1, antenna 2, mobile communication module 250, wireless communication module 260, modem processor, and baseband processor. Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals.

[0049] The mobile communication module 250 can provide wireless communication solutions, including 2G / 3G / 4G / 5G, for use on the electronic device 200. The mobile communication module 250 can receive electromagnetic waves via antenna 1, and perform filtering, amplification, and other processing on the received electromagnetic waves before transmitting them to a modem processor for demodulation. The mobile communication module 250 can also amplify the signal modulated by the modem processor and convert it into electromagnetic waves for radiation via antenna 1.

[0050] The modem processor may include a modulator and a demodulator. The modulator modulates the low-frequency baseband signal to be transmitted into a mid-to-high frequency signal. The demodulator demodulates the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After processing by the baseband processor, the low-frequency baseband signal is transmitted to the application processor. The application processor outputs sound signals through audio devices (not limited to speaker 270A, receiver 270B, etc.) or displays images or videos through the display screen 294.

[0051] The wireless communication module 260 can provide solutions for wireless communication applications on the electronic device 200, including wireless local area networks (WLAN), Bluetooth, global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), and infrared (IR) technology. The wireless communication module 260 receives electromagnetic waves via antenna 2, performs frequency modulation and filtering of the electromagnetic wave signal, and sends the processed signal to processor 110. The wireless communication module 260 can also receive signals to be transmitted from processor 210, perform frequency modulation and amplification, and convert them into electromagnetic waves for radiation via antenna 2.

[0052] Electronic device 200 can realize display functions through GPU, display screen 294, and application processor. The GPU is a microprocessor for image processing, connected to display screen 294 and application processor. The GPU is used to perform mathematical and geometric calculations and for graphics rendering. Processor 210 may include one or more GPUs, which execute instructions to generate or modify display information. Display screen 294 is used to display images, videos, etc.

[0053] Electronic device 200 can implement audio functions such as music playback and recording through audio module 270, speaker 270A, receiver 270B, microphone 270C, headphone jack 270D, and application processor.

[0054] The audio module 270 (including the encoder) is used to convert digital audio information into analog audio signal output, and also to convert analog audio input into digital audio signal. The audio module 270 can also be used for encoding and decoding audio signals.

[0055] The speaker 270A, also known as a "loudspeaker," is used to convert audio electrical signals into sound signals. The electronic device 200 can listen to music or make hands-free calls through the speaker 270A. In this embodiment, the user can listen to recorded audio data through the speaker 270A.

[0056] The receiver 270B, also known as the "earpiece," is used to convert audio electrical signals into sound signals. When the electronic device 200 answers a telephone call or voice message, the receiver 270B can be brought close to the ear to listen to the voice.

[0057] Microphone 270C, also known as a "microphone" or "voice transducer," is used to convert sound signals into electrical signals. When making a phone call or sending a voice message, the user can speak by bringing their mouth close to microphone 270C, inputting the sound signal into microphone 270C. In this embodiment, when the user records audio, the user can speak by bringing their mouth close to microphone 270C, inputting the sound signal into microphone 270C, so that the device can collect and store the user's voice. Electronic device 200 may have at least one microphone 270C. In some embodiments, electronic device 200 may have two microphones 270C, which, in addition to collecting sound signals, can also achieve noise reduction. In other embodiments, electronic device 200 may have three, four, or more microphones 270C, which can collect sound signals, reduce noise, identify sound sources, and achieve directional recording functions, etc.

[0058] The headphone jack 270D is used to connect wired headphones. The headphone jack 270D can be a USB 230 interface, a 3.5mm Open Mobile Terminal Platform (OMTP) standard interface, or a CTIA (Cellular Telecommunications Industry Association of the USA) standard interface.

[0059] The aforementioned electronic devices can be smartphones, computers (such as tablets, laptops, desktop computers, etc.), smart wearable devices (such as smartwatches, smart glasses), smart voice interaction devices, smart home appliances (such as smart TVs), vehicle terminals, or aircraft, etc.; servers can be independent physical servers, server clusters or distributed systems composed of multiple physical servers, or cloud servers providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms, etc. Furthermore, terminal devices and servers can be located within or outside the blockchain network, without limitation; even further, terminal devices and servers can upload any data stored internally to the blockchain network for storage to prevent internal data from being tampered with and improve data security.

[0060] The software system of an electronic device can adopt a layered architecture, event-driven architecture, microkernel architecture, microservice architecture, or cloud architecture. This application embodiment uses a layered architecture as the software system of the electronic device. The layered architecture divides the electronic device's software system into several layers, each with a clear role and division of labor, and the layers communicate with each other through software interfaces.

[0061] like Figure 3 As shown in the embodiments of this application, the Android system and the Linux system are used as examples of layered architecture software systems to illustrate the software structure of electronic devices. Figure 3This is a schematic diagram of the software system architecture of an electronic device provided in an embodiment of this application. When the software system is an Android system, the AudioServer layer connects to the Audio HAL through the Application Programming Interface (API) of the Hardware Abstraction Layer (HAL). The Audio HAL connects to the Platform Abstraction Layer (PAL) through the API. The PAL connects to the lightweight, high-level Linux audio driver Tiny (Advanced Linux Sound Architecture, ALSA). Tiny ALSA uses the Advanced SoC Audio (ASoC) framework within ALSA. This ASoC framework includes a Platform driver (responsible for managing audio data), a Machine driver (responsible for connecting the Platform and the encoder / codec to process and transmit audio signals), and a Codec driver (responsible for operating the codec device). The Audio Hardware Device Driver ASoC connects to the chip architecture layer (such as the Qualcomm Analog Devices Sigma DSP, ADSP) and Tiny... ALSA connects to the audio processing tool layer via plugins. This layer includes the Audio Graph Manager (AGM), the Audio Reach Management Layer (AML) / Graphics Service Layer (GSL), and the Audio Calibration Database (ACDB). Tiny ALSA connects to the AGM via plugins, the AGM connects to the AML / GSL, and the AML / GSL connects to the ACDB. The AGM is used for audio processing tasks such as speech recognition and noise reduction. The chip architecture layer also connects to the AML / GSL.

[0062] It should be noted that when the software system is a Linux system, the difference between the layered architecture of the Linux system and the layered architecture of Android is that the audio service layer of the Linux system skips the Audio HAL and connects directly to the PAL.

[0063] In one embodiment, the hierarchical structure of the electronic device according to this application may include an application layer, a framework layer, a hardware abstraction layer, a chip architecture layer, and an encoder layer. See details below. Figure 4a , Figure 4a This is a schematic diagram of the hierarchical structure of an electronic device provided in an embodiment of this application.

[0064] like Figure 4a As shown, the application layer includes recording applications. Recording applications can be understood as applications or modules with recording functionality, such as game applications, camera applications, audio recording applications, video recording applications, voice wake-up applications, etc. Recording applications can be third-party applications or system applications such as a voice recorder or video recorder.

[0065] The framework layer includes an audio management module for managing and controlling audio-related threads. In one example, in response to a recording request from the application layer, the audio management module starts (creates) a recording thread; after recording is complete, the audio management module controls the closure of the recording thread. In another example, in response to a request from the application layer to read audio data, the audio management module starts (creates) a read thread; when the read thread is paused or terminated, the audio management module closes the read thread.

[0066] The Hardware Abstraction Layer (HAL) is used to configure audio parameters related to recording, including the sampling rate. The HAL also determines path flags and establishes recording paths. Furthermore, the HAL may include recording rules, such as noise reduction and recording algorithms.

[0067] In this application embodiment, the sampling rate refers to the audio sampling rate, that is, how much analog signal the recording electronic device samples per unit time, such as 8kHz, 16kHz, 44.1kHz, 48kHz, etc. The higher the sampling rate, the more realistic and natural the audio data.

[0068] The recording path in this embodiment is also called the audio path, which can be used to transmit audio data obtained by sampling the audio signal collected by the microphone of the electronic device to the recording application of the electronic device. In this embodiment, the recording application can be a third-party application or a system application, such as a game application, an audio recording application, a voice wake-up recognition application built into the electronic device, a voice call application, a recorder / video recorder built into the electronic device, etc.

[0069] The chip architecture layer is used to perform conversion processing on the acquired audio data, such as resampling. This chip architecture layer may include, but is not limited to, the Qualcomm architecture layer.

[0070] The encoder layer includes an analog-to-digital converter (ADC) to convert the acquired audio electrical signals into audio digital signals. During the process of the ADC converting the audio electrical signals acquired by the microphone into audio digital signals, the audio digital signals are sampled, and then the sampled audio digital signals are binary encoded to obtain audio data.

[0071] Figure 4a The order indicated by the top-to-bottom arrows at each level is used for parameter configuration and recording path establishment. Figure 4a The order indicated by the top-to-bottom arrows for each level is used in the recording process when the recording path is the first recording path. See details below. Figure 6 As described in the examples.

[0072] In another embodiment, the hierarchical structure of the electronic device according to this application may include an application layer, a framework layer, a chip architecture layer, and an encoder layer. See details below. Figure 4b , Figure 4b This is a schematic diagram of the hierarchical structure of another electronic device provided in an embodiment of this application. Figure 4b The order indicated by the top-to-bottom arrows at each level is used for parameter configuration and recording path establishment. Figure 4b The order indicated by the top-to-bottom arrows at each level is used in the recording process when the recording path is the second recording path. See details below. Figure 10 As described in the examples.

[0073] It should be noted that, Figure 4a and Figure 4b The layers in the illustrated electronic device hierarchy, and the modules or components contained in each layer, do not constitute a specific limitation on the electronic device. In other embodiments, the electronic device may include more or fewer layers than illustrated, and each layer may include more or fewer components; this application does not impose any limitations.

[0074] The following uses a microphone to collect audio signals as an example, and provides a detailed explanation of the technical solution of this application and how the technical solution of this application solves the above-mentioned technical problems through specific embodiments. The following specific embodiments can be implemented independently or in combination with each other. Similar or identical concepts or processes may not be described again in some embodiments.

[0075] Please see Figure 5 , Figure 5 This is a flowchart illustrating a recording method provided in an embodiment of this application, as shown below. Figure 5 As shown, the recording method may include the following steps S501-S503:

[0076] S501: In response to a recording request from a recording application in an electronic device, configure resampling parameters according to the audio parameters carried in the recording request.

[0077] The audio parameters include the audio sampling rate (i.e., the second sampling rate) required for user recording. The electronic device is configured with a framework layer, a hardware abstraction layer (HAL), and a chip architecture layer. When configuring resampling parameters according to the audio parameters carried in the recording request, the electronic device can transmit the audio parameters carried in the recording request to the hardware abstraction layer through the framework layer. The hardware abstraction layer configures the resampling variables according to the second sampling rate indicated by the audio parameters and transmits the configured resampling variables to the chip architecture layer to complete the configuration of the resampling parameters.

[0078] This application embodiment configures resampling parameters based on the audio parameters carried in the recording request through the hardware abstraction layer of the electronic device. This helps to resample the acquired audio data using the resampling parameters during subsequent recording to obtain recording audio data that meets the user's needs (i.e., the recording request).

[0079] The recording request also carries data information. After configuring the resampling parameters according to the audio parameters carried in the recording request, the electronic device can transmit the data information carried in the recording request to the hardware abstraction layer through the framework layer. The hardware abstraction layer determines the path flag bit according to the data information and establishes a recording path according to the path flag bit, triggering the microphone to collect audio signals.

[0080] When an electronic device determines the path flag bit based on data information through the hardware abstraction layer, it can detect the data information through the hardware abstraction layer. If the detected data information meets the resampling condition, the path flag bit is determined to be the first flag, and the first flag is associated with the first recording path. If the detected data information does not meet the resampling condition, the path flag bit is determined to be the second flag, and the second flag is associated with the second recording path.

[0081] The first recording path includes an encoder, a chip architecture layer, a hardware abstraction layer, a framework layer, and an application layer; the second recording path also includes an encoder, a chip architecture layer, a framework layer, and an application layer. The path flags can be any one or more characters, including but not limited to letters, numbers, and words. For example, the first flag of the path flag "channelsplitting" can be 1, and the second flag can be 2. Alternatively, the first flag of the path flag "channelsplitting" can be "m," and the second flag can be "p."

[0082] The data information includes any one or more of the following: data type of the first audio data, data quality information, recording device information, and data parameters. In one example, the data type of the first audio data may include, but is not limited to, ordinary recording, call recording, video, ringtone, call recognition, etc.; data quality information includes, but is not limited to, ordinary, compressed, high-definition, low latency, virtual, etc.; recording device information includes, but is not limited to, device microphone, wired headphones, Bluetooth headphones, etc.; and data parameters include, but are not limited to, bit width, sampling rate, channels, latency, etc. The bit width and sampling rate have been explained previously and will not be repeated here. In this embodiment, latency refers to the time taken from when the recording application of the electronic device initiates a recording request, to when the audio signal is acquired through the microphone of the electronic device, to when the audio signal is encoded through the encoder of the electronic device, and then through the chip architecture layer, hardware abstraction layer (HAL), framework layer of the electronic device, until the recording application receives the audio data. In some embodiments, latency can be indicated by flags. For example, the flags can be: flags@0x0 indicates recording in a non-low latency scenario (normal latency scenario recording, such as a latency of 20ms); flags@0x1 indicates recording in a low latency scenario (such as a latency of 4ms); flags@0x4 indicates that the original audio data is required, without the need for recording algorithm processing; flags@0x5 (a combination of flags@0x1 and flags@0x4) indicates recording in a low latency scenario, and requires the original audio data. In this embodiment, the channels include, but are not limited to, left channel, right channel, stereo channel, etc.

[0083] In one implementation, the computing device determines that the data information meets the resampling conditions when it detects that the data type of the first audio data is the target data type, the data quality information is the target quality information, the recording device information is the target device information, and the data parameters are the target parameters. For example, if the computing device detects that the data type of the first audio data is normal recording, the data quality information is normal quality information, the recording device information is a microphone, and the bit width in the data parameters is any one of 8bit, 16bit, or 24bit, and the sampling rate is any one of 16kHz, 32kHz, 44.1kHz, or 48kHz, then the computing device determines that the data information meets the resampling conditions.

[0084] This application embodiment flexibly establishes corresponding recording channels based on different data information, so that recording can be performed directly through the established recording channels, thereby improving the flexibility and effectiveness of recording.

[0085] In one embodiment, before the electronic device responds to a recording request from a recording application in the electronic device, it may trigger the loading of the electronic device's resource management file upon detecting a startup command of the electronic device; obtain a function flag from the resource management file; if the obtained function flag indicates that the electronic device supports configuring calibration key vector parameters at the chip architecture layer, then the steps of responding to the recording request from the recording application in the electronic device and configuring resampling parameters according to the audio parameters carried in the recording request are executed.

[0086] The function marker may include a first function marker or a second function marker. The first function marker indicates that the electronic device supports configuring calibration key vector parameters at the chip architecture level, and the second function marker indicates that the electronic device does not support configuring calibration key vector parameters at the chip architecture level. The function marker may include, but is not limited to, any one or more characters such as numbers and letters.

[0087] In one example, assuming the resource management file is resourcemanger.xml and the function tag is record_samplerate_set_ckv, when a startup command for an electronic device is detected, the resource management file resourcemanger.xml is loaded. The function tag record_samplerate_set_ckv is retrieved from the resource management file resourcemanger.xml. If the function tag record_samplerate_set_ckv is retrieved and is true, it can be determined that the function tag record_samplerate_set_ckv is used to indicate that the electronic device supports configuring calibration key vector parameters at the chip architecture level. If the function tag record_samplerate_set_ckv is retrieved and is false, it can be determined that the function tag record_samplerate_set_ckv is used to indicate that the electronic device does not support configuring calibration key vector parameters at the chip architecture level.

[0088] This application embodiment, by triggering the loading of the electronic device's resource management file when the electronic device is started, and executing the recording method proposed in this solution when a function flag in the resource management file is detected to indicate that the electronic device supports configuring calibration key vector parameters at the chip architecture layer, can avoid the situation where the recording method proposed in this solution fails or the recorded audio data is of poor quality when the electronic device does not support configuring calibration key vector parameters at the chip architecture layer, thus improving the effectiveness of recording.

[0089] S502: Obtain the first audio data obtained by sampling the audio signal collected by the microphone according to the first sampling rate.

[0090] The electronic device is also equipped with an encoder; the electronic device collects audio signals through a microphone and transmits the collected audio signals to the encoder, which samples and encodes the audio signals according to a first sampling rate to obtain the first audio data.

[0091] When an electronic device collects audio signals through a microphone, it can collect audio signals sent by other devices received by the electronic device, or it can collect audio signals sent by the user corresponding to the electronic device. This application embodiment does not specifically limit the source of the audio signals collected by the microphone.

[0092] S503: Resample the first audio data according to the second sampling rate indicated by the resampling parameter to obtain recorded audio data, and store the recorded audio data for the recording application.

[0093] When an electronic device resamples the first audio data according to the second sampling rate indicated by the resampling parameters to obtain recorded audio data, it can transmit the encoded first audio data to the chip architecture layer through an encoder; the chip architecture layer converts the first audio data based on the second sampling rate indicated by the resampling parameters to obtain second audio data, and transmits the second audio data to the hardware abstraction layer; the hardware abstraction layer processes the second audio data based on pre-configured recording rules and the second sampling rate indicated by the configured resampling parameters to obtain recorded audio data.

[0094] The chip architecture layer includes a device processing module and a stream processing module. When the electronic device converts the first audio data based on the second sampling rate indicated by the resampling parameters through the chip architecture layer to obtain the second audio data, it can resample the first audio data through the device processing module of the chip architecture layer based on the second sampling rate indicated by the resampling parameters to obtain resampled audio data, and transmit the resampled audio data to the stream processing module. The stream processing module then converts the resampled audio data into the second audio data based on the first sampling rate.

[0095] In this embodiment, the device processing module resamples the first audio data based on the second sampling rate indicated by the resampling parameters. This helps to distinguish different audio data in the device processing module and avoids audio data confusion. The data is then further transmitted to the stream processing module, which converts the resampled audio data into second audio data with the first sampling rate required by the hardware abstraction layer based on the first sampling rate. This avoids the problem of not being able to process the second audio data when transmitting it to the hardware abstraction layer.

[0096] The electronic device processes the second audio data through a hardware abstraction layer based on pre-configured recording rules and a second sampling rate indicated by configured resampling parameters to obtain recorded audio data. When this results in recorded audio data, the hardware abstraction layer can further optimize the second audio data based on pre-configured recording rules to obtain third audio data. These recording rules can be either a first rule or a second rule. The third audio data is then resampled by the hardware abstraction layer based on the second sampling rate indicated by the configured resampling parameters to obtain the recorded audio data. In some embodiments, the first rule can be a first recording algorithm, and the second rule can be a second recording algorithm. These recording rules are used to optimize the clarity, timbre, saturation, volume, noise reduction, etc., of the second audio data.

[0097] The embodiments of this application optimize the second audio data by using pre-configured recording rules and a second sampling rate indicated by configured resampling parameters, thereby improving the quality of the second audio data.

[0098] In one example, assuming a first sampling rate of 48kHz and a second sampling rate of 16kHz, the electronic device can resample the first audio data based on the second sampling rate of 16kHz indicated by the resampling parameters through the device processing module of the chip architecture layer, obtaining 16kHz resampled audio data. The resampled audio data is then transmitted to the streaming processing module, which converts the resampled audio data into 48kHz second audio data based on the first sampling rate of 48kHz. The 48kHz second audio data is then transmitted to the hardware abstraction layer, which optimizes the second audio data based on pre-configured recording rules to obtain 48kHz third audio data. Finally, the third audio data is resampled based on the second sampling rate of 16kHz indicated by the configured resampling parameters to obtain 16kHz recorded audio data.

[0099] When an electronic device optimizes the second audio data based on pre-configured recording rules through a hardware abstraction layer to obtain the third audio data, it can detect the bit width and second sampling rate included in the data information through the hardware abstraction layer. If the hardware abstraction layer detects that the bit width and second sampling rate in the data information meet the first condition, the second audio data is optimized according to the pre-configured first recording rules to obtain the third audio data. If the hardware abstraction layer detects that the bit width and second sampling rate in the data information do not meet the first condition, the second audio data is optimized according to the pre-configured second recording rules to obtain the third audio data.

[0100] In one embodiment, the electronic device can detect, through a hardware abstraction layer, whether the mapping relationship between the bit width and the second sampling rate of the data information satisfies a first condition. The mapping relationship satisfying the first condition may include: a bit width of 16 bits and a second sampling rate of 44.1 kHz, a bit width of 16 bits and a second sampling rate of 32 kHz, a bit width of 16 bits and a second sampling rate of 16 kHz, a bit width of 16 bits and a second sampling rate of 48 kHz, or a bit width of 24 bits and a sampling rate of 48 kHz. In other embodiments, the mapping relationship between the bit width and the second sampling rate satisfying the first condition may be other mapping relationships, which are not specifically limited in this application.

[0101] In one example, assuming the mapping relationship between the bit width and the second sampling rate in the data information is that the bit width is 16 bits and the second sampling rate is 44.1 kHz, the hardware abstraction layer can determine that the bit width and the second sampling rate in the data information meet the first condition, and optimize the second audio data according to the pre-configured first recording rule to obtain the optimized third audio data.

[0102] In another example, assuming the mapping relationship between the bit width and the second sampling rate in the data information is a bit width of 24 bits and a second sampling rate of 16 kHz, the hardware abstraction layer can determine that the bit width and the second sampling rate in the data information do not meet the first condition, and optimize the second audio data according to the pre-configured second recording rules to obtain the optimized third audio data.

[0103] This application embodiment detects whether the bit width and the second sampling rate meet the first condition, which can avoid the situation where the second audio data is sampled and optimized according to the first rule when the bit width and the second sampling rate do not meet the first condition, resulting in poor optimization effect, and improves the optimization effect of the second audio data.

[0104] This application embodiment, in response to a recording request from a recording application in an electronic device, configures resampling parameters based on the audio parameters carried in the recording request. This allows for the resampling of the first audio data obtained by sampling the audio signal captured by the microphone at a first sampling rate, according to a second sampling rate indicated by the resampling parameters, to obtain recorded audio data that meets the recording request. By configuring resampling parameters in response to recording requests at different sampling rates and resampling the acquired audio data based on these parameters, recording can be flexibly sampled to obtain recorded audio data that meets the user's different sampling rate requirements, thus improving the flexibility and effectiveness of recording.

[0105] Please see Figure 6 , Figure 6This is a flowchart illustrating another recording method provided in an embodiment of this application, combined with... Figure 4a The hierarchical structure of the electronic devices shown is as follows: Figure 6 As shown, this recording method is an illustrative description of the recording process of the first recording path. The recording method may include the following steps S601-S607:

[0106] S601: The application layer responds to the recording request from the recording application in the electronic device and transmits the recording request to the hardware abstraction layer through the framework layer.

[0107] In this embodiment of the application, the recording request may carry audio parameters and data information. The audio parameters and data information carried in the recording request may be set by the recording application before initiating the recording request, or they may be set by the recording application after initiating the recording request.

[0108] One way a recording application sets audio parameters and data information after initiating a recording request is as follows:

[0109] When the application layer receives a recording request from a recording application on an electronic device, it can trigger an output data settings interface. This interface allows the user to input the required audio parameters and data information. The user-inputted audio parameters and data information are then transmitted as part of the recording request to the hardware abstraction layer via the framework layer. In this way, regardless of whether the recording request is initiated by the user of the electronic device or sent to the electronic device from another terminal device, the application layer of the electronic device can output a data settings interface upon receiving the recording request, allowing the user to configure audio parameters and data information to meet their personalized needs for recording.

[0110] Specifically, taking a mobile phone as an example, Figure 7 For example, Figure 7 This is a schematic diagram of an audio parameter and data information setting interface provided in an embodiment of this application. By clicking on the recording application A in the mobile phone user interface 7a, a recording request is initiated. In response to the recording request, a data setting interface 7b is output. The user inputs the audio parameters and data information required in the data setting interface 7b. When the user clicks the confirmation option 71, it is confirmed that the audio parameters and data information settings are completed, and the set audio parameters and data information are transmitted as the information carried in the recording request.

[0111] One way to configure audio parameters and data information before initiating a recording request is as follows:

[0112] Before a user of the electronic device initiates a recording request through the recording application, the user can first set the audio parameters and data information required for recording in the recording application's data settings. After the user completes the setting, the recording application generates a recording request in response to the user's confirmation of the audio parameters and data settings. This ensures that the recording request carries the audio parameters and data information. In this way, users can flexibly set audio parameters and data information beforehand, and generate recording requests based on these settings. This satisfies users' personalized needs for audio parameters and data information required for recording and improves the efficiency of initiating recording requests at the application layer.

[0113] Specifically, taking a mobile phone as an example, Figure 8 For example, Figure 8 This is a schematic diagram of another audio parameter and data information setting interface provided in this application embodiment. The user can first click the data setting 81 option in the recording application A in the mobile phone user interface 8a, output the data setting function interface 8b, and input the audio parameters and data information required for recording in the data setting function interface 8b. When the user clicks the confirmation 82 option in the data setting function interface 8b, a recording request for the recording application A is generated.

[0114] S602: The hardware abstraction layer configures the resampling variables according to the second sampling rate indicated by the audio parameters carried in the recording request, and transmits the configured resampling variables to the chip architecture layer.

[0115] Because existing electronic devices use a fixed sampling rate for recording, taking the fixed sampling rate of the electronic device in this application embodiment as the first sampling rate as an example, the hardware abstraction layer can only transmit the first audio data obtained at the first sampling rate to the chip architecture layer. The chip architecture layer does not have a need to obtain audio data at other sampling rates, so it will directly transmit the first audio data as the recording audio data to the application layer for storage. As a result, the obtained recording audio data is not the audio data requested by the recording request, and cannot meet the user's recording needs.

[0116] Therefore, this application configures a resampling variable through the hardware abstraction layer based on the second sampling rate indicated by the audio parameters carried in the recording request, and transmits the resampling variable to the chip architecture layer in the form of a variable. This allows the chip architecture layer to obtain the second sampling rate required by the recording request through the resampling variable. This enables the chip architecture layer to resample the first audio data according to the second sampling rate obtained from the resampling variable when it subsequently obtains the first audio data, thereby obtaining the recording audio data required by the recording request and meeting the user's recording needs.

[0117] In one example, assuming the resampling variable is reqSampleRate and the second sampling rate is 16kHz, the resampling variable can be configured by reqSampleRate=16kHz or reqSampleRate=16k.

[0118] The hardware abstraction layer can also configure the original sampling variable according to the first sampling rate. In one example, assuming the original sampling variable is config_SampleRate and the first sampling rate is 48kHz, the original sampling variable can be configured by config_SampleRate=48kHz or config_SampleRate=48k.

[0119] In this embodiment, when the Hardware Abstraction Layer (HAL) transmits the configured resampling variables to the Chip Architecture Layer, the HAL transmits the configured resampling parameters to the Platform Abstraction Layer (PAL), and the PAL then transmits the configured resampling variables to the Chip Architecture Layer.

[0120] S603: The hardware abstraction layer determines the path flag bit based on the data information carried in the recording request, establishes a recording path based on the path flag bit, triggers the microphone of the electronic device to collect audio signals, and transmits the collected audio signals to the encoder.

[0121] The path flag is a first marker, which is associated with a first recording path. The first path includes an encoder, a chip architecture layer, a hardware abstraction layer, a framework layer, and an application layer.

[0122] In this embodiment, when the hardware abstraction layer establishes a recording path based on the path flag, it can determine the recording path of the recording request in the electronic device as the first recording path based on the first marker of the path flag. The sequential order of the layers in the first recording path is encoder, chip architecture layer, hardware abstraction layer, framework layer, and application layer. Specifically, the recorded audio data is obtained sequentially through the encoder, chip architecture layer, and hardware abstraction layer in the first recording path, and then further transmitted to the application layer for storage through the framework layer.

[0123] This application embodiment determines and establishes a first recording path based on the data information carried in the recording request, so that recording can be performed directly according to the established first recording path, which helps to improve the recording efficiency.

[0124] S604: The encoder samples and encodes the audio signal collected by the microphone according to the first sampling rate to obtain the first audio data, and transmits the first audio data to the chip architecture layer.

[0125] The first sampling rate can be any preset sampling rate, for example, the first sampling rate can be 48kHz.

[0126] The encoder includes an analog-to-digital converter (ADC). In this embodiment, when the encoder samples and encodes the audio signal collected by the microphone according to a first sampling rate to obtain the first audio data, it can first convert the audio electrical signal collected by the microphone into an audio digital signal through the ADC in the encoder. During the process of the ADC converting the audio electrical signal collected by the microphone into an audio digital signal, the audio digital signal is sampled according to the first sampling rate. Then, the audio digital signal obtained after sampling according to the first sampling rate is encoded to obtain the first audio data. In one example, the encoder can sample the audio digital signal according to the first sampling rate and encode the sampled audio digital signal into binary data to obtain the first audio data.

[0127] S605: The chip architecture layer converts the first audio data based on the second sampling rate indicated by the resampling parameters to obtain the second audio data, and transmits the second audio data to the hardware abstraction layer according to the first recording path.

[0128] The chip architecture layer includes a device module, a device processing module, devicepp, and a stream processing module. The device module includes a data storage module, sink endpoint. The device processing module, devicepp, includes a data acquisition module (Microsoft Foundation Classes, MFC) and an optimization processing module, IIR MBDRC. The stream processing module, Stream, includes MFC and a data reading module, read endpoint.

[0129] In this embodiment, the chip architecture layer can transmit the first audio data to the device processing module through the data storage module of the device module. The first audio data is resampled by the MFC in the device processing module based on the second sampling rate indicated by the resampling parameters to obtain resampled audio data. The resampled audio data is then optimized by the IIR MBDRC in the device processing module and transmitted to the stream processing module. The resampled audio data transmitted by the IIR MBDRC is converted into second audio data by the MFC in the stream processing module based on the first sampling rate. The second audio data is then transmitted to the hardware abstraction layer through the data reading module of the stream processing module.

[0130] Specifically, it can be... Figure 9 Let's take an example to illustrate. Figure 9 This is a schematic diagram of a recording process provided in an embodiment of this application, such as... Figure 9The diagram shows the structure of the recording process after configuring the resampling parameters and establishing the recording notification. First audio data is obtained by sampling the audio signal collected by microphone 91 at a first sampling rate and then sent to the chip architecture layer. The data storage module 921 of the device module 92 in the chip architecture layer transmits the first audio data to the device processing module 93. The MFC 931 in the device processing module 93 resamples the first audio data based on the second sampling rate indicated by the resampling parameters, obtaining resampled audio data. The IIR MBDRC 932 in the device processing module 93 optimizes the resampled audio data before transmitting it to the stream processing module 94. The MFC 941 in the stream processing module 94 converts the resampled audio data transmitted by the IIR MBDRC 932 into second audio data based on the first sampling rate, and the data reading module 942 in the stream processing module 94 transmits the second audio data to the hardware abstraction layer (HAL) 95.

[0131] In this embodiment, the device processing module's MFC resamples the first audio data based on the second sampling rate indicated by the resampling parameters. This helps to distinguish different audio data in the device processing module, avoids audio data confusion, and further transmits it to the stream processing module. The stream processing module's MFC converts the resampled audio data into second audio data with the first sampling rate required by the hardware abstraction layer, avoiding the problem of not being able to process the second audio data when transmitting it to the hardware abstraction layer.

[0132] S606: The hardware abstraction layer processes the second audio data based on the pre-configured recording rules and the second sampling rate indicated by the configured resampling parameters to obtain the recorded audio data, and then transmits the recorded audio data to the framework layer.

[0133] In this embodiment of the application, the recording rule is either the first recording rule or the second recording rule;

[0134] S607: The framework layer transmits recorded audio data to the application layer for storage.

[0135] In this embodiment of the application, when the path flag is determined to be the first flag based on the data information carried by the recording request during the data configuration stage, a corresponding first recording path is established so that recording can be performed according to the first recording path, which helps to improve the efficiency and effectiveness of recording.

[0136] Please see Figure 10 , Figure 10 This is a flowchart illustrating another recording method provided in an embodiment of this application, combined with... Figure 4b The hierarchical structure of the electronic devices shown is as follows: Figure 10 As shown, this recording method is an illustrative description of the recording process of the second recording path. The recording method may include the following steps S1001-S1006:

[0137] S1001: The application layer responds to the recording request from the recording application in the electronic device and transmits the recording request to the hardware abstraction layer through the framework layer.

[0138] S1002: The hardware abstraction layer configures the resampling variables according to the second sampling rate indicated by the audio parameters carried in the recording request, and transmits the configured resampling variables to the chip architecture layer.

[0139] S1003: The hardware abstraction layer determines the path flag bit based on the data information carried by the recording request, establishes a recording path based on the path flag bit, triggers the microphone of the electronic device to collect audio signals, and transmits the collected audio signals to the encoder.

[0140] The path flag is a second flag, which is associated with a second recording path. The second recording path includes an encoder, a chip architecture layer, a framework layer, and an application layer.

[0141] In this embodiment, when the hardware abstraction layer establishes a recording path based on the path flag, it can determine the recording path of the recording request in the electronic device as a second recording path based on the second flag of the path flag. The sequential order of the layers in this second recording path is encoder, chip architecture layer, framework layer, and application layer. Specifically, the recorded audio data is obtained sequentially through the encoder and chip architecture layer in the second recording path, and then further transmitted to the application layer for storage through the framework layer.

[0142] This application embodiment determines and establishes a second recording path based on the data information carried in the recording request, so that recording can be performed directly according to the established second recording path, which helps to improve the recording efficiency.

[0143] S1004: The encoder samples and encodes the audio signal according to the first sampling rate to obtain the first audio data, and transmits the first audio data to the chip architecture layer.

[0144] S1005: The chip architecture layer converts the first audio data based on the second sampling rate indicated by the resampling parameters to obtain the second audio data, and transmits the second audio data to the framework layer according to the second recording path.

[0145] S1006: The framework layer transmits the second audio data as recorded audio data to the application layer for storage.

[0146] In this embodiment of the application, when the path flag is determined to be the second flag based on the data information carried in the recording request during the data configuration stage, a corresponding second recording path is established so that recording can be performed according to the second recording path, which helps to improve the efficiency and effectiveness of recording.

[0147] Please see Figure 11 , Figure 11 This is a timing flowchart of a recording method provided in an embodiment of this application. The interactive recording method can be jointly executed by the encoder, chip architecture layer, hardware abstraction layer, framework layer, and application layer in the electronic device. The recording method may include the following steps S1101-S1112:

[0148] S1101: The application layer obtains a recording request from the recording application in the electronic device.

[0149] In this embodiment of the application, the recording request may be initiated by a user operation in the electronic device or sent to the electronic device by other terminal devices.

[0150] In one implementation, the application layer can obtain recording requests from the recording application in the electronic device in response to user actions, wherein the user actions may include, but are not limited to, the following:

[0151] In one example, the user action could be a user clicking the recording application icon on the user interface of an electronic device. Figure 12 Using a mobile phone as an example, electronic devices are used for illustration. Figure 12 This is a schematic diagram of an interface for an electronic device to initiate a recording request, as provided in this application embodiment. Figure 12 As shown in 12a, the user interface of the mobile phone includes an icon for recording application A and an icon for recording application B. When the user clicks the icon for recording application A on the user interface of the mobile phone, the electronic device opens recording application A. When recording application A is opened, a recording request is generated. The recording request includes preset audio parameters of recording application A. For example, the preset audio parameters of recording application A are: audio sampling rate of 44.1kHz.

[0152] In another example, the user action could be a user clicking the recording control on the recording application interface. Figure 12 Taking mobile phones as an example, etc., electronic devices are used to illustrate this. Figure 12 As shown in 12b, when a user clicks the icon of the recording application B on the user interface of the mobile phone, the electronic device opens the recording application B and outputs the recording application B interface 12c. Interface 12c displays a recording control 1201. When the user clicks the recording control 1201, a recording request is generated in response to the click operation. The recording request includes the audio parameters preset by the recording application B. For example, the audio parameters preset by the recording application B are: audio sampling rate of 44.1kHz.

[0153] In another example, user actions could be voice control operations. For instance, after waking up an electronic device, a user could trigger a recording application to generate a recording request by saying a command such as "start recording".

[0154] The embodiments of this application trigger the recording application to initiate a recording request in multiple ways, which can improve the flexibility of initiating a recording request.

[0155] S1102: The application layer transmits the recording request to the framework layer.

[0156] S1103: The framework layer transmits the audio parameters and data information carried in the recording request to the hardware abstraction layer.

[0157] S1104: The hardware abstraction layer configures the resampling variables according to the second sampling rate indicated by the audio parameters and transmits the configured resampling variables to the chip architecture layer.

[0158] In this embodiment, when the hardware abstraction layer transmits the configured resampling variables to the chip architecture layer, it can encapsulate the resampling variables into calibration key vector parameters (ckv) and transmit the calibration key vector parameters to the chip architecture layer.

[0159] In one implementation, after obtaining the calibration key vector parameter ckv, the chip architecture layer can set the value of ckv for the relevant modules in the chip architecture layer. Specifically, the chip architecture layer can set the value of ckv to the second sampling rate for MFC and IIR MBDRC in the device processing module of the chip architecture layer, and set the value of ckv to the first sampling rate for MFC in the stream processing module of the chip architecture layer.

[0160] Specifically, it can be... Figure 13 Let's take an example to illustrate. Figure 13 This is a schematic diagram of an interface for setting calibration key vector parameters at the chip architecture layer, as provided in an embodiment of this application. Figure 13 As shown, the ckv setting interface 130 includes the ckv setting option 1301 of the MFC transfer module and the IIR MBDRC optimization processing module in the device processing module. By clicking the ckv setting option 1301, the user can select the desired ckv value, such as setting the ckv value to the second sampling rate of 16kHz.

[0161] In this embodiment, by configuring the ckv value for the chip architecture layer, when the chip architecture layer obtains the first audio data transmitted by the encoder, the first audio data can be quickly and efficiently transmitted to the device processing module through the data storage module of the device module. The first audio data is then resampled by the MFC in the device processing module based on the second sampling rate indicated by ckv in the MFC, resulting in resampled audio data. The resampled audio data is then optimized by the IIR MBDRC in the device processing module and transmitted to the stream processing module. Finally, the resampled audio data transmitted by the IIR MBDRC is converted into second audio data by the MFC in the stream processing module based on the first sampling rate indicated by ckv in the MFC.

[0162] S1105: The hardware abstraction layer determines the path flag bit based on the data information, establishes a recording path based on the path flag bit, triggers the microphone of the electronic device to collect audio signals, and transmits the collected audio signals to the encoder.

[0163] S1106: The encoder samples and encodes the audio signal collected by the microphone according to the first sampling rate to obtain the first audio data, and transmits the first audio data to the chip architecture layer.

[0164] S1107: The chip architecture layer converts the first audio data based on the second sampling rate indicated by the resampling parameters to obtain the second audio data.

[0165] S11081: The chip architecture layer transmits the second audio data to the hardware abstraction layer according to the established first recording path and executes step S1109, or S11082: The chip architecture layer transmits the second audio data to the framework layer according to the established second recording path and executes step S1111.

[0166] S1109: The hardware abstraction layer processes the second audio data based on the pre-configured recording rules and the second sampling rate indicated by the configured resampling parameters to obtain the recorded audio data, and transmits the recorded audio data to the framework layer.

[0167] S1110: The framework layer transmits the recorded audio data to the application layer and executes step S1112.

[0168] S1111: The framework layer transmits the second audio data as recorded audio data to the application layer.

[0169] S1112: The application layer stores recorded audio data.

[0170] In this embodiment, the application layer transmits the acquired recording request to the framework layer. The framework layer then transmits the audio parameters and data information carried in the recording request to the hardware abstraction layer. The hardware abstraction layer configures resampling variables according to the second sampling rate indicated by the audio parameters and transmits the configured resampling variables to the chip architecture layer. It also determines a path flag bit based on the data information and establishes a recording path based on the path flag bit, triggering the microphone of the electronic device to collect audio signals. The collected audio signals are then transmitted to the encoder. The encoder samples and encodes the audio signals collected by the microphone according to the first sampling rate to obtain first audio data and transmits the first audio data to the chip architecture layer. The chip architecture layer converts the first audio data based on the second sampling rate indicated by the resampling parameters to obtain second audio data. The chip architecture layer transmits the second audio data to the hardware abstraction layer or the framework layer according to the established recording path. When the chip architecture layer transmits the second audio data to the hardware abstraction layer according to the established first recording path, the hardware abstraction layer processes the second audio data based on pre-configured recording rules and the second sampling rate indicated by the configured resampling parameters to obtain recorded audio data and transmits the recorded audio data to the framework layer. The framework layer then transmits the recorded audio data to the application layer for storage. When the chip architecture layer transmits the second audio data to the framework layer via the established second recording path, the framework layer transmits the second audio data as recorded audio data to the application layer for storage. This approach allows for the configuration of resampling parameters in response to recording requests at different sampling rates. Based on these parameters, the acquired audio data is resampled, enabling flexible sampling processing of the recordings. Furthermore, it allows for the flexible establishment of different recording paths based on the data information carried in the recording request, improving the flexibility and effectiveness of recording while meeting users' recording needs at different sampling rates.

[0171] Based on the above description of the recording method embodiments, this application also discloses a recording device; the recording device may be a computer program (including one or more instructions) running in an electronic device, and the recording device can execute each step in the above-mentioned related method flow. Please refer to... Figure 14 , Figure 14 This is a schematic diagram of a recording device provided in an embodiment of this application. The recording device can operate the following units:

[0172] Configuration unit 1401 is configured to respond to a recording request from a recording application in the electronic device and configure resampling parameters according to the audio parameters carried in the recording request;

[0173] The acquisition unit 1402 is used to acquire the first audio data obtained by sampling the audio signal collected by the microphone according to the first sampling rate;

[0174] The resampling unit 1403 is used to resample the first audio data according to the second sampling rate indicated by the resampling parameters to obtain recorded audio data, and to store the recorded audio data for the recording application.

[0175] Furthermore, the electronic device is configured with a framework layer, a hardware abstraction layer, and a chip architecture layer; when the configuration unit 1401 configures the resampling parameters according to the audio parameters carried in the recording request, it is specifically used for:

[0176] The audio parameters carried in the recording request are transmitted to the hardware abstraction layer through the framework layer.

[0177] The hardware abstraction layer configures resampling variables according to the second sampling rate indicated by the audio parameters, and transmits the configured resampling variables to the chip architecture layer to complete the configuration of the resampling parameters.

[0178] Furthermore, when the configuration unit 1401 transmits the configured resampling variables to the chip architecture layer, it is specifically used for:

[0179] The resampling variables are encapsulated into calibration key vector parameters through the hardware abstraction layer.

[0180] The calibration key vector parameters are transmitted to the chip architecture layer through the hardware abstraction layer.

[0181] Furthermore, after configuring the resampling parameters according to the audio parameters carried in the recording request, the configuration unit 1401 is also used to:

[0182] The data information carried by the recording request is transmitted to the hardware abstraction layer through the framework layer.

[0183] The hardware abstraction layer determines the path flag bit based on the data information, establishes a recording path based on the path flag bit, and triggers the microphone to collect audio signals.

[0184] Furthermore, when the configuration unit 1401 determines the path flag bit based on the data information through the hardware abstraction layer, it is specifically used for:

[0185] The data information is detected through the hardware abstraction layer; the data information includes any one or more of the following: the data type of the first audio data, data quality information, recording device information, and data parameters;

[0186] If the hardware abstraction layer detects that the data information meets the resampling condition, it determines that the path flag is the first flag, and the first flag is associated with the first recording path.

[0187] If the hardware abstraction layer detects that the data information does not meet the resampling conditions, it determines that the path flag is a second flag, and the second flag is associated with the second recording path.

[0188] Furthermore, the electronic device is also equipped with an encoder; when the resampling unit 1403 resamples the first audio data according to the second sampling rate indicated by the resampling parameters to obtain recorded audio data, it is specifically used for:

[0189] The encoder transmits the encoded first audio data to the chip architecture layer.

[0190] The chip architecture layer converts the first audio data based on the second sampling rate indicated by the resampling parameters to obtain the second audio data, and then transmits the second audio data to the hardware abstraction layer.

[0191] The hardware abstraction layer processes the second audio data based on pre-configured recording rules and a second sampling rate indicated by configured resampling parameters to obtain the recorded audio data.

[0192] Furthermore, the chip architecture layer includes a device processing module and a stream processing module; when the resampling unit 1403 converts the first audio data based on the second sampling rate indicated by the resampling parameters through the chip architecture layer to obtain the second audio data, it is specifically used for:

[0193] The device processing module of the chip architecture layer resamples the first audio data based on the second sampling rate indicated by the resampling parameters to obtain resampled audio data, and transmits the resampled audio data to the stream processing module.

[0194] The stream processing module converts the resampled audio data into the second audio data based on the first sampling rate.

[0195] Furthermore, when the resampling unit 1403 processes the second audio data based on the pre-configured recording rules and the second sampling rate indicated by the configured resampling parameters through the hardware abstraction layer to obtain the recorded audio data, it is specifically used for:

[0196] The hardware abstraction layer optimizes the second audio data based on pre-configured recording rules to obtain the third audio data, wherein the recording rules are either the first rule or the second rule.

[0197] The third audio data is obtained by resampling the hardware abstraction layer based on a second sampling rate indicated by the configured resampling parameters.

[0198] Furthermore, when the resampling unit 1403 optimizes the second audio data based on pre-configured recording rules through the hardware abstraction layer to obtain the third audio data, it is specifically used for:

[0199] The data information, including the bit width and the second sampling rate, is detected through the hardware abstraction layer.

[0200] If the hardware abstraction layer detects that the bit width and the second sampling rate in the data information meet the first condition, then the second audio data is optimized according to the pre-configured first recording rule to obtain the third audio data.

[0201] If the hardware abstraction layer detects that the bit width and the second sampling rate in the data information do not meet the first condition, then the second audio data is optimized according to the pre-configured second recording rules to obtain the third audio data.

[0202] Furthermore, before responding to a recording request from a recording application in the electronic device, the configuration unit 1401 is also configured to:

[0203] When a startup command for the electronic device is detected, the loading of the electronic device's resource management file is triggered.

[0204] Retrieve the function tag from the resource management file;

[0205] If a function flag is obtained, and the obtained function flag is used to indicate that the electronic device supports configuring calibration key vector parameters at the chip architecture layer, then the step of responding to the recording request of the recording application in the electronic device and configuring resampling parameters according to the audio parameters carried in the recording request is executed.

[0206] This application embodiment, in response to a recording request from a recording application in an electronic device, configures resampling parameters based on the audio parameters carried in the recording request. This allows for the resampling of the first audio data obtained by sampling the audio signal captured by the microphone at a first sampling rate, according to a second sampling rate indicated by the resampling parameters, to obtain recorded audio data that meets the recording request. By configuring resampling parameters in response to recording requests at different sampling rates and resampling the acquired audio data based on these parameters, recording can be flexibly sampled to obtain recorded audio data that meets the user's different sampling rate requirements, thus improving the flexibility and effectiveness of recording.

[0207] Figure 14The various units in the recording device shown can be individually or entirely combined into one or more other units, or some of the units can be further divided into multiple functionally smaller units. This achieves the same operation without affecting the technical effects of the embodiments of this application. The above-mentioned units are based on logical function division. In practical applications, the function of one unit can also be implemented by multiple units, or the function of multiple units can be implemented by one unit. In other embodiments of this application, the recording device may also include other units. In practical applications, these functions can also be implemented with the assistance of other units, and can be implemented collaboratively by multiple units.

[0208] This can be achieved by running a computer program (including one or more instructions) capable of executing the steps involved in any of the above method embodiments on a general-purpose electronic device, such as a computer, which includes processing elements and storage elements such as a central processing unit (CPU), random access memory (RAM), and read-only memory (ROM), to construct a system as described above. Figure 14 The recording apparatus shown herein, and the recording method for implementing the embodiments of this application, are described. The computer program may be recorded on, for example, a computer-readable storage medium, loaded onto the aforementioned electronic device via the computer-readable storage medium, and run therein.

[0209] It is worth noting that, in the embodiments of this application, the term "unit" refers to a computer program or part of a computer program with a predetermined function, which works together with other related parts to achieve a predetermined goal, and can be implemented wholly or partially using software, hardware (such as processing circuitry or memory), or a combination thereof. Similarly, a processor (or multiple processors or memory) can be used to implement one or more modules or units. Furthermore, each module or unit can contain a portion of the overall module or unit's functionality.

[0210] Based on the description of the method and device embodiments above, this application also provides an electronic device. Please refer to... Figure 15 , Figure 15 This is a schematic diagram of the structure of another electronic device provided in an embodiment of this application, such as... Figure 15As shown, the electronic device includes at least a processor 1501, an input interface 1502, an output interface 1503, and a computer-readable storage medium 1504. The processor 1501, input interface 1502, output interface 1503, and computer-readable storage medium 1504 can be connected via a bus or other means. The computer-readable storage medium 1504 can be stored in the memory of the electronic device. The computer-readable storage medium 1504 is used to store a computer program, which includes one or more instructions. The processor 1501 is used to execute one or more instructions from the computer program stored in the computer-readable storage medium 1504. The processor 1501 (or CPU (Central Processing Unit)) is the computing and control core of the electronic device, adapted to implement one or more instructions, specifically adapted to load and execute one or more instructions to achieve a corresponding method flow or function.

[0211] The processor 1501 described in this application embodiment can be used to perform the following steps:

[0212] In response to a recording request from a recording application in the electronic device, resampling parameters are configured based on the audio parameters carried in the recording request;

[0213] The first audio data is obtained by sampling the audio signal collected by the microphone according to the first sampling rate;

[0214] The first audio data is resampled according to the second sampling rate indicated by the resampling parameter to obtain recorded audio data, and the recorded audio data is stored for the recording application.

[0215] Furthermore, the electronic device is configured with a framework layer, a hardware abstraction layer, and a chip architecture layer; when the processor 1501 configures the resampling parameters according to the audio parameters carried in the recording request, it is specifically used for:

[0216] The audio parameters carried in the recording request are transmitted to the hardware abstraction layer through the framework layer.

[0217] The hardware abstraction layer configures resampling variables according to the second sampling rate indicated by the audio parameters, and transmits the configured resampling variables to the chip architecture layer to complete the configuration of the resampling parameters.

[0218] Furthermore, when transmitting the configured resampling variables to the chip architecture layer, the processor 1501 specifically performs the following functions:

[0219] The resampling variables are encapsulated into calibration key vector parameters through the hardware abstraction layer.

[0220] The calibration key vector parameters are transmitted to the chip architecture layer through the hardware abstraction layer.

[0221] Furthermore, after configuring the resampling parameters according to the audio parameters carried in the recording request, the processor 1501 is also used to:

[0222] The data information carried by the recording request is transmitted to the hardware abstraction layer through the framework layer.

[0223] The hardware abstraction layer determines the path flag bit based on the data information, establishes a recording path based on the path flag bit, and triggers the microphone to collect audio signals.

[0224] Furthermore, when the processor 1501 determines the path flag bit based on the data information through the hardware abstraction layer, it specifically performs the following:

[0225] The data information is detected through the hardware abstraction layer; the data information includes any one or more of the following: the data type of the first audio data, data quality information, recording device information, and data parameters;

[0226] If the hardware abstraction layer detects that the data information meets the resampling condition, it determines that the path flag is the first flag, and the first flag is associated with the first recording path.

[0227] If the hardware abstraction layer detects that the data information does not meet the resampling conditions, it determines that the path flag is a second flag, and the second flag is associated with the second recording path.

[0228] Furthermore, the electronic device is also equipped with an encoder; when the processor 1501 resamples the first audio data according to the second sampling rate indicated by the resampling parameters to obtain recorded audio data, it is specifically used for:

[0229] The encoder transmits the encoded first audio data to the chip architecture layer.

[0230] The chip architecture layer converts the first audio data based on the second sampling rate indicated by the resampling parameters to obtain the second audio data, and then transmits the second audio data to the hardware abstraction layer.

[0231] The hardware abstraction layer processes the second audio data based on pre-configured recording rules and a second sampling rate indicated by configured resampling parameters to obtain the recorded audio data.

[0232] Furthermore, the chip architecture layer includes a device processing module and a stream processing module; when the processor 1501 converts the first audio data based on the second sampling rate indicated by the resampling parameters through the chip architecture layer to obtain the second audio data, it is specifically used for:

[0233] The device processing module of the chip architecture layer resamples the first audio data based on the second sampling rate indicated by the resampling parameters to obtain resampled audio data, and transmits the resampled audio data to the stream processing module.

[0234] The stream processing module converts the resampled audio data into the second audio data based on the first sampling rate.

[0235] Furthermore, when the processor 1501 processes the second audio data based on the pre-configured recording rules and the second sampling rate indicated by the configured resampling parameters through the hardware abstraction layer to obtain the recorded audio data, it specifically performs the following:

[0236] The hardware abstraction layer optimizes the second audio data based on pre-configured recording rules to obtain the third audio data, wherein the recording rules are either the first rule or the second rule.

[0237] The third audio data is obtained by resampling the hardware abstraction layer based on a second sampling rate indicated by the configured resampling parameters.

[0238] Furthermore, when the processor 1501 optimizes the second audio data based on pre-configured recording rules through the hardware abstraction layer to obtain the third audio data, it specifically performs the following:

[0239] The data information, including the bit width and the second sampling rate, is detected through the hardware abstraction layer.

[0240] If the hardware abstraction layer detects that the bit width and the second sampling rate in the data information meet the first condition, then the second audio data is optimized according to the pre-configured first recording rule to obtain the third audio data.

[0241] If the hardware abstraction layer detects that the bit width and the second sampling rate in the data information do not meet the first condition, then the second audio data is optimized according to the pre-configured second recording rules to obtain the third audio data.

[0242] Furthermore, before responding to a recording request from a recording application in the electronic device, the processor 1501 is also configured to:

[0243] When a startup command for the electronic device is detected, the loading of the electronic device's resource management file is triggered.

[0244] Retrieve the function tag from the resource management file;

[0245] If a function flag is obtained, and the obtained function flag is used to indicate that the electronic device supports configuring calibration key vector parameters at the chip architecture layer, then the step of responding to the recording request of the recording application in the electronic device and configuring resampling parameters according to the audio parameters carried in the recording request is executed.

[0246] This application embodiment, in response to a recording request from a recording application in an electronic device, configures resampling parameters based on the audio parameters carried in the recording request. This allows for the resampling of the first audio data obtained by sampling the audio signal captured by the microphone at a first sampling rate, according to a second sampling rate indicated by the resampling parameters, to obtain recorded audio data that meets the recording request. By configuring resampling parameters in response to recording requests at different sampling rates and resampling the acquired audio data based on these parameters, recording can be flexibly sampled to obtain recorded audio data that meets the user's different sampling rate requirements, thus improving the flexibility and effectiveness of recording.

[0247] It should be understood that, in the embodiments of this application, the processor 1501 may be a Central Processing Unit (CPU), but it may also be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor.

[0248] In specific implementations, the processor 1501 described in this application embodiment can execute the implementation method described in this application embodiment of the recording method, or it can execute the implementation method of the recording device described in this application embodiment, which will not be repeated here.

[0249] This application also provides a computer-readable storage medium storing program instructions that, when executed, implement any of the recording methods described above.

[0250] The computer-readable storage medium can be an internal storage unit of the device described in any of the foregoing embodiments, such as the device's hard drive or memory. The computer-readable storage medium can also be an external storage device of the device, such as a plug-in hard drive, Smart Media Card (SMC), Secure Digital (SD) card, or Flash Card equipped on the device. Further, the computer-readable storage medium may include both internal and external storage units of the device. The computer-readable storage medium is used to store the computer program and other programs and data required by the mobile device. The computer-readable storage medium can also be used to temporarily store data that has been output or will be output.

[0251] Embodiments of this application also provide a computer program product or computer program including computer instructions stored in a computer-readable storage medium. A processor of an electronic device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the electronic device to perform the methods provided in the various embodiments described above.

[0252] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this application.

[0253] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the terminals and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.

Claims

1. A recording method, characterized in that, Applied to electronic devices, the method includes: In response to a recording request from a recording application in the electronic device, resampling parameters are configured based on the audio parameters carried in the recording request; The first audio data is obtained by sampling the audio signal collected by the microphone according to the first sampling rate; The first audio data is resampled according to the second sampling rate indicated by the resampling parameter to obtain recorded audio data, and the recorded audio data is stored for the recording application.

2. The method according to claim 1, characterized in that, The electronic device is configured with a framework layer, a hardware abstraction layer, and a chip architecture layer; configuring resampling parameters according to the audio parameters carried in the recording request includes: The audio parameters carried in the recording request are transmitted to the hardware abstraction layer through the framework layer. The hardware abstraction layer configures resampling variables according to the second sampling rate indicated by the audio parameters, and transmits the configured resampling variables to the chip architecture layer to complete the configuration of the resampling parameters.

3. The method according to claim 2, characterized in that, The step of transmitting the configured resampling variables to the chip architecture layer includes: The resampling variables are encapsulated into calibration key vector parameters through the hardware abstraction layer. The calibration key vector parameters are transmitted to the chip architecture layer through the hardware abstraction layer.

4. The method according to claim 2, characterized in that, After configuring the resampling parameters according to the audio parameters carried in the recording request, the method further includes: The data information carried by the recording request is transmitted to the hardware abstraction layer through the framework layer. The hardware abstraction layer determines the path flag bit based on the data information, establishes a recording path based on the path flag bit, and triggers the microphone to collect audio signals.

5. The method according to claim 4, characterized in that, The step of determining the path flag bit based on the data information through the hardware abstraction layer includes: The data information is detected through the hardware abstraction layer; the data information includes any one or more of the following: the data type of the first audio data, data quality information, recording device information, and data parameters; If the hardware abstraction layer detects that the data information meets the resampling condition, it determines that the path flag is the first flag, and the first flag is associated with the first recording path. If the hardware abstraction layer detects that the data information does not meet the resampling conditions, it determines that the path flag is a second flag, and the second flag is associated with the second recording path.

6. The method according to claim 2, characterized in that, The electronic device is further equipped with an encoder; the step of resampling the first audio data according to the second sampling rate indicated by the resampling parameter to obtain recorded audio data includes: The encoder transmits the encoded first audio data to the chip architecture layer. The chip architecture layer converts the first audio data based on the second sampling rate indicated by the resampling parameters to obtain the second audio data, and then transmits the second audio data to the hardware abstraction layer. The hardware abstraction layer processes the second audio data based on pre-configured recording rules and a second sampling rate indicated by configured resampling parameters to obtain the recorded audio data.

7. The method according to claim 6, characterized in that, The chip architecture layer includes a device processing module and a stream processing module; the process of converting the first audio data based on the second sampling rate indicated by the resampling parameters through the chip architecture layer to obtain the second audio data includes: The device processing module of the chip architecture layer resamples the first audio data based on the second sampling rate indicated by the resampling parameters to obtain resampled audio data, and transmits the resampled audio data to the stream processing module. The stream processing module converts the resampled audio data into the second audio data based on the first sampling rate.

8. The method according to claim 6, characterized in that, The process of processing the second audio data through the hardware abstraction layer based on pre-configured recording rules and a second sampling rate indicated by configured resampling parameters to obtain the recorded audio data includes: The hardware abstraction layer optimizes the second audio data based on pre-configured recording rules to obtain the third audio data, wherein the recording rules are either the first rule or the second rule. The third audio data is obtained by resampling the hardware abstraction layer based on a second sampling rate indicated by the configured resampling parameters.

9. The method according to claim 8, characterized in that, The third audio data is obtained by optimizing the second audio data based on pre-configured recording rules through the hardware abstraction layer, including: The data information, including the bit width and the second sampling rate, is detected through the hardware abstraction layer. If the hardware abstraction layer detects that the bit width and the second sampling rate in the data information meet the first condition, then the second audio data is optimized according to the pre-configured first recording rule to obtain the third audio data. If the hardware abstraction layer detects that the bit width and the second sampling rate in the data information do not meet the first condition, then the second audio data is optimized according to the pre-configured second recording rules to obtain the third audio data.

10. The method according to claim 1, characterized in that, Before responding to a recording request from a recording application in the electronic device, the method further includes: When a startup command for the electronic device is detected, the loading of the electronic device's resource management file is triggered. Retrieve the function tag from the resource management file; If a function flag is obtained, and the obtained function flag is used to indicate that the electronic device supports configuring calibration key vector parameters at the chip architecture layer, then the step of responding to the recording request of the recording application in the electronic device and configuring resampling parameters according to the audio parameters carried in the recording request is executed.

11. A recording device, characterized in that, Applied to electronic devices, the device includes: A configuration unit is configured to respond to a recording request from a recording application in the electronic device and configure resampling parameters according to the audio parameters carried in the recording request. The acquisition unit is used to acquire the first audio data obtained by sampling the audio signal collected by the microphone according to the first sampling rate; The resampling unit is used to resample the first audio data according to the second sampling rate indicated by the resampling parameters to obtain recorded audio data, and to store the recorded audio data for the recording application.

12. An electronic device, characterized in that, The device includes a processor and a memory interconnected thereto, wherein the memory is used to store a computer program, and the processor is configured to invoke the computer program to perform the method as described in any one of claims 1 to 10.

13. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores program instructions that, when executed, implement the method as described in any one of claims 1 to 10.

14. A computer program product, characterized in that, The computer program product includes program instructions that, when executed by a processor, implement the method described in any one of claims 1 to 10.