Audio processing method, device and electronic equipment

By performing data filling processing on the audio data transmission problem caused by the mismatch of the sampling frequency of the SOC and DSP chip audio interface in electronic devices, the problem of audio playback speed is solved, and normal audio playback in the case of mismatch is achieved.

CN116088390BActive Publication Date: 2025-03-14SPREADTRUM COMMUNICATION (SHANGHAI) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310162390.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-02-23
Publication Date
2025-03-14
Estimated Expiration
2043-02-23

AI Technical Summary

Technical Problem

The sampling frequency of the audio interface of the SOC and DSP chips in electronic devices does not match, resulting in different audio data transmissions, resulting in the audio playback speed twice and the normal playback cannot be played.

Method used

By determining the audio interface sampling frequency of the SOC and DSP chips, the initial audio data is filled with data according to the frequency ratio, the target audio data is obtained, and transmitted through the corresponding audio interface to ensure that the data volume is consistent.

Benefits of technology

It solves the problem of different audio data transmissions caused by mismatch in audio interfaces, and ensures that electronic devices can play audio normally in the event of mismatch.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116088390B_ABST
    Figure CN116088390B_ABST
Patent Text Reader

Abstract

The embodiment of the present application provides an audio processing method, device and electronic device. The method includes: determining the first sampling frequency of the first audio interface of the SOC and the second sampling frequency of the second audio interface of the DSP chip; determining the initial audio data to be transmitted, the initial audio data is the audio data generated by the SOC or the DSP chip; performing data filling processing on the initial audio data according to the first sampling frequency and the second sampling frequency to obtain target audio data, and transmitting the target audio data through the first audio interface and the second audio interface. The electronic device can play audio normally when the audio interface does not match.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of signal processing technology, and in particular to an audio processing method, device and electronic device. Background Art

[0002] The electronic device may be provided with a system on chip (SOC) and a digital signal processing (DSP) chip, and the electronic device may perform audio recording or audio playback through the SOC and DSP chips.

[0003] In the related art, audio can be processed in the following manner: the audio data to be processed is transmitted to the audio interface of the DSP chip through the audio interface of the SOC, and the DSP chip plays the audio data to be processed through the speaker. Or the audio data to be processed is transmitted to the audio interface of the SOC through the audio interface of the DSP chip, and the SOC chip stores the audio data to be processed. In the above process, if the audio interface of the SOC is an integrated audio (Integrated Interchip Sound, IIS) interface, the audio interface of the DSP chip is a time-division multiplexing (Time-Division Multiplexing, TDM) interface. The IIS interface does not match the TDM interface, and the sampling frequencies of the two interfaces are different. When transmitting audio data, there may be different numbers of audio data transmissions in the same period, which makes the audio playback speed double, causing the electronic device to be unable to play audio normally. Summary of the invention

[0004] The embodiments of the present application provide an audio processing method, device and electronic device to solve the problem that the electronic device cannot play normally.

[0005] In a first aspect, an embodiment of the present application provides an audio processing method, which is applied to an electronic device, wherein the electronic device is provided with a system-on-chip (SOC) and a digital signal processing (DSP) chip, and the method comprises:

[0006] Determine a first sampling frequency of a first audio interface of the SOC and a second sampling frequency of a second audio interface of the DSP chip;

[0007] Determining initial audio data to be transmitted, wherein the initial audio data is audio data generated by the SOC or the DSP chip;

[0008] According to the first sampling frequency and the second sampling frequency, data filling processing is performed on the initial audio data to obtain target audio data, and the target audio data is transmitted through the first audio interface and the second audio interface.

[0009] In a possible implementation manner, the first audio interface is an integrated audio interface IIS interface, and the second audio interface is a time division multiplexing technology TDM interface;

[0010] According to the first sampling frequency and the second sampling frequency, the initial audio data is subjected to data filling processing to obtain target audio data, including:

[0011] Obtaining a frequency ratio M between the second sampling frequency and the first sampling frequency, where M is an integer greater than 1;

[0012] According to the frequency ratio, data filling processing is performed on the initial audio data to obtain target audio data.

[0013] In a possible implementation, performing data filling processing on the initial audio data according to the frequency ratio M to obtain target audio data includes:

[0014] Determine partial audio data in the initial audio data according to the frequency ratio, wherein the length of the initial audio data is M times the length of the partial audio data;

[0015] Perform data filling processing on the part of the audio data to obtain the target audio data.

[0016] In a possible implementation manner, the initial audio data is data generated by the SOC; and performing data filling processing on the partial audio data to obtain the target audio data includes:

[0017] Determine at least one audio data unit in the portion of audio data, wherein the length of the audio data unit is a preset unit length;

[0018] Preset data is filled after each audio data unit to obtain the target audio data, and the length of the preset data is the preset unit length.

