Mac Sound Python Library

30.03.2020by
Mac Sound Python Library Rating: 5,0/5 1424 reviews

Play and Record Sound with Python Play and Record Sound with Python ¶ This Python module provides bindings for the PortAudio library and a few convenience functions to play and record NumPy arrays containing audio signals. We can make the computer speak with Python. Given a text string, it will speak the written words in the English language. This process is called Text To Speech (TTS). Related Course: The Complete Machine Learning Course with Python. Text to speech Pyttsx text to speech.

Latest version
  1. 22 rows  Oct 09, 2019  librosa uses soundfile and audioread to load audio files. Note that soundfile.
  2. Quick Arcade Library Introduction Video. Arcade is an easy-to-learn Python library for creating 2D video games. It is ideal for people learning to program, or developers that want to code a 2D game without learning a complex framework.

Released:

Pure Python, cross platform, single function module with no dependencies for playing sounds.

Project description

Pure Python, cross platform, single function module with no dependencies for playing sounds.

Installation

Install via pip:

Done.

If you insist on the (slightly) harder way of installing, from source,you know how to do it already and don’t need my help.

The latest version of the source code can be found at:https://github.com/TaylorSMarks/playsound

Quick Start

Once you’ve installed, you can really quickly verified that it works with just this:

Documentation

The playsound module contains only one thing - the function (also named) playsound.

It requires one argument - the path to the file with the sound you’d like to play. This may be a local file, or a URL.

There’s an optional second argument, block, which is set to True by default. Setting it to False makes the function run asynchronously.

On Windows, uses windll.winmm. WAVE and MP3 have been tested and are known to work. Other file formats may work as well.

On OS X, uses AppKit.NSSound. WAVE and MP3 have been tested and are known to work. In general, anything QuickTime can play, playsound should be able to play, for OS X.

On Linux, uses GStreamer. Known to work on Ubuntu 14.04 and ElementaryOSLoki. Support for the block argument is currently not implemented.

Requirements

Python Library List

I’ve only tested playsound it with Python 2.7 on Windows 7 and OS X 10.11, butI expect that it should work on Windows XP thru 10 at least, OS X 10.5 and newer,all versions of Linux, and Python 2.3 and newer.

Copyright

This software is Copyright (c) 2016 Taylor Marks <taylor@marksfam.com>.

See the bundled LICENSE file for more information.

Release historyRelease notifications

1.2.2

1.2.1

1.2.0

1.1.0

1.0.0

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for playsound, version 1.2.2
Filename, sizeFile typePython versionUpload dateHashes
Filename, size playsound-1.2.2-py2.py3-none-any.whl (6.0 kB) File type Wheel Python version py2.py3 Upload dateHashes
Close

Hashes for playsound-1.2.2-py2.py3-none-any.whl

Hashes for playsound-1.2.2-py2.py3-none-any.whl
AlgorithmHash digest
SHA2561e83750a5325cbccee03d6e751ba3e78c037ac95b95a3ba1f38d0c5aca9e1a34
MD530f7763f7ec70f351b0767eb71e289f3
BLAKE2-256f51610d897b0a83fb4b05b03a63d7a2667ab75f857f67f7062fd447dd3f49bf7
Latest version

Released:

multi-library, cross-platform audio decoding

Project description

Decode audio files using whichever backend is available. The librarycurrently supports:

  • Gstreamer via PyGObject.
  • Core Audio on Mac OS X via ctypes. (PyObjC not required.)
  • MAD via the pymad bindings.
  • FFmpeg or Libav via its command-line interface.
  • The standard library wave, aifc, and sunau modules (foruncompressed audio formats).
Library

Use the library like so:

Buffers in the file can be accessed by iterating over the object returned fromaudio_open. Each buffer is a bytes-like object (buffer, bytes, orbytearray) containing raw 16-bit little-endian signed integer PCMdata. (Currently, these PCM format parameters are not configurable, but thiscould be added to most of the backends.)

Additional values are available as fields on the audio file object:

  • channels is the number of audio channels (an integer).
  • samplerate is given in Hz (an integer).
  • duration is the length of the audio in seconds (a float).

The audio_open function transparently selects a backend that can read thefile. (Each backend is implemented in a module inside the audioreadpackage.) If no backends succeed in opening the file, a DecodeErrorexception is raised. This exception is only used when the file type isunsupported by the backends; if the file doesn’t exist, a standard IOErrorwill be raised.

A second optional parameter to audio_open specifies which backends to try(instead of trying them all, which is the default). You can use theavailable_backends function to get a list backends that are usable on thecurrent system.

Audioread is “universal” and supports both Python 2 (2.6+) and Python 3(3.2+).

Example

The included decode.py script demonstrates using this package toconvert compressed audio files to WAV files.

Version History

