Your message dated Wed, 05 Feb 2020 21:20:41 +0000
with message-id <[email protected]>
and subject line Bug#776244: fixed in lv2file 0.84-1
has caused the Debian Bug report #776244,
regarding lv2file: [PATCH] allow piping raw FP audio from stdin to stdout
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
776244: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=776244
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: lv2file
Version: 0.83-1
Severity: wishlist
Tags: patch

This allows lv2file to be used in a pipeline with other programs
which work with raw floating point audio data, such as sox and
ecasound.

An example using sox and sc4 is below:

sox -V3 foo.flac -tf32 -r48000 - \
  | lv2file -i - -o - -r48000 -n2 \
    -c 1:left_in -c 2:right_in \
    -p attack:5 -p release:5 \
    -p threshold:-6 -p makeup_gain:5 -p knee:6 -p ratio:2 \
    http://plugin.org.uk/swh-plugins/sc4 \
  | sox -r48000 -t f32 -c2 - -b16 -r 48000 foo.ogg

This can be useful for real-time playback systems using
sox/ecasound, such as dtas-player in dtas <http://dtas.80x24.org/>
>From 61a2f330c030544055c4f546966254722363e063 Mon Sep 17 00:00:00 2001
From: Eric Wong <[email protected]>
Date: Sun, 6 Oct 2013 04:00:48 +0000
Subject: [PATCH] allow piping raw FP audio from stdin to stdout

This allows lv2file to be used in a pipeline with other programs
which work with raw floating point audio data, such as sox and
ecasound.

An example using sox and sc4 is below:

sox -V3 foo.flac -tf32 -r48000 - \
  | lv2file -i - -o - -r48000 -n2 \
    -c 1:left_in -c 2:right_in \
    -p attack:5 -p release:5 \
    -p threshold:-6 -p makeup_gain:5 -p knee:6 -p ratio:2 \
    http://plugin.org.uk/swh-plugins/sc4 \
  | sox -r48000 -t f32 -c2 - -b16 -r 48000 foo.ogg

This can be useful for real-time playback systems using
sox/ecasound, such as dtas-player in dtas <http://dtas.80x24.org/>
---
 README           |  9 +++++++++
 debian/lv2file.1 | 10 ++++++++++
 lv2file.c        | 33 ++++++++++++++++++++++++++++++---
 3 files changed, 49 insertions(+), 3 deletions(-)

diff --git a/README b/README
index 65a589a..299f802 100644
--- a/README
+++ b/README
@@ -19,6 +19,8 @@ lv2file --nameports PLUGIN
 lv2file -i IFILE -o OFILE -c CHANNEL:PORT -p PORT:VALUE PLUGIN
   * Applies the PLUGIN to to IFILE and outputs the results to OFILE. 
 
+lv2file -i - -o - -r RATE -n CHANNELS -c CHANNEL:PORT -p PORT:VALUE PLUGIN
+  * read raw 32-bit floating point samples of sample rate RATE and CHANNELS from stdin and output to stdout.
 
 ==Example==
     lv2file -c 1:voice -p pitch_correction:1 -i speechsample.wav -o outfile.wav http://hyperglitch.com/dev/VocProc
@@ -45,5 +47,12 @@ You should note that because lv2file uses LV2 plugins, the VALUES will always be
 ===-b===
 The option -b, or --blocksize, controls the size of the chunks the audio is processed in.  Larger sizes may be slightly faster, but will use more memory.  The default is 512 frames.
 
+===-n===
+
+The option -n should be used to specify the input/output channel count to read from stdin and write to stdout.  This must be combined with -r/--rate
+
+===-r==
+The option -r should be used to specify the input/output sample rate when reading from stdin and writing to stdout.  This must be combined with -n/--channels.
+
 ===--ignore-clipping===
 By default, lv2file will check every sample for clipping and will warn the user if any clipping occurs.  However, if know that the effect won't produce clipping, or you don't care if it does, you can use this option to turn off the check for clipping.  This will make lv2file run slightly faster.
diff --git a/debian/lv2file.1 b/debian/lv2file.1
index 80405f3..56eb9ad 100644
--- a/debian/lv2file.1
+++ b/debian/lv2file.1
@@ -60,9 +60,19 @@ List all the input and control ports for the specified plugin.
 .TP
 .B \-i \fIFILE\fR
 Input the audio from a given FILE.  Most common sampled audio formats are supported.
+If "-" is given and "--channels" and "--rate" are both specified, then input
+will be read as raw, 32-bit floating point samples from stdin.
 .TP
 .B \-o \fIFILE\fR
 Output to given FILE.
