[go: up one dir, main page]
More Web Proxy on the site http://driver.im/

CN116088390A - Audio processing method and device and electronic equipment - Google Patents

Audio processing method and device and electronic equipment Download PDF

Info

Publication number
CN116088390A
CN116088390A CN202310162390.1A CN202310162390A CN116088390A CN 116088390 A CN116088390 A CN 116088390A CN 202310162390 A CN202310162390 A CN 202310162390A CN 116088390 A CN116088390 A CN 116088390A
Authority
CN
China
Prior art keywords
audio data
data
audio
interface
sampling frequency
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310162390.1A
Other languages
Chinese (zh)
Inventor
卢国健
蒲胤华
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Spreadtrum Communications Shanghai Co Ltd
Original Assignee
Spreadtrum Communications Shanghai Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Spreadtrum Communications Shanghai Co Ltd filed Critical Spreadtrum Communications Shanghai Co Ltd
Priority to CN202310162390.1A priority Critical patent/CN116088390A/en
Publication of CN116088390A publication Critical patent/CN116088390A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B19/00Programme-control systems
    • G05B19/02Programme-control systems electric
    • G05B19/04Programme control other than numerical control, i.e. in sequence controllers or logic controllers
    • G05B19/042Programme control other than numerical control, i.e. in sequence controllers or logic controllers using digital processors
    • G05B19/0423Input/output
    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B2219/00Program-control systems
    • G05B2219/20Pc systems
    • G05B2219/25Pc structure of the system
    • G05B2219/25257Microcontroller

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Automation & Control Theory (AREA)
  • Signal Processing For Digital Recording And Reproducing (AREA)

Abstract

The embodiment of the application provides an audio processing method, an audio processing device and electronic equipment. The method comprises the following steps: determining 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 are audio data generated by the SOC or the DSP chip; and carrying out 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 the audio normally when the audio interfaces are not matched.

Description

