Giter VIP home page Giter VIP logo

Comments (7)

jiaaro avatar jiaaro commented on July 23, 2024

Would you mind linking the file in question along with some code to reproduce the issue?

from pydub.

jiaaro avatar jiaaro commented on July 23, 2024

@nratter just following up since the holidays are a busy time for many. Are you able to share the file in question along with some sample code?

from pydub.

pranilvora avatar pranilvora commented on July 23, 2024

I'm having the same issue. I'm trying to import a list of songs and then crossfade each of them together into one continuous mix. But when I run the code, I get the TooManyMissingFrames Exception.

from pydub import AudioSegment

songs = [
AudioSegment.from_mp3("Bang.mp3"),
AudioSegment.from_mp3("Morning.mp3"),
AudioSegment.from_mp3("Proxy.mp3"),
AudioSegment.from_mp3("Ode.mp3"),
AudioSegment.from_mp3("Above.mp3"),
AudioSegment.from_mp3("Cuba.mp3"),
AudioSegment.from_mp3("Born.mp3"),
AudioSegment.from_mp3("Backlash.mp3"),
AudioSegment.from_mp3("Mammoth.mp3"),
AudioSegment.from_mp3("waves.mp3"),
]

continuousSong = AudioSegment.empty()

for song in songs:
print song
temp = AudioSegment.empty()
temp = continuousSong.append(song, crossfade=20000)
continuousSong = AudioSegment.empty()
continuousSong = temp
print continuousSong.duration_seconds

print continuousSong.duration_seconds

continuousSong.export("test5.mp3", format="mp3", bitrate="256k")

from pydub.

jiaaro avatar jiaaro commented on July 23, 2024

Which line does the exception happen on? Would you be able to share the audio files needed to reproduce the issue?

On Wed, Jun 10, 2015 at 10:45 PM, Pranil Vora [email protected]
wrote:

I'm having the same issue. I'm trying to import a bunch of songs and then crossfade them all together into one continuous mix. But everytime I run the code, I get the TooManyMissingFrames Exception.
from pydub import AudioSegment
songs = [
AudioSegment.from_mp3("Bang.mp3"),
AudioSegment.from_mp3("Morning.mp3"),
AudioSegment.from_mp3("Proxy.mp3"),
AudioSegment.from_mp3("Ode.mp3"),
AudioSegment.from_mp3("Above.mp3"),
AudioSegment.from_mp3("Cuba.mp3"),
AudioSegment.from_mp3("Born.mp3"),
AudioSegment.from_mp3("Backlash.mp3"),
AudioSegment.from_mp3("Mammoth.mp3"),
AudioSegment.from_mp3("waves.mp3"),
]
continuousSong = AudioSegment.empty()
for song in songs:
print song
temp = AudioSegment.empty()
temp = continuousSong.append(song, crossfade=20000)
continuousSong = AudioSegment.empty()
continuousSong = temp
print continuousSong.duration_seconds
print continuousSong.duration_seconds

continuousSong.export("test5.mp3", format="mp3", bitrate="256k")

Reply to this email directly or view it on GitHub:
#82 (comment)

from pydub.

MaxMatti avatar MaxMatti commented on July 23, 2024

I have the same problem. I tried with multiple files and for me the problem seems to be using the following code:

finalsong = AudioSegment.empty()
finalsong.append(song)

I then replaced append with the + operator:

finalsong = AudioSegment.empty()
finalsong = finalsong + song

and then it worked. Also using append after that first + operation was no problem.

from pydub.

jiaaro avatar jiaaro commented on July 23, 2024

I think this is the same as #83 - the assertion error happens because the frame rates don't divide evenly.

from pydub.

olivierpons avatar olivierpons commented on July 23, 2024

Same problem with silence. This code wont work (it should append 3s silence at the beginning):

dst_full = "mymp3.mp3"
fhandle, tmp_name = tempfile.mkstemp(suffix='.tmp.mp3')
os.close(fhandle)
os.chmod(tmp_name, 0777)
final = AudioSegment.silent(float(3 * 1000))
final = final.append(AudioSegment.from_mp3(dst_full))
out_f = open(tmp_name, 'wb')
final.export(out_f, format='mp3')
out_f.close()
os.rename(tmp_name, dst_full)

and if you change
final = final.append(AudioSegment.from_mp3(dst_full))
to
final = final + AudioSegment.from_mp3(dst_full)

it works

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.