+If "-" is given and "--channels" and "--rate" are both specified, then output
+will be written as raw, 32-bit floating point samples to stdout.
+.TP
+.B \-n, \-\-channels \fICHANNELS\fR
+Specify the channel count when reading from stdin and writing to stdout.
+.TP
+.B \-r, \-\-rate \fIRATE\fR
+Specify the sample rate reading from stdin and writing to stdout.
 .TP
 .B \-c, \-\-connect \fICHANNEL\fR:\fIPORT\fR
 Connect the channel CHANNEL in the input file to the audio port PORT of the plugin.
diff --git a/lv2file.c b/lv2file.c
index c63ee96..37857b9 100644
--- a/lv2file.c
+++ b/lv2file.c
@@ -1,3 +1,4 @@
+#include <unistd.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <sndfile.h>
@@ -218,14 +219,18 @@ int main(int argc, char** argv) {
 
 	struct arg_file* infile = arg_file1("i", NULL,"input", "Input sound file");
 	struct arg_file* outfile = arg_file1("o", NULL,"output", "Output sound file");
+	struct arg_int* rate = arg_int0("r","--rate","<int>", "sample rate for raw float data");
+	struct arg_int* channels = arg_int0("n","--channels","<int>", "channel count for raw float data");
 	struct arg_rex* controls = arg_rexn("p", "parameters","(\\w+:\\w+,?)*","<controlport>:<float>",0,200,REG_EXTENDED, "Pass a value to a plugin control port.");
 	pluginname = arg_str1(NULL,NULL,"plugin","The LV2 URI of the plugin");
 	struct arg_int* blksize = arg_int0("b","blocksize","<int>","Chunk size in which the sound is processed.  This is frames, not samples.");
 	struct arg_lit* mono = arg_lit0("m","mono","Mix all of the channels together before processing.");
 	struct arg_lit* ignore_clipping = arg_lit0(NULL,"ignore-clipping", "Do not check for clipping.  This option is slightly faster");
 	blksize->ival[0]=512;
+	rate->ival[0]=-1;
+	channels->ival[0]=-1;
 	struct arg_end *endarg = arg_end(20);
-	void *argtable[] = {infile, outfile,controls,connectargs,blksize,mono,ignore_clipping,pluginname, endarg};
+	void *argtable[] = {infile, outfile,rate,channels,controls,connectargs,blksize,mono,ignore_clipping,pluginname, endarg};
 	if (arg_nullcheck(argtable) != 0) {
 		fprintf(stderr,"Error: insufficient memory\n");
 		goto cleanup_argtable;
@@ -242,6 +247,11 @@ int main(int argc, char** argv) {
 		arg_print_glossary_gnu(stderr, argtable);
 		goto cleanup_argtable;
 	}
+	bool dopipe=(rate->ival[0]>0 && channels->ival[0]>0);
+	if ((rate->ival[0]<0 && channels->ival[0]>0) || (rate->ival[0]>0 && channels->ival[0]<0)) {
+		fprintf(stderr,"--rate/-r and --channels/-n must both be specified or not at all");
+		goto cleanup_argtable;
+	}
 
 	bool mixdown=mono->count;
 
@@ -252,7 +262,19 @@ int main(int argc, char** argv) {
 	}
 	SF_INFO formatinfo;
 	formatinfo.format=0;
-	SNDFILE* insndfile=sf_open(*(infile->filename), SFM_READ, &formatinfo);
+	SNDFILE* insndfile;
+	if (dopipe) {
+		memset(&formatinfo, 0, sizeof(SF_INFO));
+		formatinfo.format=SF_FORMAT_FLOAT | SF_FORMAT_RAW | SF_ENDIAN_CPU;
+		formatinfo.samplerate=rate->ival[0];
+		formatinfo.channels=channels->ival[0];
+	}
+	if (dopipe && !strcmp(*(infile->filename),"-")) {
+		insndfile=sf_open_fd(STDIN_FILENO, SFM_READ, &formatinfo, 0);
+	} else {
+		insndfile=sf_open(*(infile->filename), SFM_READ, &formatinfo);
+	}
+
 	int sndfileerr=sf_error(insndfile) ;
 	if(sndfileerr) {
 		fprintf(stderr,"Error reading input file: %s\n",sf_error_number(sndfileerr));
@@ -320,7 +342,12 @@ int main(int argc, char** argv) {
 			goto cleanup_sndfile;
 		}
 		formatinfo.channels=numout;
-		SNDFILE* outsndfile=sf_open(*(outfile->filename), SFM_WRITE, &formatinfo);
+		SNDFILE* outsndfile;
+		if (dopipe && !strcmp(*(outfile->filename),"-")) {
+			outsndfile=sf_open_fd(STDOUT_FILENO, SFM_WRITE, &formatinfo, 0);
+		} else {
+			outsndfile=sf_open(*(outfile->filename), SFM_WRITE, &formatinfo);
+		}
 
 		sndfileerr=sf_error(outsndfile) ;
 		if(sndfileerr) {
-- 
EW


--- End Message ---
--- Begin Message ---
Source: lv2file
Source-Version: 0.84-1

We believe that the bug you reported is fixed in the latest version of
lv2file, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to [email protected],
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Dennis Braun <[email protected]> (supplier of updated lv2file package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [email protected])


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

Format: 1.8
Date: Wed, 05 Feb 2020 21:52:25 +0100
Source: lv2file
Architecture: source
Version: 0.84-1
Distribution: unstable
Urgency: medium
Maintainer: Debian Multimedia Maintainers <[email protected]>
Changed-By: Dennis Braun <[email protected]>
Closes: 776244 852439
Changes:
 lv2file (0.84-1) unstable; urgency=medium
 .
   [ Felipe Sateler ]
   * Change maintainer address to [email protected]
 .
   [ Ondřej Nový ]
   * d/control: Set Vcs-* to salsa.debian.org
   * d/copyright: Use https protocol in Format field
 .
   [ Dennis Braun ]
   * New upstream release (Closes: #852439)
     + Allow piping raw FP audio from stdin to stdout (Closes: #776244)
   * d/control:
     + Use dh-compat instead of debian/compat
     + Bump dh-compat to 12
     + Bump Standards-Version to 4.5.0
     + Add me as uploader
     + Use https protocol for homepage
     + Set RRR: no
   * d/copyright:
     + Update source url
     + Update year
     + http > https
   * Add patch to fix the debug package
Checksums-Sha1:
 a45bbafe68363972ea52c674e8ca17e404d893ed 2037 lv2file_0.84-1.dsc
 8d92e246d73ace4c91fa423d624f5bff3565d450 7200 lv2file_0.84.orig.tar.gz
 f807fc788919e2e6f5b3eeb6bf40a485f751b537 4364 lv2file_0.84-1.debian.tar.xz
Checksums-Sha256:
 e43a10c188edfd7338181605a290a8c5557d8761f3b049c4b4a35ddd1937303a 2037 
lv2file_0.84-1.dsc
 2c63498a76c52f6712e5e5d0bce8686efd407364e1218cf0a698f1a7e52ad979 7200 
lv2file_0.84.orig.tar.gz
 0e7bcc5cc6d4f0d10242ed9e97fb19b9717905500bddaa0c7bb7b809dda005c6 4364 
lv2file_0.84-1.debian.tar.xz
Files:
 d4ef0e3fa9c24cf6958710fcb04c4b6c 2037 sound optional lv2file_0.84-1.dsc
 259719c6291d4b774db3e3a485e12d18 7200 sound optional lv2file_0.84.orig.tar.gz
 5708810c61a42d2184b812e4025f3f61 4364 sound optional 
lv2file_0.84-1.debian.tar.xz

-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEE94y6B4F7sUmhHTOQafL8UW6nGZMFAl47K9UACgkQafL8UW6n
GZOqJQ//ZsKMEI9IRc2o49AYWFhOxR+TCA5Ea3VJqUrq4M77zTibjGbDT1H+JQl1
Q12Z4YIzQmMfSjYE3gOccxLCiaCpPiWfIXfKUDlP7/aefQ3hA+XoUqFxX588j/u2
2a4jyZRRGNMgB/HZiKOhArcqQZMavHjcaLf053cXfRT7IF7T+lCJM64TnfrWqrQJ
+3o0EFzluLqi+BDBOz/Q82SzCymSXjxtb1FKvINegBnZuyYwc286rL6PYYePrc+Z
Zbsc8rVypZO5i5DNJ/TYyudJhcio7aKTwBFz7lvUUZ49RfA/yRJcRgTTt4zazlmF
XP6HFDCch28XV74+2BbUz+pR6VlRwYxw22paKnrm8/NiQ/v+ahlwyocxuufsDIzp
Qa4NJzWxnHB+c+bHfXyFQ3f28Z3KqrBxOkjKrhWWAYdR5MBI+U1gyldtfjfNnUBJ
7iwX3grgUzsYNc6W08aWQcOt6iaYyEG0/rEHKqFD38hm1emGdDNJdP07wLUj1MMf
kdIJoAcYfsBKEzVV9A0FkixXa/UKSpJQ4QjEAcgw2PEM1iEJ2Wh3f5r5FKlBhfvu
PqMN4IE3XQ0QdsL35G6ceI7RjXJ47vj5Cu0RqaHaA7fAGomu/UWpAcHvv51DZnh3
R99hSKlZzW02ZIt5FNjvGlECNmHBMfAmxvMpTuyybRK2UfDDqko=
=Uc24
-----END PGP SIGNATURE-----

--- End Message ---
_______________________________________________
pkg-multimedia-maintainers mailing list
[email protected]
https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/pkg-multimedia-maintainers

Reply via email to