CN109584889A - Audio frequency transmission method and device and storage medium - Google Patents

Audio frequency transmission method and device and storage medium Download PDF

Info

Publication number
CN109584889A
CN109584889A CN201811626607.5A CN201811626607A CN109584889A CN 109584889 A CN109584889 A CN 109584889A CN 201811626607 A CN201811626607 A CN 201811626607A CN 109584889 A CN109584889 A CN 109584889A
Authority
CN
China
Prior art keywords
audio data
packets
audio
current
target
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201811626607.5A
Other languages
Chinese (zh)
Other versions
CN109584889B (en
Inventor
唐大闰
徐浩
吴明辉
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Miaozhen Information Technology Co Ltd
Miaozhen Systems Information Technology Co Ltd
Original Assignee
Miaozhen Systems Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Miaozhen Systems Information Technology Co Ltd filed Critical Miaozhen Systems Information Technology Co Ltd
Priority to CN201811626607.5A priority Critical patent/CN109584889B/en
Publication of CN109584889A publication Critical patent/CN109584889A/en
Application granted granted Critical
Publication of CN109584889B publication Critical patent/CN109584889B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G10MUSICAL INSTRUMENTS; ACOUSTICS
    • G10LSPEECH ANALYSIS TECHNIQUES OR SPEECH SYNTHESIS; SPEECH RECOGNITION; SPEECH OR VOICE PROCESSING TECHNIQUES; SPEECH OR AUDIO CODING OR DECODING
    • G10L19/00Speech or audio signals analysis-synthesis techniques for redundancy reduction, e.g. in vocoders; Coding or decoding of speech or audio signals, using source filter models or psychoacoustic analysis
    • GPHYSICS
    • G10MUSICAL INSTRUMENTS; ACOUSTICS
    • G10LSPEECH ANALYSIS TECHNIQUES OR SPEECH SYNTHESIS; SPEECH RECOGNITION; SPEECH OR VOICE PROCESSING TECHNIQUES; SPEECH OR AUDIO CODING OR DECODING
    • G10L19/00Speech or audio signals analysis-synthesis techniques for redundancy reduction, e.g. in vocoders; Coding or decoding of speech or audio signals, using source filter models or psychoacoustic analysis
    • G10L19/002Dynamic bit allocation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L1/00Arrangements for detecting or preventing errors in the information received
    • H04L1/0001Systems modifying transmission characteristics according to link quality, e.g. power backoff
    • H04L1/0006Systems modifying transmission characteristics according to link quality, e.g. power backoff by adapting the transmission format
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/06Protocols specially adapted for file transfer, e.g. file transfer protocol [FTP]

Landscapes

  • Engineering & Computer Science (AREA)
  • Signal Processing (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Computational Linguistics (AREA)
  • Health & Medical Sciences (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • Acoustics & Sound (AREA)
  • Multimedia (AREA)
  • Quality & Reliability (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)
  • Telephonic Communication Services (AREA)

Abstract

The invention discloses a kind of audio frequency transmission methods and device and storage medium.Wherein, this method comprises: obtaining the audio data size of current packets of audio data to be transmitted, wherein packets of audio data is the data packet obtained after splitting to the target audio of real-time Transmission;The target data size that detection current transmission network allows to transmit in unit interval;According to the comparison result of audio data size and target data size, determine for targeted compression ratio needed for compressing packets of audio data;Packets of audio data is compressed according to targeted compression ratio, obtains compressed packets of audio data;Pass through the compressed packets of audio data of current transmission network transmission.The present invention solves technical problem lower there are audio transmission efficiency in the method for the relevant technologies offer.

Description

Audio frequency transmission method and device and storage medium
Technical field
The present invention relates to computer fields, in particular to a kind of audio frequency transmission method and device and storage medium.
Background technique
Much have the sound pick-up outfit of networked capabilities, the audio that will have been recorded is needed to upload onto the server in real time, in order to Server in time handles it to the audio.At present during audio transmission, according to low compression ratio to sound to be transmitted Frequency is compressed,, usually can be out of condition because of network transmission when sending although can retain preferable sound quality, and is made The audio of recording can not upload onto the server in time.Audio compression is carried out according to high compression ratio, then sound quality damage is big, can lose A part of recording substance.
That is, in the audio frequency transmission method provided by the relevant technologies, it can only be using single to the audio to be transmitted One compress mode is compressed, and the flexibility of audio compression is poor, so that audio can not be completed to transmit in time, so as to cause sound The lower problem of frequency efficiency of transmission.
For above-mentioned problem, currently no effective solution has been proposed.
Summary of the invention
The embodiment of the invention provides a kind of audio frequency transmission methods and device and storage medium, at least to solve the relevant technologies There are the technical problems that audio transmission efficiency is lower in the method for offer.
According to an aspect of an embodiment of the present invention, a kind of audio frequency transmission method is provided, comprising: obtain current to be transmitted Packets of audio data audio data size, wherein above-mentioned packets of audio data be the target audio of real-time Transmission is split The data packet obtained afterwards;The target data size that detection current transmission network allows to transmit in unit interval;According to above-mentioned The comparison result of audio data size and above-mentioned target data size is determined for target needed for compressing above-mentioned packets of audio data Compression factor;Above-mentioned packets of audio data is compressed according to above-mentioned targeted compression ratio, obtains compressed above-mentioned audio number According to packet;Pass through the compressed above-mentioned packets of audio data of above-mentioned current transmission network transmission.
As a kind of optional example, the above-mentioned comparison knot according to above-mentioned audio data size and above-mentioned target data size Fruit determines for targeted compression ratio needed for compressing above-mentioned packets of audio data to include: to be greater than in above-mentioned audio data size In the case where stating target data size, the object transmission ratio between above-mentioned audio data size and above-mentioned target data size is obtained Example;According to the above-mentioned targeted compression ratio of the above-mentioned above-mentioned packets of audio data of object transmission ratio-dependent.
As a kind of optional example, the above-mentioned above-mentioned mesh according to the above-mentioned above-mentioned packets of audio data of object transmission ratio-dependent Marking compression factor includes: to repeat following steps, until the audio data size of compressed above-mentioned packets of audio data is less than Equal to above-mentioned target data size: obtaining current compression ratio;It determines and is obtained after being compressed using above-mentioned current compression ratio Above-mentioned packets of audio data current audio data size;Obtain above-mentioned current audio data size and above-mentioned target data size Between current ratio;In the case where above-mentioned current ratio is greater than above-mentioned object transmission ratio, compressed above-mentioned sound is determined The audio data size of frequency data packet is still greater than above-mentioned target data size, then adjusts above-mentioned current compression ratio according to target step Example obtains next compression factor, as above-mentioned current compression ratio;It is less than or equal to above-mentioned object transmission in above-mentioned current ratio In the case where ratio, it is big to determine that the audio data size of compressed above-mentioned packets of audio data has been less than or equal to above-mentioned target data It is small, then above-mentioned current compression ratio is determined as above-mentioned targeted compression ratio.
As a kind of optional example, above-mentioned acquisition currently packets of audio data to be transmitted audio data size it Before, further includes: record will real-time Transmission above-mentioned target audio;Above-mentioned target audio is split, is obtained multiple to be passed Defeated packets of audio data.
As a kind of optional example, above by the compressed above-mentioned audio data of above-mentioned current transmission network transmission Before packet, further includes: distribute package identification for above-mentioned packets of audio data;Above-mentioned package identification is added to above-mentioned audio number According in packet, so as to be merged after server decompresses the above-mentioned packets of audio data received according to above-mentioned package identification Above-mentioned packets of audio data is to obtain above-mentioned target audio.
As a kind of optional example, above by the compressed above-mentioned audio data of above-mentioned current transmission network transmission After packet, further includes: server decompresses the above-mentioned packets of audio data received;Above-mentioned server merges upper after decompressing Packets of audio data is stated, to obtain above-mentioned target audio.
According to another aspect of an embodiment of the present invention, a kind of audio transmission device is additionally provided, comprising: acquiring unit is used In the audio data size for obtaining current packets of audio data to be transmitted, wherein above-mentioned packets of audio data is to real-time Transmission The data packet that target audio obtains after being split;Detection unit permits in unit interval for detecting current transmission network Perhaps the target data size transmitted;Determination unit, for the ratio according to above-mentioned audio data size and above-mentioned target data size Pair as a result, determine for targeted compression ratio needed for compressing above-mentioned packets of audio data;Compression unit, for according to above-mentioned target Compression factor compresses above-mentioned packets of audio data, obtains compressed above-mentioned packets of audio data;Transmission unit, for passing through The above-mentioned compressed above-mentioned packets of audio data of current transmission network transmission.
As a kind of optional example, above-mentioned determination unit includes: acquisition module, for big in above-mentioned audio data size In the case where above-mentioned target data size, the target obtained between above-mentioned audio data size and above-mentioned target data size is passed Defeated ratio;Determining module, for the above-mentioned targeted compression ratio according to the above-mentioned above-mentioned packets of audio data of object transmission ratio-dependent.
As a kind of optional example, above-mentioned determining module includes: processing submodule, for repeating following steps, Until the audio data size of compressed above-mentioned packets of audio data is less than or equal to above-mentioned target data size: obtaining current compression Ratio;Determine that the current audio data of the above-mentioned packets of audio data obtained after being compressed using above-mentioned current compression ratio is big It is small;Obtain the current ratio between above-mentioned current audio data size and above-mentioned target data size;It is big in above-mentioned current ratio In the case where above-mentioned object transmission ratio, it is above-mentioned to determine that the audio data size of compressed above-mentioned packets of audio data is still greater than Target data size then adjusts above-mentioned current compression ratio according to target step and obtains next compression factor, works as above-mentioned Preceding compression factor;In the case where above-mentioned current ratio is less than or equal to above-mentioned object transmission ratio, compressed above-mentioned sound is determined The audio data size of frequency data packet has been less than or equal to above-mentioned target data size, then above-mentioned current compression ratio is determined as on State targeted compression ratio.
As a kind of optional example, above-mentioned apparatus further include: recording elements, for currently to be transmitted in above-mentioned acquisition Before the audio data size of packets of audio data, record will real-time Transmission above-mentioned target audio;Split cells, for It states target audio to be split, obtains multiple packets of audio data to be transmitted.
As a kind of optional example, above-mentioned apparatus further include: allocation unit, for above by above-mentioned current transmission Before the compressed above-mentioned packets of audio data of network transmission, package identification is distributed for above-mentioned packets of audio data;Adding unit is used Be added in above-mentioned packets of audio data in by above-mentioned package identification so that server to the above-mentioned packets of audio data received into After row decompression, above-mentioned packets of audio data is merged to obtain above-mentioned target audio according to above-mentioned package identification.
Another aspect according to an embodiment of the present invention, additionally provides a kind of storage medium, and meter is stored in the storage medium Calculation machine program, wherein the computer program is arranged to execute above-mentioned audio frequency transmission method when operation.
In embodiments of the present invention, the target audio recorded is split to obtain packets of audio data, then basis is worked as The case where preceding transmission network, (allows the target data size transmitted) in such as unit interval, to the packets of audio data according to target Compression factor is compressed, thus realize the status transmission according to current network, the compression to the packets of audio data to be transmitted Ratio realizes that dynamic adjusts, to improve the flexibility of audio transmission so that multiple audio datas in target audio can and When complete transmission, improve the efficiency of audio transmission, achieve the purpose that Balanced Audio transmission quality and transmission real-time, and then solve The technical problem there are audio transmission efficiency lower in the method that the relevant technologies provide.
Detailed description of the invention
The drawings described herein are used to provide a further understanding of the present invention, constitutes part of this application, this hair Bright illustrative embodiments and their description are used to explain the present invention, and are not constituted improper limitations of the present invention.In the accompanying drawings:
Fig. 1 is a kind of flow chart of optional audio frequency transmission method according to an embodiment of the present invention;
Fig. 2 is the flow chart of another optional audio frequency transmission method according to an embodiment of the present invention;
Fig. 3 is a kind of structural schematic diagram of optional audio transmission device according to an embodiment of the present invention;
Fig. 4 is the structural schematic diagram of another optional audio transmission device according to an embodiment of the present invention.
Specific embodiment
In order to enable those skilled in the art to better understand the solution of the present invention, below in conjunction in the embodiment of the present invention Attached drawing, technical scheme in the embodiment of the invention is clearly and completely described, it is clear that described embodiment is only The embodiment of a part of the invention, instead of all the embodiments.Based on the embodiments of the present invention, ordinary skill people The model that the present invention protects all should belong in member's every other embodiment obtained without making creative work It encloses.
It should be noted that description and claims of this specification and term " first " in above-mentioned attached drawing, " Two " etc. be to be used to distinguish similar objects, without being used to describe a particular order or precedence order.It should be understood that using in this way Data be interchangeable under appropriate circumstances, so as to the embodiment of the present invention described herein can in addition to illustrating herein or Sequence other than those of description is implemented.In addition, term " includes " and " having " and their any deformation, it is intended that cover Cover it is non-exclusive include, for example, the process, method, system, product or equipment for containing a series of steps or units are not necessarily limited to Step or unit those of is clearly listed, but may include be not clearly listed or for these process, methods, product Or other step or units that equipment is intrinsic.
According to an aspect of an embodiment of the present invention, a kind of audio frequency transmission method is provided, optionally, as a kind of optional Embodiment, as shown in Figure 1, above-mentioned audio frequency transmission method includes:
S102 obtains the audio data size of current packets of audio data to be transmitted, wherein packets of audio data is to real-time The data packet that the target audio of transmission obtains after being split;
S104, the target data size that detection current transmission network allows to transmit in unit interval;
S106 is determined according to the comparison result of audio data size and target data size for compressing packets of audio data Required targeted compression ratio;
S108 compresses packets of audio data according to targeted compression ratio, obtains compressed packets of audio data;
S110 passes through the compressed packets of audio data of current transmission network transmission.
Optionally, in the present embodiment, above-mentioned audio frequency transmission method can be, but not limited to be applied to networked capabilities In recorder.The method provided in through this embodiment is split to obtain audio data to the target audio recorded Then packet (allows the target data size transmitted) according to the case where current transmission network, to the audio in such as unit interval Data packet is compressed according to targeted compression ratio, so that the status transmission according to current network is realized, to the sound to be transmitted The compression factor of frequency data packet realizes that dynamic adjusts, so that the flexibility of audio transmission is improved, so that multiple in target audio Audio data can be completed to transmit in time, improve the efficiency of audio transmission, reach Balanced Audio transmission quality and transmission real-time Purpose, and then overcome the problems, such as that audio transmission efficiency is lower in the related technology.
It optionally,, can before the audio data size for obtaining current packets of audio data to be transmitted in this present embodiment With but be not limited to record will real-time Transmission target audio;Target audio is split, multiple audios to be transmitted are obtained Data packet.
It should be noted that in the present embodiment, the target audio of above-mentioned recording can be, but not limited to as with networking function The initial intact audio of the recorder real-time recording of energy.Wherein, above-mentioned recorder can also include but unlimited In: communication interface, memory and processor.Wherein, memory can be, but not limited to for caching recorded initial intact sound Frequently, processor can be, but not limited to for above-mentioned initial intact audio to be split as multiple packets of audio data, can with but it is unlimited In for executing compression processing to packets of audio data.Communication interface can be, but not limited to for by compressed packets of audio data Pass through current transmission network transmission to server.
Optionally, in the present embodiment, according to the comparison result of audio data size and target data size, determination is used for Targeted compression ratio needed for compression packets of audio data can include but is not limited to:
1) in the case where audio data size is less than or equal to target data size, then above-mentioned audio to be transmitted is not compressed Data packet;
2) it in the case where audio data size is greater than target data size, obtains audio data size and target data is big Object transmission ratio between small, and targeted compression ratio is determined according to object transmission ratio.
It should be noted that the scheme provided in the present embodiment, by the audio number for comparing packets of audio data to be transmitted Allow the target data size transmitted, in unit interval according to size and current transmission network to determine and the audio number According to the compatible targeted compression ratio of packet.It is available in sound to realize after being compressed using targeted compression ratio The packets of audio data centainly balanced is obtained between matter and size of data.In other words, identified targeted compression ratio can control The audio data size of compressed packets of audio data, close to target data size, to make full use of current transmission The transmission capacity of network reaches on the basis of guaranteeing certain sound quality, moreover it is possible to realize the purpose of real-time Transmission.
In addition, in the present embodiment, above-mentioned targeted compression ratio can be, but not limited to be used to indicate packets of audio data pressure It is reduced to the compression factor for meeting the Network status of current transmission network.It should be noted that different compression factors can with but not It is limited to correspond to different compressed format.That is, can be come by determining compressed format used in transmission packets of audio data Determine corresponding compression factor.Above-mentioned is only a kind of example, is not limited in any way in the present embodiment to this.
Optionally, in the present embodiment, obtained multiple packets of audio data after being split for above-mentioned target audio, can with but It is not limited to the object transmission ratio according to transmission network when being used for transmission each packets of audio data, to determine corresponding audio data The targeted compression ratio of packet.In other words, the targeted compression of different packets of audio data can be, but not limited to according to different network feelings Condition is determined as different values.
Optionally, in the present embodiment, transmitting compressed packets of audio data can include but is not limited to:
1) in the case where current transmission network is using long connection transmission, then server is by the compressed audio of received in-order Data packet can sequentially merge to obtain target audio after to the audio data Packet analyzing received.
2) in the case where current transmission network is not using long connection transmission, then data packet need to be added in packets of audio data Packet loss can be detected whether according to package identification so that server is upon receiving an audio data packet by identifying (such as serial number), The packets of audio data received can also be merged according to the package identification, to obtain target audio.
By embodiment provided by the present application, the target audio recorded is split to obtain packets of audio data, then (allow the target data size transmitted in such as unit interval) according to the case where current transmission network, which is pressed It is compressed according to targeted compression ratio, so that the status transmission according to current network is realized, to the packets of audio data to be transmitted Compression factor realize dynamic adjust, so that the flexibility of audio transmission is improved, so that multiple audio datas in target audio It can complete to transmit in time, improve the efficiency of audio transmission, achieve the purpose that Balanced Audio transmission quality and transmission real-time, into And overcome the problems, such as that audio transmission efficiency is lower in the related technology.
As a kind of optional scheme, according to the comparison result of audio data size and target data size, determination is used for Compression packets of audio data needed for targeted compression ratio include:
S1 obtains audio data size and target data in the case where audio data size is greater than target data size Object transmission ratio between size;
S2, according to the targeted compression ratio of object transmission ratio-dependent packets of audio data.
Optionally, in the present embodiment, include: according to the targeted compression ratio of object transmission ratio-dependent packets of audio data Following steps are repeated, until the audio data size of compressed packets of audio data is less than or equal to target data size:
S11 obtains current compression ratio;
S12 determines the current audio data size of the packets of audio data obtained after being compressed using current compression ratio;
S13 obtains the current ratio between current audio data size and target data size;
S14 determines the audio number of compressed packets of audio data in the case where current ratio is greater than object transmission ratio It is still greater than target data size according to size, then obtains next compression factor according to target step adjustment current compression ratio, makees For current compression ratio;
S15 determines the sound of compressed packets of audio data in the case where current ratio is less than or equal to object transmission ratio Frequency size of data has been less than or equal to target data size, then current compression ratio is determined as targeted compression ratio.
It should be noted that for the sound quality and real-time of the transmission of Balanced Audio data packet, the scheme provided in this implementation, It can be, but not limited to through above-mentioned cyclic process, to be sequentially adjusted in compression factor according to pre- fixed step size.It is obtaining using current pressure Contracting ratio after being compressed to packets of audio data obtained current audio data size and target data size it is between the two After current ratio, by comparing current ratio and object transmission ratio, it is adapted to determine with packets of audio data to be transmitted Targeted compression ratio.To realize on the basis of guaranteeing the real-time of audio transmission, it is reduced as far as audio compression Problem of dtmf distortion DTMF caused by journey.
Optionally, in the present embodiment, above-mentioned compression factor can be, but not limited to correspond to a kind of compressed format.In other words, During determining above-mentioned targeted compression ratio by circulation step, it can be, but not limited to when adjusting current compression ratio, Compressed format used in adjusting determines compression factor and current transmission net by using different compressed format to realize The compatible targeted compression format of the Network status of network (has targeted compression ratio).
By embodiment provided by the present application, current compression ratio is obtained by repeating, uses current compression ratio to determine Whether the audio data size that example carries out compressed packets of audio data is less than or equal to target data size, so that audio number According to packet on the basis of guaranteeing the real-time of transmission, distortion caused by audio compression process can also be reduced as far as and asked Topic.
It is also wrapped before through the compressed packets of audio data of current transmission network transmission as a kind of optional scheme It includes:
S1 distributes package identification for packets of audio data;
Package identification is added in packets of audio data by S2, so that server carries out the packets of audio data received After decompression, packets of audio data is merged to obtain target audio according to package identification.
It should be noted that above-mentioned package identification can include but is not limited to: the serial number of packets of audio data, audio data ID, random code of packet etc..Above-mentioned is only a kind of example, and the mark for uniquely distinguishing packets of audio data is applicable in this implementation, This is without limitation.
Optionally, in the present embodiment, after through the compressed packets of audio data of current transmission network transmission, service Device will decompress the packets of audio data received, and merge the packets of audio data after decompression, to obtain target audio.
Specifically example is illustrated as shown in connection with fig. 2:
Step 1: by audio recording module, record will real-time Transmission target audio (initial intact audio), and protect There are in recorder.
Step 2: being unpacked module by audio, target audio is split into multiple packets of audio data to be transmitted.
Step 3: by wire-speed detection module, timing detects the mesh that current transmission network allows to transmit in unit interval Mark size of data, i.e. network speed.It should be noted that above-mentioned network speed is to be timed detection according to predetermined period to obtain.More Before the network speed newly detected, the targeted compression ratio that newest determination is used to packets of audio data to be transmitted can be, but not limited to To be compressed.
Step 4: by audio compression module, according to the network speed of current transmission network, determining and current audio to be transmitted The compatible targeted compression ratio of data packet.Packets of audio data is compressed using targeted compression ratio, is obtained compressed Packets of audio data.
It should be noted that above-mentioned target audio is split as multiple packets of audio data, the target of different packets of audio data Compression factor can be, but not limited to realize that neatly dynamic adjusts according to the network speed of transmission network at that time.In other words, different audios The targeted compression of data packet can be, but not limited to be determined as different values according to different network conditions.
For example, it is assumed that in order to realize real-time Transmission audio data, needs to send out duration by network in 1 second and be at least 1 second audio data.Further, it is assumed that (target data for allowing to transmit in unit interval is big for the network speed of current transmission network It is small) are as follows: n KBytes/s, and the audio data size of 1 second lossless audio are as follows: M Kbytes.
Further, audio data size and network speed are compared, in the case where M is less than or equal to n, is not then compressed.And it is greater than in M In the case where n, then the object transmission ratio between audio data size and network speed: M/n is obtained.In order to guarantee wanting for real-time Transmission It asks, then the ratio between compressed audio data size and network speed is needed to be less than or equal to object transmission ratio M/n.
Thus, it in the case where M is greater than n, then needs successively to adjust compression factor according to pre- fixed step size, with finally accurately true Make targeted compression ratio.Using the ratio between the compressed audio data size of the targeted compression ratio and network speed, not only Less than or equal to object transmission ratio M/n, and close to object transmission ratio M/n.Guaranteeing real-time Transmission to realize It is required that while, reduce audio because of the sound quality loss caused by compression, reaches between audio quality and audio transmission real-time Balance.
Step 5: by network transmission module, sending compressed packets of audio data.
In the case where current transmission network does not connect (such as UDP) using length to be transmitted, then packets of audio data needs It adds package identification (such as serial number), to guarantee that server can be received sequentially, and merges, to obtain target sound Frequently.In addition, can also detect whether packet loss occur in transmission process by above-mentioned package identification.And current transmission network is adopted In the case where being transmitted with long connection (such as UDP), then sends there is no out-of-order, can not add in above-mentioned packets of audio data Add package identification (such as serial number).Above-mentioned transmission control procedures are a kind of examples, and the present embodiment is not construed as limiting this.
Above-mentioned steps 1 to 5 and corresponding module can be, but not limited to be applied in terminal device, and the terminal device is for obtaining Enroll the target audio of system, such as recorder.Such as recording pen, recorder etc..
Step 6: the audio merging module of server end will be to decompression after receiving compressed packets of audio data Packets of audio data afterwards merges, to obtain complete target audio.It further, can also be to the packets of audio data after decompression Unified format conversion is carried out, such as the audio of wav format is uniformly converted to, then merge, to obtain the target sound of wav format Frequently.This is not limited in any way in the present embodiment.
It should be noted that its corresponding targeted compression ratio can be carried in above-mentioned packets of audio data, it can also not It carries, and is voluntarily judged by server end decompression algorithm according to compressed data format.
It should be noted that for the various method embodiments described above, for simple description, therefore, it is stated as a series of Combination of actions, but those skilled in the art should understand that, the present invention is not limited by the sequence of acts described because According to the present invention, some steps may be performed in other sequences or simultaneously.Secondly, those skilled in the art should also know It knows, the embodiments described in the specification are all preferred embodiments, and related actions and modules is not necessarily of the invention It is necessary.
Other side according to an embodiment of the present invention additionally provides a kind of for implementing the sound of above-mentioned audio frequency transmission method Frequency transmitting device.As shown in figure 3, the device includes:
1) acquiring unit 302, for obtaining the audio data size of current packets of audio data to be transmitted, wherein audio Data packet is the data packet obtained after splitting to the target audio of real-time Transmission;
2) detection unit 304, it is big for detecting the target data that current transmission network allows to transmit in unit interval It is small;
3) determination unit 306 are determined for the comparison result according to audio data size and target data size for pressing Targeted compression ratio needed for contracting packets of audio data;
4) compression unit 308 obtain compressed sound for compressing according to targeted compression ratio to packets of audio data Frequency data packet;
5) transmission unit 310, for passing through the compressed packets of audio data of current transmission network transmission.
Optionally, in the present embodiment, above-mentioned audio transmission device can be, but not limited to be applied to networked capabilities In recorder.The device provided in through this embodiment is split to obtain audio data to the target audio recorded Then packet (allows the target data size transmitted) according to the case where current transmission network, to the audio in such as unit interval Data packet is compressed according to targeted compression ratio, so that the status transmission according to current network is realized, to the sound to be transmitted The compression factor of frequency data packet realizes that dynamic adjusts, so that the flexibility of audio transmission is improved, so that multiple in target audio Audio data can be completed to transmit in time, improve the efficiency of audio transmission, reach Balanced Audio transmission quality and transmission real-time Purpose, and then overcome the problems, such as that audio transmission efficiency is lower in the related technology.
Optionally, in this present embodiment, above-mentioned apparatus further include: recording elements, for obtaining current sound to be transmitted Before the audio data size of frequency data packet, record will real-time Transmission target audio;Split cells, for target audio It is split, obtains multiple packets of audio data to be transmitted.
It should be noted that in the present embodiment, the target audio of above-mentioned recording can be, but not limited to as with networking function The initial intact audio of the recorder real-time recording of energy.Wherein, above-mentioned recorder can also include but unlimited In: communication interface, memory and processor.Wherein, memory can be, but not limited to for caching recorded initial intact sound Frequently, processor can be, but not limited to for above-mentioned initial intact audio to be split as multiple packets of audio data, can with but it is unlimited In for executing compression processing to packets of audio data.Communication interface can be, but not limited to for by compressed packets of audio data Pass through current transmission network transmission to server.
Optionally, in the present embodiment, according to the comparison result of audio data size and target data size, determination is used for Targeted compression ratio needed for compression packets of audio data can include but is not limited to:
1) in the case where audio data size is less than or equal to target data size, then above-mentioned audio to be transmitted is not compressed Data packet;
2) it in the case where audio data size is greater than target data size, obtains audio data size and target data is big Object transmission ratio between small, and targeted compression ratio is determined according to object transmission ratio.
It should be noted that the scheme provided in the present embodiment, by the audio number for comparing packets of audio data to be transmitted Allow the target data size transmitted, in unit interval according to size and current transmission network to determine and the audio number According to the compatible targeted compression ratio of packet.It is available in sound to realize after being compressed using targeted compression ratio The packets of audio data centainly balanced is obtained between matter and size of data.In other words, identified targeted compression ratio can control The audio data size of compressed packets of audio data, close to target data size, to make full use of current transmission The transmission capacity of network reaches on the basis of guaranteeing certain sound quality, moreover it is possible to realize the purpose of real-time Transmission.
In addition, in the present embodiment, above-mentioned targeted compression ratio can be, but not limited to be used to indicate packets of audio data pressure It is reduced to the compression factor for meeting the Network status of current transmission network.It should be noted that different compression factors can with but not It is limited to correspond to different compressed format.That is, can be come by determining compressed format used in transmission packets of audio data Determine corresponding compression factor.Above-mentioned is only a kind of example, is not limited in any way in the present embodiment to this.
Optionally, in the present embodiment, obtained multiple packets of audio data after being split for above-mentioned target audio, can with but It is not limited to the object transmission ratio according to transmission network when being used for transmission each packets of audio data, to determine corresponding audio data The targeted compression ratio of packet.In other words, the targeted compression of different packets of audio data can be, but not limited to according to different network feelings Condition is determined as different values.
Optionally, in the present embodiment, transmitting compressed packets of audio data can include but is not limited to:
1) in the case where current transmission network is using long connection transmission, then server is by the compressed audio of received in-order Data packet can sequentially merge to obtain target audio after to the audio data Packet analyzing received.
2) in the case where current transmission network is not using long connection transmission, then data packet need to be added in packets of audio data Packet loss can be detected whether according to package identification so that server is upon receiving an audio data packet by identifying (such as serial number), The packets of audio data received can also be merged according to the package identification, to obtain target audio.
By embodiment provided by the present application, the target audio recorded is split to obtain packets of audio data, then (allow the target data size transmitted in such as unit interval) according to the case where current transmission network, which is pressed It is compressed according to targeted compression ratio, so that the status transmission according to current network is realized, to the packets of audio data to be transmitted Compression factor realize dynamic adjust, so that the flexibility of audio transmission is improved, so that multiple audio datas in target audio It can complete to transmit in time, improve the efficiency of audio transmission, achieve the purpose that Balanced Audio transmission quality and transmission real-time, into And overcome the problems, such as that audio transmission efficiency is lower in the related technology.
As a kind of optional scheme, as shown in figure 4, determination unit 306 includes:
1) module 402 is obtained, for obtaining audio data in the case where audio data size is greater than target data size Object transmission ratio between size and target data size;
2) determining module 404, for the targeted compression ratio according to object transmission ratio-dependent packets of audio data.
Optionally, in the present embodiment, determining module includes:
(1) submodule is handled, for repeating following steps, until the audio data of compressed packets of audio data is big It is small to be less than or equal to target data size:
S1 obtains current compression ratio;
S2 determines the current audio data size of the packets of audio data obtained after being compressed using current compression ratio;
S3 obtains the current ratio between current audio data size and target data size;
S4 determines the audio number of compressed packets of audio data in the case where current ratio is greater than object transmission ratio It is still greater than target data size according to size, then obtains next compression factor according to target step adjustment current compression ratio, makees For current compression ratio;
S5 determines the sound of compressed packets of audio data in the case where current ratio is less than or equal to object transmission ratio Frequency size of data has been less than or equal to target data size, then current compression ratio is determined as targeted compression ratio.
It should be noted that for the sound quality and real-time of the transmission of Balanced Audio data packet, the scheme provided in this implementation, It can be, but not limited to through above-mentioned cyclic process, to be sequentially adjusted in compression factor according to pre- fixed step size.It is obtaining using current pressure Contracting ratio after being compressed to packets of audio data obtained current audio data size and target data size it is between the two After current ratio, by comparing current ratio and object transmission ratio, it is adapted to determine with packets of audio data to be transmitted Targeted compression ratio.To realize on the basis of guaranteeing the real-time of audio transmission, it is reduced as far as audio compression Problem of dtmf distortion DTMF caused by journey.
Optionally, in the present embodiment, above-mentioned compression factor can be, but not limited to correspond to a kind of compressed format.In other words, During determining above-mentioned targeted compression ratio by circulation step, it can be, but not limited to when adjusting current compression ratio, Compressed format used in adjusting determines compression factor and current transmission net by using different compressed format to realize The compatible targeted compression format of the Network status of network (has targeted compression ratio).
By embodiment provided by the present application, current compression ratio is obtained by repeating, uses current compression ratio to determine Whether the audio data size that example carries out compressed packets of audio data is less than or equal to target data size, so that audio number According to packet on the basis of guaranteeing the real-time of transmission, distortion caused by audio compression process can also be reduced as far as and asked Topic.
As a kind of optional scheme, above-mentioned apparatus further include:
1) allocation unit, for before through the compressed packets of audio data of current transmission network transmission, being audio number Package identification is distributed according to packet;
2) adding unit, for package identification to be added in packets of audio data, so that server is to the sound received After frequency data packet is decompressed, packets of audio data is merged to obtain target audio according to package identification.
It should be noted that above-mentioned package identification can include but is not limited to: the serial number of packets of audio data, audio data ID, random code of packet etc..Above-mentioned is only a kind of example, and the mark for uniquely distinguishing packets of audio data is applicable in this implementation, This is without limitation.
Optionally, in the present embodiment, after through the compressed packets of audio data of current transmission network transmission, service Device will decompress the packets of audio data received, and merge the packets of audio data after decompression, to obtain target audio.
The functional units in various embodiments of the present invention may be integrated into one processing unit, is also possible to each Unit physically exists alone, and can also be integrated in one unit with two or more units.Above-mentioned integrated unit both may be used To use formal implementation of hardware, can also realize in the form of software functional units.
The another aspect of embodiment according to the present invention, additionally provides a kind of storage medium, is stored in the storage medium Computer program, wherein the computer program is arranged to execute the step in any of the above-described embodiment of the method when operation.
Optionally, in the present embodiment, above-mentioned storage medium can be set to store by executing based on following steps Calculation machine program:
S1 obtains the audio data size of current packets of audio data to be transmitted, wherein packets of audio data is to pass to real-time The data packet that defeated target audio obtains after being split;
S2, the target data size that detection current transmission network allows to transmit in unit interval;
S3 is determined according to the comparison result of audio data size and target data size for compressing packets of audio data institute The targeted compression ratio needed;
S4 compresses packets of audio data according to targeted compression ratio, obtains compressed packets of audio data;
S5 passes through the compressed packets of audio data of current transmission network transmission.
Optionally, in the present embodiment, those of ordinary skill in the art will appreciate that in the various methods of above-described embodiment All or part of the steps be that the relevant hardware of terminal device can be instructed to complete by program, the program can store in In one computer readable storage medium, storage medium may include: flash disk, read-only memory (Read-Only Memory, ROM), random access device (Random Access Memory, RAM), disk or CD etc..
The serial number of the above embodiments of the invention is only for description, does not represent the advantages or disadvantages of the embodiments.
If the integrated unit in above-described embodiment is realized in the form of SFU software functional unit and as independent product When selling or using, it can store in above-mentioned computer-readable storage medium.Based on this understanding, skill of the invention Substantially all or part of the part that contributes to existing technology or the technical solution can be with soft in other words for art scheme The form of part product embodies, which is stored in a storage medium, including some instructions are used so that one Platform or multiple stage computers equipment (can be personal computer, server or network equipment etc.) execute each embodiment institute of the present invention State all or part of the steps of method.
In the above embodiment of the invention, it all emphasizes particularly on different fields to the description of each embodiment, does not have in some embodiment The part of detailed description, reference can be made to the related descriptions of other embodiments.
In several embodiments provided herein, it should be understood that disclosed client, it can be by others side Formula is realized.Wherein, the apparatus embodiments described above are merely exemplary, such as the division of the unit, and only one Kind of logical function partition, there may be another division manner in actual implementation, for example, multiple units or components can combine or It is desirably integrated into another system, or some features can be ignored or not executed.Another point, it is shown or discussed it is mutual it Between coupling, direct-coupling or communication connection can be through some interfaces, the INDIRECT COUPLING or communication link of unit or module It connects, can be electrical or other forms.
The unit as illustrated by the separation member may or may not be physically separated, aobvious as unit The component shown may or may not be physical unit, it can and it is in one place, or may be distributed over multiple In network unit.It can select some or all of unit therein according to the actual needs to realize the mesh of this embodiment scheme 's.
The above is only a preferred embodiment of the present invention, it is noted that for the ordinary skill people of the art For member, various improvements and modifications may be made without departing from the principle of the present invention, these improvements and modifications are also answered It is considered as protection scope of the present invention.

