How to store RTP payload (G.711) to file?
-
Hello All, I am writing a small RTP recorder application. I am receiving the audio in RTP packets and I have to store the audio data to a .wav file. The payload type is G.711 PCMA 8000 KHz (Value - 8). I extract the payload and stored it in a file ("test.wav"). When i tried to play the file in "Media Player" and "Real Player" says the file is corrupted. Since it is raw PCM data i expected saving the payload in .wav file directly will play the audio. Can any one suggest, whether the procedure followed is correct? Storing the payload with out any conversion / decoding? Is there any site or document which tells about the procedure to be followed Note: I may start start recording in the middle of audio file playing also. Thanks in Advance Ravi
-
Hello All, I am writing a small RTP recorder application. I am receiving the audio in RTP packets and I have to store the audio data to a .wav file. The payload type is G.711 PCMA 8000 KHz (Value - 8). I extract the payload and stored it in a file ("test.wav"). When i tried to play the file in "Media Player" and "Real Player" says the file is corrupted. Since it is raw PCM data i expected saving the payload in .wav file directly will play the audio. Can any one suggest, whether the procedure followed is correct? Storing the payload with out any conversion / decoding? Is there any site or document which tells about the procedure to be followed Note: I may start start recording in the middle of audio file playing also. Thanks in Advance Ravi
Ravi Sankar S wrote: Can any one suggest, whether the procedure followed is correct? Storing the payload with out any conversion / decoding? Is there any site or document which tells about the procedure to be followed I know nothing about G.711 and wav formats, but this article about the wave file format[^] might be of help. -- "Google is your friend" jlr http://jlamas.blogspot.com/[^]
-
Hello All, I am writing a small RTP recorder application. I am receiving the audio in RTP packets and I have to store the audio data to a .wav file. The payload type is G.711 PCMA 8000 KHz (Value - 8). I extract the payload and stored it in a file ("test.wav"). When i tried to play the file in "Media Player" and "Real Player" says the file is corrupted. Since it is raw PCM data i expected saving the payload in .wav file directly will play the audio. Can any one suggest, whether the procedure followed is correct? Storing the payload with out any conversion / decoding? Is there any site or document which tells about the procedure to be followed Note: I may start start recording in the middle of audio file playing also. Thanks in Advance Ravi
Create a directshow filter graph with source filter, G.711 decompressor and wav writer. Don't try it, just do it! ;-)
-
Create a directshow filter graph with source filter, G.711 decompressor and wav writer. Don't try it, just do it! ;-)
Thanks Alex.... Thanks for ur suggestion. Let me explain the application bit more detail. It is recording application. the functionality is to record the VoIP calls going on in a LAN. So application can receive multiple VoIP call data. For each call there are sending and receiving ports. Since the packets are targetted to my system, I can not use normal socket for receiving the paceket I have to receive the packet using promisious more using any packet capture library. I am using WinPCap used which is widely used. When I receive the packet in promisious mode i am able to capture the packet, i am able to parse it and store the packet. The codec in which i receive the packet is G.711. When i store the pay load with proper WAVE file header and specify that it is G.711 format i am unable to get the replaying properly. I use Etherial for cross checking the packets received. The payload is correct and codec type is also G.711. When I tried to store the payload using the statistics option provided by Etherial i am able to replay the voice perfectly. In my application the procedure what i followed is here until RTP BYE / RTCP BYE packet get the RTP packet retrive the payload dump into a file end until add the WAVE header and store the file. I tried with DirectShow it is very slow... So I could not use that I have to go for very low level programming since the number of packets and number of VoIP calls are more.... I feel after receiving the RTP packet and before storing whether i need to do any convertion? is the procedure followed is correct? Please clarify Thanks Ravi
-
Thanks Alex.... Thanks for ur suggestion. Let me explain the application bit more detail. It is recording application. the functionality is to record the VoIP calls going on in a LAN. So application can receive multiple VoIP call data. For each call there are sending and receiving ports. Since the packets are targetted to my system, I can not use normal socket for receiving the paceket I have to receive the packet using promisious more using any packet capture library. I am using WinPCap used which is widely used. When I receive the packet in promisious mode i am able to capture the packet, i am able to parse it and store the packet. The codec in which i receive the packet is G.711. When i store the pay load with proper WAVE file header and specify that it is G.711 format i am unable to get the replaying properly. I use Etherial for cross checking the packets received. The payload is correct and codec type is also G.711. When I tried to store the payload using the statistics option provided by Etherial i am able to replay the voice perfectly. In my application the procedure what i followed is here until RTP BYE / RTCP BYE packet get the RTP packet retrive the payload dump into a file end until add the WAVE header and store the file. I tried with DirectShow it is very slow... So I could not use that I have to go for very low level programming since the number of packets and number of VoIP calls are more.... I feel after receiving the RTP packet and before storing whether i need to do any convertion? is the procedure followed is correct? Please clarify Thanks Ravi
Sir I am working as a developer in a company which is about to develop a VOIP communiction terminal, i need help for the firmware & coding Meaning is there any Good SoC available in market for VOIP , or if ther any Stack available for Voip. Currently we making a feasibility study by making a small project in VC++ and implementing VOIP on LAN. Were can i find the refrences for H.323 & SIP ? If u know any forum from were i can get help let me know Eager for your reply vikas.amin@embin.com Vikas Amin Embin Technology Bombay vikas.amin@embin.com