A 60-rnnoise.conf => 60-rnnoise.conf +17 -0
@@ 0,0 1,17 @@
+pcm.rnnoise {
+ @args [ SLAVE WET_DRY_FACTOR ]
+ @args.SLAVE {
+ type string
+ default "sysdefault"
+ }
+ @args.WET_DRY_FACTOR {
+ type real
+ default 0
+ }
+
+ type rnnoise
+ wet_dry_factor $WET_DRY_FACTOR
+ slave.pcm $SLAVE
+}
+
+# vim: ft=alsaconf :
M README.rst => README.rst +7 -14
@@ 65,23 65,16 @@ API.
.. code-block::
- pcm.urnnoise {
- type rnnoise
- slave.pcm "sysdefault"
- }
-
- pcm.rnnoise {
- type plug
- slave {
- rate 48000
- pcm "urnnoise"
- }
- }
-
pcm.!default {
type asym
playback.pcm "cards.pcm.default"
- capture.pcm "rnnoise"
+ capture.pcm "plug:rnnoise"
+ # there is a short way to add the wet/dry (and other args):
+ # capture.pcm "plug:\"rnnoise:sysdefault,0.5\""
+ # without the plug wrapper this becomes ``rnnoise:slave,wetdry'', both
+ # of the arguments are optional
+ # this is provided by 60-rnnoise.conf, takes two args: slave, wet_dry
+ # see 60-rnnoise.conf for the default values
}
License
M meson.build => meson.build +12 -0
@@ 3,6 3,7 @@ cc = meson.get_compiler('c')
static_rnnoise = get_option('static_rnnoise')
pdir = get_option('plugin_dir')
+cdir = get_option('config_dir')
libm = dependency('', required: false)
rnnoise = dependency('rnnoise', static: static_rnnoise)
@@ 17,6 18,11 @@ if pdir == ''
pdir = get_option('prefix') / get_option('libdir') / 'alsa-lib'
endif
+if cdir == ''
+ cdir = get_option('prefix') / get_option('datadir') \
+ / 'alsa/alsa.conf.d'
+endif
+
has_frame_func = cc.has_function('rnnoise_get_frame_size',
prefix: '#include <rnnoise.h>',
dependencies: rnnoise)
@@ 27,6 33,7 @@ endif
summary({
'plugin directory': pdir,
+ 'config directory': cdir,
'statically link rnnoise': static_rnnoise,
'rnnoise_get_frame_size() detected?': has_frame_func
}, section: 'build configuration')
@@ 37,3 44,8 @@ shared_library('asound_module_pcm_rnnoise',
install_dir: pdir,
c_args: ['-DPIC'],
install: true)
+
+install_data('60-rnnoise.conf',
+ install_dir: cdir)
+
+# vim: sw=8 noet :
M meson_options.txt => meson_options.txt +5 -0
@@ 3,6 3,11 @@ option('plugin_dir',
description: 'ALSA plugin directory location',
value: ''
)
+option('config_dir',
+ type: 'string',
+ description: 'ALSA plugin pcm config location',
+ value: ''
+)
option('static_rnnoise',
type: 'boolean',
description: 'Whether to static link RNNoise',