Giter VIP home page Giter VIP logo

Comments (5)

jiaaro avatar jiaaro commented on August 25, 2024

Thanks Damien,

Can you tell me a little more about the problem you were having and how you came to this solution? line 262 is not the only use of a NamedTemporaryFile(…) so I just want to make sure this change isn't needed elsewhere as well.

from pydub.

python4d avatar python4d commented on August 25, 2024

hi,
I've just tried your module and I've got no error but the export mp3 has
been not created properly (tiny bad mp3 file).

I found out that temporary MP3 file was good but when you read it and copy
it to the MP3 "out_f" file => out_f.write (output.read()) <= it seems that
the reader stop after a zero-byte string...

I know, It's weird that I'm the only one with this malfunction...
But I wonder why the "output" file is the only file open as not binary
file...

I used v2.7 of python under pydev+eclipse env. (win7).

hope it helps,
-damien
HAPPY NEW YEAR

2012/12/31 James Robert [email protected]

Thanks Damien,

Can you tell me a little more about the problem you were having and how
you came to this solution? line 262 is not the only use of a
NamedTemporaryFile(…) so I just want to make sure this change isn't
needed elsewhere as well.


Reply to this email directly or view it on GitHubhttps://github.com//issues/7#issuecomment-11781330.

from pydub.

python4d avatar python4d commented on August 25, 2024

hi again James,
Probably with windows you have to open as binary the mp3 file:
I read:
"On Windows, 'b' appended to the mode opens the file in binary mode, so
there are also modes like 'rb', 'wb', and 'r+b'. Python on Windows makes a
distinction between text and binary files; the end-of-line characters in
text files are automatically altered slightly when data is read or written.
This behind-the-scenes modification to file data is fine for ASCII text
files, but it’ll corrupt binary data like that in JPEG or EXE files. Be
very careful to use binary mode when reading and writing such files. On
Unix, it doesn’t hurt to append a 'b' to the mode, so you can use it
platform-independently for all binary files."

hope it helps,
-damien
HAPPY NEW YEAR

2012/12/31 James Robert [email protected]

Thanks Damien,

Can you tell me a little more about the problem you were having and how
you came to this solution? line 262 is not the only use of a
NamedTemporaryFile(…) so I just want to make sure this change isn't
needed elsewhere as well.


Reply to this email directly or view it on GitHubhttps://github.com//issues/7#issuecomment-11781330.

from pydub.

jiaaro avatar jiaaro commented on August 25, 2024

@python4d would you mind running from the latest rev in github to confirm that this fixes your issue? (and as an aside would you mind letting me know if you're able to export a file as mp3?)

from pydub.

python4d avatar python4d commented on August 25, 2024

I've tested your new build and it works like a charm :-)
thanks!
-damien

from pydub.

Related Issues (20)

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.