Audio transmission method, device, electronic device and storage medium

Through audio segmentation and custom processing script processing and sending, the problem of redundant transmission of audio streams collected by browsers is solved, high-fidelity transmission of audio streams collected by browsers is realized, and the audio transmission process is simplified.

CN117979210BActive Publication Date: 2024-09-17GUANGZHOU BAOLUN ELECTRONICS CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410141767.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-01-31
Publication Date
2024-09-17
Estimated Expiration
2044-01-31

AI Technical Summary

Technical Problem

When implementing the audio stream transmission collected by the browser, the existing technology needs to introduce the entire WebRTC protocol, resulting in project redundancy and unable to meet the simple and lightweight requirements of small audio transmission projects.

Method used

By obtaining the audio stream to be processed collected by the target browser, perform audio segmentation processing, calling a custom audio processing script for fidelity processing, and sending the processed audio stream to the target server to achieve high-fidelity transmission of the audio stream.

Benefits of technology

It realizes simple and lightweight high-fidelity transmission processing of audio streams collected by the browser, and avoids the project redundancy problem caused by the introduction of redundant WebRTC protocol.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117979210B
    Figure CN117979210B
Patent Text Reader

Abstract

The embodiment of the present invention discloses an audio transmission method, device, electronic device and storage medium. The method comprises: obtaining an audio stream to be processed collected by a target browser, performing audio segmentation processing on the audio stream to be processed to obtain at least two sub-audio streams to be processed; performing fidelity processing on each of the sub-audio streams to be processed by calling a custom audio processing script to obtain a target sub-audio stream corresponding to each of the sub-audio streams to be processed; and sending each of the target sub-audio streams to a target server connected to the target browser by HTTP through the target browser. The technical solution of the embodiment of the present invention realizes a relatively simple and lightweight high-fidelity transmission processing of the audio stream collected by the browser.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present invention relate to the field of computer technology, and in particular to an audio transmission method, device, electronic device and storage medium. Background Art

[0002] WebRTC (Web Real-Time Communications) is a real-time communication technology with powerful functions and rich packaging methods. In related technologies, WebRTC technology is often used to implement the function of transmitting the audio stream collected by the browser.

[0003] However, because WebRTC is powerful, it is large in size, that is, the amount of code is large. For some small audio transmission projects, simple audio transmission is generally sufficient. However, even simple audio transmission requires the introduction of the entire WebRTC protocol, making the project redundant. Therefore, a simple and lightweight solution is urgently needed to transmit the audio stream collected by the browser with high fidelity. Summary of the invention

[0004] The present invention provides an audio transmission method, device, electronic device and storage medium to realize relatively simple and lightweight high-fidelity transmission processing of audio streams collected by a browser.

[0005] According to one aspect of the present invention, there is provided an audio transmission method, the method comprising:

[0006] Acquire an audio stream to be processed collected by a target browser, and perform audio segmentation processing on the audio stream to be processed to obtain at least two sub-audio streams to be processed;

[0007] By calling a custom audio processing script, each of the sub-audio streams to be processed is subjected to fidelity processing to obtain a target sub-audio stream corresponding to each of the sub-audio streams to be processed;

[0008] Each of the target sub-audio streams is sent to a target server connected to the target browser by HTTP through the target browser.

[0009] Optionally, the sampling bit number of the sub-audio stream to be processed is a first sampling bit number, and the performing fidelity processing on each of the sub-audio streams to be processed to obtain a target sub-audio stream corresponding to each of the sub-audio streams to be processed includes:

[0010] In a case where the first sampling bit number is not the second sampling bit number, determining a first audio range corresponding to the first sampling bit number and a second audio range corresponding to the second sampling bit number, wherein the first sampling bit number is higher than the second sampling bit number;

[0011] Based on the first audio range and the second audio range, the sampling bit number of each of the sub-audio streams to be processed is converted from the first audio bit number to the second sampling bit number to obtain a target sub-audio stream corresponding to each of the sub-audio streams to be processed.

