Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inconsistency with audio segment duration on silence or Sine #805

Open
nikolas-loris-ai opened this issue Aug 1, 2024 · 0 comments
Open

Comments

@nikolas-loris-ai
Copy link

Hello, I'm facing the following issue.

Any help is appreciated

Steps to reproduce

In [48]: beep_segment = Sine(1000, sample_rate=8000).to_audio_segment(duration=4095)

In [49]: beep_segment.duration_seconds
Out[49]: 4.094875


In [52]: silence_segment = AudioSegment.silent(duration=4095, frame_rate=8000)

In [53]: silence_segment.duration_seconds
Out[53]: 4.094875

I'm trying to later replace parts of audio file with this segments and getting the error

ValueError('attempt to assign array of size 186399 to extended slice of size 186400')

Expected behavior

I would expect duration_seconds to be 4095

Actual behavior

Some milliseconds are missing

Your System configuration

  • Python version: 3.11.8
  • Pydub version: 0.25.1
  • ffmpeg or avlib?: ffmpeg
  • ffmpeg/avlib version: 4.3.6-0+deb11u1

Is there an audio file you can include to help us reproduce?

not needed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant