diff --git a/README.md b/README.md index 42e9f8f9..06df5f87 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,7 @@ Hopefully you'll enjoy it! ## How to use audio record and playback feature: - Install `vlc` and make sure `curl` and `arecord` are present on your system -- Copy the script under `utility` folder to its corresponding absolute path +- Make sure you installed xournalpp with `desktop-install` command (see install steps) - Under `vlc` settings: - - enable `http interface` (see [this](https://github.com/azrafe7/vlc4youtube/blob/master/instructions/how-to-enable-vlc-web-interface.md) ) with blank username and password "password" - - tick `Allow only one instance` under `Interface -> Instance` @@ -43,7 +43,9 @@ Hopefully you'll enjoy it! - Choose `Toolbar Left` layout under `View->Toolbars->Toolbar Left` You're ready to go! -Just press the red button to start/stop recording and use the `Play Object` tool to click on a stroke and listen to the corresponding audio +Just press the red button to start/stop recording and use the `Play Object` tool to click on a stroke and listen to the corresponding audio. + +If you need to, you can edit the recording audio gain in the script under `/usr/local/bin/xopp-recording.sh` (an option for this will be availabe through xournalpp's settings in the future) ## Building diff --git a/desktop/desktop_install.sh.in b/desktop/desktop_install.sh.in index 444092ea..d6b12c05 100755 --- a/desktop/desktop_install.sh.in +++ b/desktop/desktop_install.sh.in @@ -25,6 +25,7 @@ if test "$1" = "install"; then cp -f ${srcdir}/desktop/x-xopp.desktop /usr/share/mimelnk/application cp -f ${srcdir}/desktop/xournalpp.thumbnailer /usr/share/thumbnailers + cp -f ${srcdir}/utility/usr/local/bin/xopp-recording.sh /usr/local/bin/ else rm -f ${desktopdir}/icons/hicolor/scalable/apps/xournalpp.svg rm -f ${desktopdir}/icons/hicolor/scalable/mimetypes/xoj.svg @@ -38,6 +39,7 @@ else rm -f ${desktopdir}/applications/xournalpp.desktop rm -f /usr/share/mimelnk/application/x-xoj.desktop rm -f /usr/share/thumbnailers/xournalpp.thumbnailer + rm -f /usr/local/bin/xopp-recording.sh fi echo "Updating desktop, mime, and icon databases."; diff --git a/utility/usr/local/bin/xopp-recording.sh b/utility/usr/local/bin/xopp-recording.sh index 7706f128..4c131173 100755 --- a/utility/usr/local/bin/xopp-recording.sh +++ b/utility/usr/local/bin/xopp-recording.sh @@ -1,24 +1,21 @@ #!/bin/bash -filetype="wav" -#filename="record_$(date +%H_%M_%m_%d_%Y)" -#directory="$HOME/Musica/recordings/" - if [[ $1 == "start" ]] && [[ $# -eq 2 ]] then filename=$(echo $2|rev|cut -d'/' -f1|rev) directory=$(echo $2|rev|cut -d'/' -f2-|rev) directory=$directory/ + vol=35 + + #exec &> ${directory}${filename}.log #debug if ! [ -d "$directory" ]; then - mkdir "$directory" + mkdir -p "$directory" fi - #exec &> ${directory}${filename}.log #debug - - notify-send "Recording started" - amixer sset 'Capture' 35% + notify-send "Recording started with ${vol}% gain" + amixer sset 'Capture' ${vol}% amixer sset 'Master' 0% arecord -f cd -t wav |lame --preset 56 -mm - "$directory""$filename" & elif [[ $1 == "stop" ]]