[0012] Optionally, the converting, based on the first audio range and the second audio range, the sampling bit number of each of the sub-audio streams to be processed from the first audio bit number to the second sampling bit number to obtain a target sub-audio stream corresponding to each of the sub-audio streams to be processed includes:

[0013] Based on the first audio range and the second audio range, converting the number of sampling bits of each of the sub-audio streams to be processed from the first audio bit number to the second sampling bit number to obtain a reference sub-audio stream corresponding to each of the sub-audio streams to be processed;

[0014] For each of the reference sub-audio streams, each audio value in the reference sub-audio stream is normalized to obtain a normalized audio value, and based on the normalized audio value and a preset noise sequence, a target sub-audio stream corresponding to each of the sub-audio streams to be processed is obtained, wherein the sampling bit number of the preset noise sequence is the second sampling bit number.

[0015] Optionally, obtaining the audio stream to be processed collected by the target browser includes:

[0016] By calling the audio collection method of the target browser, the audio stream of the audio input device is collected;

[0017] Based on the audio preprocessing parameters in the audio preprocessing method of the target browser, perform audio preprocessing on the collected audio stream, and write the preprocessed audio stream into the target buffer;

[0018] The preprocessed audio stream is read from the target buffer as the audio stream to be processed.

[0019] Optionally, the performing fidelity processing on each of the sub-audio streams to be processed by calling a custom audio processing script includes:

[0020] Saving the custom audio processing script to a pre-created audio processing thread;

[0021] Through the audio processing thread, the audio streams to be processed are subjected to fidelity processing according to the preset audio fidelity strategy in the custom audio processing script.

[0022] Optionally, after obtaining the target sub-audio streams corresponding to the sub-audio streams to be processed, the method further includes:

[0023] For each target sub-audio stream, audio stream attribute information of the target sub-audio stream is determined, and the audio stream attribute information is added to the audio header information of the target sub-audio stream.

[0024] Optionally, before sending each of the target sub-audio streams to a target server connected to the target browser via HTTP, the method further comprises:

[0025] If the audio format of each target sub-audio stream is not the target audio format, audio format conversion processing is performed on each target sub-audio stream.

[0026] According to another aspect of the present invention, an audio transmission device is provided. The device comprises:

[0027] The audio stream acquisition module is used to acquire the audio stream to be processed collected by the target browser, and perform audio segmentation processing on the audio stream to be processed to obtain at least two sub-audio streams to be processed;

[0028] An audio stream processing module, configured to perform fidelity processing on each of the sub-audio streams to be processed by calling a custom audio processing script, and obtain a target sub-audio stream corresponding to each of the sub-audio streams to be processed;

[0029] The audio stream transmission module is used to send each of the target sub-audio streams to a target server connected to the target browser via HTTP through the target browser.

[0030] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:

[0031] at least one processor; and

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

[0033] The memory stores a computer program that can be executed by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the audio transmission method described in any embodiment of the present invention.

[0034] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the audio transmission method described in any embodiment of the present invention when executed.

[0035] The technical solution of the embodiment of the present invention obtains the audio stream to be processed collected by the target browser, performs audio segmentation processing on the audio stream to be processed, and obtains at least two sub-audio streams to be processed; by calling a custom audio processing script, performs fidelity processing on each of the sub-audio streams to be processed, and obtains a target sub-audio stream corresponding to each of the sub-audio streams to be processed; and sends each of the target sub-audio streams to a target server connected to the target browser by HTTP through the target browser. The technical solution of the embodiment of the present invention realizes a relatively simple and lightweight high-fidelity transmission processing of the audio stream collected by the browser.

[0036] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0038] Figure 1 A flowchart of an audio transmission method provided in Embodiment 1 of the present invention;

[0039] Figure 2 A schematic diagram of the structure of an audio transmission device provided in Embodiment 2 of the present invention;