Audio processing method and device and electronic equipment
Technical Field
The embodiment of the application relates to the technical field of signal processing, in particular to an audio processing method, an audio processing device and electronic equipment.
Background
A System On Chip (SOC) and a data signal processing (Digital Signal Processing, DSP) Chip may be disposed in the electronic device, and the electronic device may perform audio recording or audio playing through the SOC and DSP chips.
In the related art, audio may be processed as follows: and transmitting the audio data to be processed to an audio interface of the DSP chip through an audio interface of the SOC, and playing the audio data to be processed through a loudspeaker by the DSP chip. Or transmitting the audio data to be processed to the audio interface of the SOC through the audio interface of the DSP chip, and storing the audio data to be processed by the SOC chip. 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 is not matched with the TDM interface, and the sampling frequencies of the two interfaces are different. When audio data transmission is performed, the audio data transmission quantity may be different in the same period, so that the audio frequency doubling speed is played, and the electronic equipment cannot normally play the audio frequency.
Disclosure of Invention
The embodiment of the application provides an audio processing method, an audio processing device and electronic equipment, which are used for solving the problem that the electronic equipment cannot play normally.
In a first aspect, an embodiment of the present application provides an audio processing method, applied to an electronic device, where a system on chip SOC and a digital signal processing DSP chip are disposed, the method includes:
Determining 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 are audio data generated by the SOC or the DSP chip;
and carrying out 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.
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 TDM interface;
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, wherein the data filling processing comprises the following steps:
acquiring a frequency ratio M between the second sampling frequency and the first sampling frequency, wherein M is an integer greater than 1;
and carrying out data filling processing on the initial audio data according to the frequency ratio to obtain target audio data.
In one possible implementation manner, according to the frequency ratio M, performing data filling processing on the initial audio data to obtain target audio data, where the data filling processing includes:
Determining partial audio data in the initial audio data according to the frequency ratio, wherein the length of the initial audio data is M times of the length of the partial audio data;
and carrying out data filling processing on the partial audio data to obtain the target audio data.
In one possible implementation, the initial audio data is data generated by the SOC; performing data filling processing on the part of audio data to obtain the target audio data, wherein the data filling processing comprises the following steps:
determining at least one audio data unit in the part of audio data, wherein the length of the audio data unit is a preset unit length;
filling preset data after each audio data unit to obtain the target audio data, wherein the length of the preset data is the preset unit length.
In one possible implementation, transmitting the target audio data through the first audio interface and the second audio interface includes:
and sending 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.
In one possible embodiment, the method further comprises:
Removing preset data in the target audio data to obtain audio data to be played;
and playing the audio data to be played.
In one possible implementation, the initial audio data is data generated by the DSP; performing data filling processing on the part of audio data to obtain the target audio data, wherein the data filling processing comprises the following steps:
filling preset data after the part of 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 part of audio data.
In one possible implementation, transmitting the target audio data through the first audio interface and the second audio interface includes:
and sending the target audio data to the SOC through the TDM interface so that the SOC receives the target audio data through the IIS interface.
In a second aspect, embodiments of the present application provide an audio processing apparatus, the apparatus including:
the first determining module is used for determining 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;
the second determining module is used for determining initial audio data to be transmitted, wherein the initial audio data are data generated by the SOC or the DSP chip;
And the processing module is used for carrying out 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.
In a possible implementation manner, the processing module is specifically configured to:
acquiring a frequency ratio M between the second sampling frequency and the first sampling frequency, wherein M is an integer greater than 1;
and carrying out data filling processing on the initial audio data according to the frequency ratio to obtain target audio data.
In a possible implementation manner, the processing module is specifically configured to:
determining partial audio data in the initial audio data according to the frequency ratio, wherein the length of the initial audio data is M times of the length of the partial audio data;
and carrying out data filling processing on the partial audio data to obtain the target audio data.
In a possible implementation manner, the processing module is specifically configured to:
determining at least one audio data unit in the part of audio data, wherein the length of the audio data unit is a preset unit length;
Filling preset data after each audio data unit to obtain the target audio data, wherein the length of the preset data is the preset unit length.
In a possible implementation manner, the processing module is specifically configured to:
and sending 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.
In a possible implementation manner, the processing module is specifically configured to:
filling preset data after the part of 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 part of audio data.
In a possible implementation manner, the processing module is specifically configured to:
and sending the target audio data to the SOC through the TDM interface so that the SOC receives the target audio data through the IIS interface.
In one possible implementation, the apparatus further includes a play module.
Wherein, the play module is used for:
removing preset data in the target audio data to obtain audio data to be played;
And playing the audio data to be played.
In a third aspect, the present application provides a chip having a computer program stored thereon, which, when executed by the chip, implements the method according to any of the first aspects.
In a fourth aspect, the present application provides a chip module having a computer program stored thereon, which, when executed by the chip module, implements a method according to any of the first aspects.
In a fifth aspect, embodiments of the present application provide an electronic device, including:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of the first aspects.
In a sixth aspect, embodiments of the present application provide a non-transitory computer-readable storage medium storing computer instructions for causing a computer to perform the method of any one of the first aspects.
In a seventh aspect, embodiments of the present application provide a computer program product comprising a computer program which, when executed by a processor, implements the method of any of the first aspects.
According to the audio processing method, the audio processing device and the electronic equipment, the first sampling frequency of the first audio interface of the SOC is determined, and the second sampling frequency of the second audio interface of the DSP chip is determined. The initial audio data to be transmitted is determined, and the initial audio data can be audio data generated by the SOC or audio data generated by the DSP chip. And carrying out 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, so as to play or store the target audio data. In the above process, the data filling process can be performed on the initial audio data according to the first sampling frequency and the second sampling frequency, so that the situation that the transmission quantity of the audio data is different due to mismatching of the interfaces of the SOC and the DSP chip is avoided, and the electronic equipment can normally play the audio when the audio interfaces are not matched.
Drawings
Fig. 1 is a schematic diagram of an application scenario provided in an embodiment of the present application;
fig. 2 is a schematic flow chart of an audio processing method according to an embodiment of the present application;
fig. 3 is a flow chart of another audio processing method according to an embodiment of the present application;
FIG. 4 is a schematic diagram of a process for determining partial audio data according to an embodiment of the present application;
fig. 5 is a schematic diagram of a process for determining target audio data according to an embodiment of the present application;
FIG. 6 is a schematic diagram of another process for determining target audio data according to an embodiment of the present application;
FIG. 7A is a schematic diagram of an audio processing procedure according to an embodiment of the present application;
FIG. 7B is a schematic diagram of an audio processing procedure according to an embodiment of the present application;
fig. 8 is a schematic structural diagram of an audio processing device according to an embodiment of the present application;
fig. 9 is a schematic structural diagram of another audio processing device according to an embodiment of the present application;
fig. 10 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
Reference will now be made in detail to exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, the same numbers in different drawings refer to the same or similar elements, unless otherwise indicated. The implementations described in the following exemplary examples are not representative of all implementations consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with some aspects of the present application as detailed in the accompanying claims.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
In order to facilitate understanding, an application scenario to which the embodiments of the present application are applicable is described below with reference to fig. 1.
Fig. 1 is a schematic diagram of an application scenario provided in an embodiment of the present application. Referring to fig. 1, the electronic device 101 includes an electronic device 101, which may be a car stereo, a mobile phone, or the like. The electronic device 101 is provided with an SOC and a DSP chip. Both the SOC and the DSP chip are provided with audio interfaces. The electronic device 101 may play or record audio through the SOC and DSP chips. When the electronic device 101 plays audio, the SOC of the electronic device 101 transmits 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 audio data to be played through an audio interface of the DSP chip, and plays audio corresponding to the audio data to be played through a speaker of the electronic device 101. When the electronic device 101 records audio, the DSP chip of the electronic device 101 receives 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 recorded audio data through an audio interface of the SOC.
In the related art, if the audio interface of the SOC is an IIS interface, the audio interface of the DSP chip is a TDM interface. The IIS interface is not matched with the TDM interface, and the sampling frequencies of the two interfaces are different. When audio data transmission is performed, the audio data transmission quantity may be different in the same period, so that the audio frequency doubling speed is played, and the electronic equipment cannot normally play the audio frequency.
In the embodiment of the application, a first sampling frequency of a first audio interface of the SOC is determined, and a second sampling frequency of a second audio interface of the DSP chip is determined. The initial audio data to be transmitted is determined, and the initial audio data can be audio data generated by the SOC or audio data generated by the DSP chip. And carrying out 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, so as to play or store the target audio data. In the above process, the data filling process can be performed on the initial audio data according to the first sampling frequency and the second sampling frequency, so that the situation that the transmission quantity of the audio data is different due to mismatching of the interfaces of the SOC and the DSP chip is avoided, and the electronic equipment can normally play the audio when the audio interfaces are not matched.
The method shown in the present application will be described below by way of specific examples. It should be noted that the following embodiments may exist alone or in combination with each other, and for the same or similar content, the description will not be repeated in different embodiments.
Fig. 2 is a flow chart of an audio processing method according to an embodiment of the present application. Referring to fig. 2, the method may include:
s201, determining 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.
The execution body of the embodiment of the application may be an electronic device, or may be a chip, a chip module, an audio processing device, or the like, which are disposed in the electronic device. The audio processing means may be implemented by software or by a combination of software and hardware.
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.
When the first sampling frequency and the second sampling frequency are set, the first sampling frequency may be 2N times the second sampling frequency. Wherein N is an integer greater than or equal to 1.
For example, after determining that the first audio interface of the SOC in the electronic device a is the IIS interface and the second audio interface of the DSP chip is the TDM interface, the first sampling frequency of the IIS interface of the SOC may be set to 96kHz and the second sampling frequency of the TDM interface of the DSP chip may be set to 48kHz. And storing the first sampling frequency and the second sampling frequency into a preset storage space of the electronic equipment A.
S202, determining initial audio data to be transmitted.
The initial audio data is audio data generated by the SOC or the DSP chip.
When the electronic equipment plays the audio, the SOC determines the audio to be played as initial audio data in a storage space of the electronic equipment. When the electronic equipment records the audio, the DSP chip acquires the audio recorded by the microphone of the electronic equipment and determines the audio recorded by the microphone as initial audio data.
For example, a user plays song 1 using electronic device a, and the SOC of electronic device a determines audio data 1 corresponding to playing song 1 as initial audio data in the storage space of the electronic device. The user records the audio by using the electronic device B, and the microphone of the electronic device B records the voice 1 and sends the voice to the DSP chip of the electronic device B. The DSP chip of the electronic equipment B acquires the voice 1 recorded by the microphone of the electronic equipment B, and determines the voice 1 recorded by the microphone as initial audio data.
S203, 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 first audio interface is an integrated audio interface IIS interface, and the second interface is a TDM interface.
The target audio data may be obtained by: acquiring a frequency ratio M between the second sampling frequency and the first sampling frequency, wherein M is an integer greater than 1; and carrying out data filling processing on the initial audio data according to the frequency ratio to obtain target audio data.
The initial audio data may be padded with the number 0 so that the same sound quality is maintained after the initial audio data is padded.
Since the IIS interface and the TDM interface are different in sampling frequency in the same electronic device. When audio data transmission is performed, a difference is caused in the amount of audio data acquired in the same period. The initial audio data can be subjected to data filling processing to obtain target audio data, so that the audio data amount received by the audio interface in the same period is the same.
For example, when the 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. From 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 2 times that of the TDM interface. Therefore, the data stuffing process can be performed on the audio data transmitted by the IIS interface. The data volume relative to the TDM interface is 2 times larger, and is padded with 0 to the normal data volume.
According to the audio processing method, 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 are determined. Initial audio data to be transmitted is determined. And carrying out 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. In the above process, the data filling process can be performed on the initial audio data according to the first sampling frequency and the second sampling frequency, so that the situation that the transmission quantity of the audio data is different due to mismatching of the interfaces of the SOC and the DSP chip is avoided, and the electronic equipment can normally play the audio when the audio interfaces are not matched.
On the basis of any of the above embodiments, a detailed procedure of audio processing will be described below with reference to fig. 3.
Fig. 3 is a flowchart of another audio processing method according to an embodiment of the present application. Referring to fig. 3, the method includes:
s301, determining 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.
The first audio interface is an IIS interface and the second audio interface is a TDM interface.
S302, determining initial audio data to be transmitted.
The initial audio data is audio data generated by the SOC or the DSP chip.
S303, if the initial audio data is data generated by the SOC, obtaining a frequency ratio M between the second sampling frequency and the first sampling frequency.
M is an integer greater than 1.
For example, the first audio interface of the electronic device a is an IIS interface, and the second audio interface is a TDM interface. The IIS interface has a sampling frequency of 96kHz and the tdm interface has a sampling frequency of 48kHz. The first sampling frequency may be determined to be 96kHz and the second sampling frequency 48kHz. The frequency ratio M between the second sampling frequency and the first sampling frequency can be determined to be 96/48=2.
S304, determining partial audio data in the initial audio data according to the frequency ratio.
The length of the initial audio data is M times the length of the partial audio data.
Next, a process of determining a part of audio data will be described with reference to fig. 4. Fig. 4 is a schematic diagram of a process for determining partial audio data according to an embodiment of the present application. Referring to fig. 4, the initial audio data 401 is included, and 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 one piece of continuous 16-bit audio data in the initial audio data 401. For example, the partial audio data 402 may be the 0 th to 15 th bit audio data among the initial audio data 401.
And S305, performing data filling processing on part of the audio data to obtain target audio data.
The target audio data may be obtained by: determining at least one audio data unit in part of the audio data, wherein the length of the audio data unit is a preset unit length; filling preset data after each audio data unit to obtain target audio data, wherein the length of the preset data is a preset unit length.
The preset unit length may be one data frame (slot). The preset data may be 0.
Next, a process of determining the target audio data will be described with reference to fig. 5. Fig. 5 is a schematic diagram of a process for determining target audio data according to an embodiment of the present application. Referring to fig. 5, partial audio data 501 and target audio data 502 are included. The partial audio data 501 is the initial audio data received by the electronic device IIS interface. The 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 slots). slot1, slot3, slot5, and slot7 are audio data (d 0, d1, d2, and d 3). And when the data filling processing is carried out, filling preset data 0 after the slots 1, 3, 5 and 7, namely, supplementing 16-bit length data 0 for each slot to obtain target audio data. The target audio data 502 includes all audio numbers after the data filling process.
S306, sending 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.
For example, assume that the initial audio data is audio D generated by the SOC. And the SOC chip performs data filling processing on the 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.
S307, removing the preset data in the target audio data to obtain the audio data to be played.
For example, according to the target audio data 502 shown in fig. 5, the preset data 0 in the target audio data 502 is removed, so as to obtain the audio data to be played.
S308, playing the audio data to be played.
And the DSP chip plays the music data to be played through a loudspeaker of the electronic equipment.
When the audio data to be played is 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, and the difference of the played audio data in a fixed period due to the difference of the audio interface frequencies is avoided.
S309, if the initial audio data is the data generated by the DSP chip, filling preset data after part of the audio data to obtain target audio data.
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.
The preset data may be 0. The length of the portion of audio data is the same as the number of microphones of the electronic device.
Next, a process of determining the target audio data will be described with reference to fig. 6. Fig. 6 is a schematic diagram of another process for determining target audio data according to an embodiment of the present application. Referring to fig. 6, the initial audio data 601 and the target audio data 602 are included. Assuming that the electronic device has 4 microphones, after the DSP chip receives audio data recorded by the microphones of the electronic device, there are 8 channels of audio data in total. The 4 channels are audio data (d 0, d1, d2 and d 3) recorded by the microphone, the 4 channels are stoped audio data (d 4, d5, d6 and d 7), and the audio data of each channel corresponds to one slot. Depending on the number of microphones of the electronic device, the length of the portion of audio data may be determined to be 4. The initial audio data 601 is divided into two pieces of partial audio data according to the length of the partial audio. One part of the audio data is 4 slots, including audio data d0, d1, d2 and d3. The other part of the audio data is 4 slots, including audio data d4, d5, d6, d7.
The length of the padded preset data will be determined to be 8-4=4 based on the length 8 of the initial audio data and the length 4 of the partial audio data. Therefore, when the data filling process is performed, the preset data 0 having a length of 4 slots is filled after each piece of audio data, resulting in the target audio data 602.
And S310, sending the target audio data to the SOC through the TDM interface so that the SOC receives the target audio data through the IIS interface.
After the SOC receives the target audio data, the target audio data may be divided into a plurality of first target audio data according to a preset period. And deleting preset data in each first target audio data to obtain the audio data to be stored. And storing the audio data to be stored into a preset storage space of the electronic equipment. The duration of the preset period may be a duration corresponding to one period during audio data transmission.
According to the audio processing method, 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 are determined. If 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. Based on the frequency ratio, a portion of the audio data is determined from the initial audio data. And performing data filling processing on part of the audio data to obtain target audio data. And sending 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. If the initial audio data are data generated by the DSP chip, filling preset data after part of the audio data to obtain target audio data. And sending the target audio data 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 data filling process can be performed on the initial audio data according to the first sampling frequency and the second sampling frequency, so that the situation that the transmission quantity of the audio data is different due to mismatching of the interfaces of the SOC and the DSP chip is avoided, and the electronic equipment can normally play the audio when the audio interfaces are not matched.
On the basis of any one of the above embodiments, the following describes the audio processing procedure 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.
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. And determining the audio data which are correspondingly transmitted by each slot in the preset time period in the initial audio data according to the frequency ratio. The duration of the preset period may be a duration corresponding to one period during audio data transmission.
For example, according to the above-described fig. 5, when the first audio interface of the SOC is a TDM interface, the initial audio data may be directly set to the form of the target audio data 502 in fig. 5, so that the difference in the amount of audio data transmitted in one period due to the difference in the frequencies of the audio interfaces is avoided.
When the initial audio data is generated by the DSP chip, the initial audio data can be preprocessed, 2 16-bit audio data of the IIS interface are woven into 1 slot with 32 bits, each slot is filled, and the processed audio data are obtained and transmitted to the SOC through the IIS interface of the DSP chip. At this time, the DSP chip is required to have data-knitting capability.
On the basis of any of the above embodiments, the process of audio processing is exemplified below with reference to fig. 7A to 7B. Fig. 7A is a schematic diagram of a process of audio processing according to an embodiment of the present application. Referring to FIG. 7A, includes SOC 701 and DSP chip 702. The SOC 701 and the DSP chip 702 are provided in the electronic device. A hardware abstraction layer (Hardware Abstraction Layer, HAL) is provided in the SOC 701, and an audio interface of the SOC 701 is an IIS interface. The audio interface of DSP chip 702 is a TDM interface. Before audio processing, parameters of the IIS interface and the TDM interface can be set by the HAL and stored in a preset storage space of the electronic device. The parameters of the IIS interface and the TDM interface may be specifically as shown in table 1:
TABLE 1
Interface parameters IIS interface TDM interface
slot number 8
slot bit width 16 bits
Interface bit width 32 bits
Sampling frequency 96kHz 48kHz
Serial clock (bit clock, BCLK) 96kHz*32*2 48kHz*64*2
Mode of operation Right alignment
The SOC 701 determines that the initial audio data is generated audio data d0, d1, d2, d3 of the SOC 701, each of which has a length of 16 bits. From 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. 2 pieces of partial audio data are determined among the initial audio data according to the length of the partial audio data. Wherein, one part of the audio data comprises slots 0 to 3, and the other part of the audio data comprises slots 4 to 7. When the SOC 701 performs data filling processing, preset data 0 is filled after slot1, slot3, slot5 and slot7, that is, each slot supplements data 0 with 16-bit length, so as to obtain target audio data.
SOC701 sends the target audio data to DSP chip 702 via the IIS interface, and DSP chip 702 receives the target audio data via the TDM interface. The DSP chip 702 performs removal processing on preset data in the target audio data to obtain audio data to be played, and plays the audio data to be played through a microphone of the electronic device.
Fig. 7B is a schematic diagram of a process of audio processing according to an embodiment of the present application. Referring to fig. 7b, the soc701 determines that the initial audio data is the generated audio data d0, d1, d2, d3, d4, d5, d6, d7 of the DSP chip 702. The DSP chip 702 determines that the length of the padded preset data is 8-4=4 according to the length 8 of the initial audio data and the length 4 of the partial audio data. Therefore, when the DSP chip 702 performs the data filling process, the preset data 0 with a length of 4 slots is filled after each part of the audio data, so as to obtain the target audio data.
The DSP chip 702 transmits the target audio data to the SOC701 through the TDM interface, and the SOC701 receives the target audio data through the IIS interface. After the SOC701 receives the target audio data, the target audio data may be divided into a plurality of first target audio data according to a preset period. And deleting preset data in each first target audio data to obtain the audio data to be stored. And storing the audio data to be stored into a preset storage space of the electronic equipment.
In the audio processing process provided by the embodiment of the application, 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 are determined. If 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. Based on the frequency ratio, a portion of the audio data is determined from the initial audio data. And performing data filling processing on part of the audio data to obtain target audio data. And sending 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. If the initial audio data are data generated by the DSP chip, filling preset data after part of the audio data to obtain target audio data. And sending the target audio data 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 data filling process can be performed on the initial audio data according to the first sampling frequency and the second sampling frequency, so that the situation that the transmission quantity of the audio data is different due to mismatching of the interfaces of the SOC and the DSP chip is avoided, and the electronic equipment can normally play the audio when the audio interfaces are not matched.
Fig. 8 is a schematic structural diagram of an audio processing device according to an embodiment of the present application. The audio processing device may be a chip or a chip module. Referring to fig. 8, the audio playing device 10 may include:
a first determining module 11 for determining 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 12, configured to determine initial audio data to be transmitted, where the initial audio data is data generated by the SOC or the DSP chip;
and 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.
The audio processing device provided in the embodiment of the present application may execute the technical solution shown in the foregoing method embodiment, and its implementation principle and beneficial effects are similar, and will not be described herein again.
In one possible embodiment, the processing module 13 is specifically configured to:
acquiring a frequency ratio M between the second sampling frequency and the first sampling frequency, wherein M is an integer greater than 1;
And carrying out data filling processing on the initial audio data according to the frequency ratio to obtain target audio data.
In one possible embodiment, the processing module 13 is specifically configured to:
determining partial audio data in the initial audio data according to the frequency ratio, wherein the length of the initial audio data is M times of the length of the partial audio data;
and carrying out data filling processing on the partial audio data to obtain the target audio data.
In one possible embodiment, the processing module 13 is specifically configured to:
determining at least one audio data unit in the part of audio data, wherein the length of the audio data unit is a preset unit length;
filling preset data after each audio data unit to obtain the target audio data, wherein the length of the preset data is the preset unit length.
In one possible embodiment, the processing module 13 is specifically configured to:
and sending 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.
In one possible embodiment, the processing module 13 is specifically configured to:
Filling preset data after the part of 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 part of audio data.
In one possible embodiment, the processing module 13 is specifically configured to:
and sending the target audio data to the SOC through the TDM interface so that the SOC receives the target audio data through the IIS interface.
The audio processing device provided in the embodiment of the present application may execute the technical solution shown in the foregoing method embodiment, and its implementation principle and beneficial effects are similar, and will not be described herein again.
Fig. 9 is a schematic structural diagram of another audio processing apparatus according to an embodiment of the present application. Referring to fig. 9, the audio processing device 10 further includes a playing module 14 based on the embodiment shown in fig. 8.
Wherein, the play module 14 is used for:
removing preset data in the target audio data to obtain audio data to be played;
and playing the audio data to be played.
The audio processing device provided in the embodiment of the present application may execute the technical solution shown in the foregoing method embodiment, and its implementation principle and beneficial effects are similar, and will not be described herein again.
Fig. 10 is a schematic structural diagram of an electronic device according to an embodiment of the present application. Referring to fig. 10, the electronic device 20 may include: a memory 21, and a processor 22. The memory 21, the processor 22, are illustratively interconnected by a bus 23.
The memory 21 is used for storing program instructions;
the processor 22 is configured to execute the program instructions stored in the memory, so as to cause the electronic device 20 to execute the method shown in the above-described method embodiment.
The electronic device provided in the embodiment of the present application may execute the technical solution shown in the foregoing method embodiment, and its implementation principle and beneficial effects are similar, and are not described herein again.
Embodiments of the present application provide a computer-readable storage medium having stored therein computer-executable instructions for implementing the above-described method when the computer-executable instructions are executed by a processor.
Embodiments of the present application may also provide a computer program product comprising a computer program which, when executed by a processor, performs the above-described method.
All or part of the steps for implementing the method embodiments described above may be performed by hardware associated with program instructions. The foregoing program may be stored in a readable memory. The program, when executed, performs steps including the method embodiments described above; and the aforementioned memory (storage medium) includes: read-only memory (ROM), random-access memory (RAM), flash memory, hard disk, solid state disk, magnetic tape, floppy disk, optical disk, and any combination thereof.
Embodiments of the present application are described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processing unit of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processing unit of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
It will be apparent to those skilled in the art that various modifications and variations can be made to the embodiments of the present application without departing from the spirit and scope of the application. Thus, if such modifications and variations of the embodiments of the present application fall within the scope of the claims and the equivalents thereof, the present application is intended to encompass such modifications and variations.
In the present application, the term "include" and variations thereof may refer to non-limiting inclusion; the term "or" and variations thereof may refer to "and/or". The terms "first," "second," and the like in this application are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. In the present application, "plurality" means two or more. "and/or", describes an association relationship of an association object, and indicates that there may be three relationships, for example, a and/or B, and may indicate: a exists alone, A and B exist together, and B exists alone. The character "/" generally indicates that the context-dependent object is an "or" relationship.