[0019] In a possible implementation manner, transmitting the target audio data through the first audio interface and the second audio interface includes:

[0020] The target audio data is sent to the DSP chip through the IIS interface, so that the DSP chip receives the target audio data through the TDM interface.

[0021] In a possible implementation, the method further includes:

[0022] Removing the preset data from the target audio data to obtain the audio data to be played;

[0023] Play the audio data to be played.

[0024] In a possible implementation manner, the initial audio data is data generated by the DSP; and performing data filling processing on the partial audio data to obtain the target audio data includes:

[0025] Preset data is filled after the partial audio data to obtain the target audio data, wherein the length of the preset data is the difference between the length of the initial audio data and the length of the partial audio data.

[0026] In a possible implementation manner, transmitting the target audio data through the first audio interface and the second audio interface includes:

[0027] The target audio data is sent to the SOC through the TDM interface, so that the SOC receives the target audio data through the IIS interface.

[0028] In a second aspect, an embodiment of the present application provides an audio processing device, the device comprising:

[0029] A first determining module determines a first sampling frequency of a first audio interface of the SOC and a second sampling frequency of a second audio interface of the DSP chip;

[0030] A second determining module determines initial audio data to be transmitted, wherein the initial audio data is data generated by the SOC or the DSP chip;

[0031] The processing module performs data filling processing on the initial audio data according to the first sampling frequency and the second sampling frequency to obtain target audio data, and transmits the target audio data through the first audio interface and the second audio interface.

[0032] In a possible implementation manner, the processing module is specifically used to:

[0033] Obtaining a frequency ratio M between the second sampling frequency and the first sampling frequency, where M is an integer greater than 1;

[0034] According to the frequency ratio, data filling processing is performed on the initial audio data to obtain target audio data.

[0035] In a possible implementation manner, the processing module is specifically used to:

[0036] Determine partial audio data in the initial audio data according to the frequency ratio, wherein the length of the initial audio data is M times the length of the partial audio data;

[0037] Perform data filling processing on the part of the audio data to obtain the target audio data.

[0038] In a possible implementation manner, the processing module is specifically used to:

[0039] Determine at least one audio data unit in the portion of audio data, wherein the length of the audio data unit is a preset unit length;

[0040] Preset data is filled after each audio data unit to obtain the target audio data, and the length of the preset data is the preset unit length.

[0041] In a possible implementation manner, the processing module is specifically used to:

[0042] The target audio data is sent to the DSP chip through the IIS interface, so that the DSP chip receives the target audio data through the TDM interface.

[0043] In a possible implementation manner, the processing module is specifically used to:

[0044] Preset data is filled after the partial audio data to obtain the target audio data, wherein the length of the preset data is the difference between the length of the initial audio data and the length of the partial audio data.

[0045] In a possible implementation manner, the processing module is specifically used to:

[0046] The target audio data is sent to the SOC through the TDM interface, so that the SOC receives the target audio data through the IIS interface.

[0047] In a possible implementation, the device further includes a playing module.

[0048] Wherein, the playback module is used for:

[0049] Removing the preset data from the target audio data to obtain the audio data to be played;

[0050] Play the audio data to be played.

[0051] In a third aspect, the present application provides a chip having a computer program stored thereon, wherein when the computer program is executed by the chip, the method as described in any one of the first aspects is implemented.

[0052] In a fourth aspect, the present application provides a chip module having a computer program stored thereon, and when the computer program is executed by the chip module, the method as described in any one of the first aspects is implemented.

[0053] In a fifth aspect, an embodiment of the present application provides an electronic device, including:

[0054] at least one processor; and

[0055] a memory communicatively connected to the at least one processor; wherein,

[0056] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can perform any method described in the first aspect.

[0057] In a sixth aspect, an embodiment of the present application provides a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to enable the computer to execute any one of the methods in the first aspect.

[0058] In a seventh aspect, an embodiment of the present application provides a computer program product, including a computer program, which implements any method in the first aspect when executed by a processor.

[0059] The audio processing method, device and electronic device provided in the embodiments of the present application determine the first sampling frequency of the first audio interface of the SOC and the second sampling frequency of the second audio interface of the DSP chip. Determine the initial audio data to be transmitted, and the initial audio data can be audio data generated by the SOC or the DSP chip. According to the first sampling frequency and the second sampling frequency, the initial audio data is filled with data to obtain the target audio data. The target audio data is transmitted through the first audio interface and the second audio interface, so as to play or store the target audio data. In the above process, the initial audio data can be filled with data according to the first sampling frequency and the second sampling frequency to avoid the situation where the number of audio data transmissions is different due to the mismatch of the interfaces of the SOC and the DSP chip, so that the electronic device can play the audio normally when the audio interfaces do not match. BRIEF DESCRIPTION OF THE DRAWINGS