[0040] Figure 3 A schematic diagram of the structure of an electronic device provided in Embodiment 3 of the present invention. DETAILED DESCRIPTION

[0041] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

[0042] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0043] It is understandable that before using the technical solutions disclosed in the embodiments of the present disclosure, the types, scope of use, usage scenarios, etc. of the personal information involved in the present disclosure should be informed to the user and the user's authorization should be obtained in an appropriate manner in accordance with relevant laws and regulations.

[0044] For example, in response to receiving an active request from a user, a prompt message is sent to the user to clearly prompt the user that the operation requested to be performed will require obtaining and using the user's personal information. Thus, the user can autonomously choose whether to provide personal information to software or hardware such as an electronic device, application, server, or storage medium that performs the operation of the technical solution of the present disclosure according to the prompt message.

[0045] As an optional but non-limiting implementation, in response to receiving an active request from the user, the prompt information may be sent to the user in the form of a pop-up window, in which the prompt information may be presented in text form. In addition, the pop-up window may also carry a selection control for the user to choose "agree" or "disagree" to provide personal information to the electronic device.

[0046] It is understandable that the above notification and the process of obtaining user authorization are merely illustrative and do not constitute a limitation on the implementation of the present disclosure. Other methods that meet the relevant laws and regulations may also be applied to the implementation of the present disclosure.

[0047] It is understandable that the data involved in this technical solution (including but not limited to the data itself, the acquisition or use of the data) shall comply with the requirements of relevant laws, regulations and relevant provisions.

[0048] Embodiment 1

[0049] Figure 1A flow chart of an audio transmission method provided in Embodiment 1 of the present invention is provided. This embodiment is applicable to the case of performing audio transmission on an audio stream. The method can be performed by an audio transmission device. The audio transmission device can be implemented in the form of hardware and / or software. The audio transmission device can be configured in an electronic device such as a computer or a server.

[0050] like Figure 1 As shown, the method of this embodiment includes:

[0051] S110, obtaining an audio stream to be processed collected by a target browser, and performing audio segmentation processing on the audio stream to be processed to obtain at least two sub-audio streams to be processed.

[0052] The target browser can be understood as a browser with an audio stream collection function, which can be used to collect audio streams. The audio stream to be processed can be understood as an audio stream that needs to be transmitted and is collected by the target browser. The sub-audio stream to be processed can be a sub-audio stream obtained after audio segmentation processing is performed on the audio stream to be processed.

[0053] In an embodiment of the present invention, obtaining the audio stream to be processed collected by the target browser may include: collecting the audio stream of the audio input device by calling the audio collection method of the target browser; performing audio preprocessing on the collected audio stream based on the audio preprocessing parameters in the audio preprocessing method of the target browser, and writing the preprocessed audio stream to the target buffer; reading the preprocessed audio stream from the target buffer as the audio stream to be processed.

[0054] Among them, the audio acquisition method can be understood as a method provided by the target browser that can collect the audio stream of the audio input device. The audio preprocessing method can be understood as a method provided by the target browser that can perform audio preprocessing on the audio stream of the audio input device. The target buffer can be understood as a buffer used to store the audio stream collected by the browser after audio preprocessing. The audio preprocessing parameters can be parameters set by the user, or can be parameters based on defaults, or can be parameters recommended by the system. The audio preprocessing parameters may include the buffer size, the number of input channels, and the number of output channels.

[0055] In an embodiment of the present invention, the unit of the buffer size may be a sample frame. Exemplarily, the buffer size may be at least one of 256, 512, 1024, 2048, 4096, 8192, and 16384. Since a smaller buffer size usually results in a certain delay, and a larger buffer size generally results in audio crashes and failures, the system recommends a buffer value to balance delay and audio quality. Among them, the number of input channels may be understood as the number of channels of the input audio node, with a default value of 2 and a maximum value of 32. The number of output channels may be understood as the number of channels of the output audio node, with a default value of 2 and a maximum value of 32.

