[go: up one dir, main page]

CN101272383B - Real-time audio data transmission method - Google Patents

Real-time audio data transmission method Download PDF

Info

Publication number
CN101272383B
CN101272383B CN200810081844A CN200810081844A CN101272383B CN 101272383 B CN101272383 B CN 101272383B CN 200810081844 A CN200810081844 A CN 200810081844A CN 200810081844 A CN200810081844 A CN 200810081844A CN 101272383 B CN101272383 B CN 101272383B
Authority
CN
China
Prior art keywords
data
voice data
rtp
audio
audio frequency
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
CN200810081844A
Other languages
Chinese (zh)
Other versions
CN101272383A (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.)
ZTE Corp
Original Assignee
ZTE Corp
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 ZTE Corp filed Critical ZTE Corp
Priority to CN200810081844A priority Critical patent/CN101272383B/en
Publication of CN101272383A publication Critical patent/CN101272383A/en
Application granted granted Critical
Publication of CN101272383B publication Critical patent/CN101272383B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Telephonic Communication Services (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The invention discloses a real-time audio data transmission method which is used for transmitting audio data between two terminal devices. The method of the invention includes that the audio data collected by one terminal device at one end are separately encapsulated; the encapsulated audio data are transmitted to a real-time transmission protocol stack; after being received and processed by the real time transmission protocol stack, the audio data are transmitted to the terminal device at the other end after being separately encapsulated again. The real-time audio data transmission method of the invention can separately process the data transmitted by the audio device and the data received by the audio device, thus better administrating the open and close operation of the audio device and a network interface; furthermore, conveniently finding out the causes of faults when problems occur during the data transmission.

Description

A kind of real-time audio data transmission method
Technical field
The present invention relates to communication technical field, relate in particular to the audio data transmission method of a kind of VoIP (Voice Over IP, transporting speech on the IP network).
Background technology
RTP/RTCP (Realtime Transfer Protocol/Realtime Transfer Control Protocol; RTP/RTCP Real-time Transport Control Protocol) is a kind of host-host protocol that IETF (Internet Engineering Task Force, the Internet engineering duty group) formulates to multimedia data stream.RTP is defined in one to one and perhaps works under the transmission situation of one-to-many, and its objective is provides temporal information and realize that stream synchronously.Between the RTP session; Each participant periodically sends RTCP and divides into groups; And RTCP comprises the quantity of the RTP packet of having sent, the statistics such as quantity, shake time and delay time lag of the RTP packet of losing in dividing into groups, thereby to upper layer application flow control and congested control service is provided.
With reference to shown in Figure 1, be VoIP application system frame diagram.VoIP based on SIP (Session InitiationProtocol, Session initiation Protocol) uses generally by forming with the lower part, comprising: the Session Initiation Protocol stack of protocol layer, RTP/RTCP protocol stack, http protocol stack; The audio frequency apparatus control module of hardware device level, audio frequency and video coding/decoding module, video equipment control module; The SIP call management module of operation layer, contacts list administration module, presentation information administration module; And the Man Machine Interface of MMI (Man-MachineInterface, man-machine interface) layer etc., the correlation function of each several part is:
The Session Initiation Protocol stack is responsible for realizing the related content of RFC3261 agreement;
The RTP/RTCP protocol stack is responsible for realizing the related content of RFC3550/RFC3551 agreement;
Functions such as the audio frequency apparatus control module is responsible for that volume control, the audio frequency apparatus of loud speaker and microphone are opened, audio data collecting, audio data playback and audio frequency apparatus management;
The audio/video coding/decoding module is responsible for realizing the encoding and decoding to original audio/video data, for example realizes the G.711 encoding and decoding speech etc. of μ-law and A-law of ITU;
The video equipment control module is responsible for realizing the setting of opening, close, obtaining frame data and various camera parameter (for example zoom, brightness, contrast, image resolution ratio or the like) of camera equipment;
The SIP call management module is responsible for realizing the encapsulation of the sip message relevant with session and the sip message processing of arrival;
The contacts list administration module is responsible for realizing that the contact person based on SIP URL increases, deletes and revises, and is stored in application server and this machine;
Present administration module and be responsible for realizing the subscription and the notice of presentation information such as contact person's current network state (online or off-line), capacity of equipment state.
VoIP uses and must realize following two processes: obtain voice data from audio frequency apparatus, be responsible for the coding of original audio data by the audio/video coding/decoding module, the data after will encoding are again sent through the RTP/RTCP protocol stack; And on the other hand,, the voice data through coding that is received is decoded as original voice data through the audio/video coding/decoding module then from the voice data of RTP/RTCP protocol stack received code, carry out playback by audio frequency apparatus.In order to guarantee audio/video quality preferably; Improve audibility or visual effect; Need guarantee in the sampling interval, to accomplish the processing of these two processes,, must guarantee to handle and in 20ms, accomplish this two parts work for example for 160 audio samples of 8KHz; Descend otherwise sound quality can occur, sound defects off and on occurs.In the real-time voice data processing, generally adopt thread or timer to realize.
VoIP uses collection and the replayed section relate to voice data, specifically corresponding to the reading and write operation of audio frequency apparatus, requires audio frequency apparatus or to adopt alliteration card scheme with the full duplex mode running.Likewise, VoIP uses reception and the transmission that relates to voice data, and specifically the network port corresponding to RTP/RTCP receives and send data.The content of above-mentioned four aspects all must be realized in each VoIP terminal; In existing technical scheme; The data of audio frequency apparatus not being handled are carried out any differentiation; Cause bad opening and closing operation to the audio frequency apparatus and the network port to manage like this, and when transfer of data if generation problem, the not reason of easy-to-search fault.
Summary of the invention
Technical problem to be solved by this invention provides a kind of audio data transmission method, manages the opening and closing operation of audio frequency apparatus and network interface better, and then voice data is handled.
In order to solve the problems of the technologies described above, the invention provides a kind of audio data transmission method, be used for transmitting audio data between two terminal equipments, said method comprises:
The voice data that the terminal equipment of one end is gathered encapsulates separately, gives the RTP stack with the delivery of audio data after the encapsulation;
After the RTP stack receives said voice data and handles, be sent to the terminal equipment of the other end once more separately after the encapsulation.
Further, said method also comprises: after the terminal equipment of the said other end receives the voice data of said independent encapsulation, said voice data is resolved.
Further, at the voice data that the terminal equipment of an end is gathered separately before the encapsulation, also comprise the step that voice data that said terminal equipment is gathered is encoded in the said method.
Further, after said voice data is resolved, also comprise said voice data is decoded in the said method, carry out the step of playback afterwards.
Further; The said voice data that the terminal equipment of an end is gathered encapsulates separately; Comprise: judge whether the voice data size behind the coding is a size that the RTP grouping is held; If the fixing head information of then assembling RTP is formed RTP with voice data and is divided into groups to send.
Further, said parsing comprises: after receiving the RTP grouping from network, from the fixing head information of said RTP, obtain transmission information, load data is copied to the buffering area of decoding.
Further, said transport packet is drawn together: load information, sequence number and synchronisation source.
The present invention realizes the transmission of speech data on the terminal, have the characteristics of following several aspects:
By whether carrying out the collection or the playback of voice data, will be divided into two kinds corresponding to the audio frequency apparatus data structure operable: in and out; Still send data to network by receiving data, will be divided into corresponding to the data structure that rtp stack receives and sends: in and out from network.Thereby can handle respectively the data that audio frequency apparatus sent and received, better the opening and closing of the audio frequency apparatus and network port operation managed, and when transfer of data if the generation problem, the reason of easy-to-look-up fault.
The present invention has realized the transmitted in both directions of speech data on the terminal; A kind of comparatively general voice transmission method is provided; Have extensibility preferably, be applicable to other IMS (IPMultiMedia Subsystem, the IP Multimedia System) business that needs voice data transmission.
Description of drawings
Fig. 1 VoIP application system frame diagram;
Fig. 2 is an audio data transmission method flow chart of the present invention;
The deployment method schematic flow sheet of Fig. 3 audio frequency apparatus;
The collection sending method schematic flow sheet of Fig. 4 voice data;
The reception back method schematic flow sheet of Fig. 5 voice data.
Embodiment
Main thought of the present invention is: by whether carrying out the collection or the playback of voice data, the handled data of audio frequency apparatus are distinguished and encapsulation respectively, and processing is sent and received to the data after the encapsulation.Still send data to network by receiving data, will distinguish corresponding to the data that rtp stack receives and sends, and encapsulate respectively, and processing is sent and received to the data after the encapsulation from network.
Below in conjunction with accompanying drawing to a preferred embodiment of the present invention will be described in detail.
With reference to shown in Figure 2, be audio data transmission method flow chart of the present invention.Said method is used for transmitting audio data between two terminal equipments, may further comprise the steps:
Step 201: the voice data that the terminal equipment of an end is gathered encapsulates separately, gives the RTP stack with the delivery of audio data after the encapsulation;
Step 202: after the RTP stack receives said voice data and handles, be sent to the terminal equipment of the other end once more separately after the encapsulation;
Step 203: the receiving terminal audio frequency apparatus is resolved said data, and is carried out playback after receiving the independent encapsulation voice data that rtp stack sends.
The present invention can realize through the method that software, hardware or software combine with hardware, when realizing, can audio frequency apparatus and the handled data of network interface be divided into two parts: in and out separately.For audio frequency apparatus, in representes to obtain original voice data (being audio collection) from audio frequency apparatus, and out representes in audio frequency apparatus, to write voice data (being voice reproducing); For the network interface of RTP, in representes to receive data from network, and out representes to send data toward network.In concrete the realization; We can be packaged into independent data structure to the data of audio frequency apparatus and RTP relevant treatment separately; And in and out are the different instances of respective data structures; But they share identical audio frequency apparatus handle and web socket handle, and this point must be paid attention in realization.
Through the instance in the concrete application technical scheme of the present invention is carried out exemplary illustration below.
When the call management module of VoIP application was initiated SIP INVITE (conversation request) message or received the other side's SIP INVITE, the audio frequency apparatus control module checked at first whether current audio frequency apparatus is available.If audio frequency apparatus is unavailable, then to user prompt information, generally speaking, the main cause that this situation occurs possibly be to have had a calling, can let the user that the current calling of carrying out is called out and keep perhaps hanging up.
If audio frequency apparatus can be used, open audio frequency apparatus with full duplex mode so, set gradually sample format, sampling channel number and sample rate, and the volume and the broadcast source of corresponding audio mixing equipment is set and records the source.It is receiving port that corresponding RTP then sets local untapped even port, to be used for receiving the RTP data message that mails to this port.Accomplish the initialization of the audio frequency apparatus and the RTP network port, system start-up output control unit (perhaps voice reproducing timer), the terminal just can begin to receive the speech data of opposite end like this, carries out playback in this locality.If current calling only receives, session is just successfully set up so.
For should receiving the calling of sending again, also need reinitialize audio frequency apparatus and RTP related data because real physical equipment is unique, need the audio frequency apparatus and the RTP network port of multiplexing first front opening.Therefore only need duplicate the resource of previous use, and adjust some relevant parameters, system start-up Input Control Element (perhaps audio collection timer) like this, just can be accomplished the transmitted in both directions of speech data.
For the calling of only sending, only need output control unit temporarily be stopped just can to realize.
When receiving the other side's SIP BYE (conversation end) message, system at first lets Input Control Element and output control unit power cut-off, discharges audio frequency apparatus and the employed resource of the RTP network port, accomplishes the dismantlement work of calling.
Should use the content of instance below in conjunction with accompanying drawing 3, Fig. 4, the detailed elaboration of Fig. 5.
As shown in Figure 3, the opening procedure of audio frequency apparatus is:
Step 301 judges whether audio frequency apparatus is occupied, can judge through attempting opening audio frequency apparatus, returns nonnegative integer such as system through calling open, representes that then audio frequency apparatus can use;
Step 302 is provided with the unfolding mode of audio frequency apparatus, can for read-write mode, a reading mode and only WriteMode open, invoke system call open opens audio frequency apparatus, if malloc failure malloc, to user prompt information;
Step 303, the segmentation number that audio frequency apparatus hardware buffer district is set and each fragment size, the user is through these parameters of adjustment, can obtain good real-time performance can or better auditory effect;
Step 304; The sample format of audio frequency apparatus is set; The user can inquire about the sample format that audio frequency apparatus supports earlier and be provided with; If audio frequency apparatus is not supported the sample format of user's appointment, acquiescence is selected its form of supporting, thereby the user must judge whether audio frequency apparatus has adopted set sample format;
Step 305 is provided with the port number of audio frequency apparatus, is dual track if audio coding decoding requires original audio data, and equipment must be set to dual track so;
Step 306 is provided with the sample rate of audio frequency apparatus, and for example the sample rate of telephone sound quality is 8000Hz, and the sample rate of CD audio frequency is 44100Hz, and the user must guarantee set by step 104, the order of step 105 and step 106 is provided with sampling parameter;
Step 307 is obtained the read-write buffer size of audio frequency apparatus, and the buffer size of adjustment application program is so that application program can the unblock mode be carried out when reading and writing at every turn;
Step 308 through the mixer programming, is adjusted main output volume size, and for OSS (Open SoundSystem, open audio system) audio frequency apparatus, the adjustable range of volume is 0-100;
Step 309 is provided with the broadcast source of audio frequency apparatus and records the source, if there are a plurality of hardware devices in system, the user can select suitable hardware to play voice and therefrom gather voice;
Step 310 is provided with and records the volume in source, thus the sound size that control voice communication opposite end can be heard.
If above step completes successfully, audio frequency apparatus is ready so, and audio collection process of transmitting and audio interface withdrawal are let slip journey and can be started working.
The collection process of transmitting of mobile phone terminal voice data is as shown in Figure 4, and detailed process is:
Step 401 judges whether current calling stops, if the user receives SIP BYE message, then current calling stops, and finishes to gather process of transmitting, and discharges related resource;
Step 402; From the audio hardware devices collect data; Size of data is preferably audio hardware equipment buffer segment size, can guarantee like this operation unblock of hardware to be carried out the original audio data that reads at every turn; According to the requirement of audio coding, need carry out the dual track monaural conversion of walking around to it;
Step 403 copies to the data that read in the buffering area of RTP, according to the buffer size of the size of the original audio data after conversion adjustment RTP;
Step 404 is encoded to original audio data according to the coded system that both sides consult;
Step 405; Judge whether the voice data size behind the coding is a size that the RTP grouping is held, generally speaking, corresponding 160 samplings of the single frames voice data that each RTP divides into groups; If voice data is not enough, then repeating step 401, step 402, step 403 and step 404;
Step 406, the fixing head information of assembling RTP is formed RTP with voice data and is divided into groups to send.
The collection process of transmitting of voice data is exactly constantly to repeat above step, stops call up to the user.
The reception replayed section of mobile phone terminal voice data is as shown in Figure 5, and detailed process is:
Step 501 judges whether current calling stops, if the user receives SIP BYE message, then current calling stops, and finishes to receive replayed section, and discharges related resource;
Step 502 receives RTP from network and divides into groups, and can carry out selection operation to the network port, if repeatedly overtime, then thinks the network connection failure, to user prompt information;
Step 503 is resolved RTP and is divided into groups, and obtains load information, sequence number and SSRC (Synchronization source, synchronisation source) from the RTP fixing head, load data is copied to the buffering area of decoding;
Step 504 is decoded to voice data, is reduced to initial PCM (Pulse CodeModulation, pulse code modulation) data;
Step 505 judges whether decoded voice data reaches audio frequency apparatus hardware section size, if data are not enough, and then repeating step 501, step 502, step 503 and step 504;
Step 506 writes audio frequency apparatus hardware buffer district with data and carries out playback.
The reception replayed section repeating step 501-506 of voice data stops call up to the user.
The invention provides the method that is used on the terminal, realizing the speech data transmitted in both directions; Processing procedure to the audio frequency apparatus and the network port has encapsulated two general data structures; And it is classified; Can more clearly distinguish two flow processs of VoIP terminal language data process, be convenient to the transmission course that the user realizes speech data.
This voice transfer mechanism is applicable to the business of the IP Multimedia System that needs the voice real-time Transmission, for example POC (Push to talk over Cellular, the button on the mobile phone is logical) business, mobile TV and Streaming Media or the like.
It should be noted last that above embodiment is only unrestricted in order to technical scheme of the present invention to be described, the modification that those of ordinary skill in the art carries out technical scheme of the present invention perhaps is equal to replacement, all is encompassed in the middle of the claim scope of the present invention.

Claims (7)

1. audio data transmission method; Be used for transmitting audio data between two terminal equipments; It is characterized in that; By the collection of carrying out voice data or playback, the handled data of audio frequency apparatus are distinguished and encapsulation respectively, the handled data of audio frequency apparatus are divided into two parts: in and out; Still send data to network by receiving data, will distinguish and encapsulation respectively, the handled data of network interface are divided into two parts corresponding to the data that the RTP stack receives and sends from network: in and out, said method specifically comprises:
The voice data that the terminal equipment of one end is gathered encapsulates separately, gives the RTP stack with the delivery of audio data after the encapsulation;
After the RTP stack receives said voice data and handles, be sent to the terminal equipment of the other end once more separately after the encapsulation.
2. the method for claim 1 is characterized in that, said method also comprises: after the terminal equipment of the said other end receives the voice data of said independent encapsulation, said voice data is resolved.
3. method as claimed in claim 2 is characterized in that, at the voice data that the terminal equipment of an end is gathered separately before the encapsulation, also comprises the step that voice data that said terminal equipment is gathered is encoded in the said method.
4. method as claimed in claim 3 is characterized in that, after said voice data is resolved, also comprises said voice data is decoded in the said method, carries out the step of playback afterwards.
5. method as claimed in claim 4; It is characterized in that; The said voice data that the terminal equipment of an end is gathered encapsulates separately, comprising: judge whether the voice data size behind the coding is a size that the RTP grouping is held, if; Then assemble the fixing head information of RTP, voice data is formed RTP divide into groups to send.
6. method as claimed in claim 5 is characterized in that, said parsing comprises: after receiving the RTP grouping from network, from the fixing head information of said RTP, obtain transmission information, load data is copied to the buffering area of decoding.
7. method as claimed in claim 6 is characterized in that, said transport packet is drawn together: load information, sequence number and synchronisation source.
CN200810081844A 2008-05-08 2008-05-08 Real-time audio data transmission method Expired - Fee Related CN101272383B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN200810081844A CN101272383B (en) 2008-05-08 2008-05-08 Real-time audio data transmission method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN200810081844A CN101272383B (en) 2008-05-08 2008-05-08 Real-time audio data transmission method

Publications (2)

Publication Number Publication Date
CN101272383A CN101272383A (en) 2008-09-24
CN101272383B true CN101272383B (en) 2012-09-26

Family

ID=40006073

Family Applications (1)

Application Number Title Priority Date Filing Date
CN200810081844A Expired - Fee Related CN101272383B (en) 2008-05-08 2008-05-08 Real-time audio data transmission method

Country Status (1)

Country Link
CN (1) CN101272383B (en)

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102045461B (en) * 2009-10-09 2013-07-24 杭州华三通信技术有限公司 Sound mixing method and device for voice signal
CN101984622B (en) * 2010-11-01 2013-04-17 福建升腾资讯有限公司 Real-time transport protocol based bidirectional voice frequency mapping method
KR20120138604A (en) 2011-06-14 2012-12-26 삼성전자주식회사 Method and apparatus for transmitting/receiving hybrid media content in a multimedia system
CN102523260A (en) * 2011-12-02 2012-06-27 中兴通讯股份有限公司 Media transmitting method and media transmitting device
CN102665141B (en) * 2012-05-16 2014-04-09 哈尔滨工业大学深圳研究生院 AVS (audio video standard) audio and video presynchronizing method based on RTP (real time protocol) package
CN103945333B (en) * 2013-01-17 2017-09-01 中国普天信息产业股份有限公司 A kind of transmission method of group-calling service data
CN108810294A (en) * 2018-06-13 2018-11-13 广州市毅航互联通信股份有限公司 A kind of two-way sound mixing method based on FPGA
CN114285910A (en) * 2021-12-23 2022-04-05 号百信息服务有限公司 System and method for remodeling communication terminal and internet audio format

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2004064300A2 (en) * 2003-01-09 2004-07-29 Thomson Licensing S.A. A method and an apparatus for mapping an mpeg transport stream into ip packets for wlan broadcast
CN1992721A (en) * 2005-12-29 2007-07-04 三星Techwin株式会社 Method for providing video and audio data to a plurality of clients
CN101083766A (en) * 2007-06-22 2007-12-05 中兴通讯股份有限公司 Media inter cut method of visual communication procedure

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2004064300A2 (en) * 2003-01-09 2004-07-29 Thomson Licensing S.A. A method and an apparatus for mapping an mpeg transport stream into ip packets for wlan broadcast
CN1992721A (en) * 2005-12-29 2007-07-04 三星Techwin株式会社 Method for providing video and audio data to a plurality of clients
CN101083766A (en) * 2007-06-22 2007-12-05 中兴通讯股份有限公司 Media inter cut method of visual communication procedure

Also Published As

Publication number Publication date
CN101272383A (en) 2008-09-24

Similar Documents

Publication Publication Date Title
CN101272383B (en) Real-time audio data transmission method
EP2092726B1 (en) Handling announcement media in a communication network environment
US20080151885A1 (en) On-Demand Multi-Channel Streaming Session Over Packet-Switched Networks
US20050262260A1 (en) Two-way audio/video conference system
EP1578128A1 (en) Method an apparatus for conferencing with bandwidth control
EP1578129A1 (en) Method and apparatus for conferencing with stream selectivity
CN101647290B (en) Speed up video recovery of videotelephony after interruption
JP5528811B2 (en) Receiver operation and implementation for efficient media handling
AU2006283294A1 (en) Method for signaling a device to perform no synchronization or include a syncronization delay on multimedia streams
CN111327580A (en) Message transmission method and device
CN101022545A (en) Method and system for realizing multimedia broadcasting via H.248 protocol
EP2405649B1 (en) Method and terminal for synchronously recording sounds and images of opposite ends based on circuit domain video telephone
WO2010130193A1 (en) Device, method for controlling audio media packet transmission and audio media server
CN1976376B (en) Method for calling session, IP telephone system and IP telephone terminal
JP2005506806A (en) Data recording in communication systems
WO2007091207A1 (en) Providing and handling information on a state of a media stream
CN110087020B (en) Method and system for realizing video networking conference by iOS equipment
US7817576B1 (en) Transitioning between multiple data streams of a media channel based on client conditions
JP2006253864A (en) Data storage type transfer method and system and apparatus thereof
RÄSÄNEN IMPLEMENTATION OF RECORDING AND PLAYBACK IN VIDEO CALL
Recas de Buen Test bed design for interactive video conference services
You et al. Design and implementation of IPv6 multicast based High-quality Videoconference Tool (HVCT)
DE BUEN TECHNISCHE UNIVERSITAT WIEN ESCOLA POLITECNICA SUPERIOR DE CASTELLDEFELS, UPC
JP2005045740A (en) Device, method and system for voice communication

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20120926

Termination date: 20170508