A sound effect processing method, device and storage medium
By placing the sound effect post-processing algorithm in the software layer and using software and hardware collaborative processing, the problem of high complexity and cost of sound effect post-processing in electronic equipment is solved, and the effect of reducing the complexity and cost of sound effect post-processing is achieved.
Patent Information
- Application Number
- CN202310849596.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-11
- Publication Date
- 2024-09-06
- Estimated Expiration
- 2043-07-11
AI Technical Summary
In the existing technology, sound effect post-processing in electronic equipment is complex and costly, especially because the algorithm needs to be integrated on the audio processor of the system-level chip, which makes it difficult and requires redoing the algorithm integration every time the chip is replaced, resulting in a cumbersome workload.
The sound effect post-processing algorithm is placed in the software layer of the system, and the software and hardware collaborative processing method is adopted to avoid algorithm integration on the audio processor of the system-level chip. The audio data is post-processed through the hardware abstraction layer.
It reduces the complexity and cost of sound effects post-processing, realizes sound effects processing without the need for additional digital signal processors, and improves user experience and audio quality.
Smart Images

Figure CN117714969B
Abstract
Description
Technical Field
[0001] The present application relates to the field of electronic technology, and in particular to a sound effect processing method, device and storage medium. Background Art
[0002] As electronic devices continue to develop towards being thinner and lighter, the sound holes of electronic devices are usually designed at the bottom, which makes it difficult to ensure the effect of sound output. Therefore, it is necessary to optimize the sound through sound post-processing algorithms to improve the effect of sound output.
[0003] At present, in order to improve the effect of output sound, it is usually necessary to integrate a sound effect post-processing algorithm on the audio processor of the system on chip (SOC), and perform sound effect processing on the decoded audio data based on the sound effect post-processing algorithm on the audio processor, and output the processed audio data.
[0004] However, since the sound post-processing algorithm is run on the system-level chip, it is necessary to integrate the algorithm in the audio processor of the system-level chip. On the one hand, it is difficult to integrate the algorithm on the system-level chip. On the other hand, different system-level chips correspond to different instruction sets. Each time a different system-level chip is replaced, the algorithm integration needs to be redone in the audio processor. The workload is relatively large and cumbersome, resulting in the current sound effect processing being more complicated. Summary of the invention
[0005] The present application provides a sound effect processing method, device and storage medium, aiming to reduce the complexity of sound effect processing.
[0006] In order to achieve the above objectives, this application adopts the following technical solutions:
[0007] In the first aspect, the present application provides a sound effect processing method, comprising: an electronic device acquires audio data; the electronic device calls a sound effect post-processing algorithm in a sound effect post-processing algorithm module to perform sound effect processing on the audio data to obtain processed audio data, wherein the sound effect post-processing algorithm module is located in a hardware abstraction layer of an operating system of the electronic device;
[0008] Hardware Abstraction Layer; electronic devices output processed audio data.
[0009] In the embodiment of the present application, the sound effect post-processing algorithm is placed in the software layer of the system, rather than in the traditional system-level chip, and a method of performing sound effect post-processing on the audio data on the software side is adopted. This makes it possible to independently integrate the algorithm on the audio processor of the system-level chip when performing sound effect post-processing, thereby realizing the coordinated processing of software and hardware and effectively reducing the complexity of sound effect post-processing.
[0010] In one possible implementation, the electronic device calls the sound effect post-processing algorithm in the sound effect post-processing algorithm module to perform sound effect processing on the audio data to obtain the processed audio data, including: the electronic device decodes the audio data to obtain the decoded audio data; calls the sound effect post-processing algorithm in the sound effect post-processing algorithm module to perform sound effect processing on the decoded audio data to obtain the processed audio data.
[0011] In one possible implementation, the electronic device decodes audio data to obtain decoded audio data, including: the electronic device hard-decodes the audio data in a hard decoder of a system-level chip to obtain hard-decoded audio data; calls an audio effect post-processing algorithm in an audio effect post-processing algorithm module to perform audio effect processing on the decoded audio data to obtain processed audio data, including: calls an audio effect post-processing algorithm in an audio effect post-processing algorithm module to perform audio effect processing on the hard-decoded audio data to obtain processed audio data.
[0012] In one possible implementation, the electronic device decodes audio data to obtain decoded audio data, including: the electronic device uses a soft decoding module of an application framework layer in an operating system of the electronic device to soft-decode the audio data to obtain soft-decoded audio data; calls an audio effect post-processing algorithm in an audio effect post-processing algorithm module to perform audio effect processing on the decoded audio data to obtain processed audio data, including: calling an audio effect post-processing algorithm in an audio effect post-processing algorithm module to perform audio effect processing on the soft-decoded audio data to obtain processed audio data.
[0013] In one possible implementation, the electronic device calls a sound effect post-processing algorithm in a sound effect post-processing algorithm module to perform sound effect processing on audio data to obtain processed audio data, including: the electronic device calls a target sound effect post-processing algorithm from multiple sound effect post-processing algorithms in the sound effect post-processing algorithm module based on a control instruction, the control instruction is used to indicate a target sound effect selected by a user, and the target sound effect post-processing algorithm corresponds to the target sound effect; and performs sound effect processing on the audio data based on the target sound effect post-processing algorithm to obtain processed audio data.
[0014] In this application, based on the control instructions, the corresponding target sound effect post-processing algorithm can be called to process the audio data, so as to obtain audio that meets the user's needs. While reducing the complexity of sound effect post-processing, it meets the user's needs and improves the user experience.
[0015] In one possible implementation, the electronic device outputs processed audio data, including: the electronic device performs basic sound effect processing on the processed audio data to obtain optimized audio data, the basic sound effect processing including at least one of equalization processing, pitch adjustment and volume adjustment; and outputs the optimized audio data.
[0016] In a possible implementation, the electronic device obtains audio data, including: the electronic device obtains audio data from at least one of a television, a device connected via a high-definition multimedia interface, a device connected via a coaxial output interface, and a multimedia processor.
[0017] In a possible implementation manner, the method further includes: power amplifying the processed audio data to obtain power-amplified audio data; and outputting the power-amplified audio data.
[0018] Second aspect: The present application provides an electronic device, which includes a processor and a memory: the memory is used to store program code and transmit the program code to the processor; the processor is used to execute the steps of a sound effect processing method as described in the first aspect above according to the instructions in the program code.
[0019] Third aspect: The present application provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of a sound effect processing method as described in the first aspect above are implemented. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] Figure 1 A schematic diagram of the hardware structure of audio effect post-processing based on an audio processor;
[0021] Figure 2 A schematic diagram of the hardware structure of audio post-processing based on an external digital signal processor;
[0022] Figure 3 A scene graph of the first sound effect processing provided in an embodiment of the present application;
[0023] Figure 4 A scene graph of the second sound effect processing provided in an embodiment of the present application;
[0024] Figure 5 A schematic diagram of a sound effect processing hardware structure provided in an embodiment of the present application;
[0025] Figure 6 A schematic diagram of sound effect processing based on a soft decoding method provided in an embodiment of the present application;
[0026] Figure 7 A schematic diagram of a sound effect processing based on a hard decoding method provided in an embodiment of the present application;
[0027] Figure 8 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0028] The terms "first", "second", "third", etc. in the specification, claims and drawings of this application are used to distinguish different objects rather than to limit a specific order.
[0029] In the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way.
[0030] As electronic devices continue to develop in the direction of being lighter and thinner, especially electronic devices with smart screens are becoming thinner and lighter, electronic devices with smart screens include mobile phones, tablets, video monitors, indoor and outdoor large-screen advertising machines, etc., and their sound holes are usually designed at the bottom of the electronic device, which makes it difficult to ensure the effect of the output sound. To this end, it is necessary to optimize the sound through a sound post-processing algorithm to improve the effect of the output sound. Exemplarily, the sound post-processing algorithm may include a stereo expansion algorithm for widening the width of the sound field, a vocal dialogue enhancement algorithm for improving vocal performance, and a speaker transient distortion correction algorithm for reducing speaker tailing and improving sound clarity.
[0031] At present, in order to improve the effect of output sound, it is usually necessary to integrate the sound effect post-processing algorithm on the audio processor of the system-level chip, such as Figure 1 As shown in the figure, this figure is a schematic diagram of the hardware structure of sound effect post-processing based on an audio processor. The system-level chip is loaded with an audio processor or a digital signal processor (DSP). Taking the audio processor as an example, the audio processor includes a decoder, a sound effect post-processing algorithm module, and an output module. The audio data is input into the decoder in the audio processor for decoding. The sound effect post-processing algorithm module performs sound effect post-processing on the decoded audio data based on the sound effect post-processing algorithm, obtains the audio data after the sound effect post-processing, and sends the audio data after the sound effect post-processing to the power amplifier through the output module. Afterwards, the processed audio data is output through the power amplifier (PA) and the speaker.
[0032] However, since the sound effect post-processing algorithm is running on the system-level chip, it is necessary to rely on the system-level chip and integrate the algorithm in the audio processor of the system-level chip. On the one hand, it is difficult to integrate the algorithm on the system-level chip. On the other hand, different system-level chips correspond to different instruction sets. Every time a different system-level chip is replaced, the algorithm integration needs to be redone. The workload is relatively large and cumbersome. At the same time, users cannot control the progress of the work and cannot integrate the algorithm by themselves, which makes the current sound effect processing more complicated.
[0033] Based on this, the present application provides a sound effect processing method, which places the sound effect post-processing algorithm in the software layer of the system, that is, the sound effect post-processing algorithm is placed in the system hardware abstraction layer, rather than in the traditional system-level chip audio processor. After decoding the audio data and obtaining the decoded audio data, the decoded audio data is input into the sound effect post-processing algorithm module located in the hardware abstraction layer of the electronic device operating system. In the hardware abstraction layer, based on the sound effect post-processing algorithm provided by the sound effect post-processing algorithm module, the decoded audio data is subjected to sound effect post-processing to obtain the processed audio data. The processed audio data is called back to the basic sound effect processor in the system-level chip, and the basic sound effect processor outputs the processed audio data. In the present application, a method of performing sound effect post-processing on the decoded audio data in the hardware abstraction layer is adopted, so that when performing sound effect post-processing, it is not necessary to rely on algorithm integration on the audio processor of the system-level chip, so as to realize the coordinated processing of software and hardware, and effectively reduce the complexity of sound effect post-processing.
[0034] At the same time, the sound effect processing method provided by the present application can reduce the complexity of sound effect post-processing and reduce costs compared to the method of performing sound effect post-processing through an external digital signal processor. Figure 2 As shown in the figure, this figure is a schematic diagram of the hardware structure of sound effect post-processing based on an external digital signal processor.
[0035] With the above Figure 1 The way of integrating algorithms in the audio processor of the system-level chip is different. The sound effect post-processing method based on the external digital signal processor transmits the decoded audio data to the sound effect post-processing algorithm module in the external digital signal processor, and the sound effect post-processing algorithm module performs sound effect post-processing on the decoded audio data based on the sound effect post-processing algorithm. Afterwards, the audio data that has undergone sound effect post-processing is also sent to the power amplifier, and the audio data is output through the power amplifier and the speaker. In order to realize sound effect processing, this sound effect post-processing method of the external digital signal processor needs to configure an external digital signal processor carrying the sound effect post-processing algorithm for the system chip, which increases the implementation cost. However, the present application runs the sound effect post-processing algorithm at the software layer, without the need for additional configuration of a digital signal processor, which can reduce the complexity of sound effect post-processing while reducing costs.
[0036] Combine the following Figure 3-4 The scenarios corresponding to the sound effect processing method provided in the embodiments of the present application are introduced.
[0037] like Figure 3 As shown, this figure is a scene diagram of the first sound effect processing provided by an embodiment of the present application. The user uses a music playback application, and the electronic device can obtain audio data. The audio data is transmitted to the sound effect post-processing algorithm module on the Advanced RISC Machine (ARM) processor side located at the hardware abstraction layer of the electronic device. The audio data is processed based on the sound effect post-processing algorithm in the sound effect post-processing algorithm module to obtain processed audio data. After obtaining the processed audio data, the processed audio data can be output through a power amplifier and a speaker. When the user clicks the play button to play the audio, the processed audio data can be output.
[0038] like Figure 4 As shown in FIG. 1 , this figure is a scene diagram of the second sound effect processing provided by an embodiment of the present application. Figure 3 On this basis, the audio data can be processed based on the user's choice to obtain sound effects that meet the user's needs and improve the user experience.
[0039] Specifically, the electronic device can obtain audio data by using the music playing application. The user clicks the sound effect setting button 1101 in the playing interface of the music playing application to enter the sound effect setting interface. In the sound effect setting interface, the user can select different sound effects, for example, Figure 4 The smart, stereo, vocal enhancement, and clarity enhancement options are displayed in the sound effect setting interface. Among them, the stereo option corresponds to the stereo expansion algorithm, the vocal enhancement option corresponds to the vocal dialogue enhancement algorithm, and the clarity enhancement option corresponds to the speaker transient distortion correction algorithm. If the smart option is selected, the electronic device can select a sound effect post-processing algorithm suitable for the audio data from multiple sound effect post-processing algorithms based on the audio data to perform sound effect processing on the audio data.
[0040] Taking the stereo option as an example, when the user selects the stereo option in the sound effect setting interface, the electronic device can generate a corresponding control instruction based on the user's operation. The control instruction is used to indicate the target sound effect selected by the user, that is, to indicate the call of the sound effect post-processing algorithm corresponding to the stereo option to perform sound effect processing on the audio data.
[0041] After decoding the audio data to obtain the decoded audio data, the decoded audio data and the control instruction are transmitted to the sound effect post-processing algorithm module on the ARM side. Based on the control instruction, the target sound effect post-processing algorithm is called from the multiple sound effect post-processing algorithms in the sound effect post-processing algorithm module, and the target sound effect post-processing algorithm corresponds to the stereo option selected by the user, that is, the stereo expansion algorithm is called from the multiple sound effect post-processing algorithms. Based on the stereo expansion algorithm, the decoded audio data is subjected to sound effect processing to obtain the processed audio data. After obtaining the processed audio data, the processed audio data can be output through the power amplifier and the speaker.
[0042] Since the audio effect post-processing algorithm is placed in the software layer in this application, the audio effect processing of audio data in the software layer does not rely on algorithm integration on the audio processor of the system-level chip, realizing the coordinated processing of software and hardware, and effectively reducing the complexity of audio effect post-processing. At the same time, there is no need to configure an additional digital signal processor, which can reduce the complexity of audio effect post-processing and reduce costs. Figure 5-7 , the sound effect processing method provided in the embodiment of the present application is introduced. Figure 5 As shown, this figure is a schematic diagram of the sound effect processing hardware structure provided in an embodiment of the present application.
[0043] The audio data is decoded to obtain decoded audio data.
[0044] The audio data is the data to be processed, for example, the audio data may be audio data from a TV, a device connected via a High Definition Multimedia Interface (HDMI), a device connected via a coaxial output interface (Sony / Philips Digital Inter Face, SPDIF), a multimedia processor (Multimedia Processor, MMP), etc. Exemplarily, through an HDMI interface and an HDMI cable, the interconnection of devices such as a laptop computer, a TV, a projector, and a game console can be achieved.
[0045] Among them, the decoding methods can be divided into hard decoding and soft decoding. Hard decoding, that is, hardware decoding, is to decode high-definition video through the video acceleration function of the graphics card. Soft decoding, that is, software decoding, relies on the central processing unit (CPU) for decoding. Compared with the CPU required for soft decoding, the graphics processing unit (GPU) or video processing unit (VPU) of the graphics card required for hard decoding is more suitable for processing large amounts of data and low-difficulty repetitive tasks. The process of decoding the processed data is the process of converting digital signals into analog signals.
[0046] In the embodiment of the present application, different decoding methods can be used for different types of audio data, and different decoding methods correspond to different decoding positions. Exemplarily, in the present application, audio data is input into the audio processor of the system-level chip, and the audio data is hard-decoded by the hard decoder in the audio processor to obtain the hard-decoded audio data; in the soft decoding module of the electronic device, the audio data is soft-decoded to obtain the soft-decoded audio data, and exemplarily, in the application framework layer (Framework, FWK) in the electronic device operating system, the audio data is soft-decoded based on the soft decoding module of the framework layer to obtain the soft-decoded audio data.
[0047] The electronic device performs sound effect processing on the audio data based on the sound effect post-processing algorithm to obtain processed audio data. Specifically, the present application places the sound effect post-processing algorithm in the software layer of the system, and specifically, places the sound effect post-processing algorithm in the sound effect post-processing module of the hardware abstraction layer. By performing sound effect processing on the decoded audio data at the software layer, the decoupling of the sound effect processing and the system-level chip is achieved. Therefore, when performing sound effect processing, there is no need to rely on algorithm integration with the system-level chip in the audio processor module, which reduces the complexity of sound effect post-processing.
[0048] Exemplarily, the sound effect post-processing algorithm module may be specifically located on the ARM side of the hardware abstraction layer, and the embodiments of the present application are introduced on this basis.
[0049] The decoded audio data is input into the sound effect post-processing algorithm module on the hardware abstraction layer ARM side to perform sound effect processing on the decoded audio data to obtain processed audio data. Specifically, the hardware abstraction layer ARM side includes an input module, a sound effect post-processing algorithm module, and an output module.
[0050] Among them, the input module is used to receive the decoded audio data and transmit it to the sound effect post-processing algorithm module. The sound effect post-processing algorithm module integrates at least one sound effect post-processing algorithm. The sound effect post-processing algorithm is used to process the audio data, that is, to perform sound effect processing on the decoded audio data so that the output audio effect meets the user's needs.
[0051] In the embodiment of the present application, the decoded audio data may be pulse code modulated (PCM) audio data. Specifically, the pulse code modulated audio data is an uncompressed audio data stream. Pulse code modulation is a process of sampling, quantizing and encoding a continuously changing analog signal to generate a digital signal, which has a high signal reconstruction quality, that is, by processing the audio data using pulse code modulation, higher quality audio data can be obtained, the loss during the transmission process can be reduced, and the sound quality of the audio data can be improved.
[0052] It should be noted that the specific types of sound effect post-processing algorithms are not specifically limited in this application. Exemplarily, the sound effect post-processing algorithms may include a stereo expansion algorithm for widening the width of the sound field, a vocal dialogue enhancement algorithm for improving vocal performance, and a speaker transient distortion correction algorithm for reducing speaker tailing and improving sound clarity. In this application, the decoded audio data may be processed based on one sound effect post-processing algorithm, or may be processed based on multiple sound effect post-processing algorithms. For example, the decoded audio data may be processed based on a stereo expansion algorithm to obtain data for widening the width of the sound field, and then the vocal dialogue enhancement algorithm may be used to further process the data for widening the width of the sound field to improve the vocal performance in the data for widening the width of the sound field, and obtain processed audio data.
[0053] The audio effect post-processing algorithm module transmits the processed audio data to the output module, and the output module transmits the processed audio data back to the system-level chip, which transmits the processed audio data to the power amplifier. The power amplifier is connected to the speaker, and the power amplifier can process the processed audio data and amplify it, and then drive the speaker to output the amplified audio data.
[0054] In one possible implementation, in order to further improve the sound quality, the output module on the ARM side transfers the processed audio data to the basic sound processor of the audio processor in the system-level chip to perform basic sound processing on the processed audio data to obtain optimized audio data. Exemplarily, the basic sound processing includes at least one of equalizer (EQ), tone adjustment, and volume adjustment. The basic sound processor transmits the optimized audio data to the power amplifier, which amplifies the optimized audio data and outputs the amplified data through the speaker.
[0055] Specifically, since soft decoding and hard decoding each have their own advantages, for example, hard decoding has the advantages of smooth playback and low power consumption, and is suitable for decoding large amounts of audio data; soft decoding has the advantages of not being restricted by the format of audio data and having better picture quality, and thus different types of audio data can be decoded using different decoding methods.
[0056] For example, for audio data from TV, HDMI, SPDIF, and PCM, hard decoding can be used, and for MMP multimedia signal streams, soft decoding can be used. In the sound effect processing method provided in this application, soft decoding can be used to decode audio data, hard decoding can be used to decode audio data, or soft decoding and hard decoding can be used to decode multiple to-be-processed data at the same time. Figure 6 and Figure 7 The sound effect processing process based on soft decoding and the sound effect processing process based on hard decoding are introduced respectively.
[0057] like Figure 6 As shown, this figure is a schematic diagram of a sound effect processing based on a soft decoding method provided by an embodiment of the present application. The audio playback application (Application, APP) in the electronic device sends the audio data to the soft decoding module of the framework layer for soft decoding to obtain the audio data after soft decoding.
[0058] Since there is no communication connection between the framework layer and the hardware abstraction layer, in this application, the audio data after soft decoding is transmitted from the framework layer to the hardware abstraction layer (HAL) through the system-level chip, so as to perform sound effect processing on the audio data after soft decoding in the sound effect post-processing algorithm module of the hardware abstraction layer. That is, the electronic device sends the audio data after soft decoding from the framework layer to the system-level chip, and the system-level chip forwards the audio data after soft decoding to the hardware abstraction layer, wherein the hardware abstraction layer includes a sound effect post-processing algorithm module integrated with the sound effect post-processing algorithm.
[0059] The hardware abstraction layer is an interface layer between the operating system kernel and the hardware circuit, and its purpose is to abstract the hardware. It hides the hardware interface details of a specific platform and provides a virtual hardware platform for the operating system, making it hardware-independent, so that it can be ported on multiple platforms. Since software testing and hardware testing can be completed separately based on the hardware abstraction layer, the combination of software and hardware is achieved.
[0060] Specifically, the audio data after the soft decoding is forwarded to the sound effect post-processing algorithm module in the hardware abstraction layer, and the sound effect post-processing algorithm module is used to run the sound effect post-processing algorithm to perform sound effect processing on the audio data after the soft decoding.
[0061] In one possible implementation, the processor of the electronic device can call the target sound effect post-processing algorithm in the sound effect post-processing algorithm module based on the control instruction sent by the sound effect setting application, and perform sound effect processing on the soft-decoded audio data based on the target sound effect post-processing algorithm.
[0062] The sound effect setting application and the audio playback application are located in the same software layer, that is, both belong to the application layer. The user of the electronic device, that is, the user, can set the corresponding target sound effect through the audio setting application according to the desired audio effect, wherein the target sound effect corresponds to the audio effect desired by the user.
[0063] Specifically, the audio setting application responds to the user's setting operation by sending a control instruction to the sound effect post-processing algorithm module of the hardware operation layer through the decoding module of the framework layer to call the target sound effect post-processing algorithm in the sound effect post-processing algorithm module to perform sound effect processing on the audio data after soft decoding.
[0064] Among them, the control instruction is used to instruct to call the target sound effect post-processing algorithm from at least one sound effect post-processing algorithm in the sound effect post-processing algorithm module, wherein the target sound effect post-processing algorithm corresponds to the target sound effect. Exemplarily, the user's expectation is to improve the vocal performance in the audio data. In this case, the target sound effect is the vocal enhancement sound effect corresponding to the vocal dialogue enhancement algorithm. The user sets the vocal enhancement sound effect as the target sound effect through the audio setting application. Exemplarily, the user can select the vocal enhancement option in the sound effect setting interface to set the vocal enhancement sound effect as the target sound effect.
[0065] Thus, the audio setting application can respond to the user's setting operation, send a control instruction to the sound effect post-processing algorithm module of the hardware abstraction layer through the soft decoding module of the framework layer, and call the human voice dialogue enhancement algorithm in the sound effect algorithm module. Then in the hardware abstraction layer, the sound effect post-processing algorithm module performs sound effect processing on the audio data after soft decoding based on the human voice dialogue enhancement algorithm to obtain processed audio data, and the processed audio data has the effect of human voice enhancement.
[0066] In the embodiment of the present application, the corresponding target sound effect post-processing algorithm can be called to process the audio data based on the user's setting operation, so as to obtain audio that meets the user's needs. While reducing the complexity of the sound effect post-processing, it meets the user's needs and improves the user's experience.
[0067] After obtaining the processed audio data, the audio post-processing algorithm module calls back the processed audio data to the basic audio processor in the system-level chip. The basic audio processor can transmit the processed audio data to the power amplifier, which amplifies the processed audio data and outputs the amplified data through the speaker.
[0068] In a possible implementation, in order to further improve the sound quality, the basic sound processor may perform basic sound processing on the processed audio data before outputting the processed audio data, such as performing equalizer (EQ) on the processed audio data, to obtain optimized audio data. The basic sound processor transmits the optimized audio data to the power amplifier, which amplifies the power of the optimized audio data and outputs the amplified optimized audio data through the speaker.
[0069] In summary, this application places the sound effect post-processing algorithm in the software layer, and performs sound effect processing on the soft-decoded audio data based on the sound effect post-processing algorithm in the software layer, which does not rely on algorithm integration on the audio processor of the system-level chip, realizes the coordinated processing of software and hardware, and effectively reduces the complexity of sound effect post-processing. At the same time, there is no need to configure an additional digital signal processor, which can reduce the complexity of sound effect post-processing and reduce costs.
[0070] like Figure 7 As shown, this figure is a schematic diagram of a sound effect processing method based on hard decoding provided by an embodiment of the present application. Different from the above-mentioned soft decoding method, the sound effect processing method based on hard decoding is to decode the audio data in the system-level chip to obtain decoded audio data.
[0071] Specifically, the system-level chip acquires audio data, and hard-decodes the audio data in a hard decoding module of the system-level chip to obtain hard-decoded audio data.
[0072] The system-level chip sends the hard-decoded audio data to the processor, which is loaded with the audio post-processing algorithm.
[0073] Specifically, the hard-decoded audio data is sent from the decoding module of the system-level chip to the sound effect post-processing algorithm module in the hardware abstraction (HAL) layer, and the sound effect post-processing algorithm runs in the sound effect post-processing algorithm module of ARM in the hardware abstraction layer.
[0074] After receiving the hard-decoded audio data, the sound effect post-processing algorithm module performs sound effect processing on the hard-decoded audio data based on the sound effect post-processing algorithm in the sound effect post-processing algorithm module to obtain processed audio data.
[0075] In one possible implementation, the ARM of the electronic device can call the target sound effect post-processing algorithm in the sound effect post-processing algorithm module based on the control instruction sent by the sound effect setting application, and perform sound effect processing on the decoded audio data based on the target sound effect post-processing algorithm. Among them, the sound effect setting application belongs to the application layer. The user of the electronic device, that is, the user, can set the corresponding target sound effect through the audio setting application according to the desired audio effect, so that the processed audio data obtained meets the audio effect desired by the user.
[0076] Specifically, in response to the user's setting operation, the audio setting application sends a control instruction to the sound effect post-processing algorithm module of the hardware operation layer to call the target sound effect post-processing algorithm in the sound effect post-processing algorithm module to perform sound effect processing on the decoded audio data. The control instruction is used to instruct to call the target sound effect post-processing algorithm from at least one sound effect post-processing algorithm in the sound effect post-processing algorithm module, wherein the target sound effect post-processing algorithm corresponds to the target sound effect.
[0077] After obtaining the processed audio data, the audio post-processing algorithm module calls back the processed audio data to the basic audio processor in the system-level chip. The basic audio processor can transmit the processed audio data to the power amplifier, which amplifies the processed audio data to obtain the power-amplified audio data and drives the speaker to output the power-amplified audio data.
[0078] In a possible implementation, in order to further improve the sound quality, the basic sound processor may perform basic sound processing on the processed audio data before outputting the processed audio data to obtain optimized audio data. The basic sound processor transmits the optimized audio data to the power amplifier, which amplifies the optimized audio data and outputs the amplified data through the speaker.
[0079] It should be noted that in this application, multiple types of audio data can be processed for sound effects at the same time. Figure 6 As shown in , only audio data suitable for soft decoding is included; it can be Figure 7 As shown in , only audio data suitable for hard decoding is included; it can also include audio data suitable for soft decoding and audio data suitable for hard decoding. In the case where the audio data includes both audio data suitable for soft decoding and audio data suitable for hard decoding, the specific sound effect processing method can be combined with the above Figure 6 and Figure 7 The corresponding methods will not be described in detail here.
[0080] In summary, in the embodiment of the present application, the system-level chip acquires audio data, sends the audio data to the processor of the electronic device, and the processor performs sound effect processing on the audio data based on the sound effect post-processing algorithm to obtain the processed audio data, and calls back the processed audio data to the system-level chip, and the system-level chip outputs the processed audio data. Since the sound effect post-processing algorithm is placed in the processor of the electronic device, there is no need to rely on algorithm integration in the system-level chip, which can effectively reduce the complexity of sound effect processing, and at the same time, there is no need to use an external digital signal processor, which can effectively reduce the cost of sound effect processing.
[0081] In some embodiments, the electronic device may be a mobile phone, a tablet computer, a desktop, a laptop, a notebook computer, an ultra-mobile personal computer (UMPC), a handheld computer, a netbook, a personal digital assistant (PDA), a wearable electronic device, a smart watch, etc. The present application does not impose any special restrictions on the specific form of the above electronic devices. In this embodiment, the structure of the electronic device may be as follows: Figure 8 As shown, Figure 8 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application.
[0082] like Figure 8 As shown, the electronic device may include a processor 110, an external memory interface 120, an internal memory 121, an antenna, a wireless communication module 130, an audio processor 140, a speaker 140A, a receiver 140B, a microphone 140C, an earphone interface 140D, a power amplifier 140E, a hard decoder 140F, and a basic sound effect processor 140G. A sensor module 150, a button 160, and a display screen 170, etc. The sensor module 150 may include a touch sensor 150A, a bone conduction sensor 150B, etc.
[0083] It is to be understood that the structure illustrated in this embodiment does not constitute a specific limitation on the electronic device. In other embodiments, the electronic device may include more or fewer components than shown in the figure, or combine some components, or split some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.
[0084] The processor 110 may include one or more processing units, for example: the processor 110 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Among them, different processing units can be independent devices or integrated in one or more processors. For example, in the present application, the processor 110 can obtain audio data; the electronic device calls the sound effect post-processing algorithm in the sound effect post-processing algorithm module, performs sound effect processing on the audio data, and obtains the processed audio data, and the sound effect post-processing algorithm module is located in the hardware abstraction layer; the electronic device outputs the processed audio data.
[0085] The controller can be the nerve center and command center of the electronic device. The controller can generate operation control signals according to the instruction operation code and timing signal to complete the control of fetching and executing instructions.
[0086] The processor 110 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may store instructions or data that the processor 110 has just used or cyclically used. If the processor 110 needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.
[0087] In some embodiments, the processor 110 may include one or more interfaces. The interface may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc.
[0088] The I2S interface can be used for audio communication. In some embodiments, the processor 110 can include multiple I2S buses. The processor 110 can be coupled to the audio processor 140 via the I2S bus to achieve communication between the processor 110 and the audio processor 140. In some embodiments, the audio processor 140 can transmit an audio signal to the wireless communication module 130 via the I2S interface to achieve the function of answering a call through a Bluetooth headset.
[0089] The PCM interface can also be used for audio communication, sampling, quantizing and encoding analog signals. In some embodiments, the audio processor 140 and the wireless communication module 130 can be coupled via a PCM bus interface. In some embodiments, the audio processor 140 can also transmit audio signals to the wireless communication module 130 via the PCM interface to implement the function of answering calls via a Bluetooth headset. Both the I2S interface and the PCM interface can be used for audio communication.
[0090] The UART interface is a universal serial data bus for asynchronous communication. The bus can be a bidirectional communication bus. It converts the data to be transmitted between serial communication and parallel communication. In some embodiments, the audio processor 140 can transmit an audio signal to the wireless communication module 130 through the UART interface to realize the function of playing music through a Bluetooth headset.
[0091] The GPIO interface can be configured by software. The GPIO interface can be configured as a control signal or as a data signal. In some embodiments, the GPIO interface can be used to connect the processor 110 with the display screen 170, the wireless communication module 130, the audio processor 140, the sensor module 150, etc. The GPIO interface can also be configured as an I2C interface, an I2S interface, a UART interface, a MIPI interface, etc.
[0092] It is understandable that the interface connection relationship between the modules illustrated in this embodiment is only a schematic illustration and does not constitute a structural limitation of the electronic device. In other embodiments of the present application, the electronic device may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.
[0093] The wireless communication module 130 can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc., which are applied to electronic devices. The wireless communication module 130 can be one or more devices integrating at least one communication processing module. The wireless communication module 130 receives electromagnetic waves via an antenna, modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 110. The wireless communication module 130 can also receive the signal to be sent from the processor 110, modulate the frequency, amplify it, and convert it into electromagnetic waves for radiation through the antenna.
[0094] The electronic device implements the display function through a GPU, a display screen 170, and an application processor. The GPU is a microprocessor for image processing, connecting the display screen 170 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs that execute program instructions to generate or change display information.
[0095] The display screen 170 is used to display images, videos, etc. The display screen 170 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode or an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), Miniled, MicroLed, Micro-oled, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the electronic device may include 1 or N display screens 170, where N is a positive integer greater than 1.
[0096] A series of graphical user interfaces (GUIs) can be displayed on the display screen 170 of the electronic device, and these GUIs are the main screens of the electronic device. Generally speaking, the size of the display screen 170 of the electronic device is fixed, and only limited controls can be displayed on the display screen 170 of the electronic device. A control is a GUI element, which is a software component included in an application program, and controls all data processed by the application program and interactive operations on the data. Users can interact with the control through direct manipulation to read or edit relevant information of the application program. Generally speaking, a control can include visual interface elements such as icons, buttons, menus, tabs, text boxes, dialog boxes, status bars, navigation bars, widgets, etc.
[0097] Video codecs are used to compress or decompress digital videos. Electronic devices can support one or more video codecs. In this way, electronic devices can play or record videos in multiple coding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, MPEG4, etc.
[0098] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device. The external memory card communicates with the processor 110 through the external memory interface 120 to implement a data storage function. For example, files such as music and videos can be stored in the external memory card.
[0099] The internal memory 121 may be used to store computer executable program codes, which include instructions. The processor 110 executes various functional applications and data processing of the electronic device by running the instructions stored in the internal memory 121. For example, in this embodiment, the processor 110 may call the target sound effect post-processing algorithm in the sound effect post-processing algorithm module by executing the control instructions stored in the internal memory 121, so as to perform sound effect processing on the decoded audio data based on the target sound effect post-processing algorithm.
[0100] The internal memory 121 may include a program storage area and a data storage area. The program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc. The data storage area may store data created during the use of the electronic device (such as audio data, a phone book, etc.), etc. In addition, the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc. The processor 110 executes various functional applications and data processing of the electronic device by running instructions stored in the internal memory 121 and / or instructions stored in a memory provided in the processor.
[0101] The electronic device can implement audio functions such as music playing and recording through the audio processor 140, the speaker 140A, the receiver 140B, the microphone 140C, the headphone jack 140D, and the application processor.
[0102] The audio processor 140 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signals. The audio processor 140 can also be used to encode and decode audio signals. In some embodiments, the audio processor 140 can be arranged in the processor 110, or some functional modules of the audio processor 140 can be arranged in the processor 110.
[0103] The speaker 140A, also called a "speaker", is used to convert the audio electrical signal into a sound signal. In the embodiment of the present application, the electronic device can output the processed audio data through the speaker 140A.
[0104] The receiver 140B, also called a "earpiece", is used to convert audio electrical signals into sound signals. When the electronic device receives a call or voice message, the voice can be received by placing the receiver 140B close to the human ear.
[0105] Microphone 140C, also called "microphone" or "microphone", is used to convert sound signals into electrical signals. When making a call or sending a voice message, the user can speak by putting his mouth close to the microphone 140C to input the sound signal into the microphone 140C. The electronic device can be provided with at least one microphone 140C. In other embodiments, the electronic device can be provided with two microphones 140C, which can not only collect sound signals but also realize noise reduction function. In other embodiments, the electronic device can also be provided with three, four or more microphones 140C to realize the collection of sound signals, noise reduction, identification of sound sources, and directional recording function, etc.
[0106] The earphone interface 140D is used to connect a wired earphone and can be a USB interface 130 or a 3.5 mm open mobile terminal platform (OMTP) standard interface or a cellular telecommunications industry association of the USA (CTIA) standard interface.
[0107] The power amplifier 140E is used to amplify the power of the audio data so that the speaker 140A outputs the power-amplified audio data.
[0108] The hard decoder 140F is used to perform hard decoding on the audio data to obtain hard-decoded audio data.
[0109] The basic audio effect processor 140G is used to perform basic audio effect processing on the processed audio data before outputting the processed audio data, such as performing equalizer processing (EQ) on the processed audio data to obtain optimized audio data. The basic audio effect processor 140G transmits the optimized audio data to the power amplifier, which amplifies the optimized audio data and outputs the amplified optimized audio data through the speaker.
[0110] The touch sensor 150A is also called a "touch control device". The touch sensor 150A can be set on the display screen 170. The touch sensor 150A and the display screen 170 form a touch screen, also called a "touch control screen". The touch sensor 150A is used to detect touch operations acting on or near it. The touch sensor can pass the detected touch operation to the application processor to determine the type of touch event. Visual output related to the touch operation can be provided through the display screen 170. In other embodiments, the touch sensor 150A can also be set on the surface of the electronic device, which is different from the position of the display screen 170.
[0111] In the embodiment of the present application, based on the touch sensor 150A, the user can select the option corresponding to the target sound effect through touch operation in the sound effect setting interface.
[0112] The bone conduction sensor 150B can obtain a vibration signal. In some embodiments, the bone conduction sensor 150B can obtain a vibration signal of a vibrating bone block of a human body's vocal part. The bone conduction sensor 150B can also contact a human body's pulse to receive a blood pressure pulse signal. In some embodiments, the bone conduction sensor 150B can also be disposed in an earphone to form a bone conduction earphone. The audio processor 140 can parse a voice signal based on the vibration signal of a vibrating bone block of a vocal part obtained by the bone conduction sensor 150B to implement a voice function.
[0113] The key 160 includes a power key, a volume key, etc. The key 160 can be a mechanical key or a touch key. The electronic device can receive key input and generate key signal input related to user settings and function control of the electronic device.
[0114] In addition, an operating system is running on the above components, such as the iOS operating system developed by Apple, the Android open source operating system developed by Google, and the Windows operating system developed by Microsoft. Application programs can be installed and run on the operating system.
[0115] The operating system of the electronic device may adopt a layered architecture, an event-driven architecture, a micro-core architecture, a micro-service architecture, or a cloud architecture. The embodiment of the present application takes the Android system of the layered architecture as an example to exemplify the software structure of the electronic device.
[0116] The layered architecture divides the operating system of the electronic device into several layers, each with clear roles and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the operating system of the electronic device is the Android system. The Android system can be divided into four layers, from top to bottom, namely, the application (APP) layer, the application framework layer (abbreviated as FWK), the system library, and the kernel layer. Figure 6 and Figure 7 Some layers in the software structure of an electronic device are shown.
[0117] It should be noted that although the embodiments of the present application are described using the Android system as an example, its basic principles are also applicable to electronic devices based on operating systems such as iOS and Windows.
[0118] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions within the technical scope disclosed in the present application should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A sound effect processing method, characterized in that: include: The electronic device acquires audio data; The electronic device calls a target sound effect post-processing algorithm in a sound effect post-processing algorithm module to perform sound effect processing on the audio data to obtain processed audio data, the sound effect post-processing algorithm module is located in a hardware abstraction layer of the electronic device operating system, and the target sound effect post-processing algorithm corresponds to the target sound effect; The electronic device outputs the processed audio data.
2. The method according to claim 1, characterized in that The electronic device calls a target sound effect post-processing algorithm in a sound effect post-processing algorithm module to perform sound effect processing on the audio data to obtain processed audio data, including: The electronic device decodes the audio data to obtain decoded audio data; The target sound effect post-processing algorithm in the sound effect post-processing algorithm module is called to perform sound effect processing on the decoded audio data to obtain processed audio data.
3. The method according to claim 2, characterized in that The electronic device decodes the audio data to obtain decoded audio data, including: The electronic device hard-decodes the audio data in a hard decoder of the system-level chip to obtain hard-decoded audio data; The calling of the target sound effect post-processing algorithm in the sound effect post-processing algorithm module to perform sound effect processing on the decoded audio data to obtain the processed audio data includes: The target sound effect post-processing algorithm in the sound effect post-processing algorithm module is called to perform sound effect processing on the hard-decoded audio data to obtain processed audio data.
4. The method according to claim 2, characterized in that: The electronic device decodes the audio data to obtain decoded audio data, including: The electronic device performs soft decoding on the audio data using a soft decoding module in an application framework layer in an operating system of the electronic device to obtain soft-decoded audio data; The calling of the target sound effect post-processing algorithm in the sound effect post-processing algorithm module to perform sound effect processing on the decoded audio data to obtain the processed audio data includes: The target sound effect post-processing algorithm in the sound effect post-processing algorithm module is called to perform sound effect processing on the soft-decoded audio data to obtain processed audio data.
5. The method according to claim 1, characterized in that: The electronic device calls a target sound effect post-processing algorithm in a sound effect post-processing algorithm module to perform sound effect processing on the audio data to obtain processed audio data, including: The electronic device calls a target sound effect post-processing algorithm from a plurality of sound effect post-processing algorithms in the sound effect post-processing algorithm module based on a control instruction, wherein the control instruction is used to indicate the target sound effect selected by the user; Performing sound effect processing on the audio data based on the target sound effect post-processing algorithm to obtain processed audio data.
6. The method according to claim 1, characterized in that The electronic device outputting the processed audio data comprises: The electronic device performs basic sound effect processing on the processed audio data to obtain optimized audio data, wherein the basic sound effect processing includes at least one of equalization processing, tone adjustment, and volume adjustment; The optimized audio data is output.
7. The method according to claim 1, characterized in that The electronic device acquires audio data, including: The electronic device obtains the audio data from at least one of a television, a device connected via a high-definition multimedia interface, a device connected via a coaxial output interface, and a multimedia processor.
8. The method according to any one of claims 1 to 7, characterized in that: Also includes: Performing power amplification on the processed audio data to obtain power-amplified audio data; The power-amplified audio data is output.
9. An electronic device, characterized in that: The electronic device comprises a processor and a memory: The memory is used to store program code and transmit the program code to the processor; The processor is used to execute the steps of a sound effect processing method as described in any one of claims 1-8 according to the instructions in the program code.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of a sound effect processing method as described in any one of claims 1 to 8 are implemented.