Claims (12)

1. a kind of audio frequency transmission method characterized by comprising
Obtain the audio data size of current packets of audio data to be transmitted, wherein the packets of audio data is to real-time Transmission Target audio split after obtained data packet;
The target data size that detection current transmission network allows to transmit in unit interval;
According to the comparison result of the audio data size and the target data size, determine for compressing the audio data Targeted compression ratio needed for packet;
The packets of audio data is compressed according to the targeted compression ratio, obtains the compressed packets of audio data;
Pass through the compressed packets of audio data of the current transmission network transmission.
2. the method according to claim 1, wherein described according to the audio data size and the number of targets It is determining to include: for targeted compression ratio needed for compressing the packets of audio data according to the comparison result of size
The audio data size be greater than the target data size in the case where, obtain the audio data size with it is described Object transmission ratio between target data size;
According to the targeted compression ratio of packets of audio data described in the object transmission ratio-dependent.
3. according to the method described in claim 2, it is characterized in that, the audio according to the object transmission ratio-dependent The targeted compression ratio of data packet includes:
Following steps are repeated, until the audio data size of the compressed packets of audio data is less than or equal to the target Size of data:
Obtain current compression ratio;
Determine the current audio data size of the packets of audio data obtained after being compressed using the current compression ratio;
Obtain the current ratio between the current audio data size and the target data size;
In the case where the current ratio is greater than the object transmission ratio, the sound of the compressed packets of audio data is determined Frequency size of data is still greater than the target data size, then obtains according to the target step adjustment current compression ratio next Compression factor, as the current compression ratio;
In the case where the current ratio is less than or equal to the object transmission ratio, the compressed packets of audio data is determined Audio data size be less than or equal to the target data size, then the current compression ratio is determined as the target pressure Contracting ratio.
4. the method according to claim 1, wherein in the sound for obtaining current packets of audio data to be transmitted Before frequency size of data, further includes:
Record will real-time Transmission the target audio;
The target audio is split, multiple packets of audio data to be transmitted are obtained.
5. the method according to claim 1, wherein after the compression by the current transmission network transmission The packets of audio data before, further includes:
Package identification is distributed for the packets of audio data;
The package identification is added in the packets of audio data, so that server is to the packets of audio data received After being decompressed, the packets of audio data is merged to obtain the target audio according to the package identification.
6. the method according to claim 1, wherein after the compression by the current transmission network transmission The packets of audio data after, further includes:
Server decompresses the packets of audio data received;
The server merges the packets of audio data after decompression, to obtain the target audio.
7. a kind of audio transmission device characterized by comprising
Acquiring unit, for obtaining the audio data size of current packets of audio data to be transmitted, wherein the packets of audio data The data packet obtained after being split for the target audio to real-time Transmission;
Detection unit, the target data size for allowing to transmit in unit interval for detecting current transmission network;
Determination unit is determined for the comparison result according to the audio data size and the target data size for pressing Contract targeted compression ratio needed for the packets of audio data;
Compression unit obtains compressed institute for compressing according to the targeted compression ratio to the packets of audio data State packets of audio data;
Transmission unit, for passing through the compressed packets of audio data of the current transmission network transmission.
8. device according to claim 7, which is characterized in that the determination unit includes:
Module is obtained, for obtaining the audio in the case where the audio data size is greater than the target data size Object transmission ratio between size of data and the target data size;
Determining module, the targeted compression ratio for the packets of audio data according to the object transmission ratio-dependent.
9. device according to claim 8, which is characterized in that the determining module includes:
Submodule is handled, for repeating following steps, until the audio data size of the compressed packets of audio data Less than or equal to the target data size:
Obtain current compression ratio;
Determine the current audio data size of the packets of audio data obtained after being compressed using the current compression ratio;
Obtain the current ratio between the current audio data size and the target data size;
In the case where the current ratio is greater than the object transmission ratio, the sound of the compressed packets of audio data is determined Frequency size of data is still greater than the target data size, then obtains according to the target step adjustment current compression ratio next Compression factor, as the current compression ratio;
In the case where the current ratio is less than or equal to the object transmission ratio, the compressed packets of audio data is determined Audio data size be less than or equal to the target data size, then the current compression ratio is determined as the target pressure Contracting ratio.
10. device according to claim 7, which is characterized in that further include:
Recording elements, for before the audio data size for obtaining current packets of audio data to be transmitted, recording will The target audio of real-time Transmission;
Split cells obtains multiple packets of audio data to be transmitted for splitting to the target audio.
11. device according to claim 7, which is characterized in that further include:
Allocation unit, for being before the compressed packets of audio data by the current transmission network transmission The packets of audio data distributes package identification;
Adding unit, for the package identification to be added in the packets of audio data, so that server is to receiving After the packets of audio data is decompressed, the packets of audio data is merged to obtain the target according to the package identification Audio.
12. a kind of storage medium, the storage medium includes the program of storage, wherein described program executes above-mentioned power when running Benefit requires method described in 1 to 6 any one.
CN201811626607.5A 2018-12-28 2018-12-28 Audio transmission method and device and storage medium Active CN109584889B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811626607.5A CN109584889B (en) 2018-12-28 2018-12-28 Audio transmission method and device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811626607.5A CN109584889B (en) 2018-12-28 2018-12-28 Audio transmission method and device and storage medium