[0060] Figure 1 A schematic diagram of an application scenario provided by an embodiment of the present application;

[0061] Figure 2 A flowchart of an audio processing method provided in an embodiment of the present application;

[0062] Figure 3 A flowchart of another audio processing method provided in an embodiment of the present application;

[0063] Figure 4 A schematic diagram of a process for determining part of audio data provided in an embodiment of the present application;

[0064] Figure 5 A schematic diagram of a process for determining target audio data provided by an embodiment of the present application;

[0065] Figure 6 A schematic diagram of another process for determining target audio data provided by an embodiment of the present application;

[0066] Fig. 7A A schematic diagram of the audio processing process provided by an embodiment of the present application;

[0067] Figure 7B A schematic diagram of the audio processing process provided by an embodiment of the present application;

[0068] Figure 8 A schematic diagram of the structure of an audio processing device provided in an embodiment of the present application;

[0069] Fig. 9 A schematic diagram of the structure of another audio processing device provided in an embodiment of the present application;

[0070] Fig.10 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0071] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.

[0072] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.

[0073] For ease of understanding, below, combined Figure 1 , the application scenarios to which the embodiments of the present application are applicable are described.

[0074] Figure 1 This is a schematic diagram of an application scenario provided by an embodiment of the present application. Figure 1, including an electronic device 101, which can be a car audio system, a mobile phone, etc. The electronic device 101 is provided with a SOC and a DSP chip. Both the SOC and the DSP chip are provided with an audio interface. The electronic device 101 can play or record audio through the SOC and the DSP chip. When the electronic device 101 plays audio, the SOC of the electronic device 101 sends the audio data to be played to the DSP chip of the electronic device 101 through the audio interface of the SOC. The DSP chip of the electronic device 101 receives the audio data to be played through the audio interface of the DSP chip, and plays the audio corresponding to the audio data to be played through the speaker of the electronic device 101. When the electronic device 101 records audio, the DSP chip of the electronic device 101 receives the audio data recorded by the microphone of the electronic device 101, and sends the recorded audio data to the SOC of the electronic device 101 through the audio interface of the DSP chip. The SOC of the electronic device 101 receives and stores the recorded audio data through the audio interface of the SOC.

[0075] In the related art, if the audio interface of the SOC is an IIS interface and the audio interface of the DSP chip is a TDM interface, the IIS interface does not match the TDM interface, and the sampling frequencies of the two interfaces are different. When transmitting audio data, there may be different amounts of audio data transmitted in the same period, causing the audio to be played at double speed, resulting in the electronic device being unable to play audio normally.

[0076] In an embodiment of the present application, a first sampling frequency of a first audio interface of a SOC is determined, and a second sampling frequency of a second audio interface of a DSP chip is determined. Initial audio data to be transmitted is determined, and the initial audio data may be audio data generated by the SOC or generated by a DSP chip. According to the first sampling frequency and the second sampling frequency, data filling processing is performed on the initial audio data to obtain target audio data. The target audio data is transmitted through the first audio interface and the second audio interface, thereby playing or storing the target audio data. In the above process, data filling processing can be performed on the initial audio data according to the first sampling frequency and the second sampling frequency, so as to avoid the situation where the number of audio data transmissions is different due to the mismatch of the interfaces of the SOC and the DSP chip, so that the electronic device can play audio normally when the audio interfaces do not match.

[0077] The method shown in the present application is described below through specific embodiments. It should be noted that the following embodiments can exist independently or in combination with each other, and the same or similar contents will not be described repeatedly in different embodiments.

[0078] Figure 2 This is a flowchart of an audio processing method provided in an embodiment of the present application. Figure 2 , the method may include:

[0079] S201, determining a first sampling frequency of a first audio interface of a SOC and a second sampling frequency of a second audio interface of a DSP chip.

[0080] The execution subject of the embodiment of the present application may be an electronic device, or a chip, a chip module or an audio processing device arranged in the electronic device, etc. The audio processing device may be implemented by software, or by a combination of software and hardware.

[0081] The first sampling frequency of the first audio interface of the SOC and the second sampling frequency of the second audio interface of the DSP chip may be set in advance and stored in a preset storage space of the electronic device.

[0082] When the first sampling frequency and the second sampling frequency are set, the first sampling frequency may be 2N times of the second sampling frequency, where N is an integer greater than or equal to 1.

[0083] For example, after determining that the first audio interface of the SOC in electronic device A is an IIS interface and the second audio interface of the DSP chip is a TDM interface, the first sampling frequency of the IIS interface of the SOC can be set to 96kHz, and the second sampling frequency of the TDM interface of the DSP chip can be set to 48kHz. The first sampling frequency and the second sampling frequency are stored in the preset storage space of electronic device A.

