Intro
Audio Sender Daemon is a utility that can be used to stream audio from Audio Device to Voicegain Platform (Cloud or Edge) for real-time transcription. Audio Sender Daemon can be controlled remotely from the Voicegain Web Console.
Downloading the Audio Sender Daemon
You can download a pre-configured Audio Sender Daemon from Live Broadcasting page in the Web Console under the Live Transcribe App mode.
(We assume that by now you have created a websocket that will be used to broadcast the live transcriptions.) On this page click on the (i) icon in the selected websocket which will bring the websocket details page.
Select the Language Model to use for this transcription and click the Request Link button. Then copy the generated link. It will be valid for 1 hour.
Log into the machine on which you will be running the Audio Daemon. (In this guide we assume that you will be running Linux or at least a Bash shell). In the terminal run the following commands, which will download the install package from the link and will untar its contents.
pi@pi01:~/ascalon $ wget -N --backups=0 https://api.voicegain.ai/v1/websocket/Sunday.Sermon/sender/download/TQJ-BZ2-WUL
--2020-03-20 15:04:22-- https://api.voicegain.ai/v1/websocket/Sunday.Sermon/sender/download/TQJ-BZ2-WUL
Resolving api.voicegain.ai (api.voicegain.ai)... 104.196.26.33
Connecting to api.voicegain.ai (api.voicegain.ai)|104.196.26.33|:443... connected.
HTTP request sent, awaiting response... 200
Length: 7168 (7.0K) [application/octet-stream]
Saving to: ‘TQJ-BZ2-WUL’
TQJ-BZ2-WUL 100%[====================================================>] 7.00K --.-KB/s in 0s
Last-modified header missing -- time-stamps turned off.
2020-03-20 15:04:23 (14.0 MB/s) - ‘TQJ-BZ2-WUL’ saved [7168/7168]
pi@pi01:~/ascalon $ mv TQJ-BZ2-WUL TQJ-BZ2-WUL.tar
pi@pi01:~/ascalon $ tar -xvf TQJ-BZ2-WUL.tar
audio-daemon-config.json
audio-daemon-setup.sh
README.md
Installing Audio Sender Daemon
You should check README.md just in case the instructions have changed after this guide was written.
First, lets make sure the setup script is executable but running this command.
chmod u+x audio-daemon-setup.sh
Run the setup script. If the java version is 9 or higher you will see output like this:
pi@pi01:~/ascalon $ ./audio-daemon-setup.sh
Setup for Voicegain Audio Sender Daemon ver. 1.3.3_beta
Checking java version
/usr/bin/java
Found java executable in PATH
Installed Java version 9-Raspbian (009000)
OK - Java version is 1.9 or higher
Downloading Voicegain Audio Sender Daemon
--2020-03-20 16:00:25-- https://f002.backblazeb2.com/file/voicegain-cdn/vg-audio-sender-daemon-1.3.3_beta.jar
Resolving f002.backblazeb2.com (f002.backblazeb2.com)... 206.190.215.16
Connecting to f002.backblazeb2.com (f002.backblazeb2.com)|206.190.215.16|:443... connected.
HTTP request sent, awaiting response... 200
Length: 40783012 (39M) [application/jar]
Saving to: ‘vg-audio-sender-daemon-1.3.3_beta.jar’
vg-audio-sender-daemon-1.3.3_b 100%[====================================================>] 38.89M 9.26MB/s in 4.8s
Last-modified header missing -- time-stamps turned off.
2020-03-20 16:00:31 (8.08 MB/s) - ‘vg-audio-sender-daemon-1.3.3_beta.jar’ saved [40783012/40783012]
FINISHED --2020-03-20 16:00:31--
Total wall clock time: 5.9s
Downloaded: 1 files, 39M in 4.8s (8.08 MB/s)
Downloading java launch script
--2020-03-20 16:00:31-- https://raw.githubusercontent.com/voicegain/platform/master/audio-sender/bootstrap-bundle/java-launch-audio-daemon.sh
Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 151.101.64.133, 151.101.128.133, 151.101.192.133, ...
Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|151.101.64.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 265 [text/plain]
Saving to: ‘java-launch-audio-daemon.sh’
java-launch-audio-daemon.sh 100%[====================================================>] 265 --.-KB/s in 0s
Last-modified header missing -- time-stamps turned off.
2020-03-20 16:00:31 (2.86 MB/s) - ‘java-launch-audio-daemon.sh’ saved [265/265]
Downloading daemon start script
--2020-03-20 16:00:31-- https://raw.githubusercontent.com/voicegain/platform/master/audio-sender/bootstrap-bundle/start-audio-daemon.sh
Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 151.101.128.133, 151.101.192.133, 151.101.0.133, ...
Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|151.101.128.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 464 [text/plain]
Saving to: ‘start-audio-daemon.sh’
start-audio-daemon.sh 100%[====================================================>] 464 --.-KB/s in 0s
Last-modified header missing -- time-stamps turned off.
2020-03-20 16:00:31 (2.08 MB/s) - ‘start-audio-daemon.sh’ saved [464/464]
Setup done.
You can view available audio devices by running
./list-audio-devices.sh
You can launch Voicegain Audio Daemon by running
./start-audio-daemon.sh
Setting the Audio Source
Now we could launch the daemon using the start-audio-daemon.sh command, however, it is possible that the default audio source number in the start-audio-daemon.sh script does not correspond to the audio source that provides the audio on your system.
You can list the available audio sources using list-audio-devices.sh script. It will output something like this:
Available audio input outputs:
(1) [mixer=Port Internal Microphone (Conexant I, version 10.0, line=MICROPHONE source port]
(2) [mixer=Port Microphone (3- USB Audio Device, version 1.0, line=MICROPHONE source port]
(3) [mixer=Port Microphone (2- HD Pro Webcam C9, version 0.16, line=MICROPHONE source port]
(4) [mixer=Primary Sound Driver, version Unknown Version, line=interface SourceDataLine supporting 8 audio formats, and buffers of at least 32 bytes]
(5) [mixer=Primary Sound Driver, version Unknown Version, line=interface Clip supporting 8 audio formats, and buffers of at least 32 bytes]
(6) [mixer=Speakers (3- USB Audio Device), version Unknown Version, line=interface SourceDataLine supporting 8 audio formats, and buffers of at least 32 bytes]
(7) [mixer=Speakers (3- USB Audio Device), version Unknown Version, line=interface Clip supporting 8 audio formats, and buffers of at least 32 bytes]
(8) [mixer=SAMSUNG (Intel(R) Display Audio), version Unknown Version, line=interface SourceDataLine supporting 8 audio formats, and buffers of at least 32 bytes]
(9) [mixer=SAMSUNG (Intel(R) Display Audio), version Unknown Version, line=interface Clip supporting 8 audio formats, and buffers of at least 32 bytes]
(10) [mixer=Speakers (Conexant ISST Audio), version Unknown Version, line=interface SourceDataLine supporting 8 audio formats, and buffers of at least 32 bytes]
(11) [mixer=Speakers (Conexant ISST Audio), version Unknown Version, line=interface Clip supporting 8 audio formats, and buffers of at least 32 bytes]
(12) [mixer=Speakers (USB Audio Device), version Unknown Version, line=interface SourceDataLine supporting 8 audio formats, and buffers of at least 32 bytes]
(13) [mixer=Speakers (USB Audio Device), version Unknown Version, line=interface Clip supporting 8 audio formats, and buffers of at least 32 bytes]
From this list you need to pick the id (number in ()) of the correct device and then enter modify the SOURCE value in the start-audio-daemon.sh script
# Source value may have to be modified to match the correct Audio Input Device
SOURCE=5
Running the Daemon
After setting the audio source value you can start the daemon using:
./start-audio-daemon.sh
The audio daemon will run in the background. You can tail its logs to see what it is doing, e.g.
tail -100f audio-daemon.2020-05-16_18-23-54.log
If the daemon was started correctly and was able to establish connection to Voicegain platform you will see the status of its broadcast websocket change from "Offline" to "Online". You can then control the daemon remotely from the Web Console.
To shutdown the audio daemon you will need to kill it e.g.
pi@pi01:~/ascalon $ ps -aef | grep java
pi 15908 1 0 19:22 pts/0 00:00:00 /bin/bash ./java-launch-audio-daemon.sh --json audio-daemon-config.json --source 5 --log info --avc on
pi 15912 15908 99 19:22 pts/0 00:01:06 java -Xlog:gc:gc-audio-daemon.2021-01-18_19-22-45.log -Xms128m -Xmx128m -XX:+UseG1GC -XX:MaxGCPauseMillis=5 -jar vg-audio-sender-daemon-1.5.0.jar --json audio-daemon-config.json --source 5 --log info --avc on
pi 15986 15881 0 19:23 pts/0 00:00:00 grep --color=auto java
kill 15908
Comments
0 comments
Article is closed for comments.