Claims (12)

1. An audio processing method, which is applied to an electronic device, wherein a system-on-chip SOC and a digital signal processing DSP chip are arranged in the electronic device, the method comprises:
determining 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 are audio data generated by the SOC or the DSP chip;
and carrying out 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.
2. The method of claim 1, wherein the first audio interface is an integrated audio interface IIS interface and the second audio interface is a time division multiplexing TDM interface;
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, wherein the data filling processing comprises the following steps:
acquiring a frequency ratio M between the second sampling frequency and the first sampling frequency, wherein M is an integer greater than 1;
And carrying out data filling processing on the initial audio data according to the frequency ratio to obtain target audio data.
3. The method according to claim 2, wherein performing data filling processing on the initial audio data according to the frequency ratio M to obtain target audio data comprises:
determining partial audio data in the initial audio data according to the frequency ratio, wherein the length of the initial audio data is M times of the length of the partial audio data;
and carrying out data filling processing on the partial audio data to obtain the target audio data.
4. The method of claim 3, wherein the initial audio data is data generated by the SOC; performing data filling processing on the part of audio data to obtain the target audio data, wherein the data filling processing comprises the following steps:
determining at least one audio data unit in the part of audio data, wherein the length of the audio data unit is a preset unit length;
filling preset data after each audio data unit to obtain the target audio data, wherein the length of the preset data is the preset unit length.
5. The method of claim 4, wherein transmitting the target audio data over the first audio interface and the second audio interface comprises:
And sending 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.
6. The method of claim 5, wherein the method further comprises:
removing preset data in the target audio data to obtain audio data to be played;
and playing the audio data to be played.
7. A method according to claim 3, wherein the initial audio data is data generated by the DSP; performing data filling processing on the part of audio data to obtain the target audio data, wherein the data filling processing comprises the following steps:
filling preset data after the part of 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 part of audio data.
8. The method of claim 7, wherein transmitting the target audio data over the first audio interface and the second audio interface comprises:
and sending the target audio data to the SOC through the TDM interface so that the SOC receives the target audio data through the IIS interface.
9. An audio processing apparatus, the apparatus comprising:
the first determining module is used for determining 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;
the second determining module is used for determining initial audio data to be transmitted, wherein the initial audio data are data generated by the SOC or the DSP chip;
and the processing module is used for carrying out 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.
10. An electronic device, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1 to 8.
11. A non-transitory computer readable storage medium storing computer instructions, wherein the computer instructions are for causing a computer to perform the method of any one of claims 1 to 8.
12. A computer program product comprising a computer program, characterized in that the computer program, when executed by a processor, implements the method of any one of claims 1 to 8.
CN202310162390.1A 2023-02-23 2023-02-23 Audio processing method and device and electronic equipment Pending CN116088390A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310162390.1A CN116088390A (en) 2023-02-23 2023-02-23 Audio processing method and device and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310162390.1A CN116088390A (en) 2023-02-23 2023-02-23 Audio processing method and device and electronic equipment

