Audio output method and device, electronic device, and computer-readable storage medium

By dynamically adjusting the amplification factor of the analog power amplifier based on the amplitude of the audio signal, the problem of existing audio output devices being unable to adjust the amplification factor according to the signal amplitude is solved, thereby optimizing audio loudness and clarity and improving the user experience.

CN122395522APending Publication Date: 2026-07-14LENOVO (BEIJING) LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
LENOVO (BEIJING) LTD
Filing Date
2026-02-28
Publication Date
2026-07-14

AI Technical Summary

Technical Problem

Existing audio output devices based on analog power amplifiers and speaker combinations cannot dynamically adjust the amplification factor according to the amplitude of the audio signal, resulting in insufficient loudness of low-amplitude signals and easy distortion of high-amplitude signals, leading to a poor user experience.

Method used

By acquiring the signal amplitude of the audio to be output, the amplification factor of the analog power amplifier is dynamically adjusted. The target amplification factor is determined based on the mapping relationship between signal amplitude and amplification factor, and the amplification factor of the analog power amplifier is adjusted by controlling the signal state.

Benefits of technology

Optimize audio output, improve loudness and clarity, avoid distortion, and enhance user experience without increasing the rated power of the audio output device.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122395522A_ABST
    Figure CN122395522A_ABST
Patent Text Reader

Abstract

The application discloses an audio output method and device, electronic equipment and a computer readable storage medium. The audio output method comprises the following steps: in response to obtaining audio to be output, determining a signal amplitude corresponding to the audio to be output; based on the signal amplitude, determining a target amplification multiple of an analog power amplifier; adjusting the amplification multiple of the analog power amplifier to the target amplification multiple, so that the analog power amplifier amplifies the audio to be output at the target amplification multiple and outputs the audio to an audio output device.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of audio output technology, and in particular to an audio output method, apparatus, electronic device and computer-readable storage medium. Background Technology

[0002] Current electronic devices that output audio based on a combination of analog power amplifiers and speakers all set the amplification factor of the analog power amplifier based on the power of the speaker. Therefore, for a speaker with a fixed power, the amplification factor is uniform regardless of the audio signal, which cannot further enhance the loudness and sound field of the audio, resulting in a poor user experience. Summary of the Invention

[0003] In view of the above, embodiments of this application provide an audio output method, apparatus, electronic device, and computer-readable storage medium.

[0004] According to a first aspect of this application, embodiments of this application provide an audio output method, including:

[0005] In response to acquiring the audio to be output, determine the signal amplitude corresponding to the audio to be output; Determine the target amplification factor of the analog power amplifier based on the signal amplitude; Adjust the amplification factor of the analog power amplifier to the target amplification factor so that the analog power amplifier amplifies the audio to be output at the target amplification factor and outputs it to the audio output device.

[0006] Optionally, the target amplification factor of the analog power amplifier is determined based on the signal amplitude, including: Based on the signal amplitude and the mapping relationship between signal amplitude and amplification factor, the target amplification factor of the analog power amplifier is determined.

[0007] Optionally, the target amplification factor of the analog power amplifier is determined based on the signal amplitude, including: If the signal amplitude is greater than or equal to the signal amplitude threshold, the target amplification factor of the analog power amplifier is determined to be the first amplification factor; If the signal amplitude is less than the signal amplitude threshold, the target amplification factor of the analog power amplifier is determined to be the second amplification factor; the second amplification factor is greater than the first amplification factor.

[0008] Optionally, the amplification factor of the analog power amplifier is adjusted to the target amplification factor, including: Determine the control signal state corresponding to the amplification factor of the analog power amplifier when it reaches the target amplification factor; The control signal of the analog power amplifier is adjusted based on the state of the control signal, with the target amplification factor being adjusted to the amplification factor of the analog power amplifier.

[0009] Optionally, the control signal of the analog power amplifier is adjusted based on the control signal state, including: If the control signal state is the first state, the audio codec continues to input the first signal to the control switch to turn on the control switch, and the control signal of the analog power amplifier is adjusted to the first state; the first state indicates that the target amplification factor is the first amplification factor; the control switch is set on the input channel of the control signal of the analog power amplifier; If the control signal state is the second state, the audio codec inputs the second signal to the control switch to make the control switch open, and the control signal of the analog power amplifier is adjusted to the second state; the second state indicates that the target amplification factor is the second amplification factor; the second amplification factor is greater than the first amplification factor.

[0010] Optionally, before determining the signal amplitude corresponding to the audio to be output, the audio output method further includes: Determine the status of the audio driver; Accordingly, the signal amplitude corresponding to the audio to be output is determined, including: If the state of the audio driver indicates that the audio driver exists, the signal amplitude corresponding to the audio to be output is determined through the audio driver.