Publications (2)

Publication Number Publication Date
CN109584889A true CN109584889A (en) 2019-04-05
CN109584889B CN109584889B (en) 2021-07-20

Family

ID=65933391

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811626607.5A Active CN109584889B (en) 2018-12-28 2018-12-28 Audio transmission method and device and storage medium

Country Status (1)

Country Link
CN (1) CN109584889B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111432384A (en) * 2020-03-18 2020-07-17 合肥讯飞读写科技有限公司 Large data volume audio Bluetooth real-time transmission method for equipment with recording function
CN112887429A (en) * 2021-03-08 2021-06-01 深圳市车宝信息科技有限公司 Data transmission method and device, electronic equipment and storage medium

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101459616A (en) * 2009-01-04 2009-06-17 成都市华为赛门铁克科技有限公司 Method, customer terminal and access system for network access
CN105139859A (en) * 2015-08-18 2015-12-09 杭州士兰微电子股份有限公司 Audio data decoding method, audio data decoding device and SOC using audio data decoding method
CN105723678A (en) * 2013-10-29 2016-06-29 瑞典爱立信有限公司 Dynamic compression coverage
CN106161633A (en) * 2016-07-20 2016-11-23 柏科数据技术(深圳)股份有限公司 A kind of based on the transmission method of packaging file under cloud computing environment and system
CN106209773A (en) * 2016-06-24 2016-12-07 深圳羚羊极速科技有限公司 The method that the sampling transmission of a kind of audio packet is recombinated again
US20170330576A1 (en) * 2014-04-21 2017-11-16 Samsung Electronics Co., Ltd. Device and method for transmitting and receiving voice data in wireless communication system
CN108738006A (en) * 2018-05-31 2018-11-02 出门问问信息科技有限公司 Data transmission method based on bluetooth and device

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101459616A (en) * 2009-01-04 2009-06-17 成都市华为赛门铁克科技有限公司 Method, customer terminal and access system for network access
CN105723678A (en) * 2013-10-29 2016-06-29 瑞典爱立信有限公司 Dynamic compression coverage
US20170330576A1 (en) * 2014-04-21 2017-11-16 Samsung Electronics Co., Ltd. Device and method for transmitting and receiving voice data in wireless communication system
CN105139859A (en) * 2015-08-18 2015-12-09 杭州士兰微电子股份有限公司 Audio data decoding method, audio data decoding device and SOC using audio data decoding method
CN106209773A (en) * 2016-06-24 2016-12-07 深圳羚羊极速科技有限公司 The method that the sampling transmission of a kind of audio packet is recombinated again
CN106161633A (en) * 2016-07-20 2016-11-23 柏科数据技术(深圳)股份有限公司 A kind of based on the transmission method of packaging file under cloud computing environment and system
CN108738006A (en) * 2018-05-31 2018-11-02 出门问问信息科技有限公司 Data transmission method based on bluetooth and device

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111432384A (en) * 2020-03-18 2020-07-17 合肥讯飞读写科技有限公司 Large data volume audio Bluetooth real-time transmission method for equipment with recording function
CN111432384B (en) * 2020-03-18 2023-05-09 合肥讯飞读写科技有限公司 Large-data-volume audio Bluetooth real-time transmission method for equipment with recording function
CN112887429A (en) * 2021-03-08 2021-06-01 深圳市车宝信息科技有限公司 Data transmission method and device, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN109584889B (en) 2021-07-20

