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

Cannot open audio: AttributeError: 'NoneType' object has no attribute 'start' #393

Closed
AnWildDuck opened this issue Jan 26, 2017 · 3 comments

Comments

@AnWildDuck
Copy link

AnWildDuck commented Jan 26, 2017

I simply can't open audio files.

Code:

import moviepy
audio = moviepy.editor.AudioFileClip('audiofil.mp3')

Error

Traceback (most recent call last):
  File "C:\Users\Johnny\AppData\Local\Programs\Python\Python35\lib\site-packages\moviepy\video\io\ffmpeg_reader.py", line 300, in ffmpeg_parse_infos
    tbr = float(line[match.start():match.end()].split(' ')[1])
ValueError: could not convert string to float: '90k'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\Johnny\Desktop\mov\speed_up.py", line 6, in <module>
    audio = moviepy.editor.AudioFileClip('audio\\Scheming Weasel faster.mp3')
  File "C:\Users\Johnny\AppData\Local\Programs\Python\Python35\lib\site-packages\moviepy\audio\io\AudioFileClip.py", line 63, in __init__
    buffersize=buffersize)
  File "C:\Users\Johnny\AppData\Local\Programs\Python\Python35\lib\site-packages\moviepy\audio\io\readers.py", line 56, in __init__
    infos = ffmpeg_parse_infos(filename)
  File "C:\Users\Johnny\AppData\Local\Programs\Python\Python35\lib\site-packages\moviepy\video\io\ffmpeg_reader.py", line 305, in ffmpeg_parse_infos
    result['video_fps'] = float(line[match.start():match.end()].split(' ')[1])
AttributeError: 'NoneType' object has no attribute 'start'
@tburrows13
Copy link
Collaborator

Can you post the audio file it fails on please? Is it only one, or have you tried several? Have you tried updating moviepy to the latest version?

@ghost
Copy link

ghost commented Feb 27, 2017

issue #448 has the same issue, and they have supplied an audio file so we can reproduce the error.
In the zip file that request we download look at the file 01\ Demacia\ Rising.mp3.

_clip = AudioClipFile(r"01 Demacia Rising.mp3")

The code above will reproduce the error.

@ghost
Copy link

ghost commented Mar 6, 2017

fixed with pull request #449. Try pulling from repo, and if issue still exists, let us know.

@ghost ghost closed this as completed Mar 6, 2017
This issue was closed.
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

2 participants