[0011] Optionally, the audio output method also includes: If the audio driver's status indicates that the audio driver does not exist, the audio codec continues to input the first signal to the control switch.

[0012] According to a second aspect of this application, embodiments of this application provide an audio output device, including: The first determining module is used to determine the signal amplitude corresponding to the audio to be output in response to acquiring the audio to be output. The second determining module is used to determine the target amplification factor of the analog power amplifier based on the signal amplitude. The control module is used to adjust the amplification factor of the analog power amplifier to the target amplification factor, so that the analog power amplifier amplifies the audio to be output at the target amplification factor and outputs it to the audio output device.

[0013] According to a third aspect of this application, embodiments of this application provide an electronic device, including: Analog power amplifiers, audio output devices, and processors; The processor is used to perform the following actions in response to acquiring the audio to be output: determining the signal amplitude corresponding to the audio to be output; determining the target amplification factor of the analog power amplifier based on the signal amplitude; and adjusting the amplification factor of the analog power amplifier to the target amplification factor so that the analog power amplifier amplifies the audio to be output at the target amplification factor and outputs it to the audio output device.

[0014] According to a fourth aspect of this application, embodiments of this application provide a computer-readable storage medium storing computer instructions. The computer instructions are used to cause a computer to perform actions in response to acquiring an audio to be output, determining the signal amplitude corresponding to the audio to be output, determining a target amplification factor of an analog power amplifier based on the signal amplitude, and adjusting the amplification factor of the analog power amplifier to the target amplification factor, so that the analog power amplifier amplifies the audio to be output at the target amplification factor and outputs it to an audio output device.

[0015] The above description is only an overview of the technical solution of this application. In order to better understand the technical means of this application and to implement it in accordance with the contents of the specification, and to make the above and other objects, features and advantages of this application more obvious and understandable, the following are specific embodiments of this application. Attached Figure Description

[0016] Figure 1 This is a flowchart illustrating an audio output method according to an embodiment of this application; Figure 2 This is a schematic diagram of the hardware architecture for adjusting the amplification factor of the analog power amplifier in an embodiment of this application. Figure 3 This is a schematic diagram of the structure of an audio output device according to an embodiment of this application; Figure 4 This is a schematic diagram of the hardware structure of an electronic device according to an embodiment of this application; Figure 5 This is a schematic diagram of the hardware structure of another electronic device in an embodiment of this application. Detailed Implementation

[0017] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, 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, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0018] In traditional audio output systems, the amplification factor of analog amplifiers is fixed based on the rated power of the audio output device, resulting in all input audio signals being amplified uniformly. This setting cannot dynamically adjust the amplification factor according to the signal amplitude, leading to poor amplification of small-amplitude signals. For example, in multimedia applications on personal computers, the audio output device uses a 3W rated power speaker, and the analog amplifier is configured with a fixed 20dB amplification factor (gain0, gain1:00). When playing background music containing low amplitude, the amplified low-amplitude signal remains weak, sound details are not clearly presented, and the soundstage expansion is insufficient.

[0019] In response, this application proposes an audio output method aimed at optimizing audio output quality, such as... Figure 1 As shown, the audio output methods include: S101, in response to acquiring the audio to be output, determine the signal amplitude corresponding to the audio to be output.

[0020] In this embodiment, the audio to be output refers to the raw audio data or signal waiting to be processed and played. The audio can be in digital or analog format, and its content can be music, speech, or any other sound information.

[0021] In this embodiment, signal amplitude refers to the instantaneous intensity or level of the audio signal. In the digital domain, it is typically expressed as a range of sampled values; in the analog domain, it is expressed as the peak value of voltage or current. The magnitude of the signal amplitude directly affects the loudness of the sound.

[0022] In practical applications, acquiring the audio to be output can be achieved by reading audio files from storage media, receiving streaming media data, or capturing microphone input. Once the audio to be output is acquired, its signal amplitude can be determined in several ways. For example, the audio signal can be sampled in real time, and its instantaneous peak level or root mean square value can be calculated to characterize its signal amplitude. Another approach is to indirectly infer the signal amplitude by monitoring the maximum value of the digital audio data at a fixed point in the audio signal processing chain, such as before the digital-to-analog converter (DAC). Furthermore, the overall signal amplitude can also be estimated by performing spectral analysis on the audio signal and based on the energy distribution within a specific frequency range.

[0023] S102, based on the signal amplitude, determine the target amplification factor of the analog power amplifier.

[0024] In this embodiment, an analog power amplifier refers to an electronic device used to amplify analog audio signals. Its main function is to convert small-amplitude input audio signals into signals with sufficient power to drive speakers or other audio output devices to produce sound. The amplification factor of an analog power amplifier is one of its key parameters, determining the degree to which the signal is amplified.