[0056] Specifically, the audio stream of the audio input device is collected by calling the audio collection method of the target browser; and then the audio preprocessing method of the target browser is called, and the collected audio stream is audio preprocessed based on the audio preprocessing parameters defined in the audio preprocessing method. After obtaining the preset processed audio stream, the target buffer can be determined. After determining the target buffer, the preprocessed audio stream can be written to the target buffer. After the audio stream is stored in the target buffer, the preprocessed audio stream is read from the target buffer as the audio stream to be processed.

[0057] In an embodiment of the present invention, audio segmentation processing is performed on the audio stream to be processed to obtain at least two sub-audio streams to be processed, which may include: based on a preset audio segmentation strategy, audio segmentation processing is performed on the audio stream to be processed to obtain at least two sub-audio streams to be processed. As an optional implementation in the embodiment of the present invention, audio segmentation processing may be performed on the audio stream to be processed based on a pre-set audio segmentation period; wherein the preset audio segmentation period may be set according to actual needs, for example, once every 20 milliseconds or once every 100 milliseconds, etc. As another optional implementation in the embodiment of the present invention, audio segmentation processing may be performed on the audio stream to be processed based on a preset audio stream length; wherein the preset audio stream length may be set according to actual needs, for example, 1024 bytes or 2048 bytes.

[0058] S120 , performing fidelity processing on each of the sub-audio streams to be processed by calling a custom audio processing script, to obtain a target sub-audio stream corresponding to each of the sub-audio streams to be processed.

[0059] Among them, the custom audio processing script can be understood as a predefined script for performing fidelity processing on the sub-audio stream to be processed. The target sub-audio stream can be understood as the sub-audio stream obtained by performing fidelity processing on the processed sub-audio stream. In an embodiment of the present invention, the fidelity processing of each of the sub-audio streams to be processed to obtain a target sub-audio stream corresponding to each of the sub-audio streams to be processed includes: saving the custom audio processing script to a pre-created audio processing thread; and performing fidelity processing on the audio stream to be processed through the audio processing thread with the preset audio fidelity strategy in the custom audio processing script.

[0060] The custom audio processing script defines an audio fidelity strategy, i.e., a preset audio fidelity strategy. The preset audio fidelity strategy can be used as a strategy for performing fidelity processing on the audio stream to be processed. The audio processing thread can be understood as a thread for processing the sub-audio stream to be processed. The audio processing thread stores the custom audio processing script to process the sub-audio stream to be processed according to the custom audio processing script.

[0061] In the technical solution implemented by the present invention, during the entire life cycle of processing the processed audio stream, the sub-audio stream to be processed can be processed by the audio processing thread without jumping to the main thread for audio processing. The advantage of this is that it can be run on the audio rendering thread based on custom scripts and other built-in audio nodes, thereby achieving the technical effect of zero additional delay and synchronous rendering.

[0062] Specifically, an audio processing script is predefined, that is, a custom audio processing script is obtained. After obtaining the custom audio processing script, the custom audio processing script can be saved to a pre-created audio processing thread. Then, through the audio processing thread, based on the preset audio fidelity strategy in the custom audio processing script, the audio stream to be processed can be processed with fidelity.

[0063] In an implementation of the present invention, the sampling bit number of the sub-audio stream to be processed may be a first sampling bit number, and the performing fidelity processing on each of the sub-audio streams to be processed to obtain a target sub-audio stream corresponding to each of the sub-audio streams to be processed may include: when the first sampling bit number is not the second sampling bit number, determining a first audio range corresponding to the first sampling bit number and a second audio range corresponding to the second sampling bit number, wherein the first sampling bit number is higher than the second sampling bit number; based on the first audio range and the second audio range, converting the sampling bit number of each of the sub-audio streams to be processed from the first audio bit number to the second sampling bit number, to obtain a target sub-audio stream corresponding to each of the sub-audio streams to be processed.

