Audio format control method, device and electronic equipment
Patent Information
- Application Number
- CN202310389955.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-04-04
- Publication Date
- 2026-10-13
- Estimated Expiration
- 2043-04-04
AI Technical Summary
这样就会导致电子设备的音频软件版本的不统一,音频软件版本的维护复杂且维护成本高等问题,也会导致电子设备的用户体验感差
[0019]第四方面,本申请实施例提供了一种电子设备,该电子设备可包括处理器和存储器,上述处理器和存储器相互连接。其中,上述存储器用于存储计算机程序,上述处理器被配置用于执行上述计算机程序以实现上述第一方面提供的音频格式的控制方法,也能实现上述第一方面提供的音频格式的控制方法所具备的有益效果。
Smart Images

Figure CN116466908B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer technology, and in particular to a method, apparatus, and electronic device for controlling an audio format. Background Technology
[0002] With the continuous development of computer and audio technologies, audio functionality has gradually become one of the basic functions of electronic devices. From large devices like laptops and desktop computers to smaller modular devices like M2M modules and 5G communication modules, all possess audio capabilities. Therefore, people's demands for the audio functionality of electronic devices are also gradually increasing.
[0003] However, some existing electronic devices output audio signals in the factory default audio format. For example, common Qualcomm-based M2M modules output PCM audio signals by default. When users request an audio signal in a different format, the device manufacturer must modify and update the audio software accordingly and provide the new version to the user. This leads to inconsistencies in audio software versions, complex and costly maintenance, and a poor user experience. Therefore, reducing the maintenance cost of audio software in electronic devices has become a pressing technical problem. Summary of the Invention
[0004] This application provides an audio format control method, apparatus, and electronic device. The electronic device can set the audio format of the audio signal through audio format control instructions, thereby achieving uniformity of the software version of the output audio signal.
[0005] In a first aspect, embodiments of the present invention provide an audio format control method. The method includes: receiving an audio format control instruction input by a user through a loaded target application, wherein the audio format control instruction includes target format parameters corresponding to a target audio format; extracting the target format parameters through the target application; calling an audio format control interface provided by a kernel through the target application to pass the target format parameters to a modem within the kernel; and modifying the analog front-end audio parameters of the modem according to the target format parameters, so that the audio format of the audio signal output by the modem is the target audio format.
[0006] In this embodiment, the electronic device can receive user-inputted audio format control commands through a loaded target application and extract the target format parameters contained therein. Furthermore, the electronic device can pass the target format parameters to a modem within its kernel and modify the modem's analog front-end audio parameters according to the target format parameters, so that the audio signal output by the electronic device through the modem is in the target audio format. Using this method, the electronic device can achieve uniformity in its audio software version, reducing the maintenance cost of the audio software.
[0007] In conjunction with the first aspect, in one feasible implementation, the method further includes: mounting the digital audio interfaces of each of at least two audio formats to the audio data link structure in the kernel; modifying the audio structure and registration code in the kernel to make the kernel compatible with the digital audio interfaces of the at least two audio formats; and registering the audio format control interface and sound card device through the kernel.
[0008] In conjunction with the first aspect, in one feasible implementation, the method passes the target format parameter to the modem in the kernel via the kernel, including: triggering the kernel to pass the target format parameter to the modem in the kernel via the shared memory.
[0009] In conjunction with the first aspect, in one feasible implementation, the audio format includes at least the integrated circuit built-in audio bus I2S, pulse code modulation (PCM), and pulse density modulation (PDM).
[0010] In conjunction with the first aspect, in one feasible implementation, the audio format control instruction is an AT instruction that includes the target format parameter.
[0011] In conjunction with the first aspect, in one feasible implementation, the audio format control interface serves as the control interface for low-level audio debugging tools.
[0012] Secondly, embodiments of the present invention provide an audio format control device. The device includes: a receiving unit, configured to receive an audio format control command input by a user through a loaded target application, wherein the audio format control command includes target format parameters corresponding to a target audio format; an extraction unit, configured to extract the target format parameters through the target application; and a processing unit, configured to invoke an audio format control interface provided by a kernel through the target application, so as to pass the target format parameters to a modem within the kernel. The processing unit is configured to modify the analog front-end audio parameters of the modem according to the target format parameters through the kernel, so that the format of the audio signal output by the modem is the target audio format.
[0013] In conjunction with the second aspect, in one feasible implementation, the apparatus further includes: a registration unit. The processing unit is configured to mount the digital audio interfaces of each of at least two audio formats to the audio data link structure in the kernel via the kernel. The processing unit is configured to modify the audio structure and registration code in the kernel via the kernel to make the kernel compatible with the digital audio interfaces of the at least two audio formats. The registration unit is configured to register the audio format control interface and the sound card device via the kernel.
[0014] In conjunction with the second aspect, in one feasible implementation, the processing unit is configured to trigger the kernel to pass the target format parameters to the modem in the kernel via the shared memory.
[0015] In conjunction with the second aspect, in one feasible implementation, the audio format includes at least the integrated circuit built-in audio bus I2S, pulse code modulation (PCM), and pulse density modulation (PDM).
[0016] In conjunction with the second aspect, in one feasible implementation, the audio format control instruction is an AT instruction that includes the target format parameter.
[0017] In conjunction with the second aspect, in one feasible implementation, the audio format control interface serves as the control interface for low-level audio debugging tools.
[0018] Thirdly, embodiments of this application provide a computer-readable storage medium for storing a computer program. When the computer program is run on a computer, it causes the computer to execute the audio format control method provided by any possible implementation of the first aspect, thereby achieving the beneficial effects of the audio format control method provided in the first aspect.
[0019] Fourthly, embodiments of this application provide an electronic device that may include a processor and a memory, which are interconnected. The memory stores a computer program, and the processor is configured to execute the computer program to implement the audio format control method provided in the first aspect, thereby achieving the beneficial effects of the audio format control method provided in the first aspect.
[0020] By implementing the embodiments of the present invention, an electronic device can receive audio format control commands input by the user through a loaded target application and extract the target format parameters contained therein. Furthermore, the electronic device can pass the target format parameters to a modem within its kernel and modify the analog front-end audio parameters of the modem according to the target format parameters, so that the audio signal output by the electronic device through the modem is in the target audio format. Through the above method, the electronic device can achieve uniformity in its audio software version, reducing the maintenance cost of the audio software. Attached Figure Description
[0021] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0022] Figure 1 This is a flowchart illustrating an audio format control method provided in an embodiment of this application;
[0023] Figure 2 This is another flowchart illustrating an audio format control method provided in an embodiment of this application;
[0024] Figure 3 This is a schematic diagram of an audio format control device provided in an embodiment of this application;
[0025] Figure 4 This is another structural schematic diagram of an audio format control device provided in the embodiments of this application;
[0026] Figure 5 This is a schematic diagram of the structure of the electronic device provided in the embodiments of this application. Detailed Implementation
[0027] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present application.
[0028] The terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish different objects, not to describe a specific order. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or apparatus that includes a series of steps is not limited to the steps listed, but may optionally include steps not listed, or may optionally include other steps inherent to these processes, methods, products, or apparatuses.
[0029] In this document, the term "embodiment" means that a particular 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.
[0030] Many existing electronic devices output audio signals in a factory default audio format. When users request an audio signal in a different format, the device manufacturer must modify and update the audio software accordingly, providing the new version to the user. This leads to inconsistencies in audio software versions, complex and costly maintenance, and a poor user experience. Therefore, this application aims to address the technical problem of reducing the maintenance cost of audio software in electronic devices.
[0031] Please see Figure 1 , Figure 1 This is a flowchart illustrating an audio format control method provided in an embodiment of this application. Specifically, this method can be executed by an electronic device based on a Qualcomm platform. The electronic device involved in this application can be any type of device that supports at least audio functionality; it can be a complete device such as a mobile phone or laptop, a modular device such as a 5G communication module or an M2M (Machine to Machine) module, or an embedded device based on a Qualcomm platform. This application does not impose specific limitations on the implementation form of the electronic device. Figure 1 As shown, the method may specifically include the following steps:
[0032] S101 receives audio format control commands input by the user through the loaded target application.
[0033] In some feasible implementations, the electronic device can receive audio format control commands input by the user through a target application installed on the electronic device. It should be noted that the audio control commands may include target format parameters corresponding to the target audio format. These format parameters can consist of any four-bit binary number. For example, the format parameter can be 0000 or 0100. It should be understood that in the embodiments of this application, different audio formats correspond to different format parameters; that is, the correspondence between audio formats and format parameters is unique.
[0034] It should be noted that electronic devices can have one or more applications installed, such as audio control software. The target application here can be selected by the user and can provide an interactive interface for the user to input the aforementioned audio format control commands.
[0035] Optionally, the audio signal involved in the embodiments of this application may have multiple audio formats, including at least Integrated Interchip Sound (IIS), Pulse Code Modulation (PCM), and Pulse Density Modulation (PDM). It should be understood that this application does not specifically limit the type of audio format.
[0036] Optionally, the audio format control command can be an AT command that includes a target format parameter. It should be understood that the AT command is merely an illustrative example of an audio format control command, and this application does not impose specific limitations on the command format of the audio format control command. For example, the audio format control command can be "AT+MAI2SY=0000". Another example is "AT+MAI2SY=0100".
[0037] Referring to the examples above, assuming the audio format control command is "AT+MAI2SY=0000", then the target format parameter is 0000, and the audio format of the audio signal can be I2S. Assuming the audio format control command is "AT+MAI2SY=0100", then the target format parameter is 0100, and the audio format of the audio signal can be PCM.
[0038] S102, extract target format parameters through the target application.
[0039] In some feasible implementations, the electronic device can extract the target format parameters contained in the audio format control instructions through the target application installed on the electronic device.
[0040] In one optional implementation, after the electronic device receives an audio format control command input by the user through a target application installed on the electronic device, the electronic device can analyze the received audio format control command according to a preset control command format using the target application, and determine the target format parameters contained in the audio control command. Furthermore, the electronic device can extract the target format parameters contained in the audio format control command using the target application.
[0041] It should be noted that the preset control command format is used to indicate the command form of at least one audio control command and the composition structure of each audio control command. For example, the preset control command format could be "AT+MAI2SY=target format parameter".
[0042] For example, suppose the audio format control command is AT+MAI2SY=0000. After receiving the user-input audio format control command AT+MAI2SY=0000 through the target application installed on the electronic device, the electronic device can analyze the audio format control command AT+MAI2SY=0000 according to the preset control command format "AT+MAI2SY=target format parameter" through the target application installed on the electronic device, and can determine that the target format parameter contained in the audio control command is 0000. Furthermore, the electronic device can extract the target format parameter 0000 contained in the audio format control command AT+MAI2SY=0000 through the target application installed on the electronic device.
[0043] S103 calls the audio format control interface provided by the kernel through the target application to pass the target format parameters to the modem in the kernel.
[0044] In some feasible implementations, the electronic device can call the audio format control interface provided by the kernel of the electronic device through the target application installed on the electronic device, so as to pass the extracted target format parameters to the modem in the kernel of the electronic device.
[0045] In one alternative implementation, the audio format control interface can be an audio low-level debugging tool control interface (such as the Tinymix control interface). In this embodiment, no specific limitations are placed on the audio format control interface.
[0046] In one alternative implementation, the electronic device can invoke the audio format control interface provided by the kernel of the electronic device through a target application installed on the electronic device, triggering the kernel to pass the target format parameters to the modem in the kernel of the electronic device through shared memory.
[0047] In practical implementation, after the electronic device calls the audio format control interface provided by the kernel of the electronic device through the target application installed on the electronic device, the electronic device, through the target application, can trigger the kernel of the electronic device to switch to the corresponding output format, enable the corresponding pin functions, and enable MCLK (MasterCLocK, master clock) according to the obtained target format parameters. Furthermore, the electronic device can pass the target format parameters to the modem in the kernel of the electronic device through shared memory.
[0048] S104 modifies the analog front-end audio parameters of the modem according to the target format parameters through the kernel, so that the audio format of the audio signal output by the modem is the target audio format.
[0049] In some feasible implementations, after receiving the target format parameters, the modem in the kernel of the electronic device can modify the analog front end (AFE) audio parameters of the modem in the kernel of the electronic device according to the received target format parameters, so that the audio format of the audio signal output by the modem in the kernel of the electronic device is the target audio format.
[0050] For example, suppose the target audio format is I2S, the target format parameter corresponding to I2S is 0000, and the corresponding AFE audio parameter is 0. After receiving the target format parameter 0000, the modem in the electronic device's kernel can determine that the AFE audio parameter corresponding to the target format parameter 0000 is 0. Furthermore, the electronic device can modify the AFE audio parameter of the modem in its kernel to 0 based on the received target format parameter 0000, so that the modem in the electronic device's kernel can output an audio signal in I2S format.
[0051] For example, suppose the target audio format is PCM, the target format parameter corresponding to PCM is 0100, and the corresponding AFE audio parameter is 1. After receiving the target format parameter 0100, the modem in the core of the electronic device can determine that the AFE audio parameter corresponding to the target format parameter 0100 is 1. Furthermore, the electronic device can modify the AFE audio parameter of the modem in its core to 1 based on the received target format parameter 0100, so that the modem in the core of the electronic device can output an audio signal in I2S format.
[0052] In one alternative implementation, after the electronic device modifies the AFE audio parameters of the modem according to the target format parameters through the kernel of the electronic device, the electronic device can output an audio signal with the audio format of the target audio format through the audio module of the electronic device.
[0053] In this embodiment, the electronic device can receive audio format control commands input by the user through a target application installed on the electronic device, and extract the target format parameters contained therein. Furthermore, the electronic device can pass the target format parameters to the modem in the kernel of the electronic device, and modify the AFE audio parameters of the modem according to the target format parameters, thereby ensuring that the audio signal output by the modem of the electronic device is in the target audio format. Through the above method, the electronic device can set the audio format of the audio signal according to the received audio format control commands, thereby achieving uniformity in the audio software version of the electronic device, reducing the maintenance cost of the audio software of the electronic device, and improving the user experience.
[0054] In one alternative implementation, please refer to Figure 2 , Figure 2 This is another flowchart illustrating an audio format control method provided in an embodiment of this application. For example... Figure 2 As shown, the method may include the following steps:
[0055] S105 loads the digital audio interfaces of at least two audio formats into the audio data link structure in the kernel via the kernel.
[0056] In some feasible implementations, the electronic device can mount the digital audio interfaces (DAIs) of at least two audio formats into the audio data link (dai_link) structure in the kernel of the electronic device through the kernel of the electronic device.
[0057] For example, an electronic device can mount both I2S and PCM digital audio interfaces (DAI) to the audio digital link (dai_link) structure through the kernel of the electronic device.
[0058] S106 modifies the audio structure and registration code in the kernel to make the kernel compatible with digital audio interfaces of at least two audio formats.
[0059] In some feasible implementations, after the electronic device mounts the Digital Audio Interface (DAI) of at least two audio formats into the audio data link structure in the kernel through the kernel, the electronic device can modify the audio structure in the kernel of the electronic device and the registration code to make the kernel of the electronic device compatible with the Digital Audio Interface (DAI) of at least two audio formats.
[0060] In one alternative implementation, after the electronic device mounts both I2S and PCM digital audio interfaces (DAI) to the audio digital link (dai_link) through the kernel, the electronic device can modify the audio structure and registration code through the kernel of the electronic device so that the kernel of the electronic device can be compatible with both I2S and PCM audio formats of the digital audio interface (DAI).
[0061] S107 registers the audio format control interface and sound card device through the kernel.
[0062] In some feasible implementations, electronic devices can register audio format control interfaces and sound card devices through the kernel of the electronic device.
[0063] It's important to note that a sound card is used to output audio signals in a target audio format. The sound card registration process is generally handled by the SOC (System on Chip) side. When adapting to a new codec, this process usually doesn't need to be modified. It's like a framework; the part open for user customization is the relevant Digital Audio Interface (DAI) node in the device tree.
[0064] Please see Figure 3 , Figure 3 This is a schematic diagram of the structure of an audio format control device provided in an embodiment of this application. Figure 3 As shown, the control device for this audio format may include: a receiving unit 31, an extraction unit 32, and a processing unit 33.
[0065] In a specific implementation, the receiving unit 31 is used to receive audio format control instructions input by the user through the loaded target application, wherein the audio format control instructions include target format parameters corresponding to the target audio format. The extraction unit 32 is used to extract the target format parameters through the target application. The processing unit 33 is used to call the audio format control interface provided by the kernel through the target application, so as to pass the target format parameters to the modem in the kernel. The processing unit 33 is used to modify the analog front-end audio parameters of the modem according to the target format parameters through the kernel, so that the audio signal output by the modem is in the target audio format.
[0066] In one alternative implementation, please refer to Figure 4 , Figure 4 This is another structural schematic diagram of an audio format control device provided in an embodiment of this application. For example... Figure 4 As shown, the control device for this audio format may further include: a registration unit 34; a processing unit 33, configured to mount the digital audio interfaces of each of at least two audio formats into the audio data link structure in the kernel via the kernel; the processing unit 33, configured to modify the audio structure and registration code in the kernel via the kernel to make the kernel compatible with the digital audio interfaces of at least two audio formats; and a registration unit 34, configured to register the audio format control interface and sound card device via the kernel.
[0067] In an alternative implementation, processing unit 33 is configured to trigger the kernel to pass target format parameters to the modem in the kernel via shared memory.
[0068] In one alternative implementation, the audio format includes at least the integrated circuit built-in audio bus I2S, pulse code modulation (PCM), and pulse density modulation (PDM).
[0069] In one alternative implementation, the audio format control command is an AT command that includes a target format parameter.
[0070] In one alternative implementation, the audio format control interface is an audio low-level debugging tool control interface.
[0071] Please see Figure 5 , Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. This electronic device can be used to implement the steps of the audio format control method performed by the electronic device as described in the above embodiments. The electronic device may include: a processor 51, a memory 52, and a bus system 53.
[0072] The memory 52 includes, but is not limited to, RAM, ROM, EPROM, or CD-ROM, and is used to store related instructions and data. The memory 52 stores executable modules or data structures, or subsets thereof, or extended sets thereof:
[0073] Operation instructions: This includes various operation instructions used to perform various operations.
[0074] Operating system: includes various system programs used to implement various basic business functions and handle hardware-based tasks.
[0075] Figure 5 Only one memory is shown in the image; of course, multiple memory can be configured as needed.
[0076] like Figure 5 As shown, the electronic device may further include an input / output device 54, which may be a communication module or a transceiver circuit. In this embodiment, the input / output device 54 is used to perform the transmission and reception process of data or signaling, such as the target audio format, involved in the embodiment.
[0077] Processor 51 may be a controller, CPU, general-purpose processor, DSP, ASIC, FPGA, or other programmable logic device, transistor logic device, hardware component, or any combination thereof. It may implement or execute the various exemplary logic blocks, modules, and circuits described in connection with the embodiments of this application. Processor 51 may also be a combination that implements computing functions, such as including one or more microprocessor combinations, a combination of DSP and microprocessor, etc.
[0078] In practical applications, the various components of an electronic device are coupled together through a bus system 53. This bus system 53 may include, in addition to a data bus, a power bus, a control bus, and a status signal bus. However, for clarity, in... Figure 5 The various buses are all labeled as Bus System 53. For ease of representation, in... Figure 5 The image shown is only schematic.
[0079] It should be noted that in practical applications, the processor in the embodiments of this application can be an integrated circuit chip with signal processing capabilities. During implementation, each step of the above method embodiments can be completed by integrated logic circuits in the processor's hardware or by instructions in software form. The processor described above can be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application.
[0080] It is understood that the memory in the embodiments of this application can be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. The non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. The volatile memory can be random access memory (RAM), which is used as an external cache. By way of example, but not limitation, many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous linked dynamic random access memory (SLDRAM), and direct rambus RAM (DR RAM). It should be noted that the memories described in the embodiments of this application are intended to include, but are not limited to, these and any other suitable types of memory.
[0081] This application also provides a computer-readable storage medium storing a computer program thereon, which, when executed by a computer, implements the methods or steps performed by the electronic device in the above embodiments.
[0082] This application also provides a computer program product that, when executed by a computer, implements the methods or steps performed by the electronic device described above.
[0083] It should be noted that, for the embodiments of the above-described audio format control methods, for the sake of simplicity, they are all described as a series of actions. However, those skilled in the art should understand that this application is not limited to the described order of actions, because according to this application, some steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also understand that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily essential to this application.
[0084] Although this application has been described herein in conjunction with various embodiments, those skilled in the art, by reviewing the accompanying drawings, the disclosure, and the appended claims, will understand and implement other variations of the disclosed embodiments in carrying out this application. In the claims, the word "comprising" does not exclude other components or steps, and "a" or "an" does not exclude multiple instances. While different dependent claims may recite certain measures, this does not imply that these measures cannot be combined to produce a good effect.
[0085] Those skilled in the art will understand that all or part of the steps in the various methods of the above-described audio format control method embodiments can be implemented by a program instructing related hardware. The program can be stored in a computer-readable storage device, which may include: flash drive, read-only memory (ROM), random access memory (RAM), disk or optical disk, etc.
[0086] The embodiments of this application have been described in detail above. Specific examples have been used to illustrate the principle and implementation of an audio format control method, device, and electronic device of this application. The descriptions of the embodiments above are intended to help understand the method and core ideas of this application. At the same time, for those skilled in the art, based on the ideas of an audio format control method, device, and electronic device of this application, there will be changes in the specific implementation and application scope. Therefore, the content of this specification should not be construed as a limitation of this application.
[0087] Those skilled in the art will recognize that, in one or more of the examples above, the functions described in this application can be implemented using hardware, software, firmware, or any combination thereof. When implemented in software, these functions can be stored in a computer-readable medium or transmitted as one or more instructions or codes on a computer-readable medium. Computer-readable media include computer storage media and communication media, wherein communication media include any medium that facilitates the transmission of a computer program from one place to another. Storage media can be any available medium accessible to a general-purpose or special-purpose computer.
[0088] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of this application. It should be understood that the above description is only a specific embodiment of this application and is not intended to limit the scope of protection of this application. Any modifications, equivalent substitutions, improvements, etc., made on the basis of the technical solution of this application should be included within the scope of protection of this application.
Claims
1. A method for controlling an audio format, characterized in that, The method includes: The kernel mounts the digital audio interfaces of at least two audio formats to the audio data link structure in the kernel. The kernel is modified by altering the audio structure and registration code within it to make the kernel compatible with the digital audio interfaces of at least two audio formats. The kernel registers the audio format control interface and the sound card device. The target application receives audio format control instructions input by the user, wherein the audio format control instructions include target format parameters corresponding to the target audio format; Extract the target format parameters through the target application; The target application calls the audio format control interface provided by the kernel to pass the target format parameters to the modem in the kernel. The kernel modulates the analog front-end audio parameters of the modem according to the target format parameters, so that the audio format of the audio signal output by the modem is the target audio format.
2. The method according to claim 1, characterized in that, The step of passing the target format parameters to the modem in the kernel through the kernel includes: The kernel is triggered to pass the target format parameters to the modem in the kernel via shared memory.
3. The method according to claim 1 or 2, characterized in that, Audio formats include at least the integrated circuit built-in audio bus I2S, pulse code modulation (PCM), and pulse density modulation (PDM).
4. The method according to claim 1 or 2, characterized in that, The audio format control command is an AT command that includes the target format parameter.
5. The method according to claim 1 or 2, characterized in that, The audio format control interface is the control interface for low-level audio debugging tools.
6. An audio format control device, characterized in that, The device includes: A processing unit is used to mount the digital audio interfaces of at least two audio formats to the audio data link structure in the kernel via the kernel; The processing unit is used to modify the audio structure and registration code in the kernel so that the kernel is compatible with the digital audio interfaces of the at least two audio formats. A registration unit is used to register the audio format control interface and sound card device through the kernel. The receiving unit is configured to receive audio format control instructions input by the user through the loaded target application, wherein the audio format control instructions include target format parameters corresponding to the target audio format; Extraction unit, used to extract the target format parameters through the target application; The processing unit is configured to call the audio format control interface provided by the kernel through the target application, so as to pass the target format parameters to the modem in the kernel through the kernel; The processing unit is configured to modify the analog front-end audio parameters of the modem according to the target format parameters through the kernel, so that the audio signal output by the modem is in the target audio format.
7. A computer-readable storage medium, characterized in that, Used to store a computer program, which, when executed by a processor, implements the steps of the method according to any one of claims 1 to 5.
8. An electronic device, characterized in that, It includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the steps of the method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Electronic device and audio playing method
CN104007977A
Audio hardware parameter setting method and related equipment
CN111679805A