[0025] In this embodiment, the target amplification factor refers to the desired amplification ratio set for the analog power amplifier based on specific conditions or needs. This target amplification factor can be dynamically adjusted according to the characteristics of the input audio signal, the requirements of the output device, or user preferences to optimize the audio output effect.

[0026] In this embodiment, various strategies can be employed to determine the target amplification factor. For example, one or more fixed amplification factors can be preset, and one of these preset values ​​can be selected as the target amplification factor based on the currently determined signal amplitude. Specifically, a default amplification factor can be set, which is used when the signal amplitude is within a certain normal range. When the signal amplitude exceeds this normal range, a more suitable amplification factor can be selected according to preset rules. Alternatively, the target amplification factor can be determined by consulting a simple table that lists the correspondence between different signal amplitude ranges and corresponding amplification factors.

[0027] S103, adjust the amplification factor of the analog power amplifier to the target amplification factor, so that the analog power amplifier amplifies the audio to be output at the target amplification factor and outputs it to the audio output device.

[0028] In this embodiment, an audio output device refers to a hardware device capable of converting electrical signals into audible sound, such as a speaker, headphones, or audio system. This device receives amplified signals from an analog power amplifier and converts them into sound waves for the user to perceive.

[0029] In this embodiment, the amplification factor of the analog power amplifier can be adjusted in several ways. For example, in some integrated circuit designs of analog power amplifiers, the amplification factor can be adjusted by changing the combination of external resistors or capacitors. Alternatively, the amplification factor can be changed linearly or non-linearly by inputting a specific analog voltage signal to the control pins of the analog power amplifier. After adjustment, the analog power amplifier will amplify the input audio signal to be output at the set target amplification factor and transmit the amplified signal to audio output devices such as speakers or headphones, ultimately producing audible sound.

[0030] The following example will provide a more detailed explanation of the above technical solution: Suppose that user A is playing music in an electronic device. This electronic device is equipped with an analog amplifier and audio output devices (such as speakers). During playback, the electronic device first acquires the audio data to be output. This audio data is then sent to a signal processing unit. The signal processing unit analyzes the audio data, for example, by calculating its root mean square (RMS) value within a specific time window, thereby determining the signal amplitude corresponding to the audio data.

[0031] For example, the signal processing unit determines that the signal amplitude of the current music clip is at a medium level. Based on this determined signal amplitude, the electronic device needs to determine the target amplification factor of the analog power amplifier. In this example, the electronic device internally has a simple pre-set logic: if the signal amplitude is medium, the target amplification factor is set to a standard value (e.g., amplification factor corresponding to 3W output power); if the signal amplitude is low, the target amplification factor is set to a higher value (e.g., amplification factor corresponding to 6W output power); if the signal amplitude is high, the target amplification factor is set to a lower value (e.g., amplification factor corresponding to 1.5W output power). In this example, since the signal amplitude is determined to be medium, the target amplification factor of the analog power amplifier is determined to be the standard value.

[0032] Subsequently, the electronic device adjusts the amplification factor of the analog power amplifier to the standard target amplification factor. This adjustment process can be achieved by applying a specific voltage to the gain control pin of the analog power amplifier. For example, the microcontroller in the electronic device outputs a digital signal, which is converted into an analog voltage by a digital-to-analog converter. This analog voltage is applied to the gain control pin of the analog power amplifier, thereby setting the amplification factor of the analog power amplifier to the standard value. Once the amplification factor of the analog power amplifier is adjusted, the analog power amplifier amplifies the audio to be output at the standard amplification factor. The amplified audio signal is transmitted to the speaker, which converts the electrical signal into sound waves, allowing user A to hear clear and moderately loud music.

[0033] Through the above process, this method dynamically adjusts the amplification factor of the analog power amplifier based on the amplitude of the audio signal to be output. When the audio signal amplitude is low, a higher amplification factor can be set to enhance the loudness and detail of the sound; when the audio signal amplitude is high, a lower amplification factor can be set to avoid overload and protect the speaker.

[0034] The audio output method provided in this embodiment introduces a series of steps, including determining the "signal amplitude corresponding to the audio to be output," "determining the target amplification factor of the analog power amplifier based on the signal amplitude," and then "adjusting the amplification factor of the analog power amplifier to the target amplification factor." Without increasing the rated power of the audio output device, the amplification factor of the analog power amplifier can be dynamically adjusted according to the real-time characteristics of the audio signal, which can optimize the audio output effect and ensure the safe operation of the audio output device. This effectively solves the problems of insufficient sound performance and equipment damage risk caused by uniform amplification factor in the prior art, and can improve the user experience.