[0064] Among them, the number of adopted bits can be understood as the number of audio sampling bits. The first number of sampling bits can be the number of sampling bits of the sub-audio stream to be processed. The second number of sampling bits can be understood as the number of sampling bits that needs to be reached after the audio stream to be processed is processed to maintain fidelity. In an embodiment of the present invention, the first number of sampling bits is higher than the second number of sampling bits. The benefit of such a setting is to maintain the fidelity of the audio stream to be processed so as to improve the audio quality of the audio stream to be processed. Exemplarily, the first number of sampling bits is 24 bits, the second number of sampling bits is 16 bits, and the first audio range can be understood as the audio range of the audio stream of the first number of sampling bits. The first audio range can be obtained according to the maximum audio value and the minimum audio value in the audio stream of the first number of sampling bits. The second audio range can be understood as the audio range of the audio stream of the second number of sampling bits. The first audio range can be obtained according to the maximum audio value and the minimum audio value in the audio stream of the second number of sampling bits.

[0065] Specifically, the number of sampling bits required after the fidelity processing of the audio stream to be processed is pre-set, that is, the second number of sampling bits. When the number of sampling bits of the sub-audio stream to be processed is the first number of sampling bits, and the first number of sampling bits is not the second number of sampling bits, the maximum audio value and the minimum audio value in the audio stream to be processed of the first number of sampling bits can be obtained, and then the first audio range corresponding to the first number of sampling bits can be determined based on the maximum audio value and the minimum audio value; and the second audio range corresponding to the second number of sampling bits can be obtained; and then the sampling bit number of each sub-audio stream to be processed can be converted from the first audio bit number to the second number of sampling bits based on the first audio range and the second audio range. In this way, the sub-audio stream of the second number of sampling bits corresponding to each sub-audio stream to be processed can be obtained, that is, the target sub-audio stream corresponding to each sub-audio stream to be processed can be obtained.

[0066] Wherein, based on the first audio range and the second audio range, converting the sampling bit number of each of the sub-audio streams to be processed from the first audio bit number to the second sampling bit number may include: based on the ratio of the first audio range and the second audio range, converting the sampling bit number of each of the sub-audio streams to be processed from the first audio bit number to the second sampling bit number, so that the audio range of each of the sub-audio streams to be processed is mapped from the first audio range to the second audio range. The technical solution of the embodiment of the present invention, which converts the audio of the first sampling bit number into the audio of the second sampling bit number through proportional mapping of the audio range, can effectively maintain the high fidelity of the original audio.

[0067] In an embodiment of the invention, before converting the sampling bit number of each sub-audio stream to be processed from the first audio bit number to the second sampling bit number, backup processing may be performed on each sub-audio stream to be processed.

[0068] In an embodiment of the present invention, the converting the sampling bit number of each of the sub-audio streams to be processed from the first audio bit number to the second sampling bit number based on the first audio range and the second audio range to obtain a target sub-audio stream corresponding to each of the sub-audio streams to be processed may include: based on the first audio range and the second audio range, converting the sampling bit number of each of the sub-audio streams to be processed from the first audio bit number to the second sampling bit number to obtain a reference sub-audio stream corresponding to each of the sub-audio streams to be processed; for each of the reference sub-audio streams, normalizing each audio value in the reference sub-audio stream to obtain a normalized audio value, and obtaining a target sub-audio stream corresponding to each of the sub-audio streams to be processed based on the normalized audio value and a preset noise sequence, wherein the sampling bit number of the preset noise sequence is the second sampling bit number.

[0069] The reference sub-audio stream can be understood as a sub-audio stream obtained by converting the sampling bits of the sub-audio stream to be processed from the first audio bit number to the second sampling bit number based on the first audio range and the second audio range. The preset noise sequence can be understood as a preset noise sequence. The preset noise sequence may include an audio value whose sampling bits are the second sampling bit number. In an embodiment of the present invention, by introducing a noise sequence, the audio range of the second sampling bit number audio can be increased, and better fidelity can be provided at a lower bit depth.

