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_processing/ns/include/noise_suppression_x.h @ 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: 3.1 KB
Line 
1/*
2 *  Copyright (c) 2012 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#ifndef WEBRTC_MODULES_AUDIO_PROCESSING_NS_INCLUDE_NOISE_SUPPRESSION_X_H_
12#define WEBRTC_MODULES_AUDIO_PROCESSING_NS_INCLUDE_NOISE_SUPPRESSION_X_H_
13
14#include "webrtc/typedefs.h"
15
16typedef struct NsxHandleT NsxHandle;
17
18#ifdef __cplusplus
19extern "C" {
20#endif
21
22/*
23 * This function creates an instance to the noise reduction structure
24 *
25 * Input:
26 *      - nsxInst       : Pointer to noise reduction instance that should be
27 *                       created
28 *
29 * Output:
30 *      - nsxInst       : Pointer to created noise reduction instance
31 *
32 * Return value         :  0 - Ok
33 *                        -1 - Error
34 */
35int WebRtcNsx_Create(NsxHandle** nsxInst);
36
37
38/*
39 * This function frees the dynamic memory of a specified Noise Suppression
40 * instance.
41 *
42 * Input:
43 *      - nsxInst       : Pointer to NS instance that should be freed
44 *
45 * Return value         :  0 - Ok
46 *                        -1 - Error
47 */
48int WebRtcNsx_Free(NsxHandle* nsxInst);
49
50
51/*
52 * This function initializes a NS instance
53 *
54 * Input:
55 *      - nsxInst       : Instance that should be initialized
56 *      - fs            : sampling frequency
57 *
58 * Output:
59 *      - nsxInst       : Initialized instance
60 *
61 * Return value         :  0 - Ok
62 *                        -1 - Error
63 */
64int WebRtcNsx_Init(NsxHandle* nsxInst, uint32_t fs);
65
66/*
67 * This changes the aggressiveness of the noise suppression method.
68 *
69 * Input:
70 *      - nsxInst       : Instance that should be initialized
71 *      - mode          : 0: Mild, 1: Medium , 2: Aggressive
72 *
73 * Output:
74 *      - nsxInst       : Initialized instance
75 *
76 * Return value         :  0 - Ok
77 *                        -1 - Error
78 */
79int WebRtcNsx_set_policy(NsxHandle* nsxInst, int mode);
80
81/*
82 * This functions does noise suppression for the inserted speech frame. The
83 * input and output signals should always be 10ms (80 or 160 samples).
84 *
85 * Input
86 *      - nsxInst       : NSx instance. Needs to be initiated before call.
87 *      - speechFrame   : Pointer to speech frame buffer for L band
88 *      - speechFrameHB : Pointer to speech frame buffer for H band
89 *      - fs            : sampling frequency
90 *
91 * Output:
92 *      - nsxInst       : Updated NSx instance
93 *      - outFrame      : Pointer to output frame for L band
94 *      - outFrameHB    : Pointer to output frame for H band
95 *
96 * Return value         :  0 - OK
97 *                        -1 - Error
98 */
99int WebRtcNsx_Process(NsxHandle* nsxInst,
100                      short* speechFrame,
101                      short* speechFrameHB,
102                      short* outFrame,
103                      short* outFrameHB);
104
105#ifdef __cplusplus
106}
107#endif
108
109#endif  // WEBRTC_MODULES_AUDIO_PROCESSING_NS_INCLUDE_NOISE_SUPPRESSION_X_H_
Note: See TracBrowser for help on using the repository browser.