***
id: f0bdfe3e-5643-4106-b2be-bd0c93387267
title: Voice
sidebar-title: Overview
position: 0
slug: /node/reference/voice
description: >-
Access the Voice API to make and receive phone calls programmatically.
Includes methods for call control, playback, recording, and speech detection.
max-toc-depth: 3
----------------
[previous-version-of-relay]: /docs/server-sdk/v2/node/reference
[upgrade-your-relay-game]: https://signalwire.com/blogs/developers/upgrade-your-relay-game
[voice-client-1]: /docs/server-sdk/v3/node/reference/voice/client
[voice-client]: /docs/server-sdk/v3/node/reference/voice/client/events
In May 2022, Voice was incorporated into version 3 of the RELAY Realtime Server SDK. If you have an application that runs on the [previous version of RELAY][previous-version-of-relay] for Voice calls, consider upgrading. For some pointers on migrating to this version, please read our post ["Upgrade Your RELAY Game"][upgrade-your-relay-game].
Access the Voice API. You can instantiate a [Voice.Client][voice-client-1] to make or receive calls. Please see [Events][voice-client] for the list of events emitted by a [Voice.Client][voice-client-1] object.
#### Example
The following example answers any call in the "office" topic, and immediately plays some speech.
```javascript
import { Voice } from "@signalwire/realtime-api";
const client = new Voice.Client({
project: "",
token: "",
topics: ["office"],
});
client.on("call.received", async (call) => {
console.log("Got call", call.from, call.to);
try {
await call.answer();
console.log("Inbound call answered");
await call.playTTS({ text: "Hello! This is a test call." });
} catch (error) {
console.error("Error answering inbound call", error);
}
});
```
## Classes
Represents an active voice call with methods for playback, recording, speech detection, and call control.
Represents a collect operation for gathering user input via DTMF or speech during a call.
Represents a detect operation for identifying answering machines, fax tones, or digits during a call.
Represents a playback operation for playing audio, TTS, silence, or ringtones during a call.
Represents a prompt operation that combines playback with input collection during a call.
Represents a recording operation for capturing audio during a call.
Represents the state of a call with properties for tracking call progress and status.
Represents a tap operation for streaming call audio to an external destination.
The main Voice client for making outbound calls and listening for inbound call events.
Helper class for building device configurations when dialing multiple endpoints.
Helper class for building playlists of audio, TTS, silence, and ringtones for playback.