Playing Audio Files in Lync 2010 Client: Introduction (Part 1 of 2)

Summary:   Learn how to use the Microsoft Lync 2010 API to play an audio file in Microsoft Lync 2010. Part 1 introduces the scenario and lists the prerequisites.

Applies to:   Microsoft Lync 2010 API | Microsoft Lync 2010

Published:   December 2011 | Provided by:   John Austin, Microsoft | About the Author

Contents

  • Introduction

  • Prerequisites

  • Additional Resources

This is the first in a two-part series of articles about how to play audio files in a Microsoft Lync 2010 API application.

Introduction

The Microsoft Lync 2010 API enables you to play pre-recorded audio files such as Windows Media audio files (.wma) through a computer system speaker or unified communications-enabled telephone. This feature is useful when you want to give audio feedback to user input or warn a user about an unusual error condition.

This article discusses a telephone pad user control sample. The telephone pad emulates the 12 button key pad on a standard telephone. When a user clicks a button on the telephone pad, a dual-tone multifrequency (DTMF) tone is played through the system speaker. This gives a user the same experience they would have when pressing buttons on an actual telephone keypad.

Note

For information about how a Microsoft Unified Communications Managed API (UCMA) 3.0 application can process DTMF tones that are sent from a Microsoft Lync 2010 application, see Creating Automated Attendants in UCMA 3.0 and Lync 2010.

The telephone pad control is configurable and can be made to play back a human voice that speaks the number on the face of a button instead of a DTMF tone. The human voice recordings were made by the Windows Sound Recorder accessory. The DTMF tones were generated by a third-party audio recording application and then saved as .wav files.

The telephone pad user control appears in figure 1. This control can be dropped into any Windows Forms application. It exposes an event that is raised every time that a user clicks a button. The event data argument carries the character string text of the clicked button.

Figure 1. Telephone pad control

Tip

It is not necessary to play a DTMF tone through an audio playback device while a Lync 2010 audio call is active. Lync plays a tone through the selected communication audio device when AudioChannel.BeginSendDtmf is called.

Prerequisites

The following table describes the software components that you must have to implement this scenario

Prerequisite

Description

Microsoft Lync Server 2010

The unified communications server.

Microsoft Lync 2010

The Lync client that provides the API platform.

Microsoft Visual Studio 2008 development system or Microsoft Visual Studio 2010

Used to create the Lync 2010 API telephone pad user control.

Microsoft Lync 2010 SDK

Provides the object model that exposes the audio file playback feature.

A DTMF tone generator.

An audio recording application that generates a DTMF tone that you can save as an audio file.

Part 2

Playing Audio Files in Lync 2010 Client: The Phone Pad (Part 2 of 2)

Additional Resources

For more information, see the following resources:

About the Author

John Austin, Microsoft, is a programmer/writer in the Lync client SDK documentation team. He has been writing Microsoft technical documentation for four years. Prior to working for Microsoft, John spent two decades as a software developer.