[0084] S202: Determine initial audio data to be transmitted.

[0085] The initial audio data is audio data generated by a SOC or DSP chip.

[0086] When the electronic device plays audio, the SOC determines the audio to be played in the storage space of the electronic device as initial audio data. When the electronic device records audio, the DSP chip obtains the audio recorded by the microphone of the electronic device and determines the audio recorded by the microphone as initial audio data.

[0087] For example, the user uses electronic device A to play song 1, and the SOC of electronic device A determines that audio data 1 corresponding to the played song 1 is the initial audio data in the storage space of the electronic device. The user uses electronic device B to record audio, and the microphone of electronic device B records voice 1 and sends it to the DSP chip of electronic device B. The DSP chip of electronic device B obtains voice 1 recorded by the microphone of electronic device B, and determines voice 1 recorded by the microphone as the initial audio data.

[0088] S203: Perform data filling processing on the initial audio data according to the first sampling frequency and the second sampling frequency to obtain target audio data, and transmit the target audio data through the first audio interface and the second audio interface.

[0089] The first audio interface is an integrated audio interface IIS interface, and the second interface is a time division multiplexing technology TDM interface.

[0090] The target audio data may be obtained in the following manner: obtaining a frequency ratio M between the second sampling frequency and the first sampling frequency, where M is an integer greater than 1; and performing data filling processing on the initial audio data according to the frequency ratio to obtain the target audio data.

[0091] The initial audio data may be padded with digital 0s so that the initial audio data maintains the same sound quality after being padded.

[0092] Since the sampling frequencies of the IIS interface and the TDM interface in the same electronic device are different, when audio data is transmitted, the amount of audio data obtained in the same period of time is different. The initial audio data can be filled with data to obtain target audio data, so that the amount of audio data received by the audio interface in the same period of time is the same.

[0093] For example, when electronic device A plays audio, the first sampling frequency of the IIS interface is 96kHz, and the second sampling frequency of the TDM interface is 48kHz. According to the first sampling frequency and the second sampling frequency, it can be determined that the amount of audio data transmitted by the IIS interface in the same period is twice that of the TDM interface. Therefore, the audio data transmitted by the IIS interface can be filled with data. The amount of data twice relative to the TDM interface is filled with 0 to the normal amount of data.

[0094] The audio processing method provided in the embodiment of the present application determines the first sampling frequency of the first audio interface of the SOC and the second sampling frequency of the second audio interface of the DSP chip. The initial audio data to be transmitted is determined. According to the first sampling frequency and the second sampling frequency, the initial audio data is data-filled to obtain target audio data, and the target audio data is transmitted through the first audio interface and the second audio interface. In the above process, the initial audio data can be data-filled according to the first sampling frequency and the second sampling frequency to avoid the situation where the number of audio data transmissions is different due to the interface mismatch between the SOC and the DSP chip, so that the electronic device can play audio normally when the audio interface does not match.

[0095] Based on any of the above embodiments, Figure 3 , the detailed process of audio processing is explained.

[0096] Figure 3 This is a flowchart of another audio processing method provided in an embodiment of the present application. Figure 3 , the method comprising:

[0097] S301, determining a first sampling frequency of a first audio interface of a SOC and a second sampling frequency of a second audio interface of a DSP chip.

[0098] The first audio interface is an IIS interface, and the second audio interface is a TDM interface.

[0099] S302: Determine initial audio data to be transmitted.

[0100] The initial audio data is audio data generated by a SOC or DSP chip.

[0101] S303: If the initial audio data is data generated by the SOC, obtain a frequency ratio M between the second sampling frequency and the first sampling frequency.

[0102] M is an integer greater than 1.

[0103] For example, the first audio interface of electronic device A is an IIS interface, and the second audio interface is a TDM interface. The sampling frequency of the IIS interface is 96kHz, and the sampling frequency of the TDM interface is 48kHz. It can be determined that the first sampling frequency is 96kHz, and the second sampling frequency is 48kHz. Then it can be determined that the frequency ratio M between the second sampling frequency and the first sampling frequency is 96 / 48=2.

[0104] S304: Determine part of the audio data in the initial audio data according to the frequency ratio.

[0105] The length of the initial audio data is M times the length of the partial audio data.

[0106] Next, combine Figure 4 , the process of determining part of the audio data is explained. Figure 4 A schematic diagram of the process of determining part of the audio data provided by the embodiment of the present application. Figure 4 , including initial audio data 401, the data length of the initial audio data 401 is 32 bits. Assuming that the frequency ratio M between the second sampling frequency and the first sampling frequency is 2, the partial audio data 402 is any continuous 16-bit audio data in the initial audio data 401. For example, the partial audio data 402 can be the 0th to 15th audio data in the initial audio data 401.

