2008年4月15日 星期二

GVIM --- 指令

GVIM

[u]
動作還原
若不小心下錯指令,可以利用這個指令還原。
[K]
函式查詢
若您在 VIM 中撰寫 C/C++ 程式,可以在 C/C++ 標準函式厙提供的函式名字上按「K」,便可以呼叫出 man page 查詢該函式的用法
[=]
自動程式縮排對齊
若您在 VIM 中撰寫 C/C++ 程式,可以利用「gg」指令將游標移到視窗最上方、利用「v」切換到選取模式、再用「G」將游標移到檔案尾端 (即達到全選的功能),最後按「=」,VIM 便會幫你的程式做自動對齊
[ctrl]+[r]
動作重做
若不小心還原錯了,可以利用這個指令重做。

dd
將該行文字刪除
此項指令可與指令 p (貼上)配合使用
而變成是「剪下」的功能
dw
刪除該單字
cc
將該行文字改變
當輸入此指令時,游標所在該行會被刪除,並自動進入「輸入模式」
cw
改變該單字
當輸入此指令時,該單字在游標之後的字元會被刪除,並自動進入「輸入模式」

yy
將該行文字複製
指令 Y 有相同的功能
[p]
將所剪下或複製的文字貼上

[/]字串
向下搜尋字串
下達此命令之後,若文件中包含該「字串」,則文件中所有「字串」的背景顏色會被置換成較鮮明的顏色,在下達完搜尋指令之後,還可以透過「n」「N」指令作進一步控制。
[n] 跳到下一個「字串」所在地
[N] 跳到上一個「字串」所在地
另外,把游標停在想要搜尋的字串上,按下「*」也可以達到向下搜尋的效果。


[k]
向上移動游標一個字元
也就是方向鍵的「↑」
[j]
向下移動游標一個字元
也就是方向鍵的「↓」
[h]向左移動游標一個字元
也就是方向鍵的「←」
[l]向右移動游標一個字元
也就是方向鍵的「→」

若想跳出輸入模式,則鍵入即可回到命令模式。
[i]在游標左方進入輸入模式
[I]
在游標所在行的行首進入輸入模式
[a]
在游標右方進入輸入模式
[A]在游標所在行的行尾進入輸入模式
[o](小寫英文字母 o)
在游標下一行另起新行,並進入輸入模式
[O](大寫英文字母 o)
在游標上一行另起新行,並進入輸入模式

2008年4月8日 星期二

SIP Intro --- SDP

SDP

RFC2327裡的會用到的ㄧ些重要資訊。


以下原文取自RFC3264
RFC 2543 [10] specified that placing a user on hold was complished by setting the connection address to 0.0.0.0. Its usage for putting a call on hold is no longer recommended, since it doesn’t allow for RTCP to be used with held streams, doesn’t work with IPv6, and breaks with connection oriented media. However, it can be useful in an initial offer when the offerer knows it wants to use a particular set of media streams and formats, but doesn’t know the addresses and ports at the time of the offer. Of course, when used, the port number MUST NOT be zero, which would specify that the stream has been disabled. An agent MUST be capable of receiving SDP with a connection address of 0.0.0.0, in which case it means that neither RTP nor RTCP should be sent to the peer.

SIP Intro --- Audio Codecs

Codecs

音訊編解碼標準

PCMU(G.711U)
類型:Audio
制定者:ITU-T
所需頻寬:64Kbps(90.4)
特性:PCMU和PCMA都能提供較好的語音品質,但是它們佔用的頻寬較高,需要64kbps。
優點:語音品質優
缺點:佔用的頻寬較高
應用領域:voip
版稅方式:Free
備註:PCMU and PCMA都能夠達到CD音質,但是它們消耗的頻寬也最多(64kbps)。如果網路頻寬比較低,可以選用低比特速率的編碼方法,如G.723或G.729,這兩種編碼的方法也能達到傳統長途電話的音質,但是需要很少的頻寬(G723需要5.3/6.3kbps,G729需要8kbps)。如果頻寬足夠並且需要更好的語音品質,就使用PCMU 和 PCMA,甚至可以使用寬頻的編碼方法G722(64kbps),這可以提供有高保真度的音質。
                                                                                                            


SIP Intro --- SDP (Offer/Answer)

SDP (Offer/Answer)

資料來源RFC3264




SDP Indicating Capabilities
v=0
o=carol 28908764872 28908764872 IN IP4 100.3.6.6
s=-
t=0 0
c=IN IP4 192.0.2.4
m=audio 0 RTP/AVP 0 1 3
a=rtpmap:0 PCMU/8000
a=rtpmap:1 1016/8000
a=rtpmap:3 GSM/8000
m=video 0 RTP/AVP 31 34
a=rtpmap:31 H261/90000
a=rtpmap:34 H263/90000



