08.01.2013 Views

Dialogic IP Media Library API Programming Guide and Library ...

Dialogic IP Media Library API Programming Guide and Library ...

Dialogic IP Media Library API Programming Guide and Library ...

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Using the AMR-NB Audio Coder<br />

Local Side Remote Side<br />

Note: While the diagram above implies an immediate reaction to a CMR from the other side, in reality,<br />

the other side’s response to a CMR may take a few packets.<br />

The sequence of activities is as follows:<br />

1. The application on the local side:<br />

a. Sets its preferred bit rate via the remote audio coder settings, in this case 7.4 kbit/s.<br />

b. Sets its CMR value via the local audio coder settings, in this case 7.95 kbit/s.<br />

c. Sets the RTP payload format to b<strong>and</strong>width efficient <strong>and</strong> its CMR rule to “CMR Limit” via<br />

the coder options settings.<br />

d. Starts RTP streaming using ipm_Start<strong>Media</strong>( ).<br />

2. The <strong>IP</strong>M device on the local side transmits at the preferred bit rate, in this case 7.4 kbit/s.<br />

3. The <strong>IP</strong>M device on the local side receives its first packet from the remote side with a CMR<br />

value which is higher than its preferred bit rate. In this case, the CMR value of 10.2 kbit/s is<br />

higher than the preferred bit rate of 7.4 kbit/s.<br />

4. Since its CMR rule is set to “CMR Limit”, the <strong>IP</strong>M device on the local side cannot exceed the<br />

preferred bit rate, so it leaves the transmitted bit rate at the preferred value, in this case 7.4<br />

kbit/s.<br />

5. The <strong>IP</strong>M device on the local side receives a packet from the remote side with a CMR value<br />

which is less than its preferred bit rate. In this case, the CMR value of 6.7 kbit/s is less than the<br />

preferred bit rate of 7.4 kbit/s.<br />

6. Since the new received CMR value of 6.7 kbit/s does not exceed the limit (7.4 kbit/s), the <strong>IP</strong>M<br />

device on the local side changes its transmitted bit rate to match the received CMR value (6.7<br />

kbit/s).<br />

Example Code<br />

The following code demonstrates the configuration required to h<strong>and</strong>le this scenario.<br />

...<br />

/* Setup <strong>IP</strong> address here */<br />

FT=4 (7.4 kbit/s), CMR=5 (7.95 kbits/s)<br />

FT=5 (7.95 kbit/s), CMR=6 (10.2 kbit/s)<br />

FT=4 (7.4 kbit/s), CMR=5 (7.95 kbits/s)<br />

FT=5 (7.95 kbit/s), CMR=3 (6.7 kbit/s)<br />

FT=3 (6.7kbit/s), CMR=5 (7.95 kbit/s)<br />

// Local Audio Coder<br />

ipm<strong>Media</strong>Info.<strong>Media</strong>Data[unCount].e<strong>Media</strong>Type = MEDIATYPE_AUDIO_LOCAL_CODER_INFO;<br />

44 <strong>Dialogic</strong> ® <strong>IP</strong> <strong>Media</strong> <strong>Library</strong> <strong>API</strong> <strong>Programming</strong> <strong>Guide</strong> <strong>and</strong> <strong>Library</strong> Reference<br />

<strong>Dialogic</strong> Corporation

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!