[0107] S305: Perform data filling processing on part of the audio data to obtain target audio data.

[0108] The target audio data can be obtained in the following manner: determining at least one audio data unit in part of the audio data, the length of the audio data unit being a preset unit length; filling preset data after each audio data unit to obtain the target audio data, the length of the preset data being a preset unit length.

[0109] The preset unit length may be a data frame (slot). The preset data may be 0.

[0110] Next, combine Figure 5 , the process of determining the target audio data is explained. Figure 5 A schematic diagram of a process for determining target audio data provided by an embodiment of the present application. Figure 5 , including partial audio data 501 and target audio data 502. Partial audio data 501 is the initial audio data received by the IIS interface of the electronic device. Partial audio data 501 includes 8 preset unit lengths, one preset unit length is a slot, and each slot includes 16-bit audio data. Wherein, slot0, slot2, slot4 and slot6 include fixed configuration data (blank slot). Slot1, slot3, slot5 and slot7 are audio data (d0, d1, d2, d3). When performing data filling processing, fill preset data 0 after slot1, slot3, slot5 and slot7, that is, each slot supplements data 0 of 16-bit length to obtain target audio data. Target audio data 502 includes all audio numbers after data filling processing.

[0111] S306. Send the target audio data to the DSP chip through the IIS interface, so that the DSP chip receives the target audio data through the TDM interface.

[0112] For example, assume that the initial audio data is audio D generated by SOC. The SOC chip performs data filling processing on audio D according to the frequency ratio to obtain target audio data D0. The SOC chip sends the target audio data D0 to the DSP chip through the IIS interface, so that the DSP chip receives the target audio data D0 through the TDM interface.

[0113] S307: remove the preset data in the target audio data to obtain the audio data to be played.

[0114] For example, according to the above Figure 5 The target audio data 502 shown is processed by removing the preset data 0 in the target audio data 502 to obtain the audio data to be played.

[0115] S308: Play the audio data to be played.

[0116] The DSP chip plays the music data to be played through the speakers of the electronic device.

[0117] When playing the audio data to be played, the number of preset unit lengths of the audio data to be played is the same as the number of preset unit lengths of the target audio data, avoiding different amounts of audio data played within a fixed period of time due to different audio interface frequencies.

[0118] S309: If the initial audio data is data generated by a DSP chip, fill in preset data after part of the audio data to obtain target audio data.

[0119] The length of the preset data is the difference between the length of the initial audio data and the length of the partial audio data.

[0120] The preset data may be 0. The length of the partial audio data is the same as the number of microphones of the electronic device.

[0121] Next, combine Figure 6 , the process of determining the target audio data is explained. Figure 6 This is another schematic diagram of a process for determining target audio data provided by an embodiment of the present application. Figure 6 , including initial audio data 601 and target audio data 602. Assuming that the electronic device has 4 microphones, after the DSP chip receives the audio data recorded by the microphone of the electronic device, there are a total of 8 channels of audio data. Among them, 4 channels are audio data recorded by the microphone (d0, d1, d2, d3), and 4 channels are recovered audio data (d4, d5, d6, d7), and the audio data of each channel corresponds to a slot. According to the number of microphones in the electronic device, it can be determined that the length of the partial audio data is 4. According to the length of the partial audio, the initial audio data 601 is divided into two partial audio data. Among them, one partial audio data is 4 slots, including audio data d0, d1, d2, d3. The other partial audio data is 4 slots, including audio data d4, d5, d6, d7.

[0122] According to the length of the initial audio data of 8 and the length of the partial audio data of 4, the length of the preset data to be filled is determined to be 8-4=4. Therefore, when performing data filling processing, the preset data 0 with a length of 4 slots is filled after each partial audio data to obtain the target audio data 602.

[0123] S310 , sending target audio data to the SOC through the TDM interface, so that the SOC receives the target audio data through the IIS interface.

[0124] After the SOC receives the target audio data, the target audio data can be divided into a plurality of first target audio data according to a preset time period. The preset data in each first target audio data is deleted to obtain the audio data to be stored. The audio data to be stored is stored in a preset storage space of the electronic device. The duration of the preset time period can be the duration corresponding to one cycle of audio data transmission.