[0070] Specifically, based on the first audio range and the second audio range, the sampling bit number of each sub-audio stream to be processed is converted from the first audio bit number to the second sampling bit number to obtain a reference sub-audio stream corresponding to each sub-audio stream to be processed. After obtaining each reference sub-audio stream, for each reference sub-audio stream, each audio value in the reference sub-audio stream is normalized to obtain a normalized audio value. Then, the normalized audio value and each audio value in the preset noise sequence can be added respectively. Thus, an audio sequence with normalized audio values ​​can be obtained, that is, a target sub-audio stream corresponding to each sub-audio stream to be processed can be obtained.

[0071] In the embodiment of the present invention, after obtaining an audio sequence with normalized audio values, each audio value in the audio sequence may be rounded to convert each audio value into an integer value.

[0072] S130. Send each of the target sub-audio streams to a target server connected to the target browser by HTTP through the target browser.

[0073] The target server can be understood as a server that receives the audio stream. The HTTP connection is a Hypertext Transfer Protocol (HTTP) connection.

[0074] Specifically, an HTTP connection is established between the target browser and the target server. After the HTTP connection between the target browser and the target server is established, each target sub-audio stream can be sent to the target server connected to the target browser by HTTP through the target browser.

[0075] Before sending each of the target sub-audio streams to the target server, the method may further include: if the audio format of each of the target sub-audio streams is not the target audio format, then each of the target sub-audio streams may be subjected to audio format conversion processing, that is, the audio format of each of the target sub-audio streams may be converted into the target audio format. The target audio format may be an audio format set according to actual needs, such as a Blob format.

[0076] After obtaining the target sub-audio streams corresponding to the sub-audio streams to be processed, the method further includes: for each target sub-audio stream, the audio stream attribute information of the target sub-audio stream can be determined, and the audio stream attribute information is added to the audio header information of the target sub-audio stream. The audio stream attribute information may include the number of audio sampling bits and the audio sampling rate. The advantage of such processing is that it is convenient for the server to effectively identify each target sub-audio stream.

[0077] The technical solution of the embodiment of the present invention obtains the audio stream to be processed collected by the target browser, performs audio segmentation processing on the audio stream to be processed, and obtains at least two sub-audio streams to be processed; by calling a custom audio processing script, performs fidelity processing on each of the sub-audio streams to be processed, and obtains a target sub-audio stream corresponding to each of the sub-audio streams to be processed; and sends each of the target sub-audio streams to a target server connected to the target browser by HTTP through the target browser. The technical solution of the embodiment of the present invention realizes a relatively simple and lightweight high-fidelity transmission processing of the audio stream collected by the browser.

[0078] Embodiment 2

[0079] Figure 2 This is a schematic diagram of the structure of an audio transmission device provided in Embodiment 2 of the present invention. Figure 2 As shown, the device includes: an audio stream acquisition module 210, an audio stream processing module 220 and an audio stream transmission module 230.

[0080] Among them, the audio stream acquisition module 210 is used to obtain the audio stream to be processed collected by the target browser, perform audio segmentation processing on the audio stream to be processed, and obtain at least two sub-audio streams to be processed; the audio stream processing module 220 is used to perform fidelity processing on each of the sub-audio streams to be processed by calling a custom audio processing script, and obtain a target sub-audio stream corresponding to each of the sub-audio streams to be processed; the audio stream transmission module 230 is used to send each of the target sub-audio streams to the target server connected to the target browser HTTP through the target browser.

[0081] The technical solution of the embodiment of the present invention is to obtain the to-be-processed audio stream collected by the target browser through the audio stream acquisition module, perform audio segmentation processing on the to-be-processed audio stream to obtain at least two to-be-processed sub-audio streams; through the audio stream processing module, by calling a custom audio processing script, perform fidelity processing on each of the to-be-processed sub-audio streams to obtain a target sub-audio stream corresponding to each of the to-be-processed sub-audio streams; through the audio stream transmission module, through the target browser, each of the target sub-audio streams is sent to a target server connected to the target browser by HTTP. The technical solution of the embodiment of the present invention realizes a relatively simple and lightweight high-fidelity transmission processing of the audio stream collected by the browser.