Similar Documents

Publication Publication Date Title
CN111211980B (en) Transmission link management method, transmission link management device, electronic equipment and storage medium
CN102202064B (en) Method for extracting behavior characteristics of Trojan communication based on network data flow analysis
CN104219229B (en) The transmission method and device of virtual desktop data
US20100095370A1 (en) Selective packet capturing method and apparatus using kernel probe
CN109584889A (en) Audio frequency transmission method and device and storage medium
CN107925652B (en) Fixed conversion method and device of transmission protocol based on message protocol identification
CN107395559A (en) Data processing method and equipment based on redis
CN111371887B (en) Internet of things log transmission method, client, server, equipment and storage medium
CN113259256A (en) Repeating data packet filtering method and system and readable storage medium
CN110611644A (en) Data transmission method and device
JP5067362B2 (en) Communication terminal, network interface card and method thereof
CN109302367B (en) Multichannel signal analog demodulation system and method thereof
CN111163006A (en) Multipath preferred online game acceleration method based on waveform judgment
CN109213742A (en) Log collection method and device
CN113452630B (en) Data merging method, data splitting method, device, equipment and storage medium
CN112688924A (en) Network protocol analysis system
CN114466224B (en) Video data encoding and decoding method and device, storage medium and electronic equipment
CN107918737B (en) Pressure test data transmission method, device and system
CN112188456B (en) Bluetooth device data acquisition method and device, storage medium and electronic device
CN110401604A (en) A kind of information transferring method, device and computer readable storage medium
CN106230748A (en) A kind of packet sending, receiving method and equipment
CN111814161A (en) Data transmission method and system
CN112911565B (en) Bluetooth packet sending method, system, device and storage medium
CN114205392B (en) Information transmission method and device based on cloud platform and computer readable storage medium
CN113393849A (en) Intercom system that bimodulus block data was handled

Legal Events

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