Skip to content

Commit

Permalink
Merge pull request #826 from ftnext/tidy-third-party-directory
Browse files Browse the repository at this point in the history
Tidy up third-party directory
  • Loading branch information
ftnext authored Jan 30, 2025
2 parents dad115b + 7c0ac7a commit 6fec47e
Show file tree
Hide file tree
Showing 21 changed files with 6 additions and 55 deletions.
8 changes: 1 addition & 7 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -127,15 +127,11 @@ The installation instructions on the PyAudio website are quite good - for conven
* On OS X, install PortAudio using `Homebrew <http://brew.sh/>`__: ``brew install portaudio``. Then, install with PyAudio using `Pip <https://pip.readthedocs.org/>`__: ``pip install SpeechRecognition[audio]``.
* On other POSIX-based systems, install the ``portaudio19-dev`` and ``python-all-dev`` (or ``python3-all-dev`` if using Python 3) packages (or their closest equivalents) using a package manager of your choice, and then install with PyAudio using `Pip <https://pip.readthedocs.org/>`__: ``pip install SpeechRecognition[audio]`` (replace ``pip`` with ``pip3`` if using Python 3).

PyAudio `wheel packages <https://pypi.python.org/pypi/wheel>`__ for common 64-bit Python versions on Windows and Linux are included for convenience, under the ``third-party/`` `directory <https://github.com/Uberi/speech_recognition/tree/master/third-party>`__ in the repository root. To install, simply run ``pip install wheel`` followed by ``pip install ./third-party/WHEEL_FILENAME`` (replace ``pip`` with ``pip3`` if using Python 3) in the repository `root directory <https://github.com/Uberi/speech_recognition>`__.

PocketSphinx (for Sphinx users)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

`PocketSphinx <https://github.com/cmusphinx/pocketsphinx>`__ is **required if and only if you want to use the Sphinx recognizer** (``recognizer_instance.recognize_sphinx``).

`Pocketsphinx-Python <https://github.com/bambocher/pocketsphinx-python>`__ `wheel packages <https://pypi.python.org/pypi/wheel>`__ for 64-bit Python 3.4, and 3.5 on Windows are included for convenience, under the ``third-party/`` `directory <https://github.com/Uberi/speech_recognition/tree/master/third-party>`__. To install, simply run ``pip install wheel`` followed by ``pip install ./third-party/WHEEL_FILENAME`` (replace ``pip`` with ``pip3`` if using Python 3) in the SpeechRecognition folder.

On Linux and other POSIX systems (such as OS X), run ``pip install SpeechRecognition[pocketsphinx]``. Follow the instructions under "Building PocketSphinx-Python from source" in `Notes on using PocketSphinx <https://github.com/Uberi/speech_recognition/blob/master/reference/pocketsphinx.rst>`__ for installation instructions.

Note that the versions available in most package repositories are outdated and will not work with the bundled language data. Using the bundled wheel packages or building from source is recommended.
Expand Down Expand Up @@ -406,8 +402,6 @@ SpeechRecognition is made available under the 3-clause BSD license. See ``LICENS

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**.

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.

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.
SpeechRecognition distributes 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`` for license details for individual parts.

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.
15 changes: 5 additions & 10 deletions reference/pocketsphinx.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ Once installed, you can simply specify the language using the ``language`` param
Building PocketSphinx-Python from source
----------------------------------------

For Windows, it is recommended to install the precompiled Wheel packages in the ``third-party`` directory. These are provided because building Pocketsphinx on Windows requires a lot of work, and can take hours to download and install all the surrounding software.

For Linux and other POSIX systems (like OS X), you'll want to build from source. It should take less than two minutes on a fast machine.

* On any Debian-derived Linux distributions (like Ubuntu and Mint):
Expand All @@ -47,15 +45,12 @@ For Linux and other POSIX systems (like OS X), you'll want to build from source.
2. Install PocketSphinx-Python using Pip: ``pip install pocketsphinx``.
* On Windows:
1. Install `Python <https://www.python.org/downloads/>`__, `Pip <https://pip.pypa.io/en/stable/installing/>`__, `SWIG <http://www.swig.org/download.html>`__, and `Git <https://git-scm.com/downloads>`__, preferably using a package manager.
2. Install the necessary `compilers suite <http://blog.ionelmc.ro/2014/12/21/compiling-python-extensions-on-windows/>`__ (`here's a PDF version <https://github.com/Uberi/speech_recognition/blob/master/third-party/Compiling%20Python%20extensions%20on%20Windows.pdf>`__ in case the link goes down) for compiling modules for your particular Python version:
* `Visual Studio 2015 Community Edition <https://www.visualstudio.com/downloads/download-visual-studio-vs>`__ for Python 3.5.
* The installation process for Python 3.4 is outlined in the article above.
3. Add the folders containing the Python, SWIG, and Git binaries to your ``PATH`` environment variable.
2. Add the folders containing the Python, SWIG, and Git binaries to your ``PATH`` environment variable.
* My ``PATH`` environment variable looks something like: ``C:\Users\Anthony\Desktop\swigwin-3.0.8;C:\Program Files\Git\cmd;(A BUNCH OF OTHER PATHS)``.
4. Reboot to apply changes.
5. Download the full PocketSphinx-Python source code by running ``git clone --recursive --depth 1 https://github.com/cmusphinx/pocketsphinx-python`` (downloading the ZIP archive from GitHub will not work).
6. Run ``python setup.py install`` in the PocketSphinx-Python source code folder to compile and install PocketSphinx.
7. Side note: when I build the precompiled Wheel packages, I skip steps 5 and 6 and do the following instead:
3. Reboot to apply changes.
4. Download the full PocketSphinx-Python source code by running ``git clone --recursive --depth 1 https://github.com/cmusphinx/pocketsphinx-python`` (downloading the ZIP archive from GitHub will not work).
5. Run ``python setup.py install`` in the PocketSphinx-Python source code folder to compile and install PocketSphinx.
6. Side note: when I build the precompiled Wheel packages, I skip steps 5 and 6 and do the following instead:
* For Python 3.4: ``C:\Python34\python.exe setup.py bdist_wheel``.
* For Python 3.5: ``C:\Users\Anthony\AppData\Local\Programs\Python\Python35\python.exe setup.py bdist_wheel``.
* The resulting packages are located in the ``dist`` folder of the PocketSphinx-Python project directory.
Expand Down
Binary file not shown.
7 changes: 0 additions & 7 deletions third-party/LICENSE-PyAudio.txt

This file was deleted.

31 changes: 0 additions & 31 deletions third-party/LICENSE-Sphinx.txt

This file was deleted.

Binary file removed third-party/PyAudio-0.2.11-cp27-cp27m-win_amd64.whl
Binary file not shown.
Binary file removed third-party/PyAudio-0.2.11-cp34-cp34m-win_amd64.whl
Binary file not shown.
Binary file removed third-party/PyAudio-0.2.11-cp35-cp35m-win_amd64.whl
Binary file not shown.
Binary file removed third-party/PyAudio-0.2.11-cp36-cp36m-win_amd64.whl
Binary file not shown.
Binary file removed third-party/PyAudio-0.2.11.tar.gz
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed third-party/pocketsphinx-0.1.3.zip
Binary file not shown.

0 comments on commit 6fec47e

Please sign in to comment.