Electronic device and audio transmission method of electronic device
By setting a reference clock for each audio processing module, the problem of data overflow or loss caused by frequency asynchrony between audio processing modules is solved, synchronous transmission is achieved, complexity is reduced, and the reliability and quality of audio transmission are improved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-10
- Publication Date
- 2026-03-27
AI Technical Summary
Because the operating clock frequencies of different audio processing modules are not synchronized, data overflow or loss may occur during audio data transmission.
Each audio processing module obtains a reference clock and sends data according to the reference clock. At the same time, it sends a reference clock signal to the next audio processing module to ensure that the data transmission frequency is synchronized.
It avoids data overflow or loss, simplifies the transmission process, reduces costs, and improves the accuracy and fault tolerance of audio transmission.
Smart Images

Figure CN116112114B_ABST
Abstract
Description
[0001] The application relates to an electronic device and an audio transmission method of the electronic device, and belongs to the technical field of audio transmission.
[0002] At present, an electronic device suitable for processing audio data is usually provided with multiple audio processing modules. Different audio processing modules perform different data processing tasks in one audio data processing process, and the multiple audio processing modules work cooperatively to complete the processing of the audio data. For example, the electronic device can be provided with multiple audio processing modules such as a micro control unit (MCU), a digital signal processing (DSP) and an analog-to-digital converter (ADC) to process audio data. In one audio processing process, the data obtained after the current audio processing module processes the audio data can need to be transmitted to the next audio processing module for use by the next audio processing module.
[0003] In a conventional audio transmission method, each audio processing module in the same electronic device has a working clock. After an audio processing module receives audio data and processes the audio data, the audio processing module sends the audio data to the next audio processing module based on its own working clock, thereby realizing the transmission of the audio data.
[0004] However, since the clock frequencies of the working clocks of different audio processing modules can be asynchronous, the speed of the audio processing modules in sending the audio data can be asynchronous. The asynchronous speed of the audio processing modules in sending the audio data can cause a problem that the data sent by a certain audio processing module is more than the data sent by other audio processing modules, and the excess data can cause data overflow or loss when received by the other audio processing modules.
[0005] The application provides an electronic device and an audio transmission method of the electronic device, which can solve the problem that when the data sent by a certain audio processing module is more than the data sent by other audio processing modules, the excess data can cause data overflow or loss when received by the other audio processing modules. The application provides the following technical solutions:
[0006] In a first aspect, an electronic device is provided, and the electronic device includes at least two audio processing modules. Each audio processing module is configured to:
[0007] obtain to-be-processed audio data;
[0008] processing the to-be-processed audio data according to a working clock of the audio processing module to obtain processed audio data;
[0009] obtaining a reference clock;
[0010] in a case where the processed audio data needs to be sent, sending the processed audio data to a next audio processing module according to the reference clock, and sending a clock signal of the reference clock to the next audio processing module, so that the next audio processing module receives the processed audio data according to the clock signal.
[0011] Optionally, the audio processing module comprises a micro control module, and in a case where the current audio processing module is not the micro control module, the micro control module is further configured to:
[0012] send a working clock of the micro control module to the audio processing module;
[0013] Correspondingly, the audio processing module obtains a reference clock, comprising:
[0014] receiving the working clock sent by the micro control module to obtain the reference clock.
[0015] Optionally, before the obtaining of the to-be-processed audio data, the method further comprises:
[0016] in a case where the current audio processing module is not the micro control module, receiving a clock signal of a reference clock sent by a previous audio processing module;
[0017] receiving to-be-processed audio data sent by the previous audio processing module according to the clock signal.
[0018] Optionally, before the obtaining of the to-be-processed audio data, the method further comprises:
[0019] in a case where the current audio processing module is the micro control module, receiving to-be-processed audio data sent by a previous audio processing module according to a working clock of the micro control module.
[0020] Optionally, before the sending of the processed audio data to the next audio processing module according to the reference clock in a case where the processed audio data needs to be sent, the method further comprises:
[0021] sending a data transmission request to the next audio processing module;
[0022] in a case where an acknowledgement transmission feedback of the next audio processing module is received, determining that the processed audio data needs to be sent.
[0023] Optionally, a receiving buffer is arranged in each audio processing module, and the next audio processing module is further configured to:
[0024] In a case where the data transmission request is received, it is determined whether the number of unused bytes in the receiving buffer of the next audio processing module is greater than or equal to the number of bytes of the processed audio data indicated by the data transmission request;
[0025] In a case where the number of unused bytes is greater than or equal to the number of bytes of the processed audio data, the confirmation transmission feedback is sent to the audio processing module.
[0026] Optionally, the electronic device further comprises an audio acquisition module, and in a case where the audio processing module is connected to the audio acquisition module, the obtaining of the audio data to be processed comprises:
[0027] Obtaining analog audio data acquired by the audio acquisition module;
[0028] Correspondingly, the processing of the audio data to be processed according to the working clock of the audio processing module comprises:
[0029] Converting the analog audio data into digital audio data according to the working clock.
[0030] Optionally, a sending buffer is arranged in the audio processing module, and before the sending of the processed audio data to the next audio processing module according to the reference clock, the method further comprises:
[0031] Storing the processed audio data into the sending buffer;
[0032] Correspondingly, the sending of the processed audio data to the next audio processing module according to the reference clock comprises:
[0033] In a case where the number of bytes of the processed audio data in the sending buffer is greater than or equal to a preset number of bytes, the processed audio data is sent to the next audio processing module according to the reference clock.
[0034] Optionally, the at least two audio processing modules comprise an audio acquisition module, an audio conversion module, a digital processing module, a micro control module, a digital power amplifier module and an audio playing module connected in sequence;
[0035] The micro control module is configured to send a working clock of the micro control module to other audio processing modules, so as to take the working clock of the micro control module as a reference clock.
[0036] The audio acquisition module is configured to acquire initial audio data.
[0037] The audio conversion module is configured to convert the initial audio data into digital audio data to obtain first digital audio data.
[0038] The digital processing module is configured to perform noise reduction processing and gain processing on the first digital audio data to obtain second digital audio data.
[0039] The micro control module is further configured to receive and store the second digital audio data.
[0040] The digital power amplifier module is configured to convert the second digital audio data into an electrical signal.
[0041] The audio playback module is configured to convert the electrical signal into a sound signal and play the sound signal.
[0042] In a second aspect, an audio transmission method of an electronic device is provided, the electronic device comprising at least two audio processing modules, and the method comprising:
[0043] Obtaining to-be-processed audio data;
[0044] Processing the to-be-processed audio data according to a working clock of the audio processing module to obtain processed audio data;
[0045] Obtaining a reference clock;
[0046] In a case where the processed audio data needs to be transmitted, transmitting the processed audio data to a next audio processing module according to the reference clock, and transmitting a clock signal of the reference clock to the next audio processing module, so that the next audio processing module receives the processed audio data according to the clock signal.
[0047] The beneficial effects of the present application at least include: the electronic device comprises at least two audio processing modules, each audio processing module is configured to acquire to-be-processed audio data, process the to-be-processed audio data according to a working clock of the audio processing module to obtain processed audio data, acquire a reference clock, and in a case where the processed audio data needs to be sent, send the processed audio data to a next audio processing module according to the reference clock, and send a clock signal of the reference clock to the next audio processing module, so that the next audio processing module receives the processed audio data according to the clock signal; the problem that when data sent by a certain audio processing module is more than data sent by other audio processing modules, the excess data may cause data overflow or loss when received by the other audio processing modules can be solved; since each audio processing module sends the processed data according to the reference clock, and sends the clock signal of the reference clock to the next audio processing module, so that the next audio processing module receives the processed data according to the reference clock, the frequency of sending data by the current audio processing module is synchronized with the frequency of receiving data by the next audio processing module, so that there is no excess data in the transmission process, and thus the problem of data overflow or loss can be avoided.
[0048] In addition, since the micro control module is a central processing module of the electronic device and is configured to control the flow direction of the audio data, in a case where the current audio processing module is not the micro control module, the working clock sent by the micro control module is received to obtain the reference clock, a new clock circuit does not need to be established, and the cost can be reduced.
[0049] In addition, the working clock of the micro control module is used as the reference clock when all the audio processing modules transmit the audio data, and the transmission frequencies of all the audio processing modules when transmitting the audio data can be guaranteed to be synchronized.
[0050] In addition, in a case where the current audio processing module is not the micro control module, the clock signal of the reference clock is sent to the next audio processing module, so that the next audio processing module does not need to acquire the reference clock from the micro control module again, the transmission process of the audio data is simplified, and thus the complexity of audio transmission can be reduced.
[0051] In addition, the next audio processing module may be unable to receive the audio data, and thus the current audio processing module transmits data to the next audio processing module, which may cause the audio data to be lost. Therefore, before the processed audio data is transmitted, a data transmission request is sent to the next audio processing module, and the processed audio data is transmitted in a case where an acknowledgement transmission feedback of the next audio processing module is received, so that the audio data can be guaranteed not to be lost.
[0052] In addition, by setting the receiving buffer, the data can be temporarily stored in the receiving buffer when the audio processing module has a problem, and the fault tolerance of the audio transmission can be improved.
[0053] In addition, since digital audio is suitable for long distance transmission and is not easy to introduce interference, converting analog audio data into digital audio data can improve audio quality
[0054] The above description is only a summary of the technical solutions of the present application. In order to make the technical means of the present application more clearly understood, and to be implemented according to the content of the description, the following will be described in detail with the preferred embodiments of the present application and in conjunction with the drawings. BRIEF DESCRIPTION OF DRAWINGS
[0055] Figure 1 is a schematic diagram of an electronic device provided by an embodiment of the present application;
[0056] Figure 2 is a schematic diagram of another electronic device provided by an embodiment of the present application;
[0057] Figure 3 is a flowchart of an audio transmission method of an electronic device provided by an embodiment of the present application. DETAILED DESCRIPTION
[0058] The specific embodiments of the present application will be further described in detail below in conjunction with the drawings and embodiments. The following embodiments are used to illustrate the present application, but not to limit the scope of the present application.
[0059] Figure 1 is a structural schematic diagram of an electronic device 10 provided by an embodiment of the present application. The electronic device 10 can be a mobile phone, a tablet computer, or a control terminal (such as an audio control terminal or a video control terminal), a Bluetooth conference treasure, etc., and the implementation of the electronic device 10 is not limited in the present embodiment. According to the present embodiment, the electronic device 10 includes at least two audio processing modules 110. Figure 1 It can be seen that the electronic device includes at least two audio processing modules 110.
[0060] The audio processing module 110 is configured to acquire and process audio data to be processed, and then send the audio data to the next audio processing module if it is necessary to send the processed audio data.
[0061] The audio transmission between the at least two audio processing modules 110 includes, but is not limited to, the following two transmission methods: analog audio transmission and digital audio transmission.
[0062] In analog audio transmission, analog audio data represents a sound wave, so analog audio transmission means that a copy of the sound wave is sent out in the form of electrical energy through a wire, and then converted back to a sound wave at the receiving end.
[0063] For example, analog audio transmission includes, but is not limited to, line in and line out, etc.
[0064] However, since the anti-interference ability of the sound wave transmission is weak, the analog audio transmission is easily interfered by system power supply, printed circuit board-layout (PCB-layout) and radio frequency signals; and with the increase of the transmission distance, the sound wave signal attenuation increases, and the sound wave signal transmission also amplifies the sound, that is, any static electricity or other noise that can be picked up in the transmission process will also be amplified, so in the analog audio transmission process, with the increase of the transmission distance, the transmitted sound wave signal attenuates while also bringing in noise and other interferences. Therefore, the accuracy of the analog audio transmission is poor.
[0065] The digital audio transmission runs in binary. Before transmission, the sound signal is converted into a digital signal, and in the binary system, a series of 0 and 1 are used to represent and send the signal.
[0066] Therefore, the digital audio transmission is not easy to introduce noise, has strong anti-interference ability, and the digital signal will not attenuate with the increase of the transmission distance, which is suitable for long-distance transmission. Therefore, the accuracy of the digital audio transmission is good. Therefore, in the embodiment, digital audio transmission is adopted. In other embodiments, analog audio transmission or other audio transmission methods can be used, and the embodiment does not limit the implementation manner of the audio transmission.
[0067] However, in the audio transmission process, each audio processing module 110 in the same electronic device 10 has a working clock, and after the audio processing module 110 receives and processes the audio data, the audio data is sent to the next audio processing module 110 based on the working clock of the audio processing module 110, so as to realize the transmission of the audio data.
[0068] The working clock is used to determine the timing and frequency hopping of the audio processing module 110 receiving and sending the audio data. The clock cannot be adjusted or turned off. Illustratively, the clock can be used as a 28-bit counter, and the clock frequency is 3.2 thousand cycles per second (kHz).
[0069] However, since the clock frequencies of the working clocks of different audio processing modules 110 can be out of sync, the speed of the audio processing modules 110 sending the audio data can be out of sync. The speed of the different audio processing modules 110 sending the audio data can be out of sync, and there can be a certain audio processing module 110 sending more data than other audio processing modules 110, and this part of the extra data can cause data overflow or loss when received by other audio processing modules 110.
[0070] Schematically, the digital audio transmission methods include: Inter-IC Sound (I2S), Pulse Code Modulation (PCM), etc.
[0071] To solve the above problems, in the embodiment, each audio processing module 110 is configured to: acquire to-be-processed audio data; process the to-be-processed audio data according to a working clock of the audio processing module 110 to obtain processed audio data; acquire a reference clock; in a case where the processed audio data needs to be sent, send the processed audio data to a next audio processing module 110 according to the reference clock; and send a clock signal of the reference clock to the next audio processing module 110, so that the next audio processing module 110 receives the processed audio data according to the clock signal.
[0072] The reference clock is a standard clock followed by each audio transmission module in the electronic device 10 when transmitting audio data.
[0073] Since each audio processing module 110 transmits audio data according to the reference clock, the speeds of transmitting audio data by different audio processing modules 110 are consistent, so there is no case where the audio data received by an audio processing module 110 is more than the audio data sent to the next module, thereby avoiding the problems of data overflow or loss.
[0074] In each electronic device 10, there can be as many audio processing modules 110 as needed, which can be different or the same.
[0075] Optionally, the audio processing module 110 includes a micro control (MCU) module.
[0076] The micro control module is a central control module in the electronic device 10, configured to control the transmission direction of audio data in the electronic device 10.
[0077] In the embodiment, the micro control module is further configured to send a working clock of the micro control module to other audio processing modules 110, so as to take the working clock of the micro control module as the reference clock.
[0078] Since the micro control module is the central control module of the electronic device 10, that is, the micro control module needs to send data to other audio processing modules 110, the micro control module does not need to establish an additional clock circuit when sending the reference clock to other audio processing modules 110, thereby saving resources and reducing the complexity of the circuit.
[0079] In one example, in a case that the current audio processing module 110 is a micro control module, the audio processing module 110 obtaining the reference clock comprises: obtaining a working clock of the micro control module.
[0080] In another example, in a case that the current audio processing module 110 is not a micro control module, the micro control module is further configured to: send the working clock of the micro control module to the audio processing module 110.
[0081] Correspondingly, the audio processing module 110 obtaining the reference clock comprises: receiving the working clock sent by the micro control module to obtain the reference clock.
[0082] Taking the working clock of the micro control module as the reference clock when other audio processing modules 110 in the electronic device 10 transmit data can ensure that different audio processing modules 110 receive and transmit at the same frequency when transmitting audio data; and the micro control module receives and transmits audio data according to its own working clock when transmitting data with other audio processing modules 110. Therefore, the speed of data transmission of all audio processing modules 110 in the electronic device 10 can be synchronized, thereby avoiding the problem of data loss or overflow caused by data transmission.
[0083] Since the audio processing module 110 needs to receive the audio data to be processed according to the reference clock, in one example, before obtaining the audio data to be processed, the method further comprises: in a case that the current audio processing module 110 is not a micro control module, receiving a clock signal of the reference clock sent by the previous audio processing module 110; and receiving the audio data to be processed sent by the previous audio processing module 110 according to the clock signal.
[0084] The previous audio processing module 110 includes but is not limited to the following two cases:
[0085] First, the previous audio processing module 110 is a micro control module, at this time, receiving the clock signal of the reference clock sent by the previous audio processing module 110 comprises: receiving the clock signal of the reference clock sent by the micro control module.
[0086] Second, the previous audio processing module 110 is not a micro control module, at this time, receiving the clock signal of the reference clock sent by the previous audio processing module 110 comprises: receiving the clock signal of the reference clock sent by the micro control module received and sent by the previous audio processing module 110.
[0087] Since the last audio processing module 110 sends the clock signal of the reference clock while sending the audio data, the current audio processing module 110 can directly obtain the clock signal of the reference clock sent by the last audio processing module 110, simplifying the step of obtaining the clock signal of the reference clock before receiving the to-be-processed data, thereby improving the efficiency of audio transmission.
[0088] In another example, before obtaining the to-be-processed audio data, the method further includes: in the case that the current audio processing module 110 is a micro control module, receiving the to-be-processed audio data sent by the last audio processing module 110 according to the working clock of the micro control module
[0089] Since the working clock of the micro control module is used as the reference clock, in the case that the current audio processing module 110 is a micro control module, the working clock of the micro control module can be directly used without being obtained from the last audio processing module 110, thereby reducing the amount of data in the transmission process and improving the intelligent degree of the electronic device 10.
[0090] When the electronic device 10 needs to collect audio data in real time, the electronic device 10 can optionally further include an audio collection (Microphone, MIC) module. The audio collection module can be a microphone array or a goose neck microphone, and the embodiment is not limited to the implementation manner of the audio collection module.
[0091] The audio collection module is configured to collect audio data.
[0092] Since the real-time audio data collected by the audio collection module is analog audio data, an audio processing module 110 connected to the audio collection module is needed to convert the analog audio data into digital audio data. At this time, the audio processing module 110 further includes an audio conversion (Analog-to-digital converter, ADC) module connected to the audio collection module.
[0093] The audio conversion module is configured to convert analog audio data into digital audio data.
[0094] Optionally, in the case that the audio processing module 110 is connected to the audio collection module, obtaining the to-be-processed audio data includes: obtaining analog audio data collected by the audio collection module.
[0095] Correspondingly, processing the to-be-processed audio data according to the working clock of the audio processing module 110 includes: converting the analog audio data into digital audio data according to the working clock.
[0096] Optionally, the audio collection module and the audio conversion module can also be integrated into one module. The embodiment is not limited to the implementation manner of the audio collection module and the audio conversion module.
[0097] Since the digital audio data is not susceptible to interference and does not attenuate with distance, converting the analog audio data into the digital audio data can improve the quality of the audio transmission.
[0098] When the next audio processing module 110 is full of audio data, the next audio processing module cannot accept the audio data sent by the current audio processing module 110, resulting in data overflow or loss.
[0099] Therefore, optionally, in the case where the processed audio data needs to be sent, before sending the processed audio data to the next audio processing module 110 according to the reference clock, the method further comprises: sending a data transmission request to the next audio processing module 110; and determining that the processed audio data needs to be sent in the case where an acknowledgement transmission feedback is received from the next audio processing module 110.
[0100] The data transmission request is a transmission signal sent by the current audio processing module 110 to the next audio processing module 110.
[0101] The acknowledgement transmission feedback is an acknowledgement signal sent by the next audio processing module 110 to the current audio processing module 110 when the next audio processing module 110 can receive the audio data.
[0102] Since the clock used by the audio processing module 110 in receiving data and processing data is different, the data receiving rate and the data processing rate are also different, and optionally, a receiving buffer is arranged in each audio processing module 110.
[0103] By arranging the receiving buffer, the audio processing module 110 can continue to receive the to-be-processed audio data sent by the previous audio processing module 110 when the data processing rate is less than the data receiving rate, thereby improving the efficiency of the audio transmission.
[0104] At this time, the next audio processing module 110 is further configured to: in the case where the data transmission request is received, determine whether the number of unused bytes in the receiving buffer of the next audio processing module 110 is greater than or equal to the number of bytes of the processed audio data indicated by the data transmission request; and in the case where the number of unused bytes is greater than or equal to the number of bytes of the processed audio data, send the acknowledgement transmission feedback to the audio processing module 110.
[0105] Firstly confirming whether the next audio processing module 110 can receive the audio data before transmission can avoid the case of data overflow or loss caused by the fact that the next audio processing module 110 cannot receive the data, and can be used in most application scenarios, thereby improving the applicability of the audio transmission method.
[0106] The comparison of the number of unused bytes in the receiving buffer and the audio data to be transmitted determines whether the transmission feedback is returned, so that the electronic device 10 can autonomously determine the transmission time, thereby improving the intelligent level of the electronic device 10.
[0107] Similarly, since the clock used by the audio processing module 110 in sending data and processing data is different, the data sending rate and the data processing rate are also different. Optionally, the audio processing module 110 is provided with a sending buffer.
[0108] At this time, when the data processing efficiency is less than the data sending rate, the processed audio data can be temporarily stored in the sending buffer, so that the audio data stored in the sending buffer is sent to the next audio processing module 110 when the sending condition is met.
[0109] In this embodiment, the sending condition is that the number of bytes of the audio data in the sending buffer is greater than or equal to a preset byte number.
[0110] Illustratively, before sending the processed audio data to the next audio processing module 110 according to the reference clock, the processed audio data is stored in the sending buffer.
[0111] Correspondingly, sending the processed audio data to the next audio processing module 110 according to the reference clock comprises: when the number of bytes of the processed audio data in the sending buffer is greater than or equal to the preset byte number, sending the processed audio data to the next audio processing module 110 according to the reference clock.
[0112] The preset byte number can be pre-stored in the electronic device 10 or obtained from other devices, and the embodiment does not limit the implementation manner of the preset byte number.
[0113] When the number of bytes of the audio data in the sending buffer is greater than or equal to the preset byte number, the audio data can be sent, which can ensure that the number of bytes of the audio data sent each time is the same or similar, and can facilitate the audio processing module 110 to distinguish resources; and the electronic device 10 can determine the time of transmitting data, thereby realizing batch transmission and reducing the transmission times of the audio data.
[0114] Different electronic devices 10 have different function audio processing modules 110, Figure 2 is a schematic diagram of another electronic device provided by the embodiment, according to Figure 2 It can be known that the at least two audio processing modules comprise the audio acquisition module 111, the audio conversion module 112, the digital signal processing (DSP) module 113, the micro control module 114, the digital power amplifier module 115 and the audio playing module 116 connected in sequence.
[0115] The audio acquisition module 111 is configured to acquire initial audio data; the audio conversion module 112 is configured to convert the initial audio data into digital audio data to obtain first digital audio data; the digital signal processing module 113 is configured to perform noise reduction processing and gain processing on the first digital audio data to obtain second digital audio data; the micro control module 114 is further configured to receive and store the second digital audio data; the digital power amplifier module 115 is configured to convert the second digital audio data into an electrical signal; and the audio playing module 116 is configured to convert the electrical signal into an audio signal and play the audio signal.
[0116] The digital power amplifier module 115 comprises an equalizer (EQ) and the like, and the implementation of the digital power amplifier module 115 is not limited in the embodiment; the audio playing module 116 can be a loudspeaker or a plurality of loudspeakers, and the implementation of the audio playing module 116 is not limited in the embodiment,
[0117] Since the electronic device can be connected with other devices or a cloud platform and perform data transmission, optionally, the at least two audio processing modules further comprise a Bluetooth module connected with the micro control module 114, the Bluetooth module being configured to receive the second digital audio data sent by the micro control module 114 and send the stored digital audio data to other devices or the cloud platform.
[0118] For example, the Bluetooth module receives the 16KHz sampling rate vocal digital audio sent by the micro control module 114 and sends the 16KHz sampling rate vocal digital audio to a mobile phone.
[0119] Optionally, the Bluetooth module is further configured to receive third digital audio data sent by other devices or the cloud platform and send the third digital audio data to the micro control module 114.
[0120] For example, the Bluetooth module receives the 48KHz sampling rate music digital audio sent by the mobile phone and sends the 48KHz sampling rate music digital audio to the micro control module 114.
[0121] Since the Bluetooth module actively sends data to the micro control module 114, if the reference clock sent by the micro control module 114 is waited for at this time, data received by the Bluetooth module before the reference clock can be lost. Therefore, the resampling component is optionally arranged in the Bluetooth module, and the Bluetooth module is configured to: obtain the reference clock; synchronize the working clock of the Bluetooth module with the reference clock through the resampling component; and send the third digital audio data to the micro control module 114 according to the working clock of the Bluetooth module.
[0122] When the Bluetooth module is connected with the micro control module 114, the working clock of the Bluetooth module is synchronized with the reference clock through the resampling component. Therefore, when the Bluetooth module receives data transmitted by other devices or a cloud platform, the audio data can be transmitted to the micro control module 114 according to the working clock of the Bluetooth module. At this time, the rate at which the micro control module 114 receives data is consistent with the rate at which the Bluetooth module sends data, and therefore the problem of data overflow or loss caused by extra data in the transmission process does not occur.
[0123] In the embodiment, the electronic device includes at least two audio processing modules. Each audio processing module is configured to: obtain to-be-processed audio data; process the to-be-processed audio data according to a working clock of the audio processing module to obtain processed audio data; obtain a reference clock; and in a case where the processed audio data needs to be sent, send the processed audio data to a next audio processing module according to the reference clock, and send a clock signal of the reference clock to the next audio processing module, so that the next audio processing module receives the processed audio data according to the clock signal. The problem of data overflow or loss caused by extra data received by other audio processing modules when the data sent by a certain audio processing module is more than the data sent by other audio processing modules can be solved. Since each audio processing module sends the processed data according to the reference clock, and sends the clock signal of the reference clock to the next audio processing module, so that the next audio processing module receives the processed data according to the reference clock, the frequency at which the current audio processing module sends data is synchronized with the frequency at which the next audio processing module receives data, and therefore there is no extra data in the transmission process, and the problem of data overflow or loss can be avoided.
[0124] In addition, since the micro control module is a central processing module of the electronic device and is configured to control the flow direction of the audio data, in a case where the current audio processing module is not the micro control module, the working clock sent by the micro control module is received to obtain the reference clock, and a new clock circuit does not need to be established, and the cost can be reduced.
[0125] In addition, the working clock of the micro control module is used as the reference clock when all the audio processing modules transmit the audio data, and the transmission frequencies of all the audio processing modules when transmitting the audio data can be ensured to be synchronized.
[0126] In addition, in the case that the current audio processing module is not a micro control module, the clock signal of the reference clock is sent to the next audio processing module, so that the next audio processing module does not have to reacquire the reference clock from the micro control module, simplifying the transmission process of the audio data, and thus reducing the complexity of audio transmission.
[0127] In addition, the next audio processing module may not be able to receive the audio data, and thus the transmission of the data by the current audio processing module to the next audio processing module may result in loss of the audio data. Therefore, a data transmission request is sent to the next audio processing module before the transmission of the processed audio data, and the processed audio data is transmitted only when an acknowledgement transmission feedback is received from the next audio processing module, so that loss of the audio data can be avoided.
[0128] In addition, by setting the receiving buffer, the data can be temporarily stored in the receiving buffer when the audio processing module has a problem, so that the fault tolerance of the audio transmission is improved.
[0129] In addition, since the digital audio is suitable for long-distance transmission and is not prone to interference, the analog audio data is converted into digital audio data, so that the audio quality can be improved.
[0130] The audio transmission method of the electronic device provided in the present application will be described in detail below. The following embodiments are described by taking the method as being used in the electronic device shown in the drawings as an example. In actual implementation, the method can also be used in other devices in communication with the electronic device, such as a user terminal or a server, etc. The user terminal includes but is not limited to a mobile phone, a computer, a tablet computer, a wearable device, etc. The present embodiment does not limit the implementation manner of the other devices and the implementation manner of the user terminal. Figure 1
[0131] The communication connection manner can be wired communication or wireless communication. The wireless communication manner can be short-distance communication or wireless communication, etc. The present embodiment does not limit the communication manner between the electronic device and the other devices.
[0132] Figure 3 FIG. 1 is a flowchart of an audio transmission method of an electronic device according to an embodiment of the present application. The method includes the following steps:
[0133] 301, obtaining to-be-processed audio data.
[0134] The to-be-processed audio data can be analog audio data or digital audio data. The present embodiment does not limit the implementation manner of the to-be-processed audio data.
[0135] 302, processing the to-be-processed audio data according to the working clock of the audio processing module to obtain processed audio data.
[0136] 303, acquire a reference clock.
[0137] 304, in the case of sending the processed audio data, send the processed audio data to the next audio processing module according to the reference clock, and send the clock signal of the reference clock to the next audio processing module, so that the next audio processing module receives the processed audio data according to the clock signal.
[0138] In summary, in the audio transmission method of the electronic device provided in the embodiment, by acquiring the to-be-processed audio data, processing the to-be-processed audio data according to the working clock of the audio processing module to obtain the processed audio data, acquiring the reference clock, in the case of sending the processed audio data, sending the processed audio data to the next audio processing module according to the reference clock, and sending the clock signal of the reference clock to the next audio processing module, so that the next audio processing module receives the processed audio data according to the clock signal; the problem that when the data sent by a certain audio processing module is more than the data sent by other audio processing modules, the excess data may cause data overflow or loss when received by other audio processing modules can be solved; since each audio processing module sends the processed data according to the reference clock, and sends the clock signal of the reference clock to the next audio processing module, so that the next audio processing module receives the processed data according to the reference clock, the frequency of sending data by the current audio processing module is synchronized with the frequency of receiving data by the next audio processing module, so that there is no excess data in the transmission process, and thus the problem of data overflow or loss can be avoided.
[0139] The technical features of the above-described embodiments can be combined in any manner. To make the description concise, not all possible combinations of the technical features in the above-described embodiments are described, but it should be considered that any combination of the technical features is within the scope of the present disclosure.
[0140] The above-described embodiments only express several implementation manners of the present application, and the description is relatively specific and detailed, but it should not be understood as a limitation on the patent scope of the present application. It should be noted that for those skilled in the art, without departing from the concept of the present application, some modifications and improvements can be made, which are all within the protection scope of the present application. Therefore, the patent protection scope of the present application should be subject to the appended claims.
Claims
1. An electronic device, comprising: The electronic device comprises at least two audio processing modules, each audio processing module is configured to: obtain to-be-processed audio data; process the to-be-processed audio data according to a working clock of the audio processing module to obtain processed audio data; obtain a reference clock; in a case where the processed audio data needs to be sent, send the processed audio data to a next audio processing module according to the reference clock, and send a clock signal of the reference clock to the next audio processing module, so that the next audio processing module receives the processed audio data according to the clock signal; the at least two audio processing modules comprise a micro control module, in a case where a current audio processing module is not the micro control module, the micro control module is further configured to: send a working clock of the micro control module to the audio processing module; correspondingly, the audio processing module obtains a reference clock, comprising: receiving the working clock sent by the micro control module to obtain the reference clock; before the obtaining to-be-processed audio data, further comprising: in a case where a current audio processing module is not the micro control module, receiving a clock signal of a reference clock sent by a previous audio processing module; receiving to-be-processed audio data sent by the previous audio processing module according to the clock signal; before the obtaining to-be-processed audio data, further comprising: in a case where the current audio processing module is the micro control module, receiving to-be-processed audio data sent by a previous audio processing module according to a working clock of the micro control module.
2. The electronic device of claim 1, wherein, before the in a case where the processed audio data needs to be sent, sending the processed audio data to a next audio processing module according to the reference clock, further comprising: sending a data transmission request to the next audio processing module; in a case where an acknowledgement transmission feedback of the next audio processing module is received, determining that the processed audio data needs to be sent.
3. The electronic device of claim 2, wherein, A receiving buffer is arranged in each audio processing module, and the next audio processing module is further configured to: in a case where the data transmission request is received, determining whether a number of unused bytes in a receiving buffer of the next audio processing module is greater than or equal to a number of bytes of the processed audio data indicated by the data transmission request; in a case where the number of unused bytes is greater than or equal to the number of bytes of the processed audio data, sending the acknowledgement transmission feedback to the audio processing module.
4. The electronic device of claim 1, wherein, The electronic device further comprises an audio acquisition module, in a case where the audio processing module is connected with the audio acquisition module, the obtaining to-be-processed audio data comprises: obtaining analog audio data collected by the audio acquisition module; correspondingly, the processing the to-be-processed audio data according to the working clock of the audio processing module comprises: converting the analog audio data into digital audio data according to the working clock.
5. The electronic device of claim 1, wherein, A sending buffer is arranged in the audio processing module, and before the sending the processed audio data to the next audio processing module according to the reference clock, further comprising: storing the processed audio data into the sending buffer; Correspondingly, the sending the processed audio data to the next audio processing module according to the reference clock comprises: In a case that the byte number of the processed audio data in the sending buffer is greater than or equal to the preset byte number, the processed audio data is sent to the next audio processing module according to the reference clock.
6. The electronic device of claim 1, wherein, The at least two audio processing modules comprise an audio acquisition module, an audio conversion module, a digital processing module, a micro control module, a digital power amplifier module and an audio playing module connected in sequence; The micro control module is configured to send a working clock of the micro control module to other audio processing modules, so as to take the working clock of the micro control module as a reference clock; The audio acquisition module is configured to acquire initial audio data; The audio conversion module is configured to convert the initial audio data into digital audio data to obtain first digital audio data; The digital processing module is configured to perform noise reduction processing and gain processing on the first digital audio data to obtain second digital audio data; The micro control module is further configured to receive and store the second digital audio data; The digital power amplifier module is configured to convert the second digital audio data into an electrical signal; The audio playing module is configured to convert the electrical signal into an acoustic signal and play the acoustic signal.
7. An audio transmission method of an electronic device, the method comprising: The electronic device comprises at least two audio processing modules, and the method comprises: acquiring to-be-processed audio data; processing the to-be-processed audio data according to a working clock of the audio processing module to obtain processed audio data; acquiring a reference clock; in a case that the processed audio data needs to be sent, sending the processed audio data to a next audio processing module according to the reference clock; and sending a clock signal of the reference clock to the next audio processing module, so that the next audio processing module receives the processed audio data according to the clock signal; The at least two audio processing modules comprise a micro control module, and in a case that the current audio processing module is not the micro control module, the micro control module is further configured to: send a working clock of the micro control module to the audio processing module; Correspondingly, the audio processing module acquires a reference clock, which comprises: receiving the working clock sent by the micro control module to obtain the reference clock; Before the to-be-processed audio data is acquired, the method further comprises: in a case that the current audio processing module is not the micro control module, receiving a clock signal of a reference clock sent by a previous audio processing module; receiving to-be-processed audio data sent by the previous audio processing module according to the clock signal; In a case that the current audio processing module is the micro control module, to-be-processed audio data sent by a previous audio processing module is received according to a working clock of the micro control module.
Citation Information
Patent Citations
Optical fiber serial data communication method
CN108631898A
Node optical transmitter and receiver and large-scale telephone transmission system and method based on optical transmitter and receiver
CN109639358A