In addition to the three network streaming modes, para_recv can also
operate in local (afh) mode. In this mode it writes the content of
an audio file on the local file system in complete chunks to stdout,
-optionally 'just in time'. This allows to cut an audio file without
-first decoding it, and it enables third-party software which is unaware
-of the particular audio format to send complete frames in real time.
+optionally 'just in time'. This allows cutting audio files without
+decoding, and it enables third-party software which is unaware of
+the particular audio format to send complete frames in real time.
<h3> para_filter </h3>
cd osl && make && sudo make install && sudo ldconfig
sudo apt-get install autoconf libssl-dev m4 \
libmad0-dev libid3tag0-dev libasound2-dev libvorbis-dev \
- libfaad-dev libspeex-dev libFLAC-dev libsamplerate-dev realpath \
+ libfaad-dev libspeex-dev libflac-dev libsamplerate-dev \
libasound2-dev libao-dev libreadline-dev libncurses-dev \
libopus-dev
git clone git://git.tuebingen.mpg.de/lopsub
- [gcc](ftp://ftp.gnu.org/pub/gnu/gcc) or
-[clang](http://clang.llvm.org). All gcc versions >= 4.2 are currently
-supported. Clang version 1.1 or newer should work as well.
+[clang](http://clang.llvm.org). All gcc versions >= 5.4 are currently
+supported. Moderately recent versions of clang should work as well.
- [gnu make](ftp://ftp.gnu.org/pub/gnu/make) is also shipped with the
disto. On BSD systems the gnu make executable is often called gmake.
you need libogg, libvorbis, libvorbisfile. The corresponding Debian
packages are called `libogg-dev` and `libvorbis-dev`.
-- [libfaad and mp4ff](http://www.audiocoding.com/). For aac files
+- [libfaad and mp4ff](https://sourceforge.net/projects/faac/). For aac files
(m4a) you need libfaad and libmp4ff (package: `libfaad-dev`). Note
that for some distributions, e.g. Ubuntu, mp4ff is not part of the
libfaad package. Install the faad library from sources (available
Next, change to the "bar" account on client_host and generate the
key pair with the commands
- ssh-keygen -q -t rsa -b 2048 -N '' -f $key
+ ssh-keygen -q -t rsa -b 2048 -N '' -m RFC4716
This generates the two files id_rsa and id_rsa.pub in ~/.ssh. Note
that para_server won't accept keys shorter than 2048 bits. Moreover,
para_client init
This initializes a couple of empty tables under
-~/.paraslash/afs_database-0.4. You normally don't need to look at these
+~/.paraslash/afs_database-0.7. You normally don't need to look at these
tables, but it's good to know that you can start from scratch with
- rm -rf ~/.paraslash/afs_database-0.4
+ rm -rf ~/.paraslash/afs_database-0.7
in case something went wrong.
- para_client receives the encrypted buffer and decrypts it with the
user's private key, thereby obtaining the challenge buffer and the
-session key. It sends the SHA1 hash value of the challenge back to
-para_server and stores the session key for further use.
+session key. It hashes the challenge buffer with a crytographic hash
+function, sends the hash value back to para_server and stores the
+session key for further use.
-- para_server also computes the SHA1 hash of the challenge and compares
+- para_server also computes the hash value of the challenge and compares
it against what was sent back by the client.
- If the two hashes do not match, the authentication has failed and
paraslash relies on the quality of the pseudo-random bytes provided
by the crypto library (openssl or libgcrypt), on the security of
the implementation of the RSA and AES crypto routines and on the
-infeasibility to invert the SHA1 function.
+infeasibility to invert the hash function.
Neither para_server or para_client create RSA keys on their
own. This has to be done once for each user as sketched in
AFS database. It contains the information needed to stream each audio
file. In particular the following data is stored for each audio file.
-- SHA1 hash value of the audio file contents. This is computed once
-when the file is added to the database. Whenever AFS selects this
-audio file for streaming the hash value is recomputed and checked
-against the value stored in the database to detect content changes.
+- The cryptographic hash value of the audio file contents. This is
+computed once when the file is added to the database. Whenever AFS
+selects this audio file for streaming the hash value is recomputed
+and checked against the value stored in the database to detect
+content changes.
- The time when this audio file was last played.
`bitrate` | integer | The average bitrate
`frequency` | integer | The output sample rate
`channels` | integer | The number of channels
+`duration` | integer | The number of milliseconds
`is_set("foo")` | boolean | True if attribute "foo" is set.
[\*] For most audio formats, the year tag is stored as a string. It
File renames and content changes
--------------------------------
-Since the audio file selector knows the SHA1 of each audio file that
+Since the audio file selector knows the hash of each audio file that
has been added to the afs database, it recognizes if the content of
a file has changed, e.g. because an ID3 tag was added or modified.
Also, if a file has been renamed or moved to a different location,
case you'll have to run the oslfsck program of libosl to fix your
database:
- oslfsck -fd ~/.paraslash/afs_database-0.4
+ oslfsck -fd ~/.paraslash/afs_database-0.7
However, make sure para_server isn't running before executing oslfsck.
If you don't mind to recreate your database you can start
from scratch by removing the entire database directory, i.e.
- rm -rf ~/.paraslash/afs_database-0.4
+ rm -rf ~/.paraslash/afs_database-0.7
Be aware that this removes all attribute definitions, all playlists
and all mood definitions and requires to re-initialize the tables.
all. The wav filter is only useful with para_filter and in connection
with a decoder. It asks the decoder for the number of channels and the
sample rate of the stream and adds a Microsoft wave header containing
-this information at the beginning. This allows to write wav files
+this information at the beginning. This allows writing wav files
rather than raw PCM files (which do not contain any information about
the number of channels and the sample rate).
operating on uncompressed audio streams, since data buffers are simply
"pushed down" rather than copied.
-Examples
---------
-
--> Decode an mp3 file to wav format:
-
- para_filter -f mp3dec -f wav < file.mp3 > file.wav
-
--> Amplify a raw audio file by a factor of 1.5:
-
- para_filter -f amp --amp 32 < foo.raw > bar.raw
-
======
Output
======
also limited. For example only one application can open the device
at any time. The OSS writer is activated by default on BSD Systems.
-- *FILE*. The file writer allows to capture the audio stream and
-write the PCM data to a file on the file system rather than playing
+- *FILE*. The file writer allows capturing the audio stream and
+writing the PCM data to a file on the file system rather than playing
it through a sound device. It is supported on all platforms and is
always compiled in.
- Don't leave whitespace at the end of lines.
- The limit on the length of lines is 80 columns.
- Use K&R style for placing braces and spaces:
-
+<pre>
if (x is true) {
we do y
}
-
+</pre>
- Use a space after (most) keywords.
- Do not add spaces around (inside) parenthesized expressions.
- Use one space around (on each side of) most binary and ternary operators.