2.1.8
Fix an unhandled OSError when FFmpeg is not installed.
2.1.7
Properly close some filehandles in the FFmpeg backend (thanks to@RyanMarcus and @ssssam).The maddec backend now always produces bytes objects, like the otherbackends (thanks to @ssssam).Resolve an audio data memory leak in the GStreamer backend (thanks again to@ssssam).You can now optionally specify which specific backends audio_open shouldtry (thanks once again to @ssssam).On Windows, avoid opening a console window to run FFmpeg (thanks to @flokX).
2.1.6
Fix a “no such process” crash in the FFmpeg backend on Windows Subsystem forLinux (thanks to @llamasoft).Avoid suppressing SIGINT in the GStreamer backend on older versions ofPyGObject (thanks to @lazka).
2.1.5
Properly clean up the file handle when a backend fails to decode a file.Fix parsing of “N.M” channel counts in the FFmpeg backend (thanks to @piem).Avoid a crash in the raw backend when a file uses an unsupported number ofbits per sample (namely, 24-bit samples in Python < 3.4).Add a __version__ value to the package.
2.1.4
Fix a bug in the FFmpeg backend where, after closing a file, the program’sstandard input stream would be “broken” and wouldn’t receive any input.
2.1.3
Avoid some warnings in the GStreamer backend when using modern versions ofGLib. We now require at least GLib 2.32.
2.1.2
Fix a file descriptor leak when opening and closing many files usingGStreamer.
2.1.1
Just fix ReST formatting in the README.
2.1.0
The FFmpeg backend can now also use Libav’s avconv command.Fix a warning by requiring GStreamer >= 1.0.Fix some Python 3 crashes with the new GStreamer backend (thanks to@xix-xeaon).
2.0.0
The GStreamer backend now uses GStreamer 1.x via the newgobject-introspection API (and is compatible with Python 3).
1.2.2
When running FFmpeg on Windows, disable its crash dialog. Thanks tojcsaaddupuy.
1.2.1
Fix an unhandled exception when opening non-raw audio files (thanks toaostanin).Fix Python 3 compatibility for the raw-file backend.
1.2.0
Add support for FFmpeg on Windows (thanks to Jean-Christophe Saad-Dupuy).
1.1.0
Add support for Sun/NeXT Au files via the standard-library sunaumodule (thanks to Dan Ellis).
1.0.3
Use the rawread (standard-library) backend for .wav files.
1.0.2
Send SIGKILL, not SIGTERM, to ffmpeg processes to avoid occasional hangs.
1.0.1
When GStreamer fails to report a duration, raise an exception instead ofsilently setting the duration field to None.
1.0.0
Catch GStreamer’s exception when necessary components, such asuridecodebin, are missing.The GStreamer backend now accepts relative paths.Fix a hang in GStreamer when the stream finishes before it begins (whenreading broken files).Initial support for Python 3.
0.8
All decoding errors are now subclasses of DecodeError.
0.7
Fix opening WAV and AIFF files via Unicode filenames.
0.6
Make FFmpeg timeout more robust.Dump FFmpeg output on timeout.Fix a nondeterministic hang in the Gstreamer backend.Fix a file descriptor leak in the MAD backend.
0.5
Fix crash when FFmpeg fails to report a duration.Fix a hang when FFmpeg fills up its stderr output buffer.Add a timeout to ffmpeg tool execution (currently 10 seconds for each4096-byte read); a ReadTimeoutError exception is raised if the tool timesout.
0.4
Fix channel count detection for FFmpeg backend.
0.3
Fix a problem with the Gstreamer backend where audio files could be left openeven after the GstAudioFile was “closed”.
0.2
Fix a hang in the GStreamer backend that occurs occasionally on someplatforms.
0.1
Initial release.

Et Cetera

audioread is by Adrian Sampson. It is made available under the MITlicense. An alternative to this module is decoder.py.

Release historyRelease notifications

2.1.8

2.1.7

Python Sound Library Mac

2.1.6

2.1.5

2.1.4

2.1.3

2.1.2

2.1.1

2.1.0

2.0.0

1.2.1

Python audio library

1.2.0

1.0.3

1.0.2

1.0.1

1.0.0

0.8

0.7

Moving iphoto to external drive. Dec 11, 2018  If you just have your photos in a folder on your Mac, all you need to do is plug your external drive in and move them over. If you’re using another app that maintains a library, you’ll have to configure things within that app. Mar 18, 2020  Move your Photos library to an external storage device. In the Finder, go to the external drive where you want to store your library. In another Finder window, find your library. The default location is Users username Pictures, and it's named Photos Library. Drag your library to.

0.6

0.5

0.4

0.3

0.2

0.1

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for audioread, version 2.1.8
Filename, sizeFile typePython versionUpload dateHashes
Filename, size audioread-2.1.8.tar.gz (21.2 kB) File type Source Python version None Upload dateHashes
Close

Hashes for audioread-2.1.8.tar.gz

Hashes for audioread-2.1.8.tar.gz
AlgorithmHash digest
SHA256073904fabc842881e07bd3e4a5776623535562f70b1655b635d22886168dd168
MD5f8a67aac7eb5a0bb263851fc4ddbb527
BLAKE2-2562e0b940ea7861e0e9049f09dcfd72a90c9ae55f697c17c299a323f0148f913d2
Comments are closed.