5

I am going to make a PTT project on Android. Could you tell me how deep Android supports Voice and Multimedia API (such as RTP,RTSP,VoIP) for developers?

Jonas
  • 121,568
  • 97
  • 310
  • 388
Alireza Asadi
  • 78
  • 1
  • 7

2 Answers2

8

MediaPlayer supports playing rtsp://.. URLs. Audio and Video are supported. Check media format support to see which codecs are supported.

MediaPlayer internally automatically handles RTSP and RTP, so there is not much you need to handle. OTOH it does not give any low-level control over this process.

About VoIP: Android only consumes RTSP/RTP streams, but does not create/publish them. So this is one-way only.

Android 2.3 (Gingerbread) is said to have support for SIP-based VoIP.

Peter Knego
  • 79,991
  • 11
  • 123
  • 154
  • Thanks for your prompt reply, But if I want to create an stream(RTP/RTSP), what should I do? – Alireza Asadi Dec 13 '10 at 07:00
  • 1
    I'm thinking of looking into some of the opensource C/C++ libraries to see how difficult it is to build them with the NDK. That seems to be your only option, aside from implementing your own RTP/RTSP server in Java. – Nicholi Mar 18 '11 at 21:51
3

Use AudioTrack\AudioRecord APIs for streaming audio recording and playback. They allow you to deal with raw audio frames.

RTP packets are pretty straightforward - it's just a packet that contains some minimal header data and a raw audio frame. It is easy to implement - check out SipDroid for a reference implementation of RTP packets.

SirKnigget
  • 3,614
  • 2
  • 28
  • 61