Audio data transmission method and device, equipment and medium
By channel identification, expansion and speed-up processing of audio data at the sending end, and decoding, detection and filling processing at the receiving end, the problem that the built-in audio bus of the integrated circuit cannot transmit multiple audio data is solved, and multi-channel audio is realized Effective transmission of data and avoidance of noise.
Patent Information
- Application Number
- CN202411580705.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-07
- Publication Date
- 2025-02-14
AI Technical Summary
In the prior art, since the integrated circuit built-in audio bus only supports one I2S bus, multiple audio data cannot be effectively transmitted, and data loss and noise may be caused during the transmission process.
By performing channel identification processing, expansion processing and speed-up processing on the audio data at the transmitting end, the second audio data that can be transmitted through the built-in audio bus of the integrated circuit is obtained. The receiving end decodes and restores the received data, and detects whether there is missing data. If so, fills it to avoid the generation of noise.
It realizes the efficient transmission of multi-channel audio data through a built-in audio bus of an integrated circuit, avoiding noise problems caused by data loss.
Smart Images

Figure CN119446158A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing technology, and in particular to an audio data transmission method, device, equipment and medium. Background Art
[0002] In many application scenarios, the recording data of the CPU (Central Processing Unit) comes from an I2S bus (Inter-ICSound, integrated circuit built-in audio bus) of the DSP (Digital Signal Processing). The I2S bus itself does not support the TDM (time-division multiplexing) format (TDM supports multiple channels). Due to the limitation of the number of I2S buses of the CPU or DSP, there can only be one physical I2S bus (that is, only 2 channels can be transmitted) to transmit the recording data, but in actual project applications, there are usually 6 channels of audio that need to be transmitted.
[0003] In view of this, since there is only one physical I2S bus but 6 channels of recorded audio data need to be transmitted, the solution commonly used in the prior art is to compress the audio data before transmission. However, this method requires that the data before compression and the data after compression are exactly in a multiple relationship (because the I2S rate is fixed after configuration, if it is not a multiple relationship, it is difficult to guarantee the audio rate), and there are not many choices for compression algorithms that maintain the multiple relationship. Summary of the invention
[0004] In view of the above, it is necessary to provide an audio data transmission method, device, equipment and medium that can solve the problem that multiple channels of audio data cannot be transmitted based on a built-in audio bus of an integrated circuit in actual application scenarios, and noise is generated due to data loss during transmission.
[0005] An audio data transmission method is applied to an audio data transmission system, wherein the audio data transmission system includes a transmitting end and a receiving end; the audio data transmission method includes:
[0006] In response to an instruction to transmit the first audio data from the transmitting end to the receiving end through the built-in audio bus of the integrated circuit, the transmitting end performs channel identification processing, expansion processing and speed-up processing on the first audio data to obtain second audio data;
[0007] The transmitting end sends the second audio data to the receiving end through the built-in audio bus of the integrated circuit;
[0008] When receiving the second audio data, the receiving end decodes and restores the second audio data to obtain third audio data;
[0009] The receiving end detects whether the third audio data is missing;
[0010] When it is detected that the third audio data is missing, the receiving end performs padding processing on the third audio data to obtain fourth audio data.
[0011] According to a preferred embodiment of the present invention, the first audio data is 6-channel audio data; the data sent by the digital signal processor of the transmitting end is 16 bits wide and 16 kHz sampling rate; the transmitting end performs channel identification processing, expansion processing and speed-up processing on the first audio data, including:
[0012] Add a channel identifier to each channel in the first audio data, and create a 3-bit channel index according to the channel identifier;
[0013] The bit width of the first audio data is extended from 16 bits to 32 bits; wherein the 32-bit audio data obtained after the extension includes, starting from the most significant bit, 3 bits of the channel index, 16 bits of the first audio data, and 13 bits of invalid data; wherein the 13 bits of invalid data are filled with 0;
[0014] The transmission rate of the audio bus built into the integrated circuit is increased from a 16 kHz sampling rate to a 48 kHz sampling rate.
[0015] According to a preferred embodiment of the present invention, the method further comprises:
[0016] In response to the transmission instruction, calling the pcm_open function interface of the ALSA standard to open the pulse code modulation device;
[0017] After the pulse code modulation device is turned on, the sampling rate of the pulse code modulation device is configured to be 48 kHz, the bit width is 32 bits, and the number of channels is 2 channels using the pcm configuration function, and the values of the period_count function and the period_size function are set so that the number of audio frames read by each call to the pcm_read function is divisible by 3;
[0018] The pulse code modulation device is used to transmit audio data between the transmitting end and the receiving end.
[0019] According to a preferred embodiment of the present invention, the receiving end decodes and restores the second audio data to obtain the third audio data, including:
[0020] Call the pcm_read function to read data from the returned buffer data in a 32-bit width loop;
[0021] For each 32-bit data to be processed that is read, the data to be processed is shifted rightward by 13 bits to remove 13 bits of invalid data, and the remaining 19 bits of data are obtained as intermediate data;
[0022] Shift the intermediate data rightward by 16 bits to obtain the channel index of the data to be processed;
[0023] Performing an AND operation on the intermediate data and 0xffff to obtain 16 bits of valid audio data;
[0024] Filling the valid audio data into the buffer area corresponding to the channel index of the data to be processed, to obtain the restored audio data of the data to be processed;
[0025] All restored audio data are integrated to obtain the third audio data.
[0026] According to a preferred embodiment of the present invention, the receiving end detecting whether the third audio data is missing includes:
[0027] Detect whether the channel index corresponding to the third audio data exceeds the valid value range, and detect whether the value of the bitmap is 0x3F;
[0028] When it is detected that the channel index corresponding to the third audio data exceeds the valid value range, and / or the value of the bitmap is not 0x3F, it is determined that the third audio data is missing; or
[0029] When it is detected that the channel index corresponding to the third audio data does not exceed the valid value range and the value of the bitmap is 0x3F, it is determined that the third audio data is not missing.
[0030] According to a preferred embodiment of the present invention, the receiving end performs padding processing on the third audio data to obtain the fourth audio data, which includes:
[0031] Acquire missing frame data in the third audio data, and acquire the channel to which the missing frame data belongs as a target channel;
[0032] Obtain corresponding data of the previous frame data of the missing frame data on the target channel;
[0033] The missing frame data is filled with the acquired data to obtain the fourth audio data.
[0034] According to a preferred embodiment of the present invention, after obtaining the fourth audio data, the method further includes:
[0035] The fourth audio data is encrypted and stored in the configuration database.
[0036] An audio data transmission system, the audio data transmission system comprising a transmitting end and a receiving end; the audio data transmission system comprises:
[0037] The transmitting end is used to perform channel identification processing, expansion processing and speed-up processing on the first audio data in response to an instruction to transmit the first audio data from the transmitting end to the receiving end through the built-in audio bus of the integrated circuit to obtain second audio data;
[0038] The transmitting end is further used to send the second audio data to the receiving end through the built-in audio bus of the integrated circuit;
[0039] The receiving end is configured to decode and restore the second audio data to obtain third audio data when the second audio data is received;
[0040] The receiving end is further used to detect whether the third audio data is missing;
[0041] The receiving end is further configured to fill the third audio data to obtain fourth audio data when it is detected that the third audio data is missing.
[0042] A computer device, comprising:
[0043] a memory storing at least one instruction; and
[0044] The processor executes the instructions stored in the memory to implement the audio data transmission method.
[0045] A computer-readable storage medium stores at least one instruction, and the at least one instruction is executed by a processor in a computer device to implement the audio data transmission method.
[0046] It can be seen from the above technical solution that, on the one hand, in response to an instruction to transmit the first audio data from the transmitting end to the receiving end through the built-in audio bus of the integrated circuit, the transmitting end performs channel identification processing, expansion processing and speed-up processing on the first audio data to realize effective transmission of multi-channel audio through the built-in audio bus of the integrated circuit; on the other hand, the receiving end decodes and restores the received second audio data, detects whether the third audio data obtained after the restoration is missing, and fills the missing data to avoid noise caused by sound jumps. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] Figure 1It is a flow chart of a preferred embodiment of the audio data transmission method of the present invention.
[0048] Figure 2 It is a functional module diagram of a preferred embodiment of the audio data transmission system of the present invention.
[0049] Figure 3 It is a structural schematic diagram of a computer device of a preferred embodiment of the audio data transmission method of the present invention. DETAILED DESCRIPTION
[0050] In order to make the purpose, technical solutions and advantages of the present invention more clear, the present invention is described in detail below with reference to the accompanying drawings and specific embodiments.
[0051] like Figure 1 FIG. 1 is a flow chart of a preferred embodiment of the audio data transmission method of the present invention. According to different requirements, the order of the steps in the flow chart can be changed, and some steps can be omitted.
[0052] The audio data transmission method is applied to one or more computer devices, which are devices that can automatically perform numerical calculations and / or information processing according to pre-set or stored instructions, and their hardware includes but is not limited to microprocessors, application specific integrated circuits (ASICs), programmable gate arrays (FPGAs), digital signal processors (DSPs), embedded devices, etc.
[0053] The computer device may be any electronic product that can perform human-computer interaction with a user, such as a personal computer, a tablet computer, a smart phone, a personal digital assistant (PDA), a game console, an interactive network television (IPTV), a smart wearable device, etc.
[0054] The computer device may also include a network device and / or a user device, wherein the network device includes, but is not limited to, a single network server, a server group consisting of multiple network servers, or a cloud consisting of a large number of hosts or network servers based on cloud computing.
[0055] The server can be an independent server or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDN), as well as big data and artificial intelligence platforms.
[0056] Among them, Artificial Intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.
[0057] AI basic technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, mechatronics, etc. AI software technologies mainly include computer vision technology, robotics technology, biometrics technology, speech processing technology, natural language processing technology, and machine learning / deep learning.
[0058] The network where the computer device is located includes but is not limited to the Internet, a wide area network, a metropolitan area network, a local area network, a virtual private network (VPN), etc.
[0059] The audio data transmission method described in this embodiment is applied to an audio data transmission system, and the audio data transmission system includes a transmitting end and a receiving end, including:
[0060] S10, in response to an instruction to transmit the first audio data from the transmitting end to the receiving end through an integrated circuit built-in audio bus (Inter-IC Sound, I2S bus), the transmitting end performs channel identification processing, expansion processing and speed-up processing on the first audio data to obtain second audio data.
[0061] In this embodiment, the first audio data may be audio data such as recording data.
[0062] In this embodiment, the transmission instruction can be triggered by the user according to actual needs, or can be automatically triggered when audio data is collected. The present invention does not limit the triggering method of the transmission instruction.
[0063] In this embodiment, the transmitting end may include a DSP (Digital Signal Processing) for processing the audio data to be transmitted; the receiving end may include a CPU (Central Processing Unit) for processing the received audio data.
[0064] In this embodiment, the integrated circuit built-in audio bus can only transmit 2-channel audio data.
[0065] In this embodiment, the first audio data is 6-channel audio data; the data sent by the digital signal processor of the transmitting end is 16 bits wide and 16 kHz sampling rate; the transmitting end performs channel identification processing, expansion processing and speed-up processing on the first audio data, including:
[0066] Add a channel identifier to each channel in the first audio data, and create a 3-bit channel index according to the channel identifier;
[0067] The bit width of the first audio data is extended from 16 bits to 32 bits; wherein the 32-bit audio data obtained after the extension includes, starting from the most significant bit, 3 bits of the channel index, 16 bits of the first audio data, and 13 bits of invalid data; wherein the 13 bits of invalid data are filled with 0;
[0068] The transmission rate of the audio bus built into the integrated circuit is increased from a 16 kHz sampling rate to a 48 kHz sampling rate.
[0069] Among them, since a physical integrated circuit built-in audio bus I2S only supports 2 channels, if 6-channel data needs to be transmitted through 2 channels, the CPU as the receiving end cannot determine which of the transmitted audio data is channel 1, which is channel 2, which is channel 3... Therefore, this embodiment adds a channel identifier to indicate which channel the received data corresponds to, so that the receiving end can normally distinguish each channel data in the 6 channels.
[0070] Among them, since 6 channels need to occupy 3 bits of width to be correctly identified, the original 16-bit audio data plus the 3-bit channel identification requires at least 19 bits of width. Common audio data is usually 24 bits and 32 bits. Therefore, in order to facilitate processing, this embodiment expands the audio data to 32 bits, and other unused bits can be ignored and directly filled with 0. Then, the final 32-bit data becomes the high 3 bits as the channel index information, and the following 16 bits are the real audio data.
[0071] The sampling rate of the audio data sent by the DSP at the transmitting end is 16KHz. If I2S transmits data at a rate of 16KHz, it can only transmit 2-channel data. Therefore, if more data needs to be transmitted, the transmission rate of I2S can only be increased. Since 6 channels are 3 times that of 2 channels, the transmission rate needs to be increased by 3 times to carry 6-channel data, that is, to transmit data at a rate of 48KHz.
[0072] Through the above series of channel identification processing, expansion processing and speed-up processing, the DSP at the sending end inserts the 6-channel, 16K, 16-bit original audio data into the channel index when sending audio, so that the audio data after the channel index is inserted is expanded from 16bit to 32bit. The high 3 bits of the 32bit are the channel index, and the next 16bit is the valid audio data. The following data can be filled with 0 (the receiving end will ignore it). Then, the processed 32bit audio data is transmitted to an I2S bus through 48K, and the three consecutive frames of data correspond to the original one frame of data.
[0073] Through the above embodiments, 6-channel audio data can be transmitted on an integrated circuit built-in audio bus to meet the needs of multi-channel data transmission in actual application scenarios supporting formats such as TDM (time-division multiplexing).
[0074] S11, the transmitting end sends the second audio data to the receiving end through the built-in audio bus of the integrated circuit.
[0075] In this embodiment, a PCM (Pulse Code Modulation) device may be used for data transmission.
[0076] Specifically, the method further includes:
[0077] In response to the transmission instruction, calling the pcm_open function interface of the ALSA (Advanced Linux Sound Architecture) standard to open the pulse code modulation device pcm device;
[0078] After the pulse code modulation device is turned on, the sampling rate of the pulse code modulation device is configured to be 48 kHz, the bit width is 32 bits, and the number of channels is 2 channels using the pcm configuration function, and the values of the period_count function and the period_size function are set so that the number of audio frames read by each call to the pcm_read function is divisible by 3;
[0079] The pulse code modulation device is used to transmit audio data between the transmitting end and the receiving end.
[0080] The values of the period_count function and the period_size function make the number of audio frames read by each call to the pcm_read function divisible by 3, thereby ensuring that after each call to the pcm_read function returns data, the subsequent decoding process can decode the complete 6-channel data to avoid the situation where only half or part of the last 6 frames are decoded.
[0081] Through the above-mentioned embodiment, the initialization processing of the pulse code modulation device can be implemented to support the transmission of the extended 32-bit audio data.
[0082] S12: When receiving the second audio data, the receiving end decodes and restores the second audio data to obtain third audio data.
[0083] In this embodiment, the receiving end decodes and restores the second audio data to obtain the third audio data, including:
[0084] Call the pcm_read function to read data from the returned buffer data in a 32-bit width loop;
[0085] For each 32-bit data to be processed that is read, the data to be processed is shifted rightward by 13 bits to remove 13 bits of invalid data, and the remaining 19 bits of data are obtained as intermediate data;
[0086] Shift the intermediate data rightward by 16 bits to obtain the channel index of the data to be processed;
[0087] Performing an AND operation on the intermediate data and 0xffff to obtain 16 bits of valid audio data;
[0088] Filling the valid audio data into the buffer area corresponding to the channel index of the data to be processed, to obtain the restored audio data of the data to be processed;
[0089] All restored audio data are integrated to obtain the third audio data.
[0090] Through the above embodiments, the received audio data can be effectively restored to extract the original audio data.
[0091] S13, the receiving end detects whether the third audio data is missing.
[0092] Since data loss may occur during data transmission, which may cause audio noise, this embodiment needs to first detect whether the third audio data is missing.
[0093] Specifically, the receiving end detecting whether the third audio data is missing includes:
[0094] Detect whether the channel index corresponding to the third audio data exceeds the valid value range, and detect whether the value of the bitmap is 0x3F;
[0095] When it is detected that the channel index corresponding to the third audio data exceeds the valid value range, and / or the value of the bitmap is not 0x3F, it is determined that the third audio data is missing; or
[0096] When it is detected that the channel index corresponding to the third audio data does not exceed the valid value range and the value of the bitmap is 0x3F, it is determined that the third audio data is not missing.
[0097] For example: Since 6-channel audio data is transmitted, the valid value of the channel index is 0-5. If the value of the channel index exceeds 5, it indicates a transmission error, and the corresponding log can be entered into the log system. In addition, after each 32-bit is processed, the bitmap will record which channel has been found. After 6 consecutive 32-bit audio data are processed, the bitmap value should be 0x3F, which means that all 6 channels have been found. At this time, if the bitmap value is not 0x3F, it indicates that the audio transmitted from the other end has a missing channel. In this case, the corresponding log needs to be output in the log system for later troubleshooting.
[0098] Through the above embodiment, it is possible to detect whether the third audio data is missing, so as to perform targeted processing in a timely manner.
[0099] S14, when it is detected that the third audio data is missing, the receiving end performs padding processing on the third audio data to obtain fourth audio data.
[0100] In this embodiment, the receiving end performs padding processing on the third audio data to obtain the fourth audio data, including:
[0101] Acquire missing frame data in the third audio data, and acquire the channel to which the missing frame data belongs as a target channel;
[0102] Obtain corresponding data of the previous frame data of the missing frame data on the target channel;
[0103] The missing frame data is filled with the acquired data to obtain the fourth audio data.
[0104] Among them, whether the channel index is out of range or the bitmap value is not 0x3F, it will cause a channel data to fail to correspond to the corresponding channel. In this case, there is a high probability that data loss has occurred, so the data needs to be recovered accordingly.
[0105] The recovery mechanism adopted in this embodiment is to fill the data of the corresponding channel of the previous frame into the current frame. For example, if the data of channel 3 is missing in a certain frame of 6 channels, the audio data of channel 3 of the previous frame (6 channels) is taken forward and filled into channel 3 of the current frame to fill the missing data. If this is not done, the data of the current channel 3 can only be filled with 0, which will cause the audio to jump to 0 quickly, thereby causing noise. If the data of the previous frame is taken to fill, since the data jump between two adjacent frames is usually not very large, this ensures that the sound will not jump too much, and will not cause noise.
[0106] In this embodiment, after obtaining the fourth audio data, the method further includes:
[0107] The fourth audio data is encrypted and stored in the configuration database.
[0108] The configuration database may be a local database of the receiving end, or a pre-agreed cloud database.
[0109] The fourth audio data may be encrypted using algorithms such as symmetric encryption, and the present invention does not limit the type of encryption algorithm used.
[0110] This embodiment can realize the transmission of 6-channel data through a physical integrated circuit built-in audio bus in actual mass production projects, which guarantees the actual needs of the project when the chip physical resources are insufficient, and can also save part of the chip cost.
[0111] It can be seen from the above technical solution that, on the one hand, in response to an instruction to transmit the first audio data from the transmitting end to the receiving end through the built-in audio bus of the integrated circuit, the transmitting end performs channel identification processing, expansion processing and speed-up processing on the first audio data to realize effective transmission of multi-channel audio through the built-in audio bus of the integrated circuit; on the other hand, the receiving end decodes and restores the received second audio data, detects whether the third audio data obtained after the restoration is missing, and fills the missing data to avoid noise caused by sound jumps.
[0112] like Figure 2 1 is a functional block diagram of a preferred embodiment of the audio data transmission system of the present invention. The audio data transmission system 11 comprises a transmitting end 110 and a receiving end 111.
[0113] The transmitting end 110 is used to perform channel identification processing, expansion processing and speed-up processing on the first audio data in response to an instruction to transmit the first audio data from the transmitting end 110 to the receiving end 111 through the built-in audio bus of the integrated circuit to obtain the second audio data;
[0114] The transmitting end 110 is further configured to transmit the second audio data to the receiving end 111 via the built-in audio bus of the integrated circuit;
[0115] The receiving end 111 is used for decoding and restoring the second audio data to obtain third audio data when the second audio data is received;
[0116] The receiving end 111 is further used to detect whether the third audio data is missing;
[0117] The receiving end 111 is further configured to fill the third audio data to obtain fourth audio data when it is detected that the third audio data is missing.
[0118] It can be seen from the above technical solution that, on the one hand, in response to an instruction to transmit the first audio data from the transmitting end to the receiving end through the built-in audio bus of the integrated circuit, the transmitting end performs channel identification processing, expansion processing and speed-up processing on the first audio data to realize effective transmission of multi-channel audio through the built-in audio bus of the integrated circuit; on the other hand, the receiving end decodes and restores the received second audio data, detects whether the third audio data obtained after the restoration is missing, and fills the missing data to avoid noise caused by sound jumps.
[0119] like Figure 3 FIG. 1 is a schematic diagram of the structure of a computer device of a preferred embodiment of the audio data transmission method of the present invention.
[0120] The computer device 1 may include a memory 12 , a processor 13 , and a bus, and may also include a computer program stored in the memory 12 and executable on the processor 13 , such as an audio data transmission program.
[0121] Those skilled in the art will appreciate that the schematic diagram is merely an example of the computer device 1 and does not constitute a limitation on the computer device 1. The computer device 1 may be a bus-type structure or a star-type structure. The computer device 1 may also include more or less other hardware or software than shown in the diagram, or a different arrangement of components. For example, the computer device 1 may also include input and output devices, network access devices, etc.
[0122] It should be noted that the computer device 1 is only an example, and other existing or future electronic products that are suitable for the present invention should also be included in the protection scope of the present invention and included here by reference.
[0123] The memory 12 includes at least one type of readable storage medium, and the readable storage medium includes a flash memory, a mobile hard disk, a multimedia card, a card-type memory (e.g., SD or DX memory, etc.), a magnetic memory, a disk, an optical disk, etc. In some embodiments, the memory 12 may be an internal storage unit of the computer device 1, such as a mobile hard disk of the computer device 1. In other embodiments, the memory 12 may also be an external storage device of the computer device 1, such as a plug-in mobile hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the computer device 1. Further, the memory 12 may also include both an internal storage unit of the computer device 1 and an external storage device. The memory 12 may not only be used to store application software and various types of data installed in the computer device 1, such as the code of an audio data transmission program, etc., but may also be used to temporarily store data that has been output or is to be output.
[0124] In some embodiments, the processor 13 may be composed of an integrated circuit, for example, a single packaged integrated circuit, or a plurality of packaged integrated circuits with the same or different functions, including one or more central processing units (CPUs), microprocessors, digital processing chips, graphics processors, and combinations of various control chips. The processor 13 is the control core (Control Unit) of the computer device 1, and uses various interfaces and lines to connect various components of the entire computer device 1, and executes various functions and processes data of the computer device 1 by running or executing programs or modules stored in the memory 12 (for example, executing audio data transmission programs, etc.), and calling data stored in the memory 12.
[0125] The processor 13 executes the operating system of the computer device 1 and various installed applications. The processor 13 executes the applications to implement the steps in the above-mentioned various audio data transmission method embodiments, for example Figure 1 Steps shown.
[0126] Exemplarily, the computer program may be divided into one or more modules / units, which are stored in the memory 12 and executed by the processor 13 to implement the present invention. The one or more modules / units may be a series of computer-readable instruction segments capable of implementing specific functions, which are used to describe the execution process of the computer program in the computer device 1. For example, the computer program may be divided into a sending end 110 and a receiving end 111.
[0127] The above-mentioned integrated unit implemented in the form of a software function module can be stored in a computer-readable storage medium. The above-mentioned software function module is stored in a storage medium, and includes a number of instructions for enabling a computer device (which can be a personal computer, a computer device, or a network device, etc.) or a processor to execute the part of the audio data transmission method described in each embodiment of the present invention.
[0128] If the module / unit integrated in the computer device 1 is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present invention implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware devices through a computer program. The computer program can be stored in a computer-readable storage medium, and when the computer program is executed by a processor, the steps of each of the above-mentioned method embodiments can be implemented.
[0129] The computer program includes computer program code, which may be in source code form, object code form, executable file or some intermediate form, etc. The computer readable medium may include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory, etc.
[0130] Furthermore, the computer-readable storage medium may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function, etc.; the data storage area may store data created according to the use of the blockchain node, etc.
[0131] The blockchain referred to in this invention is a new application mode of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanism, encryption algorithm, etc. Blockchain is essentially a decentralized database, a string of data blocks generated by cryptographic methods. Each data block contains a batch of network transaction information, which is used to verify the validity of its information (anti-counterfeiting) and generate the next block. Blockchain can include the underlying blockchain platform, platform product service layer, and application service layer.
[0132] The bus can be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 3 The bus is represented by only one straight line, but it does not mean that there is only one bus or one type of bus. The bus is configured to realize the connection and communication between the memory 12 and at least one processor 13, etc.
[0133] Although not shown, the computer device 1 may also include a power source (such as a battery) for supplying power to each component. Preferably, the power source may be logically connected to the at least one processor 13 through a power management device, so that the power management device can realize functions such as charging management, discharging management, and power consumption management. The power source may also include any components such as one or more DC or AC power sources, recharging devices, power failure detection circuits, power converters or inverters, power status indicators, etc. The computer device 1 may also include a variety of sensors, Bluetooth modules, Wi-Fi modules, etc., which will not be repeated here.
[0134] Furthermore, the computer device 1 may also include a network interface. Optionally, the network interface may include a wired interface and / or a wireless interface (such as a WI-FI interface, a Bluetooth interface, etc.), which is usually used to establish a communication connection between the computer device 1 and other computer devices.
[0135] Optionally, the computer device 1 may further include a user interface, which may be a display, an input unit (such as a keyboard), or a standard wired interface or a wireless interface. Optionally, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, or an OLED (Organic Light-Emitting Diode) touch device. The display may also be appropriately referred to as a display screen or a display unit, which is used to display information processed in the computer device 1 and to display a visual user interface.
[0136] It should be understood that the embodiment is for illustration only and the scope of the patent application is not limited to this structure.
[0137] It can be understood by those skilled in the art that Figure 3 The structure shown does not constitute a limitation on the computer device 1, and may include fewer or more components than shown in the figure, or combine certain components, or arrange the components differently.
[0138] Combination Figure 1 , the memory 12 in the computer device 1 stores a plurality of instructions to implement an audio data transmission method, and the processor 13 can execute the plurality of instructions to implement:
[0139] In response to an instruction to transmit the first audio data from the transmitting end to the receiving end through the built-in audio bus of the integrated circuit, the transmitting end performs channel identification processing, expansion processing and speed-up processing on the first audio data to obtain second audio data;
[0140] The transmitting end sends the second audio data to the receiving end through the built-in audio bus of the integrated circuit;
[0141] When receiving the second audio data, the receiving end decodes and restores the second audio data to obtain third audio data;
[0142] The receiving end detects whether the third audio data is missing;
[0143] When it is detected that the third audio data is missing, the receiving end performs padding processing on the third audio data to obtain fourth audio data.
[0144] Specifically, the specific implementation method of the processor 13 for the above instructions can refer to Figure 1 The description of the relevant steps in the corresponding embodiments will not be repeated here.
[0145] It should be noted that the data involved in this case were all obtained legally.
[0146] In the several embodiments provided by the present invention, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only illustrative, for example, the division of the modules is only a logical function division, and there may be other division methods in actual implementation.
[0147] The present invention can be used in many general or special computer system environments or configurations. For example: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronic devices, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, etc. The present invention can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The present invention can also be practiced in distributed computing environments, in which tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media including storage devices.
[0148] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0149] In addition, each functional module in each embodiment of the present invention may be integrated into one processing unit, each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of hardware plus software functional modules.
[0150] It is obvious to those skilled in the art that the present invention is not limited to the details of the above exemplary embodiments, and that the present invention can be implemented in other specific forms without departing from the spirit or essential characteristics of the present invention.
[0151] Therefore, no matter from which point of view, the embodiments should be regarded as illustrative and non-restrictive, and the scope of the present invention is limited by the appended claims rather than the above description, so it is intended that all changes falling within the meaning and scope of the equivalent elements of the claims are included in the present invention. Any attached figure mark in the claims should not be regarded as limiting the claims involved.
[0152] In addition, it is clear that the word "comprising" does not exclude other units or steps, and the singular does not exclude the plural. Multiple units or devices stated in the present invention can also be implemented by one unit or device through software or hardware. The words first, second, etc. are used to indicate names, and do not indicate any particular order.
[0153] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solution of the present invention can be modified or replaced by equivalents without departing from the spirit and scope of the technical solution of the present invention.
Claims
1. An audio data transmission method, characterized in that: Applied to an audio data transmission system, the audio data transmission system includes a transmitting end and a receiving end; the audio data transmission method includes: In response to an instruction to transmit the first audio data from the transmitting end to the receiving end through the built-in audio bus of the integrated circuit, the transmitting end performs channel identification processing, expansion processing and speed-up processing on the first audio data to obtain second audio data; The transmitting end sends the second audio data to the receiving end through the built-in audio bus of the integrated circuit; When receiving the second audio data, the receiving end decodes and restores the second audio data to obtain third audio data; The receiving end detects whether the third audio data is missing; When it is detected that the third audio data is missing, the receiving end performs padding processing on the third audio data to obtain fourth audio data.
2. The audio data transmission method according to claim 1, characterized in that: The first audio data is 6-channel audio data; the data sent by the digital signal processor at the transmitting end has a 16-bit width and a 16 kHz sampling rate; The transmitting end performs channel identification processing, expansion processing and speed-up processing on the first audio data, including: Add a channel identifier to each channel in the first audio data, and create a 3-bit channel index according to the channel identifier; The bit width of the first audio data is extended from 16 bits to 32 bits; wherein the 32-bit audio data obtained after the extension includes, starting from the most significant bit, 3 bits of the channel index, 16 bits of the first audio data, and 13 bits of invalid data; wherein the 13 bits of invalid data are filled with 0; The transmission rate of the audio bus built into the integrated circuit is increased from a 16 kHz sampling rate to a 48 kHz sampling rate.
3. The audio data transmission method according to claim 1, characterized in that: The method further comprises: In response to the transmission instruction, calling the pcm_open function interface of the ALSA standard to open the pulse code modulation device; After the pulse code modulation device is turned on, the sampling rate of the pulse code modulation device is configured to be 48 kHz, the bit width is 32 bits, and the number of channels is 2 channels using the pcm configuration function, and the values of the period_count function and the period_size function are set so that the number of audio frames read by each call to the pcm_read function is divisible by 3; The pulse code modulation device is used to transmit audio data between the transmitting end and the receiving end.
4. The audio data transmission method according to claim 3, characterized in that: The receiving end decodes and restores the second audio data to obtain the third audio data, which includes: Call the pcm_read function to read data from the returned buffer data in a 32-bit width loop; For each 32-bit data to be processed that is read, the data to be processed is shifted rightward by 13 bits to remove 13 bits of invalid data, and the remaining 19 bits of data are obtained as intermediate data; Shift the intermediate data rightward by 16 bits to obtain the channel index of the data to be processed; Performing an AND operation on the intermediate data and 0xffff to obtain 16 bits of valid audio data; Filling the valid audio data into the buffer area corresponding to the channel index of the data to be processed, to obtain the restored audio data of the data to be processed; All restored audio data are integrated to obtain the third audio data.
5. The audio data transmission method according to claim 1, characterized in that: The receiving end detecting whether the third audio data is missing includes: Detect whether the channel index corresponding to the third audio data exceeds the valid value range, and detect whether the value of the bitmap is 0x3F; When it is detected that the channel index corresponding to the third audio data exceeds the valid value range, and / or the value of the bitmap is not 0x3F, it is determined that the third audio data is missing; or When it is detected that the channel index corresponding to the third audio data does not exceed the valid value range and the value of the bitmap is 0x3F, it is determined that the third audio data is not missing.
6. The audio data transmission method according to claim 5, characterized in that: The receiving end performs padding processing on the third audio data to obtain fourth audio data, including: Acquire missing frame data in the third audio data, and acquire the channel to which the missing frame data belongs as a target channel; Obtain corresponding data of the previous frame data of the missing frame data on the target channel; The missing frame data is filled with the acquired data to obtain the fourth audio data.
7. The audio data transmission method according to claim 1, characterized in that: After obtaining the fourth audio data, the method further includes: The fourth audio data is encrypted and stored in the configuration database.
8. An audio data transmission system, characterized in that: The audio data transmission system comprises a transmitting end and a receiving end; the audio data transmission system comprises: The transmitting end is used to perform channel identification processing, expansion processing and speed-up processing on the first audio data in response to an instruction to transmit the first audio data from the transmitting end to the receiving end through the built-in audio bus of the integrated circuit to obtain second audio data; The transmitting end is further used to send the second audio data to the receiving end through the built-in audio bus of the integrated circuit; The receiving end is configured to decode and restore the second audio data to obtain third audio data when the second audio data is received; The receiving end is further used to detect whether the third audio data is missing; The receiving end is further configured to fill the third audio data to obtain fourth audio data when it is detected that the third audio data is missing.
9. A computer device, characterized in that: The computer device comprises: a memory storing at least one instruction; and A processor executes instructions stored in the memory to implement the audio data transmission method as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores at least one instruction, and the at least one instruction is executed by a processor in a computer device to implement the audio data transmission method according to any one of claims 1 to 7.