[0125] The audio processing method provided in the embodiment of the present application determines the first sampling frequency of the first audio interface of the SOC and the second sampling frequency of the second audio interface of the DSP chip. If the initial audio data is data generated by the SOC, the frequency ratio M between the second sampling frequency and the first sampling frequency is obtained. According to the frequency ratio, part of the audio data is determined in the initial audio data. Data filling processing is performed on the part of the audio data to obtain the target audio data. The target audio data is sent to the DSP chip through the IIS interface so that the DSP chip receives the target audio data through the TDM interface. If the initial audio data is data generated by the DSP chip, preset data is filled after the part of the audio data to obtain the target audio data. The target audio data is sent to the SOC through the TDM interface so that the SOC chip receives the target audio data through the IIS interface. In the above process, the initial audio data can be data filled according to the first sampling frequency and the second sampling frequency to avoid the situation where the number of audio data transmissions is different due to the mismatch of the interfaces of the SOC and the DSP chip, so that the electronic device can play audio normally when the audio interface does not match.

[0126] Based on any one of the above embodiments, the following describes the process of audio processing when the first audio interface of the SOC is a TDM interface and the second audio interface of the DSP chip is an IIS interface.

[0127] When the initial audio data is data generated by the SOC, a frequency ratio M between the second sampling frequency and the first sampling frequency is obtained. According to the frequency ratio, the audio data corresponding to each slot in the preset time period in the initial audio data is determined. The duration of the preset time period can be the duration corresponding to one cycle when the audio data is transmitted.

[0128] For example, according to the above Figure 5 As shown, when the first audio interface of the SOC is a TDM interface, the initial audio data can be directly set to Figure 5 The target audio data 502 is in the form of the target audio data 502, so as to avoid the difference in the amount of audio data transmitted in one cycle due to the difference in the frequency of the audio interface.

[0129] When the initial audio data is data generated by the DSP chip, the initial audio data can be pre-processed, and the two 16-bit audio data of the IIS interface can be woven into a 32-bit slot, and each slot can be filled to obtain the processed audio data and transmit it to the SOC through the IIS interface of the DSP chip. At this time, the DSP chip needs to have the ability to weave data.

[0130] Based on any of the above embodiments, Figure 7A-7B , the process of audio processing is illustrated with examples. Fig. 7A This is a schematic diagram of the audio processing process provided by the embodiment of the present application. Fig. 7A , including SOC 701 and DSP chip 702. SOC 701 and DSP chip 702 are arranged in the electronic device. A hardware abstraction layer (HAL) is arranged in SOC 701, and the audio interface of SOC 701 is an IIS interface. The audio interface of DSP chip 702 is a TDM interface. Before audio processing, the parameters of the IIS interface and the TDM interface can be set through HAL and stored in the preset storage space of the electronic device. The parameters of the IIS interface and the TDM interface can be specifically shown in Table 1:

[0131] Table 1

[0132] Interface parameters IIS Interface TDM Interface Number of slots — 8 slot width — 16-bit Interface width 32-bit — Sampling frequency 96kHz 48kHz Serial clock (bit clock, BCLK) 96kHz*32*2 48kHz*64*2 Operation Mode Right Align —

[0133] SOC 701 determines that the initial audio data is the audio data d0, d1, d2, and d3 generated by SOC 701, and the length of each audio data is 16 bits. According to Table 1, it can be determined that the frequency ratio between the second sampling frequency of the TDM interface and the first sampling frequency of the IIS interface is 2. Since the length of the initial audio data is 8 slots, it can be determined that the length of the partial audio data is 4 slots. According to the length of the partial audio data, 2 partial audio data are determined in the initial audio data. Among them, one partial audio data includes slot0~slot3, and the other partial audio data includes slot4~slot7. When SOC 701 performs data filling processing, it fills the preset data 0 after slot1, slot3, slot5 and slot7, that is, each slot is supplemented with data 0 of 16 bits in length to obtain the target audio data.

[0134] SOC 701 sends the target audio data to DSP chip 702 through IIS interface, and DSP chip 702 receives the target audio data through TDM interface. DSP chip 702 removes the preset data in the target audio data to obtain the audio data to be played, and plays the audio data to be played through the microphone of the electronic device.

[0135] Figure 7B This is a schematic diagram of the audio processing process provided by the embodiment of the present application. Figure 7B , SOC701 determines that the initial audio data is the audio data d0, d1, d2, d3, d4, d5, d6, d7 generated by DSP chip 702. DSP chip 702 determines that the length of the preset data to be filled is 8-4=4 according to the length of the initial audio data 8 and the length of the partial audio data 4. Therefore, when performing data filling processing, DSP chip 702 fills the preset data 0 with a length of 4 slots after each partial audio data to obtain the target audio data.

[0136] The DSP chip 702 sends the target audio data to the SOC 701 through the TDM interface, and the SOC 701 receives the target audio data through the IIS interface. After the SOC 701 receives the target audio data, the target audio data can be divided into a plurality of first target audio data according to a preset time period. The preset data in each first target audio data is deleted to obtain the audio data to be stored. The audio data to be stored is stored in the preset storage space of the electronic device.