[0082] Optionally, the sampling bit number of the sub-audio stream to be processed is a first sampling bit number, and the audio stream processing module 220 is configured to:

[0083] In a case where the first sampling bit number is not the second sampling bit number, determining a first audio range corresponding to the first sampling bit number and a second audio range corresponding to the second sampling bit number, wherein the first sampling bit number is higher than the second sampling bit number;

[0084] Based on the first audio range and the second audio range, the sampling bit number of each of the sub-audio streams to be processed is converted from the first audio bit number to the second sampling bit number to obtain a target sub-audio stream corresponding to each of the sub-audio streams to be processed.

[0085] Optionally, the audio stream processing module 220 is configured to:

[0086] Based on the first audio range and the second audio range, converting the number of sampling bits of each of the sub-audio streams to be processed from the first audio bit number to the second sampling bit number to obtain a reference sub-audio stream corresponding to each of the sub-audio streams to be processed;

[0087] For each of the reference sub-audio streams, each audio value in the reference sub-audio stream is normalized to obtain a normalized audio value, and based on the normalized audio value and a preset noise sequence, a target sub-audio stream corresponding to each of the sub-audio streams to be processed is obtained, wherein the sampling bit number of the preset noise sequence is the second sampling bit number.

[0088] Optionally, the audio stream acquisition module 210 is used to:

[0089] By calling the audio collection method of the target browser, the audio stream of the audio input device is collected;

[0090] Based on the audio preprocessing parameters in the audio preprocessing method of the target browser, perform audio preprocessing on the collected audio stream, and write the preprocessed audio stream into the target buffer;

[0091] The preprocessed audio stream is read from the target buffer as the audio stream to be processed.

[0092] Optionally, the audio stream processing module 220 is configured to:

[0093] Save custom audio processing scripts to pre-created audio processing threads;

[0094] The audio stream to be processed is processed with fidelity by using an audio processing thread and a preset audio fidelity strategy in a custom audio processing script.

[0095] Optionally, the device further includes an audio header information adding module; the audio header information adding module is used to:

[0096] After obtaining the target sub-audio streams corresponding to the sub-audio streams to be processed, for each target sub-audio stream, the audio stream attribute information of the target sub-audio stream is determined, and the audio stream attribute information is added to the audio header information of the target sub-audio stream.

[0097] Optionally, the device also includes an audio format conversion module; the audio format conversion module is used to: before sending each target sub-audio stream to the target server HTTP connected to the target browser, if the audio format of each target sub-audio stream is not the target audio format, then perform audio format conversion processing on each target sub-audio stream.

[0098] The audio transmission device provided in the embodiment of the present invention can execute the audio transmission method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.

[0099] It is worth noting that the various units and modules included in the above-mentioned audio transmission device are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be achieved; in addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not used to limit the protection scope of the embodiments of the present invention.

[0100] Embodiment 3

[0101] Figure 3 A schematic diagram of the structure of an electronic device 10 that can be used to implement an embodiment of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.

[0102] like Figure 3 As shown, the electronic device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.

[0103] A number of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0104] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 performs the various methods and processes described above, such as an audio transmission method.

[0105] In some embodiments, the audio transmission method may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the audio transmission method described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to perform the audio transmission method in any other appropriate manner (e.g., by means of firmware).

[0106] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0107] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0108] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0109] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).

[0110] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.

[0111] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.

[0112] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.

