Skip to content

Commit 7bba545

Browse files
committed
Make licensing info clearer, update all the FLAC binaries, fix issue template
1 parent c111915 commit 7bba545

10 files changed

+377
-12
lines changed

.github/ISSUE_TEMPLATE.md

+2
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ System information
2020

2121
(Delete all the statements that don't apply.)
2222

23+
My **Python version** is <INSERT VERSION HERE>. (You can check this by running `python -V`.)
24+
2325
My **SpeechRecognition library version** is <INSERT VERSION HERE>. (You can check this by running `python -c "import speech_recognition as sr;print(sr.__version__)"`.)
2426

2527
My **PyAudio library version** is <INSERT VERSION HERE> / I don't have PyAudio installed. (You can check this by running `python -c "import pyaudio as p;print(p.__version__)"`.)

LICENSE-FLAC.txt

+339
Large diffs are not rendered by default.

MANIFEST.in

+1
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ graft reference
33
recursive-exclude speech_recognition *.pyc
44
include README.rst
55
include LICENSE.txt
6+
include LICENSE-FLAC.txt

README.rst

+33-10
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
Speech Recognition
2-
==================
1+
SpeechRecognition
2+
=================
33

44
.. image:: https://img.shields.io/pypi/dm/SpeechRecognition.svg
55
:target: https://pypi.python.org/pypi/SpeechRecognition/
@@ -120,10 +120,31 @@ See `Notes on using PocketSphinx <https://github.com/Uberi/speech_recognition/bl
120120
FLAC (for some systems)
121121
~~~~~~~~~~~~~~~~~~~~~~~
122122

123-
A FLAC encoder is required to encode the audio data to send to the API. If using Windows, OS X, or Linux on an i385-compatible architecture, the encoder is already bundled with this library - you do not need to install anything else.
123+
A `FLAC encoder <https://xiph.org/flac/>`__ is required to encode the audio data to send to the API. If using Windows (x86 or x86-64), OS X (Intel Macs only, OS X 10.6 or higher), or Linux (x86 or x86-64), the encoder is already bundled with this library - you do not need to install anything else.
124124

125125
Otherwise, ensure that you have the ``flac`` command line tool, which is often available through the system package manager.
126126

127+
The included ``flac-win32`` executable is the `official FLAC 1.3.1 32-bit Windows binary <http://downloads.xiph.org/releases/flac/flac-1.3.1-win.zip>`__.
128+
129+
The included ``flac-linux-x86`` executable is built from the `FLAC 1.3.1 source code <http://downloads.xiph.org/releases/flac/flac-1.3.1.tar.xz>`__ with `Holy Build Box <http://phusion.github.io/holy-build-box/>`__ to ensure that it's compatible with a wide variety of distributions. The exact commands used are:
130+
131+
```bash
132+
# download and extract the FLAC source code
133+
wget http://downloads.xiph.org/releases/flac/flac-1.3.1.tar.xz
134+
tar xf flac-1.3.1.tar.xz
135+
sudo docker run --tty --interactive --volume "$(pwd):/root" --rm phusion/holy-build-box-32:latest /hbb_exe/activate-exec bash # download an start a shell inside the Holy Build Box
136+
137+
# we're now in a Bash shell inside the Docker image
138+
cd /root/flac-1.3.1
139+
./configure LDFLAGS=-static # compiler flags to make a static build
140+
make
141+
exit # return to the original shell
142+
```
143+
144+
The resulting executable can then be found at ``flac-1.3.1/src/flac`` in the build directory. A copy of the source code can also be found at ``third-party/flac-1.3.1.tar.xz``.
145+
146+
The included ``flac-mac`` executable is extracted from `xACT 2.37 <http://xact.scottcbrown.org/>`__, which is a frontend for FLAC that conveniently includes binaries for all of its encoders. Specifically, it is a copy of ``xACT 2.37/xACT.app/Contents/Resources/flac`` in ``xACT2.37.zip``.
147+
127148
Troubleshooting
128149
---------------
129150

@@ -201,9 +222,9 @@ For errors of the form "ALSA lib [...] Unknown PCM", see `this StackOverflow ans
201222
On OS X, I get a ``ChildProcessError`` saying that it couldn't find the system FLAC converter, even though it's installed.
202223
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
203224

204-
Installing [FLAC for OS X](https://xiph.org/flac/download.html) directly from the source code will not work, since it doesn't correctly add the executables to the search path.
225+
Installing `FLAC for OS X <https://xiph.org/flac/download.html>`__ directly from the source code will not work, since it doesn't correctly add the executables to the search path.
205226

206-
Installing FLAC using [Homebrew](http://brew.sh/) ensures that the search path is correctly updated. First, ensure you have Homebrew, then run ``brew install flac`` to install the necessary files.
227+
Installing FLAC using `Homebrew <http://brew.sh/>`__ ensures that the search path is correctly updated. First, ensure you have Homebrew, then run ``brew install flac`` to install the necessary files.
207228

208229
Developing
209230
----------
@@ -252,12 +273,14 @@ Also check out the `Python Baidu Yuyin API <https://github.com/DelightRun/PyBaid
252273
License
253274
-------
254275

255-
Copyright 2014-2016 `Anthony Zhang (Uberi) <https://uberi.github.io>`__.
276+
Copyright 2014-2016 `Anthony Zhang (Uberi) <https://uberi.github.io>`__. The source code for this library is available online at `GitHub <https://github.com/Uberi/speech_recognition>`__.
277+
278+
SpeechRecognition is made available under the 3-clause BSD license. See ``LICENSE.txt`` in the project's root directory for more information.
256279

257-
The source code is available online at `GitHub <https://github.com/Uberi/speech_recognition>`__.
280+
For convenience, all the official distributions of SpeechRecognition already include a copy of the necessary copyright notices and licenses. In your project, you can simply **say that licensing information for SpeechRecognition can be found within the SpeechRecognition README, and make sure SpeechRecognition is visible to users if they wish to see it**.
258281

259-
This program is made available under the 3-clause BSD license. See ``LICENSE.txt`` in the project's root directory for more information.
282+
SpeechRecognition distributes source code, binaries, and language files from `CMU Sphinx <http://cmusphinx.sourceforge.net/>`__. These files are BSD-licensed and redistributable as long as copyright notices are correctly retained. See ``speech_recognition/pocketsphinx-data/*/LICENSE*.txt`` and ``third-party/LICENSE-Sphinx.txt`` for license details for individual parts.
260283

261-
This program distributes source code, binaries, and language files from `CMU Sphinx <http://cmusphinx.sourceforge.net/>`__. These files are BSD-licensed and redistributable as long as copyright notices are correctly retained. See ``speech_recognition/pocketsphinx-data/*/LICENSE*.txt`` and ``third-party/LICENSE-Sphinx.txt`` for details concerning individual files.
284+
SpeechRecognition distributes source code and binaries from `PyAudio <http://people.csail.mit.edu/hubert/pyaudio/>`__. These files are MIT-licensed and redistributable as long as copyright notices are correctly retained. See ``third-party/LICENSE-PyAudio.txt`` for license details.
262285

263-
This program distributes source code and binaries from `PyAudio <http://people.csail.mit.edu/hubert/pyaudio/>`__. These files are MIT-licensed and redistributable as long as copyright notices are correctly retained. See license files inside ``third-party/LICENSE-PyAudio.txt`` for details concerning individual files.
286+
SpeechRecognition distributes binaries from `FLAC <https://xiph.org/flac/>`__ - ``speech_recognition/flac-win32.exe``, ``speech_recognition/flac-linux-x86``, and ``speech_recognition/flac-mac``. These files are GPLv2-licensed and redistributable, as long as the terms of the GPL are satisfied. The FLAC binaries are an `aggregate <https://www.gnu.org/licenses/gpl-faq.html#MereAggregation>`__ of `separate programs <https://www.gnu.org/licenses/gpl-faq.html#NFUseGPLPlugins>`__, so these GPL restrictions do not apply to the library or your programs that use the library, only to FLAC itself. See ``LICENSE-FLAC.txt`` for license details.

speech_recognition/__init__.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"""Library for performing speech recognition, with support for several engines and APIs, online and offline."""
44

55
__author__ = "Anthony Zhang (Uberi)"
6-
__version__ = "3.3.3"
6+
__version__ = "3.4.0"
77
__license__ = "BSD"
88

99
import io, os, subprocess, wave, base64
@@ -273,7 +273,7 @@ def get_flac_data(self, convert_rate = None, convert_width = None):
273273
if system == "Windows" and platform.machine() in ["i386", "x86", "x86_64", "AMD64"]: # Windows NT, use the bundled FLAC conversion utility
274274
flac_converter = os.path.join(path, "flac-win32.exe")
275275
elif system == "Linux" and platform.machine() in ["i386", "x86", "x86_64", "AMD64"]:
276-
flac_converter = os.path.join(path, "flac-linux-i386")
276+
flac_converter = os.path.join(path, "flac-linux-x86")
277277
elif system == "Darwin" and platform.machine() in ["i386", "x86", "x86_64", "AMD64"]:
278278
flac_converter = os.path.join(path, "flac-mac")
279279
else:

speech_recognition/flac-linux-i386

-862 KB
Binary file not shown.

speech_recognition/flac-linux-x86

657 KB
Binary file not shown.

speech_recognition/flac-mac

238 KB
Binary file not shown.

speech_recognition/flac-win32.exe

453 KB
Binary file not shown.

third-party/flac-1.3.1.tar.xz

920 KB
Binary file not shown.

0 commit comments

Comments
 (0)