[0035] In an optional embodiment, this application further proposes step S102, which determines the target amplification factor of the analog power amplifier based on the signal amplitude, including: determining the target amplification factor of the analog power amplifier based on the signal amplitude and the mapping relationship between the signal amplitude and the amplification factor.

[0036] The mapping relationship between signal amplitude and amplification factor refers to a pre-established data structure or algorithm that describes the correspondence between the signal amplitude of the audio to be output and the target amplification factor required by the analog power amplifier. This mapping relationship can be a pre-defined lookup table storing a series of signal amplitude values ​​and their corresponding amplification factors. When the signal amplitude of the audio to be output is obtained, the system can directly retrieve the corresponding target amplification factor by querying this lookup table. Alternatively, this mapping relationship can be a mathematical function or algorithm that takes the signal amplitude as input and calculates the corresponding amplification factor. For example, it can be a piecewise linear function, logarithmic function, or polynomial function used to describe the dynamic relationship between signal amplitude and amplification factor. The existence of this mapping relationship allows the system to accurately and efficiently determine the target amplification factor of the analog power amplifier based on the real-time signal amplitude of the audio to be output, thereby optimizing the dynamic range and sound quality of the audio output.

[0037] By utilizing the above technical solution, the target amplification factor of the analog power amplifier is determined by the mapping relationship between signal amplitude and amplification factor, ensuring the accuracy and efficiency of the target amplification factor determination. This optimizes the dynamic range and sound quality of the audio output, avoids distortion or insufficient volume caused by improper amplification factor setting, and improves the user experience.

[0038] In an optional embodiment, this application further proposes step S102, which determines the target amplification factor of the analog power amplifier based on the signal amplitude, including: if the signal amplitude is greater than or equal to a signal amplitude threshold, determining the target amplification factor of the analog power amplifier as a first amplification factor; if the signal amplitude is less than the signal amplitude threshold, determining the target amplification factor of the analog power amplifier as a second amplification factor; the second amplification factor is greater than the first amplification factor.

[0039] The signal amplitude threshold is a preset value used to distinguish different signal amplitude ranges. This threshold can be a fixed value, for example, set as a specific decibel value (e.g., -30dBFS) or digital quantization value based on the audio device's hardware specifications, speaker characteristics, or the user's listening habits. Alternatively, the threshold can be dynamically adjustable, for example, calculated or adjusted in real-time using an adaptive algorithm based on ambient noise levels, the user's current volume setting, or the dynamic range of the audio content, to better adapt to different usage scenarios. The first amplification factor refers to the amplification factor used when the signal amplitude is high (i.e., greater than or equal to the signal amplitude threshold). This first amplification factor is usually a relatively small value, designed to ensure that high-amplitude signals achieve sufficient loudness after amplification while avoiding overload distortion and helping to reduce power consumption. The second amplification factor refers to the amplification factor used when the signal amplitude is low (i.e., less than the signal amplitude threshold). This second amplification factor is set greater than the first amplification factor, with the aim of amplifying low-amplitude signals more significantly, thereby improving the listening experience at low volumes and making audio details clearer.

[0040] The following is a concrete example. As a specific implementation, assume that in the audio processing unit, the signal amplitude threshold is set to -30 dBFS (decibels relative to full scale), the first amplification factor is set to 10x, and the second amplification factor is set to 20x. When the system acquires an audio segment to be output and detects its signal amplitude as -25 dBFS, since -25 dBFS is greater than or equal to -30 dBFS, the system will determine the target amplification factor of the analog power amplifier to be the first amplification factor, i.e., 10x. If the system acquires another audio segment to be output and detects its signal amplitude as -40 dBFS, since -40 dBFS is less than -30 dBFS, the system will determine the target amplification factor of the analog power amplifier to be the second amplification factor, i.e., 20x. Subsequently, the analog power amplifier will operate according to the determined target amplification factor.

[0041] Through the above technical solution, this application can intelligently select an appropriate amplification factor based on the actual amplitude of the audio signal to be output. This segmented amplification strategy effectively solves the problems of insufficient volume for low-amplitude signals and easy distortion for high-amplitude signals under a single amplification strategy. Specifically, when the signal amplitude is low, using a larger second amplification factor can significantly improve the loudness and clarity of the audio, allowing users to better perceive subtle audio details; while when the signal amplitude is high, using a smaller first amplification factor can effectively avoid audio overload and distortion, while reducing unnecessary power consumption. Therefore, the solution of this application can provide a more balanced, clearer audio output experience with better dynamic range, significantly improving the quality of audio output and user satisfaction.

[0042] In an optional embodiment, this application further proposes step S103, adjusting the amplification factor of the analog power amplifier to the target amplification factor, including: S1031, Determine the control signal state corresponding to the amplification factor of the analog power amplifier when it reaches the target amplification factor.

