diff options
author | Andreas Pehrson <[email protected]> | 2023-11-21 11:21:23 +0100 |
---|---|---|
committer | Andreas Pehrson <[email protected]> | 2024-01-15 15:25:40 +0100 |
commit | 5a2df9b0aaa5352c168b7aa2a29d80f8a0e3880b (patch) | |
tree | 05d02aadeb7e680757be5cea15695feab4394a91 /include | |
parent | ffec8ede4c8ab15c0db3043c793b0c82e299e14d (diff) | |
download | cubeb-5a2df9b0aaa5352c168b7aa2a29d80f8a0e3880b.tar.gz cubeb-5a2df9b0aaa5352c168b7aa2a29d80f8a0e3880b.zip |
Add APIs for input processing
Diffstat (limited to 'include')
-rw-r--r-- | include/cubeb/cubeb.h | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/include/cubeb/cubeb.h b/include/cubeb/cubeb.h index b606695..5c66d58 100644 --- a/include/cubeb/cubeb.h +++ b/include/cubeb/cubeb.h @@ -258,6 +258,18 @@ typedef enum { the jack backend. */ } cubeb_stream_prefs; +/** + * Input stream audio processing parameters. Only applicable with + * CUBEB_STREAM_PREF_VOICE. + */ +typedef enum { + CUBEB_INPUT_PROCESSING_PARAM_NONE = 0x00, + CUBEB_INPUT_PROCESSING_PARAM_ECHO_CANCELLATION = 0x01, + CUBEB_INPUT_PROCESSING_PARAM_NOISE_SUPPRESSION = 0x02, + CUBEB_INPUT_PROCESSING_PARAM_AUTOMATIC_GAIN_CONTROL = 0x04, + CUBEB_INPUT_PROCESSING_PARAM_VOICE_ISOLATION = 0x08, +} cubeb_input_processing_params; + /** Stream format initialization parameters. */ typedef struct { cubeb_sample_format format; /**< Requested sample format. One of @@ -514,6 +526,18 @@ cubeb_get_min_latency(cubeb * context, cubeb_stream_params * params, CUBEB_EXPORT int cubeb_get_preferred_sample_rate(cubeb * context, uint32_t * rate); +/** Get the supported input processing features for this backend. See + cubeb_stream_set_input_processing for how to set them for a particular input + stream. + @param context A pointer to the cubeb context. + @param params Out parameter for the input processing params supported by + this backend. + @retval CUBEB_OK + @retval CUBEB_ERROR_NOT_SUPPORTED */ +CUBEB_EXPORT int +cubeb_get_supported_input_processing_params( + cubeb * context, cubeb_input_processing_params * params); + /** Destroy an application context. This must be called after all stream have * been destroyed. @param context A pointer to the cubeb context.*/ @@ -641,6 +665,18 @@ CUBEB_EXPORT int cubeb_stream_get_current_device(cubeb_stream * stm, cubeb_device ** const device); +/** Set what input processing features to enable for this stream. + @param stream the stream for which to set input processing features. + @param params what input processing features to use + @retval CUBEB_OK + @retval CUBEB_ERROR if params could not be applied + @retval CUBEB_ERROR_INVALID_PARAMETER if a given param is not supported by + this backend, or if this stream does not have an input device + @retval CUBEB_ERROR_NOT_SUPPORTED */ +CUBEB_EXPORT int +cubeb_stream_set_input_processing_params(cubeb_stream * stream, + cubeb_input_processing_params params); + /** Destroy a cubeb_device structure. @param stream the stream passed in cubeb_stream_get_current_device @param devices the devices to destroy |