mediastreamer2: Creating typical VoIP audio streams.

mediastreamer2 2.7.3

- Main Page
- Related Pages
- Modules
- Data Structures
- Files
- Directories

Typedefs | Functions
Creating typical VoIP audio streams.
Mediastreamer2's high level APIs

Audio streaming API - easily run audio streams from soundcard or wav files to RTP. More...

## Typedefs
typedef struct _AudioStream | AudioStream
typedef VideoStream | VideoPreview
## Functions
MS2_PUBLIC int | audio_stream_start_full (AudioStream *stream, RtpProfile *profile, const char *remip, int remport, int rem_rtcp_port, int payload, int jitt_comp, const char *infile, const char *outfile, MSSndCard *playcard, MSSndCard *captcard, bool_t use_ec)
MS2_PUBLIC AudioStream * | audio_stream_new (int locport, bool_t ipv6)
MS2_PUBLIC int | audio_stream_start_now (AudioStream *stream, RtpProfile *prof, const char *remip, int remport, int rem_rtcp_port, int payload_type, int jitt_comp, MSSndCard *playcard, MSSndCard *captcard, bool_t echo_cancel)
MS2_PUBLIC void | audio_stream_iterate (AudioStream *stream)

## Detailed Description

Audio streaming API - easily run audio streams from soundcard or wav files to RTP.

## Typedef Documentation

typedef struct _AudioStream AudioStream

The AudioStream holds all resources to create and run typical VoIP audiostream.

typedef VideoStream VideoPreview

Small API to display a local preview window.

## Function Documentation

MS2_PUBLIC int audio_stream_start_full | ( | AudioStream * | stream,
|  | RtpProfile * | profile,
|  | const char * | remip,
|  | int | remport,
|  | int | rem_rtcp_port,
|  | int | payload,
|  | int | jitt_comp,
|  | const char * | infile,
|  | const char * | outfile,
|  | MSSndCard * | playcard,
|  | MSSndCard * | captcard,
|  | bool_t | use_ec
| ) |  |

Starts an audio stream from/to local wav files or soundcards.

This method starts the processing of the audio stream, that is playing from wav file or soundcard, voice processing, encoding, sending through RTP, receiving from RTP, decoding, voice processing and wav file recording or soundcard playback.

Parameters:

  stream | an AudioStream previously created with audio_stream_new().
  prof | a RtpProfile containing all PayloadType possible during the audio session.
  remip | remote IP address where to send the encoded audio.
  remport | remote IP port where to send the encoded audio
  rem_rtcp_port | remote port for RTCP.
  payload_type | payload type index to use for the sending stream. This index must point to a valid PayloadType in the RtpProfile.
  jitt_comp | Nominal jitter buffer size in milliseconds.
  infile | path to wav file to play out (can be NULL)
  outfile | path to wav file to record into (can be NULL)
  playcard | The soundcard to be used for playback (can be NULL)
  captcard | The soundcard to be used for catpure. (can be NULL)
  echo_cancel | whether echo cancellation is to be performed.

Returns:
  0 if sucessful, -1 otherwise.

MS2_PUBLIC AudioStream* audio_stream_new | ( | int | locport,
|  | bool_t | ipv6
| ) |  |

Creates an AudioStream object listening on a RTP port.

Parameters:

  locport | the local UDP port to listen for RTP packets.
  ipv6 | TRUE if ipv6 must be used.

Returns:
  a new AudioStream.

MS2_PUBLIC int audio_stream_start_now | ( | AudioStream * | stream,
|  | RtpProfile * | prof,
|  | const char * | remip,
|  | int | remport,
|  | int | rem_rtcp_port,
|  | int | payload_type,
|  | int | jitt_comp,
|  | MSSndCard * | playcard,
|  | MSSndCard * | captcard,
|  | bool_t | echo_cancel
| ) |  |

Starts an audio stream from local soundcards.

This method starts the processing of the audio stream, that is capture from soundcard, voice processing, encoding, sending through RTP, receiving from RTP, decoding, voice processing and soundcard playback.

Parameters:

  stream | an AudioStream previously created with audio_stream_new().
  prof | a RtpProfile containing all PayloadType possible during the audio session.
  remip | remote IP address where to send the encoded audio.
  remport | remote IP port where to send the encoded audio
  rem_rtcp_port | remote port for RTCP.
  payload_type | payload type index to use for the sending stream. This index must point to a valid PayloadType in the RtpProfile.
  jitt_comp | Nominal jitter buffer size in milliseconds.
  playcard | The soundcard to be used for playback
  captcard | The soundcard to be used for catpure.
  echo_cancel | whether echo cancellation is to be performed.

MS2_PUBLIC void audio_stream_iterate | ( | AudioStream * | stream | ) |

Executes background low priority tasks related to audio processing (RTP statistics analysis). It should be called periodically, for example with an interval of 100 ms or so.