logo
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Receiving G.711 over RTP, decoding & Transmit
btking
#1 Posted : Monday, December 19, 2011 3:35:01 AM(UTC)
Rank: Member

Groups: Member
Joined: 11/22/2011(UTC)
Posts: 20
Points: 60

Hi,Guys

I want to know how can I get the rtp packets from sip_callout, and decode them to pcm?
btking
#2 Posted : Tuesday, February 14, 2012 5:31:02 AM(UTC)
Rank: Member

Groups: Member
Joined: 11/22/2011(UTC)
Posts: 20
Points: 60

Hi,

Who knows how to decode G.711 to PCM and PCM encode to G.711 ?
ivx
#3 Posted : Tuesday, February 14, 2012 3:01:51 PM(UTC)
Rank: Administration

Groups: Administration
Joined: 9/15/2006(UTC)
Posts: 1,946
Points: 5,711
Man
Location: Estonia

Was thanked: 68 time(s) in 68 post(s)
Hi,

What about using LumiSoft.Net.Media.Codec.Audio.PCMA and LumiSoft.Net.Media.Codec.Audio.PCMU encoder/decoder.
btking
#4 Posted : Wednesday, February 15, 2012 4:36:24 AM(UTC)
Rank: Member

Groups: Member
Joined: 11/22/2011(UTC)
Posts: 20
Points: 60

This is my code:

private void m_pStream_Receivced(object sender,RTP_PacketEventArgs e)
{
AudioCodec codec = null;
if (!m_pAudioCodecs.TryGetValue(e.Packet.PayloadType, out codec))
{
// Unknown codec(payload value), skip it.
return;
}

byte[] data = e.Packet.Data;
byte[] decodeData = codec.Decode(data, 0, data.Length);

m_pBinaryWriter.Write(decodeData, 0, decodeData.Length);
}

I called sip:music@iptel.org and recorded music to test.raw.

When I used toolsoft-audio-player to play the file, player display sample rate of test.raw is 441000, but I can

only hear noise when playing, then I modified sample rate(8000) of input format in the player's options. Finally, that

works. Is this a problem of the player?
ivx
#5 Posted : Wednesday, February 15, 2012 8:02:10 AM(UTC)
Rank: Administration

Groups: Administration
Joined: 9/15/2006(UTC)
Posts: 1,946
Points: 5,711
Man
Location: Estonia

Was thanked: 68 time(s) in 68 post(s)

G711 is always 8khz PCM audio, so when you store to to wave, you must store it to 8khz wav file.
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Powered by YAF 1.9.5.5 | YAF © 2003-2011, Yet Another Forum.NET
This page was generated in 0.037 seconds.