GitXplorerGitXplorer
r

python-audiolayer

public
3 stars
0 forks
2 issues

Commits

List of commits on branch master.
Unverified
34bd20346dd8d94cb9d97bd0df414d1c5ff62629

Add travis config

rremcohaszing committed 11 years ago
Unverified
9e8b62c8e084a5457c626cf5244b655ad33e9bd4

Made all lines fit within the 79 character limit.

rremcohaszing committed 11 years ago
Unverified
3b80e5df7ba016c75bbc004d52a8480e8259f46b

Added special character to the name for testing output files.

rremcohaszing committed 11 years ago
Unverified
60f488b167479c58d4e583f2faa7b17bbb68fcc1

Updated some metadata.

rremcohaszing committed 11 years ago
Unverified
eab7fbcba1ed8231165089317307254db9340b20

Added a hack to disable the annoying default logging by portaudio.

rremcohaszing committed 11 years ago
Unverified
822d238d5b985c96b592b9a027361741a031adfd

It is now possible to save metadata to either the current file or specify an optional target file. The file is generated and afterwards moved to the original location, so no corrupt files will be created.

rremcohaszing committed 11 years ago

README

The README file for this repository.

Python Audiolayer

.. image:: https://travis-ci.org/remcohaszing/grunt-angular-templatecache.png?branch=master :target: https://travis-ci.org/remcohaszing/python-audiolayer

This package contains a Python 3 Extension for playing audio files, reading and writing metadata and converting those files. For decoding and encoding files the libav_ library is used. Playback is handled by libportaudio_.

The project can be found at GitHub <https://github.com/remcohaszing/python-audiolayer>_ and PyPi <https://pypi.python.org/pypi?name=audiolayer&:action=display>_.

Requirements

  • python3.x (Tested using python3.3)
  • libavcodec
  • libavformat
  • libavutil
  • libportaudio

Installation

Using pip::

pip install audiolayer

From GitHub::

git clone https://github.com/remcohaszing/python-audiolayer.git
cd python-audiolayer
python3 setup.py install

Usage

Reading song metadata:

from audiolayer import Song filename = 'Finntroll - Trollhammaren.flac' song = Song(filename) song['artist'] Finntroll song['album'] Trollhammaren song['title'] Trollhammaren

Saving song metadata:

song['album'] = 'Nattfödd' song['album'] 'Nattfödd' song.save()

Saving a copy of the song with the new metadata to a new file:

song.save(filename='Finntroll/Nattfödd - Trollhammaren.flac')

Converting the song (not implemented):

converted = song.convert('Finntroll - Trollhammaren.ogg', ... format='opus', q=4) converted.filename Finntroll - Trollhammaren.ogg

Playback (current implementation):

song.play() # Wait for the song to finish.

Playback (target implementation):

song.play() 0.00 song.pause() 4.29 song.play_or_pause() 4.29 song.playing_time 12.53

Testing

The unittests can be run using::

python3 setup.py test

It is also possible to use nose_ to run the tests::

python3 setup.py nosetests

Coding style

  • C code must be in compliance with pep7_.
  • Python code must be in compliance with pep8_.
  • All code must be covered by unittests.

To test the Python code for pep8 compliance, go to the project root directory and run::

python3 setup.py flake8

License

This project is licensed under the BSD 3-Clause License.

WIP

This project is still a work in progress.

.. _libav: https://libav.org .. _libportaudio: http://portaudio.com/ .. _nose: http://nose.readthedocs.org .. _pep7: http://www.python.org/dev/peps/pep-0007 .. _pep8: http://www.python.org/dev/peps/pep-0008