[0137] The audio processing process provided in the embodiment of the present application determines the first sampling frequency of the first audio interface of the SOC and the second sampling frequency of the second audio interface of the DSP chip. If the initial audio data is data generated by the SOC, the frequency ratio M between the second sampling frequency and the first sampling frequency is obtained. According to the frequency ratio, part of the audio data is determined in the initial audio data. Data filling processing is performed on the part of the audio data to obtain the target audio data. The target audio data is sent to the DSP chip through the IIS interface so that the DSP chip receives the target audio data through the TDM interface. If the initial audio data is data generated by the DSP chip, preset data is filled after the part of the audio data to obtain the target audio data. The target audio data is sent to the SOC through the TDM interface so that the SOC chip receives the target audio data through the IIS interface. In the above process, the initial audio data can be data filled according to the first sampling frequency and the second sampling frequency to avoid the situation where the number of audio data transmissions is different due to the mismatch of the interfaces of the SOC and the DSP chip, so that the electronic device can play audio normally when the audio interface does not match.

[0138] Figure 8The following is a schematic diagram of the structure of an audio processing device provided in an embodiment of the present application. The audio processing device may be a chip or a chip module. Figure 8 , the audio playback device 10 may include:

[0139] A first determining module 11 determines a first sampling frequency of a first audio interface of the SOC and a second sampling frequency of a second audio interface of the DSP chip;

[0140] A second determining module 12 determines initial audio data to be transmitted, where the initial audio data is data generated by the SOC or the DSP chip;

[0141] The processing module 13 performs data filling processing on the initial audio data according to the first sampling frequency and the second sampling frequency to obtain target audio data, and transmits the target audio data through the first audio interface and the second audio interface.

[0142] The audio processing device provided in the embodiment of the present application can execute the technical solution shown in the above method embodiment, and its implementation principle and beneficial effects are similar, which will not be repeated here.

[0143] In a possible implementation manner, the processing module 13 is specifically used to:

[0144] Obtaining a frequency ratio M between the second sampling frequency and the first sampling frequency, where M is an integer greater than 1;

[0145] According to the frequency ratio, data filling processing is performed on the initial audio data to obtain target audio data.

[0146] In a possible implementation manner, the processing module 13 is specifically used to:

[0147] Determine partial audio data in the initial audio data according to the frequency ratio, wherein the length of the initial audio data is M times the length of the partial audio data;

[0148] Perform data filling processing on the part of the audio data to obtain the target audio data.

[0149] In a possible implementation manner, the processing module 13 is specifically used to:

[0150] Determine at least one audio data unit in the portion of audio data, wherein the length of the audio data unit is a preset unit length;

[0151] Preset data is filled after each audio data unit to obtain the target audio data, and the length of the preset data is the preset unit length.

[0152] In a possible implementation manner, the processing module 13 is specifically used to:

[0153] The target audio data is sent to the DSP chip through the IIS interface, so that the DSP chip receives the target audio data through the TDM interface.

[0154] In a possible implementation manner, the processing module 13 is specifically used to:

[0155] Preset data is filled after the partial audio data to obtain the target audio data, wherein the length of the preset data is the difference between the length of the initial audio data and the length of the partial audio data.

[0156] In a possible implementation manner, the processing module 13 is specifically used to:

[0157] The target audio data is sent to the SOC through the TDM interface, so that the SOC receives the target audio data through the IIS interface.

[0158] The audio processing device provided in the embodiment of the present application can execute the technical solution shown in the above method embodiment, and its implementation principle and beneficial effects are similar, which will not be repeated here.

[0159] Fig. 9 A schematic diagram of the structure of another audio processing device provided in an embodiment of the present application. Figure 8 Based on the examples shown, see Fig. 9 The audio processing device 10 also includes a playing module 14 .

[0160] Wherein, the playing module 14 is used for:

[0161] Removing the preset data from the target audio data to obtain the audio data to be played;

[0162] Play the audio data to be played.

[0163] The audio processing device provided in the embodiment of the present application can execute the technical solution shown in the above method embodiment, and its implementation principle and beneficial effects are similar, which will not be repeated here.

[0164] Fig.10 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Fig.10 The electronic device 20 may include: a memory 21 and a processor 22. Exemplarily, the memory 21 and the processor 22 are interconnected via a bus 23.

[0165] The memory 21 is used to store program instructions;

[0166] The processor 22 is used to execute the program instructions stored in the memory, so as to enable the electronic device 20 to execute the method shown in the above method embodiment.

[0167] The electronic device provided in the embodiment of the present application can execute the technical solution shown in the above method embodiment, and its implementation principle and beneficial effects are similar, which will not be repeated here.

[0168] An embodiment of the present application provides a computer-readable storage medium, in which computer-executable instructions are stored. When the computer-executable instructions are executed by a processor, they are used to implement the above method.