[0043] S1032 adjusts the control signal of the analog power amplifier based on the control signal status, with the target amplification factor being the adjusted amplification factor of the analog power amplifier.

[0044] Specifically, determining the control signal state corresponding to the target amplification factor of the analog power amplifier refers to specifying the particular signal mode or value that the internal or external control circuit of the analog power amplifier expects to receive, given the target amplification factor, so that the analog power amplifier can achieve that target amplification factor. This control signal state can be digital encoding, analog voltage level, duty cycle of a pulse width modulation (PWM) signal, or a command word sent through a specific protocol.

[0045] Adjusting the control signal of an analog power amplifier based on its control signal state refers to actually changing the signal applied to the control input of the analog power amplifier according to the control signal state determined in the previous step. This adjustment can be achieved in several ways. For example, if the control signal state is an analog voltage level, a corresponding voltage can be output through a digital-to-analog converter (DAC); if the control signal state is a digital code, the code can be sent directly to the digital control interface of the analog power amplifier through a microcontroller or application-specific integrated circuit (ASIC); if the control signal state involves switching operations, it can be achieved by controlling the on / off state of switching elements such as relays or transistors. The purpose of these adjustments is to ensure that the actual amplification factor of the analog power amplifier accurately reaches the predetermined target amplification factor.

[0046] Through the above technical solution, this application provides a specific and operable analog power amplifier gain adjustment mechanism. This mechanism can transform an abstract target gain into a control signal state that the analog power amplifier can recognize and execute, and based on this, precisely adjust the control signal of the analog power amplifier. This makes the gain setting of the analog power amplifier more accurate and controllable, thereby effectively avoiding audio distortion or power waste caused by improper gain settings. Simultaneously, through this refined control, the system can dynamically adjust the gain according to the signal amplitude of the audio to be output, thereby optimizing the system's power efficiency and dynamic range performance while ensuring audio output quality.

[0047] In an optional embodiment, this application further proposes step S1032, which involves adjusting the control signal of the analog power amplifier based on the control signal state, including: if the control signal state is a first state, then the audio codec continues to input a first signal to the control switch to turn on the control switch, thereby adjusting the control signal of the analog power amplifier to the first state; the first state represents a target amplification factor of a first amplification factor; the control switch is set on the input channel of the control signal of the analog power amplifier. If the control signal state is a second state, then the audio codec is controlled to input a second signal to the control switch to turn off the control switch, thereby adjusting the control signal of the analog power amplifier to the second state; the second state represents a target amplification factor of a second amplification factor; the second amplification factor is greater than the first amplification factor.

[0048] The control signal state indicates the control logic state corresponding to the required amplification factor of the analog power amplifier. This state can be represented by a high or low level of a digital signal, different ranges of analog voltage, or specific encoded instructions. For example, the first state may correspond to a low level or a specific voltage range, while the second state may correspond to a high level or another voltage range. The audio codec can be a standalone audio codec chip or an audio processing unit integrated within the main control chip. The control switch can be implemented using transistors (such as MOSFETs or BJTs), relays, or analog switch integrated circuits; its function is to selectively turn on or off the input channel of the analog power amplifier control signal according to the signal input to the audio codec, thereby changing the control signal of the analog power amplifier.

[0049] The first signal can be a level or pulse that turns the control switch on, such as a high or low level. The second signal can be a level or pulse that turns the control switch off, such as a level opposite to the first signal. Adjusting the analog amplifier's control signal to either the first or second state refers to the input signal received by the analog amplifier to set its amplification factor. When the control switch is turned on or off, it changes the level or state on the analog amplifier's control signal input channel, thus changing the amplification factor of the analog amplifier. The first amplification factor and the second amplification factor are two different amplification factors that an analog amplifier can achieve. The first amplification factor is typically used for higher signal amplitudes, while the second amplification factor (greater than the first amplification factor) is used for lower signal amplitudes to accommodate different audio output requirements.

[0050] The following is a concrete example to illustrate this. Suppose in a certain implementation scenario, such as... Figure 2As shown, the general purpose input / output pins of the audio codec default to outputting a low level to turn on the control switch MOSFET, thereby adjusting the state of the analog power amplifier's gain control pins (gain0, gain1), i.e., the control signal state, to the first state (gain0, gain1:00), making the analog power amplifier's amplification factor 20dB (gain0, gain1:00). When the audio driver detects that the amplitude of the audio signal to be output is high and requires a first amplification factor of 20dB, the processor determines that the control signal state of the analog power amplifier is in the first state. At this time, the audio codec maintains a low-level first signal output to the gate of the MOSFET. This low-level signal continues to turn on the MOSFET, keeping the analog power amplifier's amplification factor at 20dB, at which point the analog power amplifier outputs a 3W audio signal. When the audio driver detects that the amplitude of the audio signal to be output is low and requires a second amplification factor of 26dB, the processor determines that the control signal state of the analog power amplifier is in the second state. At this time, the audio codec outputs a high-level second signal to the gate of the MOSFET. The high-level signal causes the MOSFET to turn off, which adjusts the control signal of the analog power amplifier to the second state (gain0, gain1:10), thereby achieving a 26dB amplification factor. At this time, the analog power amplifier outputs a 6W audio signal.

