17
Voice Over IP Developing IPHONE Jeremy Stanley CS 460 section 1

Voice Over IP Developing IPHONE Jeremy Stanley CS 460 section 1

Embed Size (px)

Citation preview

Page 1: Voice Over IP Developing IPHONE Jeremy Stanley CS 460 section 1

Voice Over IP

Developing IPHONE

Jeremy StanleyCS 460 section 1

Page 2: Voice Over IP Developing IPHONE Jeremy Stanley CS 460 section 1

VoIP Advantages

No long distance fees No dedicated circuit

More efficient use of networks 64 Kbps raw audio vs. 13 Kbps compressed Data need not be transmitted during silence

Page 3: Voice Over IP Developing IPHONE Jeremy Stanley CS 460 section 1

VoIP Issues

Latency Packetization Network jitter

Quality of Service Real-time requirements

Addressing Issues IPv6 is a pratical necessity

Page 4: Voice Over IP Developing IPHONE Jeremy Stanley CS 460 section 1

Voice Encoding

PCM (pulse code modulation)

ADPCM - adaptive delta PCM Fast 4:1 Compression, Good quality

Vocoders (LPC, CELP, GSM) Slower, 12-30x compression common Voice only - Music does not work well

Page 5: Voice Over IP Developing IPHONE Jeremy Stanley CS 460 section 1

Introduction to IPHONE

Win32 application Uses Windows Multimedia and Sockets

APIs for audio and communication Two-way, full duplex voice channel

(PC to PC) Runs over UDP or TCP, supports data

compression and silence detection

Page 6: Voice Over IP Developing IPHONE Jeremy Stanley CS 460 section 1

IPHONE Design

Page 7: Voice Over IP Developing IPHONE Jeremy Stanley CS 460 section 1

Screen Shot

Page 8: Voice Over IP Developing IPHONE Jeremy Stanley CS 460 section 1

The Naïve Algorithm

Receive thread

1. Receive a packet

2. Decode and play audio

3. Return to step 1

Send thread

1. Record audio

2. Encode, packetize, and send

3. Return to step 1

Page 9: Voice Over IP Developing IPHONE Jeremy Stanley CS 460 section 1

Problems

Sounds like talking into a fan

Latency quickly rises to intolerable levels

Page 10: Voice Over IP Developing IPHONE Jeremy Stanley CS 460 section 1

Timing Issues

Page 11: Voice Over IP Developing IPHONE Jeremy Stanley CS 460 section 1

Solutions

Asynchronous sound processing Encode and send previous packet while

recording current packet Receive and decode next packet while

playing current packet

At least two send and receive buffers required

Page 12: Voice Over IP Developing IPHONE Jeremy Stanley CS 460 section 1

Revised Algorithm

Page 13: Voice Over IP Developing IPHONE Jeremy Stanley CS 460 section 1

Network Jitter

The double-buffered solution last described works well on a LAN

Delay still accumulates when receive buffer empties due to delayed packets

Increasing receive buffer only does so much - it will eventually be exhausted

Page 14: Voice Over IP Developing IPHONE Jeremy Stanley CS 460 section 1

Jitter Solutions

Drop late packets

Imperceptibly increase playback speed

Shorten delays between words

Use silence detection IPHONE does this

Page 15: Voice Over IP Developing IPHONE Jeremy Stanley CS 460 section 1

Silence Detection

Do not send audio chunks whose maximum amplitude is below a silence threshold

Phone conversations are 60% silence

Turns voice into bursty data

Page 16: Voice Over IP Developing IPHONE Jeremy Stanley CS 460 section 1

Comfort Noise

Total silence construed as dead line Substitute pre-recorded "open mic" Play low-volume white noise Record and repeat periods of silence during

conversation

Page 17: Voice Over IP Developing IPHONE Jeremy Stanley CS 460 section 1

Demonstration/Questions