---
name: "ost_DTMFDetect"
section: "3"
platform: "linux"
package: "libccaudio2-doc"
version: "1.0.0-2"
release: "Debian 6.0 (Squeeze)"
platforms: ["linux"]
url: "https://new.carta.tech/ost_DTMFDetect"
---

# ost\_DTMFDetect(3)

DTMFDetect is used for detecting DTMF tones in a stream of audio.

## NAME

ost::DTMFDetect - **DTMFDetect** is used for detecting DTMF tones in a stream of audio.

## SYNOPSIS

`#include <audio2.h>`

Inherits **ost::Audio**.

### Public Member Functions

**DTMFDetect** ()\
 **~DTMFDetect** ()\
 int **putSamples** (**Linear** buffer, int count)\
 *This routine is used to push linear audio data into the dtmf tone detection analysizer.*  int **getResult** (char \*data, int size)\
 *Copy detected dtmf results into a data buffer.*

### Protected Member Functions

void **goertzelInit** (**goertzel\_state\_t** \*s, tone\_detection\_descriptor\_t \*t)\
 void **goertzelUpdate** (**goertzel\_state\_t** \*s, **Sample** x\[\], int samples)\
 float **goertzelResult** (**goertzel\_state\_t** \*s)\

## Detailed Description

**DTMFDetect** is used for detecting DTMF tones in a stream of audio.

It currently only supports 8000Hz input.

## Constructor & Destructor Documentation

### ost::DTMFDetect::DTMFDetect ()

### ost::DTMFDetect::~DTMFDetect ()

## Member Function Documentation

### int ost::DTMFDetect::putSamples (Linear buffer, int count)

This routine is used to push linear audio data into the dtmf tone detection analysizer.

It may be called multiple times and results fetched later.

**Parameters:**

*buffer* of audio data in native machine endian to analysize. \
 *count* of samples to analysize from buffer.

### int ost::DTMFDetect::getResult (char \* data, int size)

Copy detected dtmf results into a data buffer.

**Parameters:**

*data* buffer to copy into. \
 *size* of data buffer to copy into.

### void ost::DTMFDetect::goertzelInit (goertzel\_state\_t \* s, tone\_detection\_descriptor\_t \* t)` [protected]`

### void ost::DTMFDetect::goertzelUpdate (goertzel\_state\_t \* s, Sample x\[\], int samples)` [protected]`

### float ost::DTMFDetect::goertzelResult (goertzel\_state\_t \* s)` [protected]`

## Author

Generated automatically by Doxygen for ccAudio from the source code.
