Audio data processing method, storage medium, terminal equipment and vehicle
By calculating the target sampling rate and number of channels through the audio data processing method, merging the data blocks and driving the speakers, Hi-Res audio playback is realized, solving the problems of hardware limitations and cost increase, and realizing high-quality software playback.
Patent Information
- Application Number
- CN202310204524.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-22
- Publication Date
- 2024-08-23
AI Technical Summary
When implementing high-resolution audio playback, the existing technology needs to replace hardware to meet the minimum requirements of Hi-Res audio, which leads to increased costs and is not suitable for mass production hardware, and cannot get rid of hardware limitations.
Through the audio data processing method, the target sampling rate and number of channels are calculated based on the initial sampling rate and number of channels of the sound source file, the data blocks are merged, and the speaker is driven to play through the power amplification circuit to achieve high-quality Hi-Res playback function and get rid of Hardware limitations, reducing costs.
It realizes high-quality Hi-Res playback function through software, reduces hardware costs, avoids hardware limitations, and is suitable for mass production hardware.
Smart Images

Figure CN118538237A
Abstract
Description
Technical Field
[0001] The present disclosure relates to the technical field of audio processing, and in particular to an audio data processing method, a storage medium, a terminal device, and a vehicle. Background Art
[0002] With the development of smart cockpits, users have higher demands for smart cockpit audio systems, and Hi-Res (High Resolution Audio) audio playback is one of them. However, the minimum requirement for Hi-Res audio quality is 96KHz / 2CH / 24bit. To meet this requirement, the relevant technology proposes a method of replacing hardware. However, this method will increase costs and is not suitable for products in the mass production stage where the hardware has been finalized. Summary of the invention
[0003] The present disclosure aims to solve at least one of the technical problems in the related art to a certain extent. To this end, the purpose of the present disclosure is to propose an audio data processing method, a storage medium, a terminal device and a vehicle to achieve high sound quality such as Hi-Res playback function through software, get rid of hardware limitations and reduce costs.
[0004] To achieve the above-mentioned object, a first aspect of the present disclosure provides an audio data processing method, which is used in a terminal device, wherein the terminal device includes a power amplifier circuit and a speaker, and the method includes:
[0005] The audio data in the sound source file is processed to obtain a plurality of data blocks; a target number of channels and a target sampling rate are obtained according to an initial sampling rate and an initial number of channels in the sound source file; a merging number is calculated according to the target number of channels and the initial number of channels; a plurality of the data blocks are merged according to the merging number; the merged data blocks are configured as a data stream according to the target number of channels and the target sampling rate and transmitted to a power amplifier circuit; a speaker is driven by the power amplifier circuit to play the audio corresponding to the data stream according to the initial sampling rate and the initial number of channels.
[0006] In addition, the audio data processing method of the above embodiment of the present disclosure may also have the following additional technical features:
[0007] According to an embodiment of the present disclosure, obtaining the target number of channels and the target sampling rate according to the initial sampling rate and the initial number of channels in the sound source file includes: obtaining the target sampling rate according to the initial sampling rate; obtaining the target number of channels according to the initial sampling rate, the target sampling rate and the initial number of channels.
[0008] According to one embodiment of the present disclosure, obtaining the target sampling rate based on the initial sampling rate includes: taking a target preset sampling rate among at least one preset sampling rate as the target sampling rate, the initial sampling rate is k times the target preset sampling rate, and k is an integer greater than 1.
[0009] According to an embodiment of the present disclosure, obtaining the target number of channels according to the initial sampling rate, the target sampling rate and the initial number of channels includes: calculating the target number of channels by the following formula:
[0010] c2=s1*c1 / s2,
[0011] Among them, c2 represents the target number of channels, s1 represents the initial sampling rate, c1 represents the initial number of channels, and s2 represents the target sampling rate.
[0012] According to an embodiment of the present disclosure, the step of calculating the merged number according to the target number of channels and the initial number of channels includes: calculating the merged number by the following formula:
[0013] n=c2 / c1,
[0014] Wherein, n represents the merged number, c2 represents the target number of channels, and c1 represents the initial number of channels.
[0015] According to an embodiment of the present disclosure, the cache area adopts a first-in-first-out cache area, and the merging of multiple data blocks according to the merging number includes: merging n adjacent data blocks into one in sequence according to the order of transmission of the data blocks, where n is the merging number.
[0016] According to an embodiment of the present disclosure, the driving of the speaker to play the audio corresponding to the data stream according to the initial sampling rate and the initial number of channels by the power amplifier circuit includes: dividing the data stream into channel data according to the initial number of channels by the power amplifier circuit to obtain multiple channel data; sampling each of the channel data at the initial sampling rate to obtain multiple sampling results; and generating a corresponding driving signal to the speaker according to each of the sampling results to drive the speaker to play audio.
[0017] According to one embodiment of the present disclosure, the preset sampling rate includes a first preset sampling rate and a second preset sampling rate, the first preset sampling rate is 48KHz, and the second preset sampling rate is 44.1KHz.
[0018] To achieve the above objectives, a second aspect of the present disclosure provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the above audio data processing method is implemented.
[0019] To achieve the above-mentioned purpose, the third aspect embodiment of the present disclosure proposes a terminal device, including a power amplifier circuit, a speaker and a controller, wherein the controller includes a memory and a processor, and when the computer program stored in the memory is executed by the processor, the above-mentioned audio data processing method is implemented.
[0020] In order to achieve the above-mentioned objectives, the present disclosure provides a vehicle according to a first embodiment, comprising the above-mentioned terminal device.
[0021] The audio data processing method, storage medium, terminal device and vehicle of the disclosed embodiment, after receiving the sound source file, first process the audio data in the sound source file to obtain multiple data blocks, then obtain the target sampling rate, target number of channels and number of merges according to the initial sampling rate and initial number of channels in the sound source file, and merge the multiple data blocks according to the number of merges, and then transmit the target sampling rate, target number of channels and merged data blocks to the power amplifier circuit; the power amplifier circuit drives the speaker to play the audio corresponding to the merged data block according to the target sampling rate and target number of channels. Thus, high sound quality such as Hi-Res playback function is realized through software, getting rid of hardware limitations and reducing costs. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] Figure 1 is a flowchart of an audio data processing method according to an embodiment of the present disclosure;
[0023] Figure 2 is a structural block diagram of an audio data processing system according to an embodiment of the present disclosure;
[0024] Figure 3 is a flowchart of an audio data processing method according to another embodiment of the present disclosure;
[0025] Figure 4 is a schematic diagram of a data block merging method according to an embodiment of the present disclosure;
[0026] Figure 5 is a flowchart of an audio data processing method according to another embodiment of the present disclosure;
[0027] Figure 6 is a structural block diagram of a power amplifier according to an embodiment of the present disclosure;
[0028] Figure 7 is a schematic diagram of a method for writing data into a buffer according to an embodiment of the present disclosure;
[0029] Figure 8 is a timing diagram of an audio data processing method according to an embodiment of the present disclosure;
[0030] Fig. 9is a structural block diagram of a terminal device according to an embodiment of the present disclosure;
[0031] Fig.10 is a structural block diagram of a controller according to an embodiment of the present disclosure;
[0032] Fig.11 It is a structural block diagram of a vehicle according to an embodiment of the present disclosure. DETAILED DESCRIPTION
[0033] Embodiments of the present disclosure are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present disclosure, and should not be construed as limiting the present disclosure.
[0034] Please refer to the following Figure 1 -Attached Fig.11 The present invention describes an audio data processing method, a storage medium, a terminal device, and a vehicle according to an embodiment of the present invention.
[0035] Figure 1 The figure is a flowchart of an audio data processing method according to an embodiment of the present disclosure.
[0036] In this embodiment, the audio data processing method can be used in a terminal device (such as a vehicle-mounted terminal), and the terminal device includes a power amplifier circuit and a speaker. The terminal device may be installed with an operating system, and the operating system includes an application APP, AudioFlinger, an audio hardware abstraction layer, and a kernel.
[0037] See also Figure 1 , the audio data processing method includes:
[0038] S11, processing the audio data in the audio source file to obtain multiple data blocks.
[0039] Specifically, Figure 2 , Figure 8 As shown, when the operating system installed in the terminal device starts, a buffer area, such as a FIFO (First Input First Output) buffer area, can be created in the audio hardware abstraction layer (Audio Hal) to manage the data blocks written by the playback thread PlaybackThread. Afterwards, when the application plays the audio data, the audio source file sent by the application is received in the AudioFlinger layer, and the audio data in the audio source file is processed to obtain multiple data blocks. At the same time, multiple data blocks, the initial sampling rate and the initial number of channels in the audio source file can also be sent to the audio hardware abstraction layer.
[0040] It should be noted that the AudioFlinger layer is the executor of the audio system strategy and is responsible for the management of audio stream devices (such as the terminal devices mentioned above) and the processing and transmission of audio stream data. Figure 2 , Figure 8 As shown, the AudioFlinger layer includes a playback thread PlaybackThread. When the application APP plays audio data, the playback thread PlaybackThread receives and processes the audio source file sent by the APP, and transmits the processed data to the audio hardware abstraction layer.
[0041] S12, obtaining a target sampling rate and a target number of channels according to an initial sampling rate and an initial number of channels in the sound source file.
[0042] S13, calculating the number of channels to be merged according to the target number of channels and the initial number of channels.
[0043] S14, merging multiple data blocks according to the merging number.
[0044] S15, configuring the merged data blocks into a data stream and transmitting them to the power amplifier circuit according to the target number of channels and the target sampling rate.
[0045] Specifically, Figure 2 , Figure 8 As shown, the playback thread PlaybackThread transmits the processed data to the audio hardware abstraction layer for processing. The audio hardware abstraction layer merges the data blocks through the created buffer area, and then configures the merged data blocks as data streams according to the target number of channels and the target sampling rate and transmits them to the kernel. The kernel transmits the data to the DSP on the power amplifier circuit PA side through DAI (Digital Audio Interface), external DSP (Digital Signal Processing) and A2B bus.
[0046] Take the target sampling rate as 48KHz and the target number of channels as 4CH as an example. The data stream configured according to 48KHz / 4CH is: 100 data transmissions per second, 4 frames of data transmission each time (including 1 frame of the first channel data, 1 frame of the second channel data, 1 frame of the third channel data, and 1 frame of the fourth channel data played at the same time). For example, the 4-channel data stream is configured as 012301230123….
[0047] S16, driving the speaker to play the audio corresponding to the data stream according to the initial sampling rate and the initial number of channels through the power amplifier circuit.
[0048] Specifically, taking the audio data with an initial sampling rate of 96KHz and an initial number of channels of 2CH as an example, the audio data is first divided into blocks, and then the target sampling rate and the target number of channels such as 48KHz / 4CH can be obtained based on the initial sampling rate and the initial number of channels, and then the number of merges is calculated according to the target number of channels and the initial number of channels, and the data blocks are merged based on the number, and then the merged data blocks are configured according to 48KHz / 4CH to obtain a data stream. Finally, the data stream is received by the power amplifier circuit, and the speaker can be driven to play the audio according to the initial 96KHz / 2CH, thereby ensuring the sound quality.
[0049] The audio data processing method of the disclosed embodiment adds a buffer area in the AudioHal layer to cache the audio data blocks such as 96KHz / 2CH data blocks passed down from the upper layer, and merges the data blocks of adjacent buffer areas into one block, and then writes the pcm (Pulse-code-modulation) stream configured according to the target configuration (i.e. the above-mentioned target sampling rate and target number of channels) such as 48KHz / 4CH to the kernel, and transmits it to the DSP on the power amplifier side through the kernel to configure DACL / DACR for the required sound quality such as 96KHz / 2CH output. This method eliminates the hardware limitations of DAI, external DSP, A2B BUS, etc., realizes the playback function of high sound quality such as Hi-Res from the software, and reduces the hardware cost.
[0050] In some embodiments, the audio data processing method further includes: determining whether the initial sampling rate is a multiple of a preset sampling rate; if so, prohibiting resampling of the audio data.
[0051] Among them, the preset sampling rate can be 48KHz or 44.1KHz, which can be set according to Hi-Res sound quality requirements.
[0052] Specifically, Figure 2 , Figure 8 As shown, the playback thread PlaybackThread transmits the audio data to AudioMixer for resampling, and AudioMixer then transmits the processed audio data to the playback thread PlaybackThread. When the application plays music, the playback thread PlaybackThread determines whether the initial sampling rate is a multiple of 48KHz or 44.1KHz based on the initial sampling rate and initial number of channels parameters passed down by the application. If so, PlaybackThread disables the resampling function of AudioMixer. If it is not disabled, for example, 96KHz will be resampled to 48KHz. Reducing the number of samples means that the sound quality is reduced, and Hi-Res playback cannot be achieved.
[0053] In some embodiments, Figure 3As shown, the target sampling rate and the target number of channels are obtained according to the initial sampling rate and the initial number of channels in the sound source file, including:
[0054] S31, obtaining a target sampling rate according to the initial sampling rate.
[0055] In some embodiments, obtaining the target sampling rate according to the initial sampling rate includes: taking the target preset sampling rate of at least one preset sampling rate as the target sampling rate, the initial sampling rate is k times the target preset sampling rate, and k is an integer greater than 1.
[0056] Taking two preset sampling rates as an example, which are respectively recorded as the first preset sampling rate such as 48KHz and the second preset sampling rate such as 44.1KHz, the target sampling rate is obtained according to the initial sampling rate, including: if the initial sampling rate is a multiple of the first preset sampling rate, then the target sampling rate is determined to be the first preset sampling rate; if the initial sampling rate is a multiple of the second preset sampling rate, then the target sampling rate is determined to be the second preset sampling rate.
[0057] Specifically, according to the above method, the playback thread PlaybackThread determines whether the initial sampling rate is a multiple of 48KHz or 44.1KHz, and at the same time notifies the audio hardware abstraction layer to configure the correct sampling rate: if it is a multiple of 48KHz, such as 96KHz, 144KHz, 192KHz, etc., the audio hardware abstraction layer is configured to play at 48KHz, that is, the first preset sampling rate is 48KHz; if it is a multiple of 44.1KHz, such as 88.2KHz, 132.3KHz, etc., the audio hardware abstraction layer is configured to play at 44.1KHz, that is, the second preset sampling rate is 44.1KHz.
[0058] S32, obtaining a target number of channels according to the initial sampling rate, the target sampling rate and the initial number of channels.
[0059] In some embodiments, the target number of channels is calculated by the following formula:
[0060] c2=s1*c1 / s2
[0061] Where c2 indicates the target number of channels, s1 indicates the initial sampling rate, c1 indicates the initial number of channels, and s2 indicates the target sampling rate. For example, a 96KHz / 2CH (meaning that one data block is sampled at a frequency of 96KHz, and each data block contains two-channel audio data) audio source file has an initial sampling rate of 96KHz and an initial number of channels of 2. After being processed by the audio hardware abstraction layer, it becomes a 48KHz / 4CH audio file, a 192KHz / 2CH audio source file is converted to a 48KHz / 8CH audio file, and a 132.3KHz / 2CH audio source file is converted to a 44.1KHz / 6CH audio file.
[0062] In some embodiments, when the merged number is obtained according to the target number of channels and the initial number of channels, the merged number is calculated by the following formula:
[0063] n=c2 / c1
[0064] Among them, n represents the number of merges, c2 represents the target number of channels, and c1 represents the initial number of channels.
[0065] In some embodiments, the cache area adopts a first-in-first-out cache area to merge multiple data blocks according to the number of merges, including: merging n adjacent data blocks into one in the order of data block transmission, where n is the number of merges.
[0066] Specifically, Figure 4 As shown in the figure, 96KHz / 2CH to 48KHz / 4CH playback requires merging two data blocks, 144KHz2CH to 48KHz / 6CH requires merging three data blocks, and 192KHz / 2CH to 48KHz / 8CH requires merging four data blocks. When merging, the data blocks are merged in the order of first-in-first-out, and the merged data blocks are written to the kernel according to the target sampling rate and target number of channels configured by the audio hardware abstraction layer.
[0067] In some embodiments, Figure 5 As shown, the power amplifier circuit drives the speaker to play the audio corresponding to the data stream according to the initial sampling rate and the initial number of channels, including:
[0068] S61, dividing the data stream into channel data according to the initial number of channels by a power amplifier circuit to obtain a plurality of channel data.
[0069] S62, sampling each channel data respectively using the initial sampling rate to obtain a plurality of sampling results.
[0070] S63, generating corresponding driving signals to the speakers according to each sampling result, so as to drive the speakers to play audio.
[0071] Specifically, Figure 6 As shown, taking the initial number of channels = 2 as an example, the power amplifier circuit 500 includes a processing module 510, a first power amplifier module 520 and a second power amplifier module 530. The processing module 510 may include a microprocessor MCU1 and a digital processor DSP1, the first power amplifier module 520 may include a first digital-to-analog conversion chip DAC1 and a first power amplifier PA1, and the second power amplifier module 530 may include a second digital-to-analog conversion chip DAC2 and a second power amplifier PA2.
[0072] See also Figure 6, the data stream is transmitted to the A2B slave through the A2B bus, and then transmitted to the power amplifier circuit 500 for processing. The microprocessor MCU1 sends the received DAI configuration parameters (including the target sampling rate and the target number of channels) and DAC configuration parameters to the digital processor DSP1. The digital processor DSP1 receives the data stream in the buffer area according to the DAI configuration parameters, and configures the first digital-to-analog conversion chip DAC1 and the second digital-to-analog conversion chip DAC2 according to the DAC configuration parameters. After receiving the data stream, the digital processor DSP1 divides the data stream into channel data according to the initial number of channels to obtain two channel data, specifically: if the data stream is 012301230123…, the data 0 and 2 in the buffer area are stored in the first buffer of the digital processor DSP1 to obtain one channel data; the data 1 and 3 in the buffer area are stored in the second buffer of the digital processor DSP1 to obtain another channel data; then the data in the first buffer is transmitted to the first digital-to-analog conversion chip DAC1, and the data in the second buffer is transmitted to the second digital-to-analog conversion chip DAC2.
[0073] For example, converting 48KHz / 4CH / 32Bits to 96KHz / 2CH / 32Bits: Figure 7 As shown, the microprocessor MCU1 receives the DAI configuration parameters (48KHz / 4CH / 32Bits) and DAC configuration parameters (96KHz / 32Bits) through the I2C / SPI interface, and sends the configuration parameters to the digital processor DSP1. The digital processor DSP1 configures dual-channel output, and configures the first digital-to-analog conversion chip DAC1 and the second digital-to-analog conversion chip DAC2 to 96KHz / 32Bits. When the audio is played, the digital processor DSP1 saves the CH0 and CH2 samples in the FIFO to the first buffer (Buffer1), and saves the CH1 and CH3 samples to the second buffer (Buffer2). The first buffer data is transmitted to the first digital-to-analog conversion chip DAC1, and the parallel second buffer data is transmitted to the second digital-to-analog conversion chip DAC2, and finally the speaker is driven to sound through the power amplifier.
[0074] In summary, the audio data processing method of the disclosed embodiment creates a FIFO buffer in the audio hal layer of the operating system, and merges the 48KHz or 44.1KHz multiplied sampling rate / 2CH data block passed down from the upper layer into a larger block according to the number of merges calculated by the algorithm, and then sends it to the kernel according to 48KHz or 44.1KHz and the number of channels calculated by the algorithm, and plays it at the external power amplifier PA side according to the 48KHz or 44.1KHz multiplied sampling rate and dual channels. This method gets rid of the hardware limitations, realizes the Hi-Res playback function through software, and reduces costs.
[0075] Based on the above audio data processing method, the present disclosure also proposes a computer-readable storage medium.
[0076] In this embodiment, a computer program is stored on a computer-readable storage medium, and when the computer program is executed by a processor, the above-mentioned audio data processing method is implemented.
[0077] Fig. 9 It is a structural block diagram of a terminal device according to an embodiment of the present disclosure.
[0078] like Fig. 9 As shown, the terminal device 900 includes a power amplifier circuit 901 , a speaker 902 and a controller 1000 .
[0079] In some embodiments, Fig.10 As shown, the controller 1000 includes: a processor 1001 and a memory 1003. The processor 1001 and the memory 1003 are connected, such as through a bus 1002. Optionally, the controller 1000 may also include a transceiver 1004. It should be noted that in actual applications, the transceiver 1004 is not limited to one, and the structure of the controller 1000 does not constitute a limitation on the embodiments of the present disclosure.
[0080] Processor 1001 may be a CPU (Central Processing Unit), a general-purpose processor, a DSP, an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. It may implement or execute various exemplary logic blocks, modules, and circuits described in conjunction with the present disclosure. Processor 1001 may also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, and the like.
[0081] The bus 1002 may include a path to transmit information between the above components. The bus 1002 may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus. The bus 1002 may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Fig.10 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0082] The memory 1003 is used to store a computer program corresponding to the audio data processing method of the above embodiment of the present disclosure, and the computer program is controlled and executed by the processor 1001. The processor 1001 is used to execute the computer program stored in the memory 1003 to implement the contents shown in the above method embodiment. Fig.10 The controller 1000 shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0083] Fig.11 It is a structural block diagram of a vehicle according to an embodiment of the present disclosure.
[0084] like Fig.11 As shown, vehicle 1100 includes terminal device 900 .
[0085] It should be noted that the logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a sequenced list of executable instructions for implementing logical functions, and can be specifically implemented in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute instructions), or in combination with these instruction execution systems, devices or apparatuses. For the purposes of this specification, "computer-readable medium" can be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in combination with these instruction execution systems, devices or apparatuses. More specific examples of computer-readable media (a non-exhaustive list) include the following: an electrical connection portion with one or more wirings (electronic device), a portable computer disk box (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium and then editing, interpreting or processing in other suitable ways if necessary, and then stored in a computer memory.
[0086] It should be understood that the various parts of the present disclosure can be implemented in hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, multiple steps or methods can be implemented in software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.
[0087] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present disclosure. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.
[0088] In the description of the present disclosure, it should be understood that the terms "center", "longitudinal", "lateral", "length", "width", "thickness", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inside", "outside", "clockwise", "counterclockwise", "axial", "radial", "circumferential" and the like indicate orientations or positional relationships based on the orientations or positional relationships shown in the accompanying drawings, and are only for the convenience of describing the present disclosure and simplifying the description, and do not indicate or imply that the referred device or element must have a specific orientation, be constructed and operated in a specific orientation, and therefore should not be understood as a limitation on the present disclosure.
[0089] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of the features. In the description of the present disclosure, "plurality" means at least two, such as two, three, etc., unless otherwise clearly and specifically defined.
[0090] In the present disclosure, unless otherwise clearly specified and limited, the terms "installed", "connected", "connected", "fixed" and the like should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection or an indirect connection through an intermediate medium, it can be the internal connection of two elements or the interaction relationship between two elements, unless otherwise clearly defined. For ordinary technicians in this field, the specific meanings of the above terms in the present disclosure can be understood according to specific circumstances.
[0091] In the present disclosure, unless otherwise clearly specified and limited, a first feature being "above" or "below" a second feature may mean that the first and second features are in direct contact, or the first and second features are in indirect contact through an intermediate medium. Moreover, a first feature being "above", "above" or "above" a second feature may mean that the first feature is directly above or obliquely above the second feature, or simply means that the first feature is higher in level than the second feature. A first feature being "below", "below" or "below" a second feature may mean that the first feature is directly below or obliquely below the second feature, or simply means that the first feature is lower in level than the second feature.
[0092] Although the embodiments of the present disclosure have been shown and described above, it is to be understood that the above embodiments are exemplary and are not to be construed as limitations of the present disclosure. A person skilled in the art may change, modify, replace and vary the above embodiments within the scope of the present disclosure.
Claims
1. An audio data processing method, characterized in that: The method comprises: Processing the audio data in the audio source file to obtain multiple data blocks; Obtaining a target number of channels and a target sampling rate according to an initial sampling rate and an initial number of channels in the sound source file; Calculate the number of merges according to the target number of channels and the initial number of channels; Merging the plurality of data blocks according to the merge number; According to the target number of channels and the target sampling rate, the merged data blocks are configured as data streams and transmitted to the power amplifier circuit; The power amplifier circuit drives a speaker to play the audio corresponding to the data stream according to the initial sampling rate and the initial number of channels.
2. The audio data processing method according to claim 1, characterized in that: The step of obtaining a target number of channels and a target sampling rate according to an initial sampling rate and an initial number of channels in the sound source file comprises: Obtaining the target sampling rate according to the initial sampling rate; The target number of channels is obtained according to the initial sampling rate, the target sampling rate and the initial number of channels.
3. The audio data processing method according to claim 2, characterized in that: The step of obtaining the target sampling rate according to the initial sampling rate comprises: A target preset sampling rate among at least one preset sampling rate is used as the target sampling rate, and the initial sampling rate is k times the target preset sampling rate, where k is an integer greater than 1.
4. The audio data processing method according to claim 2, characterized in that: The obtaining the target number of channels according to the initial sampling rate, the target sampling rate and the initial number of channels comprises: The target number of channels is calculated by the following formula: c2=s1*c1 / s2, Among them, c2 represents the target number of channels, s1 represents the initial sampling rate, c1 represents the initial number of channels, and s2 represents the target sampling rate.
5. The audio data processing method according to claim 1, characterized in that: The calculating the merged number according to the target number of channels and the initial number of channels includes: The combined number is calculated by the following formula: n=c2 / c1, Wherein, n represents the merged number, c2 represents the target number of channels, and c1 represents the initial number of channels.
6. The audio data processing method according to claim 1, characterized in that: The merging of the plurality of data blocks according to the merging number includes: According to the order of transmission of the data blocks, n adjacent data blocks are merged into one, wherein n is the number of merged blocks.
7. The audio data processing method according to claim 1, characterized in that: The driving a speaker to play the audio corresponding to the data stream according to the initial sampling rate and the initial number of channels by the power amplifier circuit includes: Dividing the data stream into channel data according to the initial number of channels by the power amplifier circuit to obtain a plurality of channel data; Using the initial sampling rate to sample each of the channel data to obtain a plurality of sampling results; Generate corresponding driving signals to the speakers according to the sampling results to drive the speakers to play audio.
8. The audio data processing method according to claim 3, characterized in that: The preset sampling rate includes a first preset sampling rate and a second preset sampling rate, the first preset sampling rate is 48 KHz, and the second preset sampling rate is 44.1 KHz.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 8 is implemented.
10. A terminal device, characterized in that: The device comprises a power amplifier circuit, a speaker and a controller, wherein the controller comprises a memory and a processor, and when a computer program stored in the memory is executed by the processor, the method as claimed in any one of claims 1 to 8 is implemented.
11. A vehicle, characterized in that: Comprising the terminal device as claimed in claim 10.
Citation Information
Patent Citations
Audio data processing method, audio data processing device, electronic equipment and storage medium
CN110335615A
Method and system for performing sample rate conversion
US20080114605A1
Audio transmission method, speaker system, audio transmission device, speaker, and program
WO2013018138A1
Audio data processing method and device thereof
WO2022092609A1