[0169] The embodiment of the present application may also provide a computer program product, including a computer program, which can implement the above method when executed by a processor.

[0170] All or part of the steps of the above-mentioned method embodiments can be completed by hardware related to program instructions. The aforementioned program can be stored in a readable memory. When the program is executed, the steps of the above-mentioned method embodiments are executed; and the aforementioned memory (storage medium) includes: read-only memory (English: read-only memory, abbreviated: ROM), random access memory (English: Random Access Memory, abbreviated: RAM), flash memory, hard disk, solid state drive, magnetic tape (English: magnetic tape), floppy disk (English: floppy disk), optical disc (English: optical disc) and any combination thereof.

[0171] The embodiments of the present application are described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processing unit of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processing unit of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0172] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0173] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0174] Obviously, those skilled in the art can make various changes and modifications to the embodiments of the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the embodiments of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.

[0175] In the present application, the term "include" and its variations may refer to non-restrictive inclusion; the term "or" and its variations may refer to "and / or". The terms "first", "second", etc. in the present application are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. In the present application, "plurality" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B may mean: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the previously associated objects are in an "or" relationship.

Claims

1. An audio processing method, characterized in that: Applied in an electronic device, the electronic device is provided with a system-on-chip (SOC) and a digital signal processing (DSP) chip, and the method comprises: Determine a first sampling frequency of a first audio interface of the SOC and a second sampling frequency of a second audio interface of the DSP chip; Determining initial audio data to be transmitted, wherein the initial audio data is audio data generated by the SOC or the DSP chip; According to the first sampling frequency and the second sampling frequency, the initial audio data is subjected to data filling processing to obtain target audio data, and the target audio data is transmitted through the first audio interface and the second audio interface; according to the first sampling frequency and the second sampling frequency, the initial audio data is subjected to data filling processing to obtain target audio data, including: Obtain a frequency ratio M between the second sampling frequency and the first sampling frequency, and determine partial audio data in the initial audio data according to the frequency ratio M, wherein the length of the initial audio data is M times the length of the partial audio data; perform data filling processing on the partial audio data to obtain the target audio data, wherein M is an integer greater than 1.

2. The method according to claim 1, characterized in that: The first audio interface is an integrated audio interface IIS interface, and the second audio interface is a time division multiplexing technology TDM interface.

3. The method according to claim 1, characterized in that The initial audio data is data generated by the SOC; performing data filling processing on the partial audio data to obtain the target audio data includes: Determine at least one audio data unit in the portion of audio data, wherein the length of the audio data unit is a preset unit length; Preset data is filled after each audio data unit to obtain the target audio data, and the length of the preset data is the preset unit length.

4. The method according to claim 2, characterized in that: Transmitting the target audio data through the first audio interface and the second audio interface includes: The target audio data is sent to the DSP chip through the IIS interface, so that the DSP chip receives the target audio data through the TDM interface.

5. The method according to claim 4, characterized in that The method further comprises: Removing the preset data from the target audio data to obtain the audio data to be played; Play the audio data to be played.

6. The method according to claim 1, characterized in that The initial audio data is the data generated by the DSP; performing data filling processing on the partial audio data to obtain the target audio data includes: Preset data is filled after the partial audio data to obtain the target audio data, wherein the length of the preset data is the difference between the length of the initial audio data and the length of the partial audio data.

7. The method according to claim 2, characterized in that Transmitting the target audio data through the first audio interface and the second audio interface includes: The target audio data is sent to the SOC through the TDM interface, so that the SOC receives the target audio data through the IIS interface.

8. An audio processing device, characterized in that: The device comprises: A first determining module determines a first sampling frequency of a first audio interface of the SOC and a second sampling frequency of a second audio interface of the DSP chip; A second determining module determines initial audio data to be transmitted, wherein the initial audio data is data generated by the SOC or the DSP chip; a processing module, performing data filling processing on the initial audio data according to the first sampling frequency and the second sampling frequency to obtain target audio data, and transmitting the target audio data through the first audio interface and the second audio interface; The processing module is specifically used to obtain a frequency ratio M between the second sampling frequency and the first sampling frequency, and determine partial audio data in the initial audio data according to the frequency ratio M, where the length of the initial audio data is M times the length of the partial audio data; perform data filling processing on the partial audio data to obtain the target audio data, where M is an integer greater than 1.

9. An electronic device, characterized in that: include: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 7.

10. A non-transitory computer-readable storage medium storing computer instructions, characterized in that: in, The computer instructions are used to make a computer execute the method according to any one of claims 1 to 7.

11. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Method and equipment for processing digital audio in variable speed

    CN102117613A

  • Method and apparatus for pre-processing in a common-format control processing input signals of, or output signals for, interfaces of different type

    US20040161040A1