guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

branch master updated: gnu: Add python-pysox.


From: guix-commits
Subject: branch master updated: gnu: Add python-pysox.
Date: Mon, 29 Nov 2021 11:10:36 -0500

This is an automated email from the git hooks/post-receive script.

arunisaac pushed a commit to branch master
in repository guix.

The following commit(s) were added to refs/heads/master by this push:
     new 653bcab  gnu: Add python-pysox.
653bcab is described below

commit 653bcab96d70d25e98753681d48657fe6634f8c5
Author: jgart <jgart@dismail.de>
AuthorDate: Wed Nov 24 23:42:45 2021 -0500

    gnu: Add python-pysox.
    
    * gnu/packages/audio.scm (python-pysox): New variable.
    
    Signed-off-by: Arun Isaac <arunisaac@systemreboot.net>
---
 gnu/packages/audio.scm | 55 ++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 55 insertions(+)

diff --git a/gnu/packages/audio.scm b/gnu/packages/audio.scm
index 4b1a602..e7bcf04 100644
--- a/gnu/packages/audio.scm
+++ b/gnu/packages/audio.scm
@@ -34,6 +34,7 @@
 ;;; Copyright © 2020 Giacomo Leidi <goodoldpaul@autistici.org>
 ;;; Copyright © 2020, 2021 Vinicius Monego <monego@posteo.net>
 ;;; Copyright © 2020 Michael Rohleder <mike@rohleder.de>
+;;; Copyright © 2021 jgart <jgart@dismail.de>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -5532,6 +5533,60 @@ generator, generating audio signals out of Linux's 
/dev/dsp audio
 device.  There is support for mono and/or stereo and 8 or 16 bit samples.")
     (license license:gpl2)))
 
+(define-public python-pysox
+  ;; PyPi does not include the data folder containing audio files for testing.
+  (let ((commit "3d0053381c24ae3490f759d4de87194b85789d36")
+        (revision "0"))
+    (package
+      (name "python-pysox")
+      (version (git-version "1.4.2" revision commit))
+      (source
+       (origin
+         (method git-fetch)
+         (uri (git-reference
+               (url "https://github.com/rabitt/pysox";)
+               (commit commit)))
+         (file-name (git-file-name name version))
+         (sha256
+          (base32
+           "0i62jx92vfpcr2z7lp69yzqdi9idfs3pifl3rzm2akc2c4cr1mac"))))
+      (build-system python-build-system)
+      (arguments
+       `(#:phases
+         (modify-phases %standard-phases
+           (add-after 'unpack 'patch-sox
+             (lambda* (#:key inputs #:allow-other-keys)
+               (let* ((sox-store-path (assoc-ref inputs "sox"))
+                      (sox-bin (string-append sox-store-path "/bin/sox")))
+                 (substitute* "sox/__init__.py"
+                   (("sox -h")
+                    (string-append sox-bin " -h")))
+                 (substitute* "sox/core.py"
+                   (("\\['sox")
+                    (string-append "['" sox-bin))))))
+           (replace 'check
+             (lambda* (#:key inputs outputs tests? #:allow-other-keys)
+               (when tests?
+                 (add-installed-pythonpath inputs outputs)
+                 (invoke "pytest")))))))
+      (propagated-inputs
+       `(("python-numpy" ,python-numpy)
+         ("python-typing-extensions" ,python-typing-extensions)))
+      (native-inputs
+       `(("sox" ,sox)
+         ("python-pytest" ,python-pytest)
+         ("python-pytest-cov" ,python-pytest-cov)
+         ("python-soundfile" ,python-soundfile)))
+      (home-page "https://github.com/rabitt/pysox";)
+      (synopsis "Python wrapper around SoX")
+      (description "@code{python-pysox} is a wrapper around the @command{sox}
+command line tool.  The API offers @code{Transformer} and @code{Combiner}
+classes that allow the user to incrementally build up effects and audio
+manipulations.  @code{python-pysox} also provides methods for querying audio
+information such as sample rate, determining whether an audio file is silent,
+and much more.")
+      (license license:bsd-3))))
+
 (define-public mda-lv2
   (package
     (name "mda-lv2")



reply via email to

[Prev in Thread] Current Thread [Next in Thread]