Sunday, June 26, 2011

Audio frequency communication in DirectX technology video conference

June 26th, 2011 by admin | Print

The video conference is with its convenient, swiftness, ? Face-to-face ? The advantage exchanged has been approved by people gradually, a lot of enterprises and institutions, educational unit, the medical units all hope to replace the traditional meeting form with video conference. In the video conference, what mainly transmitted is audio frequency data and video data between the conferees, the audio frequency data among them seem even more important. Because most useful information at the meeting include in the conferee?s speech is exchanged, so the video conference system must guarantee the smoothness and all duplexing of communication of audio frequency, could make the video conference approach the true meeting environment even more.

DirectX is the special interface of application program API used for developing the game and multimedia software that Microsoft develops ,Include two peacekeeping 3-D views, sound, music and direct against the strong support of the network communications of network games of many people. DirectX is a kind of standard software interface, all main hardware suppliers offer the drive apparatus of DirectX of support, can run normally under the environment of different hardwares while employing the software of DirectX. On the other hand, DirectX to choose the appropriate way to use the hardware to accelerate ability according to different hardwares used, it is easy to develop high-quality multimedia and game software. In the numerous assemblies that DirectX offer, it is Direct Sound assembly that is used in the audio frequency and deal with. In order to guarantee the smoothness of the pronunciation in the video conference system, need to adopt Streaming Buffer flowing type is buffered offered in Direct Sound The mechanism comes to realize. And in order to guarantee the all duplexing audio frequency communication in the video conference system, that was mainly utilized is mixing the sound mechanism to realize in Direct Sound.

Make use of Streaming Buffer to realize smooth speech

Having offered two kinds of buffer mechanisms in Direct Sound, including Static Buffer static behavior is buffered With Streaming Buffer flowing type is buffered . Static Buffer means storing an intact sound in while buffering once; Streaming Buffer means that does not read into and buffer all once data, but read into while broadcasting the sound dynamically, it is relatively small to take up the space. Generally speaking, if the sound needs broadcasting repeatedly and the capacity is limited such as the sound effect of the game ,Use Static Buffer to contribute to raising the efficiency of the procedure even more; On the contrary, if capacity very great requiring higher audio frequency dataflowing by real-time character, it is good to use Streaming Buffer. In the intersection of video conference and system, use Static Buffer, to person who buffer write new the intersection of audio frequency and data into, the playback of the sound must present the minibreak, makes the conferee?s intact words not broadcast continuously, influence the smoothness of conversing, and Streaming Buffer can overcome the shortcoming with discontinous pronunciation.

Streaming Buffer has offered two indicators: Play Cursor return the vernier With Write Cursor write into the vernier ,Their value is only the skew amount but not absolute memory address relative to beginning in the buffering area. Among them Play Cursor always points to the next byte of data outputted, but address that Write Cursor point to point out until where begin can write new the intersection of audio frequency and data into without being influence, return safely. Looked according to returning the order of the audio frequency data, Write Cursor is always before Play Cursor, and kept certain interval among them, and this interval will be different to some extent on the basis of different systematic states, the experiment indicates this interval is probably about byte 100- 200. When beginning to circulate the mode to return to the audio frequency data buffered in the district, always begin at the place where Play Cursor points. Return, move before Play Cursor and speed of interval,etc. that Write Cursor will keep them, and Play Cursor always points to the next byte of data outputted. When returning the ending of reaching the buffering area, Play Cursor will point to the beginning of the buffering area again, circulate so. But when the procedure stops returning the audio frequency data in Streaming Buffer, Play Cursor no longer moves, and stayed in the byte of data that the next one is outputted, will not move before continuing until returning again. In addition, the area between Play Cursor and Write Cursor is considered to be the data that will need to return soon, so can not upgrade it. After the basic working way understood by Streaming Buffer, and then explain how to realize specifically with Visual C in detail, among them will involve some functions of Visual C , can consult Microsoft MSDN specifically.

In the procedure, sets up a size generally equivalent to the pronunciation for 0.25 seconds that is a frame audio frequency data 2 time Streaming Buffer. And it indicates one touches off the incident to set up with the ending respectively among the centre of Streaming Buffer. When the procedure begins, circulate and return the data in Streaming Buffer through transferring Play function. When Play Cursor reaches centre and endings, the incident will be produced, can write to the buffering area into the new audio frequency data of frame through the procedure. While written into a new a frame audio frequency data, transfer Lock function and lock and buffer the part in the district at first, Write Cursor at this moment is locked and does not move again, but Play Cursor continues advancing following the playback of the sound; While utilizing some time of the audio frequency data returned among Play Cursor and Write Cursor, according to lplpvAudioPtr1 the place that lplpvAudioPtr1 at this moment points to is the places pointed of Write Cursor while locking got while focusing on ,LpdwAudioBytes1 the size of audio frequency data that can be written into safely Wait for information such as the parameter lplpvAudioPtr2, lpdwAudioBytes2 correlated to Streaming Buffer, write the data into the buffering area in the designated place, then transfer Unlock function and remove the locking of Write Cursor. So, Write Cursor revitalizes the place that keeps byte interval 100- 200 with Play Cursor, continues returning the new audio frequency data. This above-mentioned course is being circulated and gone on constantly in operation of the whole procedure, as shown in Fig. 1, have realized and written an old a frame audio frequency data in Streaming Buffer into the new audio frequency data of frame when returned.

