Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. How to store RTP payload (G.711) to file?

How to store RTP payload (G.711) to file?

Scheduled Pinned Locked Moved C / C++ / MFC
tutorialquestion
5 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    Ravi Sankar S
    wrote on last edited by
    #1

    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

    J A 2 Replies Last reply
    0
    • R Ravi Sankar S

      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

      J Offline
      J Offline
      Jose Lamas Rios
      wrote on last edited by
      #2

      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/[^]

      1 Reply Last reply
      0
      • R Ravi Sankar S

        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

        A Offline
        A Offline
        Alexander M
        wrote on last edited by
        #3

        Create a directshow filter graph with source filter, G.711 decompressor and wav writer. Don't try it, just do it! ;-)

        R 1 Reply Last reply
        0
        • A Alexander M

          Create a directshow filter graph with source filter, G.711 decompressor and wav writer. Don't try it, just do it! ;-)

          R Offline
          R Offline
          Ravi Sankar S
          wrote on last edited by
          #4

          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

          V 1 Reply Last reply
          0
          • R Ravi Sankar S

            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

            V Offline
            V Offline
            vikas amin
            wrote on last edited by
            #5

            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

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups