From 64c833b765ccc8dea6d3baa7a7185401cb2befa2 Mon Sep 17 00:00:00 2001 From: cpu Date: Sat, 2 Dec 2023 23:59:31 +0100 Subject: [PATCH] support for different type of sound cards --- .asoundrc | 6 +++--- README.md | 2 +- dog-trainer.py | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.asoundrc b/.asoundrc index d2d68a3..a7b6374 100644 --- a/.asoundrc +++ b/.asoundrc @@ -1,13 +1,13 @@ -pcm.my_usb_sound_device { +pcm.my_sound_device { type hw card USB device 0 } -pcm.my_usb_sound_device_with_converter { +pcm.my_sound_device_with_converter { type plug slave { - pcm my_usb_sound_device + pcm my_sound_device format S16_LE channels 2 rate 48000 diff --git a/README.md b/README.md index 55686bd..da6336e 100644 --- a/README.md +++ b/README.md @@ -45,7 +45,7 @@ The recordings must be edited a little bit so some audio processing tool is need Configuration ------------- -If your sound device is other then USB type then modify and adapt the line `hw:CARD=USB,DEV=0` in ALSA config +If your sound device is other then USB type then change the line `card USB` in ALSA config > `nano .asoundrc` Install the ALSA config file diff --git a/dog-trainer.py b/dog-trainer.py index 9d232c2..c2052ee 100755 --- a/dog-trainer.py +++ b/dog-trainer.py @@ -4,8 +4,8 @@ from datetime import datetime import subprocess import sys -PLAY_DEVICE = "my_usb_sound_device_with_converter" # as defined in '~/.asoundrc' -REC_DEVICE = "my_usb_sound_device" # as defined in '~/.asoundrc' +PLAY_DEVICE = "my_sound_device_with_converter" # as defined in '~/.asoundrc' +REC_DEVICE = "my_sound_device" # as defined in '~/.asoundrc' MAX_RECORDING_TIME = 30 # limit recordings to only e.g. 30 seconds long TRIM_RECORDING_END = 0.8 # remove the clicking noise from the end of recordings RECORD_BUTTON_PRESS_TIME = 2 # pressing and holding a button longer then e.g. 2 seconds triggers recording otherwise playing