[0051] Through the above technical solution, this application provides an efficient and accurate analog power amplifier gain adjustment mechanism. By introducing an audio codec and control switches, discrete management of the analog power amplifier control signals is achieved, enabling the analog power amplifier to quickly and stably switch between preset first and second gain values. This control method simplifies the gain adjustment circuit design of the analog power amplifier, reduces the complexity of the control system, and improves the response speed and accuracy of gain adjustment. Especially in scenarios where it is necessary to quickly adapt to different output power requirements based on the dynamic range of the audio signal, this solution can effectively optimize the sound quality and power consumption of the audio output, thereby improving the user experience.

[0052] In an optional embodiment, this application further proposes to include determining the state of the audio driver before determining the signal amplitude corresponding to the audio to be output; accordingly, determining the signal amplitude corresponding to the audio to be output includes: if the state of the audio driver indicates that the audio driver exists, determining the signal amplitude corresponding to the audio to be output through the audio driver.

[0053] In this embodiment, the amplification factor of the analog power amplifier can be adjusted via the audio driver. Determining the status of the audio driver refers to detecting whether the software component is running normally, loaded, and available. This can be achieved in various ways. For example, the system can query the operating system's device manager or audio service to obtain the current operating status information of the audio driver; or, the system can attempt to communicate with the audio driver by sending heartbeat signals or test data packets and determine its activity status based on whether a valid response is received. When the audio driver is determined to exist and be normal, the system can rely on the driver to accurately obtain the signal amplitude of the audio to be output. This can include, but is not limited to, the following: the audio driver can provide an application programming interface (API) that allows upper-layer applications to query the peak amplitude, root mean square (RMS) amplitude, or instantaneous amplitude of the current audio stream; or, the audio driver may integrate a digital signal processor (DSP) module, which or the control software can analyze the audio data stream in real time and calculate its signal amplitude information. The audio driver can then compare the signal amplitude with a signal amplitude threshold. If the amplitude of the output audio signal is less than the signal amplitude threshold, the audio driver can control the audio codec to output a high level to the controllable switch, causing the controllable switch to open and the amplification factor of the analog power amplifier to be the second amplification factor. If the amplitude of the output audio signal is greater than or equal to the signal amplitude threshold, the audio driver can control the audio codec to output a low level to the controllable switch, causing the controllable switch to close and the amplification factor of the analog power amplifier to be the first amplification factor.

[0054] Through the above technical solution, the system can effectively determine the availability of the audio driver before determining the signal amplitude of the audio to be output. This avoids erroneous or inaccurate amplitude values ​​caused by the system still attempting to obtain the signal amplitude when the audio driver is abnormal or absent, thus ensuring that the determined signal amplitude is reliable and valid. Based on this reliable signal amplitude, the target amplification factor of the analog power amplifier can be determined more accurately, thereby enabling the analog power amplifier to amplify the audio at a more appropriate amplification factor, significantly improving the stability and sound quality of the audio output, and avoiding audio distortion or silent output caused by driver problems.

[0055] In an optional embodiment, this application further proposes that if the state of the audio driver indicates that the audio driver does not exist, the audio codec should continue to input a first signal to the control switch.

[0056] When an audio driver is missing, it can be understood that the system has failed to detect or load the corresponding audio driver, or that the audio driver is disabled, corrupted, or not installed. Methods for determining the existence of an audio driver can include: during system startup, querying the operating system or hardware management module to check the loading status of the audio driver or the availability of audio devices in the Device Manager; or during audio playback, attempting to call the API provided by the audio driver; if the call fails or returns a specific error code, it is determined that the audio driver is missing; or checking specific hardware registers or interrupt signals to determine whether the audio hardware has been correctly initialized and driven.

[0057] A control switch, such as a transistor, relay, or control logic gate integrated within the analog power amplifier, is used to change its on or off state based on a received control signal. This control switch is located on the input channel of the analog power amplifier's control signal, and its state affects the amplifier's amplification factor. When the control switch receives a first signal, it turns on, thus adjusting the analog power amplifier's control signal to a first state, which indicates that the target amplification factor of the analog power amplifier is a first amplification factor. Maintaining the audio codec's input of the first signal to the control switch ensures that, even when the audio driver is unavailable, the system actively maintains the audio codec's output of a specific control signal to ensure the control switch is in a preset on state, thereby fixing the analog power amplifier's amplification factor at a preset first amplification factor. In this way, even when the audio driver is unavailable, the analog power amplifier's amplification factor can be stably set to a known and relatively safe fixed value (the first amplification factor), preventing damage to the audio output device.