[0113] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. An audio transmission method, characterized in that: include: Acquire an audio stream to be processed collected by a target browser, and perform audio segmentation processing on the audio stream to be processed to obtain at least two sub-audio streams to be processed; By calling a custom audio processing script, each of the sub-audio streams to be processed is subjected to fidelity processing to obtain a target sub-audio stream corresponding to each of the sub-audio streams to be processed; Sending each of the target sub-audio streams to a target server connected to the target browser by HTTP through the target browser; The sampling bit number of the sub-audio stream to be processed is a first sampling bit number, and the fidelity processing is performed on each of the sub-audio streams to be processed to obtain a target sub-audio stream corresponding to each of the sub-audio streams to be processed, including: In a case where the first sampling number is not the same as the second sampling number, determining a first audio range corresponding to the first sampling number and a second audio range corresponding to the second sampling number; the first sampling number is higher than the second sampling number; Based on the first audio range and the second audio range, converting the number of sampling bits of each of the sub-audio streams to be processed from the first sampling number of bits to the second sampling number of bits, to obtain a reference sub-audio stream corresponding to each of the sub-audio streams to be processed; For each of the reference sub-audio streams, each audio value in the reference sub-audio stream is normalized to obtain a normalized audio value, and based on the normalized audio value and a preset noise sequence, a target sub-audio stream corresponding to each of the sub-audio streams to be processed is obtained; the sampling bit number of the preset noise sequence is the second sampling bit number.

2. The method according to claim 1, characterized in that The step of obtaining the audio stream to be processed collected by the target browser includes: By calling the audio collection method of the target browser, the audio stream of the audio input device is collected; Based on the audio preprocessing parameters in the audio preprocessing method of the target browser, perform audio preprocessing on the collected audio stream, and write the preprocessed audio stream into the target buffer; The preprocessed audio stream is read from the target buffer as the audio stream to be processed.

3. The method according to claim 1, characterized in that The method of performing fidelity processing on each of the sub-audio streams to be processed by calling a custom audio processing script includes: Save custom audio processing scripts to pre-created audio processing threads; Through the audio processing thread, the audio streams to be processed are subjected to fidelity processing according to the preset audio fidelity strategy in the custom audio processing script.

4. The method according to claim 1, characterized in that After obtaining the target sub-audio streams corresponding to the sub-audio streams to be processed, the method further includes: For each target sub-audio stream, audio stream attribute information of the target sub-audio stream is determined, and the audio stream attribute information is added to the audio header information of the target sub-audio stream.

5. The method according to claim 1, characterized in that Before sending each of the target sub-audio streams to a target server connected to the target browser via HTTP, the method further comprises: If the audio format of each target sub-audio stream is not the target audio format, audio format conversion processing is performed on each target sub-audio stream.

6. An audio transmission device, characterized in that: include: The audio stream acquisition module is used to acquire the audio stream to be processed collected by the target browser, and perform audio segmentation processing on the audio stream to be processed to obtain at least two sub-audio streams to be processed; An audio stream processing module, configured to perform fidelity processing on each of the sub-audio streams to be processed by calling a custom audio processing script, and obtain a target sub-audio stream corresponding to each of the sub-audio streams to be processed; An audio stream transmission module, used for sending each of the target sub-audio streams to a target server connected to the target browser via HTTP through the target browser; The number of sampling bits of the sub-audio stream to be processed is a first number of sampling bits; The audio stream processing module is specifically configured to, when the first sampling bit number is not the second sampling bit number, determine a first audio range corresponding to the first sampling bit number and a second audio range corresponding to the second sampling bit number; based on the first audio range and the second audio range, convert the sampling bit number of each of the sub-audio streams to be processed from the first sampling bit number to the second sampling bit number, to obtain a reference sub-audio stream corresponding to each of the sub-audio streams to be processed; For each of the reference sub-audio streams, each audio value in the reference sub-audio stream is normalized to obtain a normalized audio value, and based on the normalized audio value and a preset noise sequence, a target sub-audio stream corresponding to each of the sub-audio streams to be processed is obtained; the first sampling bit number is higher than the second sampling bit number; the sampling bit number of the preset noise sequence is the second sampling bit number.

7. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the audio transmission method according to any one of claims 1 to 5.

8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the audio transmission method according to any one of claims 1 to 5 when executed.