Comments (7)
Would you mind linking the file in question along with some code to reproduce the issue?
from pydub.
@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.
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.
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_secondscontinuousSong.export("test5.mp3", format="mp3", bitrate="256k")
Reply to this email directly or view it on GitHub:
#82 (comment)
from pydub.
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.
I think this is the same as #83 - the assertion error happens because the frame rates don't divide evenly.
from pydub.
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)
- set_frame_rate() doesn't work HOT 1
- URGENT ISSUE:- RuntimeWarning: Couldn't find ffmpeg or avconv - defaulting to ffmpeg, but may not work warn("Couldn't find ffmpeg or avconv - defaulting to ffmpeg, but may not work", RuntimeWarning) HOT 1
- pyaudioop.rms() TypeError: 'float' object cannot be interpreted as an integer and NameError: name 'buffer' is not defined HOT 1
- JSONDecodeError with AudioSegment when reading from bytesio
- Wrong exception when ffprobe is not installed HOT 1
- works for me on win11
- Option to return offsets with audio segments when splitting on silence
- CouldntDecodeError: Decoding failed. ffmpeg returned error code: 1
- AudioSegment.from_file(audio_path) crashes despite ffmpeg.exe hardcoded and also in the PATH
- M4A Chapters
- Pydub import error
- Improve memory footprint of make_chunks
- Calling AudioSegment.export() with an integer bitrate causes Python subprocess exception HOT 1
- is there a faster way to play audio?
- using base64 audio data on AudioSegment
- test failures on python 3.12 HOT 2
- Tell
- Create new tag version.
- Disable pydub RuntimeWarning if not applicable to deployment HOT 1
- How do you guys install ffmpeg or libav inside a python-image? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pydub.