[0058] Through the above technical solution, when the audio driver's status indicates its absence, the system can actively maintain the audio codec inputting a first signal to the control switch, thereby stably setting the amplification factor of the analog power amplifier to a preset first amplification factor. This effectively solves the problem that the amplitude of the output audio signal cannot be obtained when the audio driver is missing, thus preventing the analog power amplifier's amplification factor from being dynamically adjusted. This solution ensures that even in incomplete or abnormal system environments, the audio output function can still operate with a safe and stable preset gain, avoiding adverse consequences such as audio distortion, equipment damage, or no sound output that may be caused by uncontrolled amplification factor, significantly improving the robustness of the audio output system and the user experience.

[0059] This application also provides an audio output device, such as... Figure 3 As shown, it includes: The first determining module 31 is used to determine the signal amplitude corresponding to the audio to be output in response to acquiring the audio to be output.

[0060] The second determining module 32 is used to determine the target amplification factor of the analog power amplifier based on the signal amplitude.

[0061] The control module 33 is used to adjust the amplification factor of the analog power amplifier to the target amplification factor, so that the analog power amplifier amplifies the audio to be output at the target amplification factor and outputs it to the audio output device.

[0062] The audio output device provided in this embodiment introduces a series of steps, including determining the "signal amplitude corresponding to the audio to be output," "determining the target amplification factor of the analog power amplifier based on the signal amplitude," and then "adjusting the amplification factor of the analog power amplifier to the target amplification factor." Without increasing the rated power of the audio output device, the amplification factor of the analog power amplifier can be dynamically adjusted according to the real-time characteristics of the audio signal, which can optimize the audio output effect and ensure the safe operation of the audio output device. This effectively solves the problems of insufficient sound performance and equipment damage risk caused by uniform amplification factor in the prior art, and improves the user experience.

[0063] This application also provides an electronic device, such as... Figure 4 As shown, it includes: Analog power amplifiers, audio output devices, and processors; The processor is used to perform the following actions in response to acquiring the audio to be output: determining the signal amplitude corresponding to the audio to be output; determining the target amplification factor of the analog power amplifier based on the signal amplitude; and adjusting the amplification factor of the analog power amplifier to the target amplification factor so that the analog power amplifier amplifies the audio to be output at the target amplification factor and outputs it to the audio output device.

[0064] Figure 5 A schematic block diagram of an example electronic device 800 that can be used to implement embodiments of this application is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the application described and / or claimed herein.

[0065] like Figure 5As shown, the electronic device 800 includes a computing unit 801, which can perform various appropriate actions and processes based on a computer program stored in a read-only memory (ROM) 802 or a computer program loaded from a storage unit 808 into a random access memory (RAM) 803. The RAM 803 may also store various programs and data required for the operation of the electronic device 800. The computing unit 801, ROM 802, and RAM 803 are interconnected via a bus 804. An input / output (I / O) interface 805 is also connected to the bus 804.

[0066] Multiple components in electronic device 800 are connected to I / O interface 805, including: input unit 806, such as keyboard, mouse, etc.; output unit 807, such as various types of monitors, speakers, analog amplifiers, audio output devices, etc.; storage unit 808, such as disk, optical disk, etc.; and communication unit 809, such as network card, modem, wireless transceiver, etc. Communication unit 809 allows electronic device 800 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.

[0067] The computing unit 801 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 801 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 801 performs the various methods and processes described above, such as the audio output method. For example, in some embodiments, the audio output method may be implemented as a computer software program tangibly contained in a computer-readable storage medium, such as storage unit 808. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 800 via ROM 802 and / or communication unit 809. When the computer program is loaded into RAM 803 and executed by the computing unit 801, one or more steps of the audio output method described above may be performed. Alternatively, in other embodiments, the computing unit 801 may be configured to perform the audio output method by any other suitable means (e.g., by means of firmware).

[0068] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), system-on-a-chip (SoCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transferring data and instructions to the storage system, the at least one input device, and the at least one output device.

[0069] The program code used to implement the methods of this application may be written in any combination of one or more programming languages. This program code may be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable data processing device, such that when executed by the processor or controller, the functions / operations specified in the flowcharts and / or block diagrams are implemented. The program code may be executed entirely on a machine, partially on a machine, as a standalone software package partially on a machine and partially on a remote machine, or entirely on a remote machine or server.

[0070] According to embodiments of this application, this application also provides a computer-readable storage medium.

[0071] In the context of this application, a computer-readable storage medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable storage medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of computer-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0072] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device for displaying information to the user (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor); and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the computer. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).