Assume that the caller, Alice, has included the following description
in her offer.
v=0
o=alice 2890844526 2890844526 IN IP4 host.anywhere.com
s=
c=IN IP4 host.anywhere.com
t=0 0
m=audio 49170 RTP/AVP 0
a=rtpmap:0 PCMU/8000
m=video 51372 RTP/AVP 31
a=rtpmap:31 H261/90000
m=video 53000 RTP/AVP 32
a=rtpmap:32 MPV/90000



he returns the SDP below as the answer
v=0
o=bob 2890844730 2890844730 IN IP4 host.example.com
s=
c=IN IP4 host.example.com
t=0 0
m=audio 49920 RTP/AVP 0
a=rtpmap:0 PCMU/8000
m=video 0 RTP/AVP 31
m=video 53000 RTP/AVP 32
a=rtpmap:32 MPV/90000



Bob decides to change the port.
v=0
o=bob 2890844730 2890844731 IN IP4 host.example.com
s=
c=IN IP4 host.example.com
t=0 0
m=audio 65422 RTP/AVP 0
a=rtpmap:0 PCMU/8000
m=video 0 RTP/AVP 31
m=video 53000 RTP/AVP 32
a=rtpmap:32 MPV/90000
m=audio 51434 RTP/AVP 110
a=rtpmap:110 telephone-events/8000
a=recvonly



Alice accepts the additional media stream, and so generates the following answer:
v=0
o=alice 2890844526 2890844527 IN IP4 host.anywhere.com
s=
c=IN IP4 host.anywhere.com
t=0 0
m=audio 49170 RTP/AVP 0
a=rtpmap:0 PCMU/8000
m=video 0 RTP/AVP 31
a=rtpmap:31 H261/90000
m=video 53000 RTP/AVP 32
a=rtpmap:32 MPV/90000
m=audio 53122 RTP/AVP 110
a=rtpmap:110 telephone-events/8000
a=sendonly



One of N Codec Selection

The initial offer from Alice to Bob indicates a single audio stream with the three audio codecs that are available in the DSP.
v=0
o=alice 2890844526 2890844526 IN IP4 host.anywhere.com
s=
c=IN IP4 host.anywhere.com
t=0 0
m=audio 62986 RTP/AVP 0 4 18
a=rtpmap:0 PCMU/8000
a=rtpmap:4 G723/8000
a=rtpmap:18 G729/8000
a=inactive



Bob can support dynamic switching between PCMU and G.723. So, he sends the following answer
v=0
o=bob 2890844730 2890844731 IN IP4 host.example.com
s=
c=IN IP4 host.example.com
t=0 0
m=audio 54344 RTP/AVP 0 4
a=rtpmap:0 PCMU/8000
a=rtpmap:4 G723/8000
a=inactive



Alice can then select any one of these two codecs.
v=0
o=alice 2890844526 2890844527 IN IP4 host.anywhere.com
s=
c=IN IP4 host.anywhere.com
t=0 0
m=audio 62986 RTP/AVP 4
a=rtpmap:4 G723/8000
a=sendrecv



Bob accepts the single codec
v=0
o=bob 2890844730 2890844732 IN IP4 host.example.com
s=
c=IN IP4 host.example.com
t=0 0
m=audio 54344 RTP/AVP 4
a=rtpmap:4 G723/8000
a=sendrecv

2008年4月2日 星期三

DTMF Tone Generator (Free Software)

D

TMF tone generator software (free)


NCH Tone Generator (Free Software)

這個軟體是免費的,除非要有進階功能才需要付費,而且還額外提供ㄧ些處理音頻訊號的PLUGIN下載使用。

使用此工具在依照我之前有一篇介紹的DTMF tone的說明,就可以自己產生DTMF Tone了!!!

可以去NCH官網查看~

以下是轉貼自他的官網簡介~

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Typical Applications

Generation of test tones in radio and other studios for the alignment of levels.
Calibration and testing of audio equipment or speakers.
Tuning music instruments as an accurate reference tone.
Demonstration of audio principles to students.
Acoustics testing and equalisation.
Quality control and testing of sound cards.
White noise generator
Audio band signalling.
Hearing tests (under suitable medical supervision).

Features

Sine wave, square wave, triangular waveform, saw tooth waveform, impulse, white noise and pink noise.
Supports frequencies from 1Hz to 22kHz bandwidth (subject to sound card).
Multiple simultaneous tones (1 to 16 tones can be created at the same time) (useful to create harmonics).
Mono or separate stereo operation (ideal to create dual tones or 'beats').
Tone Sweeps (Log or Linear).
Plays tone or saves as wav file.


搜尋此網誌