Package: saraswati
SaraswatiAboutSaraswati is a robust, multi-channel audio recording, transmission and storage
system. The system is designed for flexible field recording of audio signals in
environmental monitoring systems.Saraswati is developed by an independent community of scientists from different
domains working collaboratively on this project. You are welcome to join our
efforts.EtymologySaraswatiis the
Hindu goddess of knowledge, music, art, wisdom and learning.TechnologiesThe software is based onGStreamerand theGStreamer Python Bindings, in
turn using the finePyGObjectunder the hood. It is designed to run onSingle-board computer (SBC)systems as well as larger machines.StatusThe software was tested successfully with Python 3.7-3.9, GStreamer 1.10.4,
1.14.4, 1.16.2 and 1.18.4, on both Linux (Debian 10 buster, Debian 11 bullseye,
Linux Mint 20.2) and macOS (Catalina 10.15.7).SetupThis part of the documentation covers the basic installation of Saraswati.
The first step to using any software package is getting it properly installed.
Please read this section carefully.When aiming to run Saraswati autonomously in a production setup, please also
consider reading the documentation aboutrunning Saraswati in production.Install prerequisitesAs Saraswati is based onGStreamerand, optionally,ALSA, let’s install the
relevant packages.Debian-based systemssudo apt-get update
sudo apt-get install --yes libgstreamer1.0 gstreamer1.0-tools gstreamer1.0-alsa gstreamer1.0-plugins-base gstreamer1.0-plugins-good
sudo apt-get install --yes python3 python3-pip python3-gst-1.0 python3-gi python3-tz
sudo apt-get install --yes alsa-utils mkvtoolnix flacmacOS systemsbrew install gstreamer gst-python gst-libav gst-plugins-base gst-plugins-good
brew install mkvtoolnix flacConfigure systemSynchronize system time with NTP, this is important for appropriate timestamping:sudo timedatectl set-ntp trueInstall SaraswatiInstallsaraswatipackage from PyPI:pip install saraswatiTo quickly verify the installation, invoke:saraswati record --channel="testdrive source=autoaudiosrc"UsageThis part of the documentation covers how to run Saraswati interactively.
Please read this section carefully.When aiming to run Saraswati autonomously in a production setup, please also
consider reading the documentation aboutrunning Saraswati in production.Recording audiosaraswati recordis an implementation toingest audio from a GStreamer audio source element,run it throughflacencto encode audio with the FLAC lossless audio
encoder, andfinally store it usingsplitmuxsink, a GStreamer component which
multiplexes incoming streams into multiple time- or size-limited filesEach audio fragment will be timestamped with the current date/time
information in an ISO8601-like format, using a qualified UTC offset of+0000.In order to learn about the command line syntax, please invokesaraswati--helporsaraswati record--help.Uploading audioWhen the--upload=option is given, Saraswati will attempt to upload
its spool directory to an rsync target. By default, it will do this each
5 minutes.Please notersyncwill be invoked using the--remove-source-filesoption. So, after successful upload, the spooled files on the local machine
will get purged.ExampleInvoke:saraswati record --channel="testdrive source=autoaudiosrc"This will yield audio fragments in chunks worth of 5 minutes each:recording_testdrive_20210621T155817+0000_0000.mka
recording_testdrive_20210621T160317+0000_0001.mka
recording_testdrive_20210621T160817+0000_0002.mka
recording_testdrive_20210621T161317+0000_0003.mka
recording_testdrive_20210621T161817+0000_0004.mkaDisplay segment metadata information embedded into the Matroska container file:mkvinfo recording_testdrive_20210620T122642+0000_0065.mka | grep -E 'Codec|Date|duration'
| + Date: Sun Jun 20 12:26:42 2021 UTC
|  + Default duration: 00:00:00.104489796 (9.570 frames/fields per second for a video track)
|  + Codec ID: A_FLACExtract audio track:mkvextract recording_testdrive_20210621T155817+0000_0000.mka tracks 0:audio_20210621T155817.flac
flac --decode audio_20210621T155817.flac

file recording_testdrive_20210621T155817+0000_0000.mka
Matroska data

file audio_20210621T155817.flac
FLAC audio bitstream data, 16 bit, mono, 48 kHz, length unknown

file audio_20210621T155817.wav
RIFF (little-endian) data, WAVE audio, Microsoft PCM, 16 bit, mono 48000 HzProject informationBackgroundThis software gets developed for the “Bee Observer” (BOB) project, a joint
endeavour initiated by theCognitive neuroinformatics group at the
University of Bremenand the people of the independent research and
development projectHiveeyes. See also:hiverize.org - Vernetzt. Smart. Imkern.The Hiveeyes ProjectUni Bremen und Hiveeyes werden als Citizen-Science-Projekte vom Forschungsministerium unterstütztSystem für kontinuierliche Audio-Aufzeichnung (BOB Projekt, Phase 1)DetailsThe “Saraswati” program is released under the GNU AGPL license.
Its source code lives onGitHuband
the Python package is published toPyPI.
You might also want to have a look at thedocumentation.If you’d like to contribute you’re most welcome!
Spend some time taking a look around, locate a bug, design issue or
spelling mistake and then send us a pull request or create an issue.Thanks in advance for your efforts, we really appreciate any help or feedback.Code licenseThe code is licensed under the GNU AGPL license. SeeLICENSEfile for details.Have fun!