[0073] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as a data server), or computing systems that include middleware components (e.g., an application server), or computing systems that include frontend components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., a communication network). Examples of communication networks include local area networks (LANs), wide area networks (WANs), and the Internet.

[0074] Computer systems can include clients and servers. Clients and servers are generally located far apart and typically interact via communication networks. Client-server relationships are created by computer programs running on the respective computers and having a client-server relationship with each other. Servers can be cloud servers, servers in distributed systems, or servers incorporating blockchain technology.

[0075] It should be understood that the various forms of processes shown above can be used to rearrange, add, or delete steps. For example, the steps described in this application can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution disclosed in this application can be achieved, and this is not limited herein.

[0076] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. In the description of this application, "a plurality of" means two or more, unless otherwise explicitly specified.

[0077] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. An audio output method, comprising: In response to acquiring the audio to be output, the signal amplitude corresponding to the audio to be output is determined; Based on the signal amplitude, determine the target amplification factor of the analog power amplifier; The amplification factor of the analog power amplifier is adjusted to the target amplification factor, so that the analog power amplifier amplifies the audio to be output at the target amplification factor and outputs it to the audio output device.

2. The audio output method according to claim 1, wherein determining the target amplification factor of the analog power amplifier based on the signal amplitude includes: Based on the signal amplitude and the mapping relationship between signal amplitude and amplification factor, the target amplification factor of the analog power amplifier is determined.

3. The audio output method according to claim 1, wherein determining the target amplification factor of the analog power amplifier based on the signal amplitude includes: If the signal amplitude is greater than or equal to the signal amplitude threshold, the target amplification factor of the analog power amplifier is determined to be the first amplification factor; If the signal amplitude is less than the signal amplitude threshold, the target amplification factor of the analog power amplifier is determined to be the second amplification factor; the second amplification factor is greater than the first amplification factor.

4. The audio output method according to claim 1, adjusting the amplification factor of the analog power amplifier to the target amplification factor, includes: The control signal state corresponding to when the amplification factor of the analog power amplifier is the target amplification factor; The control signal of the analog power amplifier is adjusted based on the control signal state to adjust the amplification factor of the analog power amplifier to the target amplification factor.

5. The audio output method according to claim 4, wherein adjusting the control signal of the analog power amplifier based on the control signal state includes: If the control signal state is the first state, the audio codec continues to input the first signal to the control switch to turn on the control switch, and the control signal of the analog power amplifier is adjusted to the first state; the first state indicates that the target amplification factor is the first amplification factor; the control switch is set on the input channel of the control signal of the analog power amplifier; If the control signal state is the second state, the audio codec is controlled to input a second signal to the control switch to make the control switch open, and the control signal of the analog power amplifier is adjusted to the second state; the second state indicates that the target amplification factor is the second amplification factor; the second amplification factor is greater than the first amplification factor.

6. The audio output method according to any one of claims 1-5, before determining the signal amplitude corresponding to the audio to be output, further comprising: Determine the status of the audio driver; Accordingly, determining the signal amplitude corresponding to the audio to be output includes: If the state of the audio driver indicates that the audio driver exists, the signal amplitude corresponding to the audio to be output is determined through the audio driver.

7. The audio output method according to claim 6 further includes: If the state of the audio driver indicates that the audio driver does not exist, the audio codec continues to input the first signal to the control switch.

8. An audio output device, comprising: The first determining module is used to determine the signal amplitude corresponding to the audio to be output in response to acquiring the audio to be output. The second determining module is used to determine the target amplification factor of the analog power amplifier based on the signal amplitude. The control module is used to adjust the amplification factor of the analog power amplifier to the target amplification factor, so that the analog power amplifier amplifies the audio to be output at the target amplification factor and outputs it to the audio output device.

9. An electronic device, comprising: Analog power amplifiers, audio output devices, and processors; The processor is configured to perform a response to acquiring the audio to be output and determining the signal amplitude corresponding to the audio to be output; Based on the signal amplitude, the target amplification factor of the analog power amplifier is determined; the amplification factor of the analog power amplifier is adjusted to the target amplification factor so that the analog power amplifier amplifies the audio to be output at the target amplification factor and outputs it to the audio output device.

10. A computer-readable storage medium storing computer instructions for causing a computer to perform actions in response to acquiring an audio to be output, determining a signal amplitude corresponding to the audio to be output, determining a target amplification factor of an analog power amplifier based on the signal amplitude, and adjusting the amplification factor of the analog power amplifier to the target amplification factor, so that the analog power amplifier amplifies the audio to be output at the target amplification factor and outputs it to an audio output device.