Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
195 views
in Technique[技术] by (71.8m points)

node.js - How to remove noise added when converting pcma/aluw file I received in RTP to wav?

This is the sdp:

v=0
o=root 807151903 807151903 IN IP4 104.154.78.142
s=Asterisk PBX 11.18.0
c=IN IP4 104.154.78.142
t=0 0
m=audio 13822 RTP/AVP 8 101
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=sendrecv

I'm taking all the payloads and combine them to one file using rdp-parser.

var b = p.parseRtpPacket(msg)
fs.appendFileSync("./b", b.payload)

I also tried other RTP parse libraries to be sure it's not the issue with the parser.

Then I'm running ffmpeg:

ffmpeg -f mulaw -ar 8000 -i b  a.wav

Now I'm playing the file. I'm hearing my voice, and lot of noise in the background. Why? and how to fix it?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

You should use the -alaw format instead. And it will work for you.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...