Note: We no longer publish the latest version of our code here. We primarily use a kumc-bmi github organization. The heron ETL repository, in particular, is not public. Peers in the informatics community should see MultiSiteDev for details on requesting access.

source: webrtc/webrtc/modules/audio_coding/neteq/set_fs.c @ 0:4bda6873e34c

pub_scrub_3792 tip
Last change on this file since 0:4bda6873e34c was 0:4bda6873e34c, checked in by Michael Prittie <mprittie@…>, 6 years ago

Scrubbed password for publication.

File size: 1.8 KB
Line 
1/*
2 *  Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
3 *
4 *  Use of this source code is governed by a BSD-style license
5 *  that can be found in the LICENSE file in the root of the source
6 *  tree. An additional intellectual property rights grant can be found
7 *  in the file PATENTS.  All contributing project authors may
8 *  be found in the AUTHORS file in the root of the source tree.
9 */
10
11/*
12 * Function were the sample rate is set.
13 */
14
15#include "mcu.h"
16
17#include "dtmf_buffer.h"
18#include "neteq_error_codes.h"
19
20int WebRtcNetEQ_McuSetFs(MCUInst_t *inst, uint16_t fs)
21{
22    int16_t ok = 0;
23
24    switch (fs)
25    {
26        case 8000:
27        {
28#ifdef NETEQ_ATEVENT_DECODE
29            ok = WebRtcNetEQ_DtmfDecoderInit(&inst->DTMF_inst, 8000, 560);
30#endif
31            inst->timestampsPerCall = inst->millisecondsPerCall * 8;
32            break;
33        }
34
35#ifdef NETEQ_WIDEBAND
36        case 16000:
37        {
38#ifdef NETEQ_ATEVENT_DECODE
39            ok = WebRtcNetEQ_DtmfDecoderInit(&inst->DTMF_inst, 16000, 1120);
40#endif
41            inst->timestampsPerCall = inst->millisecondsPerCall * 16;
42            break;
43        }
44#endif
45
46#ifdef NETEQ_32KHZ_WIDEBAND
47        case 32000:
48        {
49#ifdef NETEQ_ATEVENT_DECODE
50            ok = WebRtcNetEQ_DtmfDecoderInit(&inst->DTMF_inst, 32000, 2240);
51#endif
52            inst->timestampsPerCall = inst->millisecondsPerCall * 32;
53            break;
54        }
55#endif
56
57#ifdef NETEQ_48KHZ_WIDEBAND
58        case 48000:
59        {
60#ifdef NETEQ_ATEVENT_DECODE
61            ok = WebRtcNetEQ_DtmfDecoderInit(&inst->DTMF_inst, 48000, 3360);
62#endif
63            inst->timestampsPerCall = inst->millisecondsPerCall * 48;
64            break;
65        }
66#endif
67
68        default:
69        {
70            /* Not supported yet */
71            return CODEC_DB_UNSUPPORTED_FS;
72        }
73    } /* end switch */
74
75    inst->fs = fs;
76
77    return ok;
78}
Note: See TracBrowser for help on using the repository browser.