Theoretically, this has already guaranteed the smoothness that the audio frequency returns. But in the course of realizing, it is the audio frequency data of a frame because of the target operating it, its time when is returned is 0.25 seconds, so a question that must consider is the reaction speed question of the procedure. If neglect and touch off from incident to really use the part that Lock function locks the buffering area in order to the time when write, this kind of implementation method does not have any question. Besides two frame data begun most, one new frame data will be followed closely after the first frame data, not overlapping the part each other, there is no space to exist, can well reach the smooth result that the audio frequency returns. But in fact, must also be monitored to the incident through the thread while writing the part that the incident touches off to really use Lock function to lock the buffering area into in order to carry on new data, analyze the buffer area that the incident is corresponding, then touch off the corresponding reajustment function to go on

The writing into the course of the above-mentioned a new a frame audio frequency data. The time that and this series of analytical work takes up will change with state of the system at that time, one random length, each time to person who buffer lock part of buffering area with the intersection of Lock and function, the position that Write Cursor locates will all be different, cause one new frame data and might not be followed closely after the first frame data strictly in this way, may overlap the part between them, there may be space too and appear, unfavorable to the broadcasting continuously of audio frequency data. Overlap part, return, cause, have some the intersection of audio frequency and data lose; If there are appearances of space, will cause the discontinuity or confusion of the pronunciation. But through debugging, has analyzed and touched off from incident to really use the part that Lock function locks the buffering area in order that after time when write into the new data carefully, the fluctuation that the deviation of Write Cursor position produces is not big while finding it to focusing on, some or space part of general overlap produced by this is in about 50 bytes, that is to say that there is mistake of the 50 bytes in average every frame data. In the procedure, a frame audio frequency data appointed, for the 2000 bytes correspond to 0.25 seconds ,So about 2.5% audio frequency data will make mistakes. If calculate with audio frequency forms adopted, 8KSPS sampling rate *8Bit each sample is indicated by 8 =64KBit/s=8KB/s is then these 2.5% of the audio frequency data that a corresponding one will be 0.025s within every second of mistake, basically people?s hearing is different to distinguish. So adopting Streaming Buffer can still well meet requirements for smoothness of the audio frequency.

Have only explained the implementation method that the audio frequency returns above, but say as the audio frequency function in the whole video conference system, there must also be audio frequency and gather some and match with it. It is the same to gather some basic principles of implementation method and playback module in audio frequency, make use of Streaming Buffer to realize, so no longer detail here.

Utilize mixing the sound mechanism and realize the communication of all duplexing audio frequency

There is Primary Buffer mainly the buffering area in Direct Sound With Secondary Buffer assist the buffering area Two buffer areas. Streaming Buffer stated in the front is Secondary Buffer. When initialized DirectSound, it will establish one Primary Buffer automatically, this function mainly buffered is to mix the sound and send mixing the sound result to the output equipment. Besides Primary Buffer, the procedure should also establish one Secondary Buffer at least, the auxiliary function that buffers is to store the sound that will be used, can release when using, but Primary Buffer can?t be released. Realized by DirectSound and broadcast a plurality of sounds at the same time, provided that the hardware is allowed. Its working course is as follows, when the procedure returns the audio frequency data in a plurality of Secondary Buffer at the same time, Direct Sound will come from different voice of Secondary Buffer these buffering area go on, mix transliteration automatically mainly, then export through the output equipment, as shown in Fig. 2. So generally, users do not need and mainly buffer and come into contacts, DirectSound will be managed by oneself. All duplexing audio frequency communication functions of the video conference system, it is to utilize this one of DirectSound to mix what the sound mechanism reach.

All duplexing to communicate that the all duplexing audio frequency communication functions to be realized are not merely limited to two conferees in the video conference, and the persons who should expand to each one of the meeting can follow needing, hear other conferees? speech at the same time, in order to reach the good discussion very to exchange the result. For this reason, distribute a buffer array in the procedure for each conferee, the size of the array is the same as size of audio frequency data of a frame. After the system begins to run, the procedure receives the audio frequency data frame of each member participating in the conference on one hand, then annotate and keep them in the corresponding buffer array separately according to users, and the order is arranged according to time, and will establish one Streaming Buffer and used in the audio frequency to return for each user. On the other hand, begin the content in Streaming Buffer corresponding to each user to broadcast in a circle and return and upgrade, and newer audio frequency data are offered by each user?s buffer array order. In this way, different the intersection of audio frequency and information of user will go on, mix sound Direct Sound automatically, put result to mix transliteration into Primary Buffer, export from the output equipment again, thus reach the necessary result.

Conclusion

DirectX technology has facilitated the development of different multimedia software greatly, has already been adopted extensively. Through jointly using Streaming Buffer mechanism offered in DirectX and mixing the sound mechanism, has realized smooth all duplexing audio frequency communication in the video conference system, the result of use is satisfactory.

Source: http://networkvip.net/archives/audio-frequency-communication-in-directx-technology-video-conference.html

biology chemistry sean avery chlamydia algebra trigonometry statistics

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.