Giter VIP home page Giter VIP logo

pymad's People

Contributors

dependabot[bot] avatar holzhaus avatar jaqx0r avatar markushackspacher avatar petli avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

pymad's Issues

MP3 decoding broken

I noticed that this package seems to be broken. I wrote a minimal test program:

#!/usr/bin/env python
import sys
import mad
import wave

if len(sys.argv) not in (2, 3):
    print('Usage: %s INFILE [OUTFILE]' % sys.argv[0])
    sys.exit(1)

mf = mad.MadFile(sys.argv[1])

if len(sys.argv) == 2:
    print('Samplerate: %r' % mf.samplerate())
    print('Mode: %r' % mf.mode())
    print('Channels: %d' % (1 if mf.mode() == mad.MODE_SINGLE_CHANNEL else 2))
else:
    wf = wave.open(sys.argv[2], mode='wb')
    wf.setframerate(mf.samplerate())
    wf.setnchannels(1 if mf.mode() == mad.MODE_SINGLE_CHANNEL else 2)
    #4 is the sample width of 32 bit audio
    wf.setsampwidth(4)
    frame = mf.read()
    while frame is not None:
        wf.writeframes(frame)
        frame = mf.read()
    wf.close()

I used the 1938 radio broadcast of "War of the Worlds" to test this.

The output of MadFile.mode() is wrong (it's stereo) and conversion to wave produces just noise. Also, the python 3 version returns a samplerate of 0.

$ python2 mp3conv.py 381030.mp3
Samplerate: 44100
Mode: 0
Channels: 1

$ python mp3conv.py 381030.mp3
Samplerate: 0
Mode: 0
Channels: 1

I'm using the latest available version on Arch Linux:

$ pacman -Qs pymad
local/python-pymad 0.9-1
    Python interface to libmad
local/python2-pymad 0.9-1
    Python interface to libmad

Website should be updated

The Website at http://spacepants.org/src/pymad/ is quite outdated.

The latest version of the source code is kept in arch:

baz register-archive http://arch.spacepants.org/[email protected]
baz get [email protected]/pymad--main--0

People who are interested in helping out should be pointed to this Git repository instead of the baz repo, since development seems to happen here.

The latest stable release of pymad can be downloaded from here.

That should be a link to https://github.com/jaqx0r/pymad/releases instead.

Output Sample Width?

Hello!

I wish to use pymad to decode MP3 files into a PCM stream. The main problem I'm having is figuring out the output sample width. Is there any way to query this? Without this information it is impossible to make sense of the buffer output from MadFile.read since there's no way to know how many bytes make up a single sample.

Thanks!

Trying to create a madFile

Hey, My name is Eliomar.
I am a bit new on this, and also I am new with python.
I am trying to test the software with the "test.py" file, in the description you say that a mad.MadFile, how I do this? isn't a predefined mad.MadFile with the project?
I was finding on internet how to do that but I didn't found anything. Can you give me an example?
I tried with some links of youtube (streaming audio with mpeg format no?) but nothing happened, It just give me this messages (Attached picture).

I also tried with madradio.py but it gives me an error with "import ao", I tried to install it with pip but it gives me an error.

Could you help me with this? sorry if some of these questions are stupid, I just have few days programming with python.

Regards and thanks.
screenshot from 2018-08-23 18-49-08

Not able to install it using pip

Although, there is a pypi entry, I was not able to install the package using pip (e.g., pip install pymad). Would be great if this would be possible.. Cloning and running the build/setup tools worked, but pip would be easier :)

Add pip release

Could you do a release so that this package is installable under pip?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.