Publications (1)

Publication Number Publication Date
CN116088390A true CN116088390A (en) 2023-05-09

Family

ID=86214096

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310162390.1A Pending CN116088390A (en) 2023-02-23 2023-02-23 Audio processing method and device and electronic equipment

Country Status (1)

Country Link
CN (1) CN116088390A (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040161040A1 (en) * 2003-02-12 2004-08-19 Ulrich Schreiber Method and apparatus for pre-processing in a common-format control processing input signals of, or output signals for, interfaces of different type
CN102117613A (en) * 2009-12-31 2011-07-06 展讯通信(上海)有限公司 Method and equipment for processing digital audio in variable speed
CN109101213A (en) * 2018-08-23 2018-12-28 广州酷狗计算机科技有限公司 Control the method, apparatus and storage medium of sound card transmission audio
CN110111791A (en) * 2019-05-21 2019-08-09 扬州航盛科技有限公司 A kind of speech recognition system based on vehicle intelligent net connection
CN209642945U (en) * 2019-06-05 2019-11-15 中山市力泰电子工业有限公司 A kind of jamproof wireless acoustics
CN111782866A (en) * 2019-04-04 2020-10-16 阿里巴巴集团控股有限公司 Drawing method, drawing device, terminal equipment and computer storage medium
CN113534704A (en) * 2021-07-08 2021-10-22 辉创电子科技(苏州)有限公司 System and process for detecting foreign matters on surface of ultrasonic sensor
CN114424167A (en) * 2019-05-06 2022-04-29 强力物联网投资组合2016有限公司 Platform for promoting intelligent development of industrial Internet of things system

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040161040A1 (en) * 2003-02-12 2004-08-19 Ulrich Schreiber Method and apparatus for pre-processing in a common-format control processing input signals of, or output signals for, interfaces of different type
CN102117613A (en) * 2009-12-31 2011-07-06 展讯通信(上海)有限公司 Method and equipment for processing digital audio in variable speed
CN109101213A (en) * 2018-08-23 2018-12-28 广州酷狗计算机科技有限公司 Control the method, apparatus and storage medium of sound card transmission audio
CN111782866A (en) * 2019-04-04 2020-10-16 阿里巴巴集团控股有限公司 Drawing method, drawing device, terminal equipment and computer storage medium
CN114424167A (en) * 2019-05-06 2022-04-29 强力物联网投资组合2016有限公司 Platform for promoting intelligent development of industrial Internet of things system
CN110111791A (en) * 2019-05-21 2019-08-09 扬州航盛科技有限公司 A kind of speech recognition system based on vehicle intelligent net connection
CN209642945U (en) * 2019-06-05 2019-11-15 中山市力泰电子工业有限公司 A kind of jamproof wireless acoustics
CN113534704A (en) * 2021-07-08 2021-10-22 辉创电子科技(苏州)有限公司 System and process for detecting foreign matters on surface of ultrasonic sensor

Similar Documents

Publication Publication Date Title
JP5461835B2 (en) Audio signal encoding / decoding method and encoding / decoding device
JP3915585B2 (en) DATA GENERATION METHOD, PROGRAM, RECORDING MEDIUM, AND DATA GENERATION DEVICE
CN103152499B (en) Echo canceler
CN105679345B (en) Audio processing method and electronic equipment
CN106024035B (en) A kind of method and terminal of audio processing
KR101837084B1 (en) Method for signal processing, encoding apparatus thereof, decoding apparatus thereof, and information storage medium
KR100739723B1 (en) Method and apparatus for audio reproduction supporting audio thumbnail function
KR101166735B1 (en) Musical instrument digital interface hardware instructions
CN107135301A (en) A kind of audio data processing method and device
CN110248285B (en) Multi-channel audio equipment
JP7045266B2 (en) Acoustic signal auxiliary information conversion transmission device and program
CN116088390A (en) Audio processing method and device and electronic equipment
CN107978318A (en) A kind of real-time sound mixing method and device
CN109949792B (en) Multi-audio synthesis method and device
CN101488356B (en) Overdubbing device
JP5626586B2 (en) Delay measuring apparatus, delay measuring method and computer program
US7507900B2 (en) Method and apparatus for playing in synchronism with a DVD an automated musical instrument
JP6968108B2 (en) Acoustic device and acoustic control device
JP3925349B2 (en) Apparatus and method for synchronous reproduction of audio data and performance data
KR101946471B1 (en) Apparatus and method for synchronizing video and audio
DE2800387A1 (en) Recording system for acoustic signals - has analysed signals entered into digital memory and synthesised for replaying
JP4174859B2 (en) Method and apparatus for mixing digital audio signal
JP7476516B2 (en) Signal processing device, signal processing system, program, and signal processing method
JP3969249B2 (en) Apparatus and method for synchronous reproduction of audio data and performance data
CN101019104B (en) Electronic device, digital signal generating method, digital signal recording medium, signal processing device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination