AVbin is a C library that provides a thin, cross-platform wrapper around Libav’s video- and audio-decoding functionality, providing long-term binary compatibility for applications and languages that need it. See also: Pyglet, a python media framework that makes extensive use of AVbin.
I'm using pyglet to make a little handheld music player, and I've run into an AVbin issue when I try to load certain M4A media files using the pyglet.media.load function.
When I try to load certain M4A audio files I get this error.
C:\Users\Music Production\Desktop\Programing\Pathway Player Pre-Alpha\V1>python
error-maker.py
Traceback (most recent call last):
File "error-maker.py", line 34, in <module>
if __name__ == "__main__": main()
File "error-maker.py", line 24, in main
loaded_song = pyglet.media.load(r"C:/Users/Music Production/Desktop/Programi
ng/Pathway Player Pre-Alpha/V1/player-a/creek.m4a")
File "C:\Program Files\Python-ver-3-6\lib\site-packages\pyglet\media\__init__.
py", line 1429, in load
source = get_source_loader().load(filename, file)
File "C:\Program Files\Python-ver-3-6\lib\site-packages\pyglet\media\__init__.
py", line 1405, in load
return avbin.AVbinSource(filename, file)
File "C:\Program Files\Python-ver-3-6\lib\site-packages\pyglet\media\avbin.py"
, line 266, in __init__
av.avbin_stream_info(self._file, i, info)
File "C:\Program Files\Python-ver-3-6\lib\site-packages\pyglet\media\avbin.py"
, line 196, in f
result = func(*args)
OSError: exception: integer divide by zero
The M4A files that cause this error seem to open fine on in other media players such as Media Player Classic for Windows or BeaTunes for Windows.
I have M4A files that load fine too, but I haven't been able to figure out the difference between the M4A files that load and the ones that cause this error.
Here is the code that I'm using to load these files,
#!/usr/bin/python3
def main():
import pyglet
import os
import time
from pyglet import clock
window = pyglet.window.Window()
@window.event
def on_draw():
window.clear()
#----TRACK LIST CREATION FROM FOLDERS----
#SETTING FOLDER LOCATIONS
player_a_folder = 'C:/Users/Music Production/Desktop/Programing/Pathway Player Pre-Alpha/V1/player-a/'
#PLAYER SETUP STUFF
pyglet.options['audio'] = ('directsound', 'pulse', 'silent') #setting sound output correctly
player_a = pyglet.media.Player() #creating a player
#add absolue path to media file here:
loaded_song = pyglet.media.load(r"C:/Users/Music Production/Desktop/Programing/Pathway Player Pre-Alpha/V1/player-a/creek.m4a")
#adding loaded media file to the queue
player_a.queue(loaded_song)
player_a.play()
pyglet.app.run() #LETS DOT HIS THANG! !!^O^!!
if __name__ == "__main__": main(
Here is a "pip list" of the python libraries I currently have installed
Hello there!
I'm using pyglet to make a little handheld music player, and I've run into an AVbin issue when I try to load certain M4A media files using the pyglet.media.load function.
When I try to load certain M4A audio files I get this error.
The M4A files that cause this error seem to open fine on in other media players such as Media Player Classic for Windows or BeaTunes for Windows.
I have M4A files that load fine too, but I haven't been able to figure out the difference between the M4A files that load and the ones that cause this error.
Here is the code that I'm using to load these files,
Here is a "pip list" of the python libraries I currently have installed
I have also installed the most recent version of AVbin.
Here is a google drive link the examples M4A files that cause the error and ones that don't
M4As that load correctly: https://drive.google.com/drive/folders/0B4TzKg61IkDQVHBtWXNGeUk0X28?usp=sharing
M4as that cause errors: https://drive.google.com/drive/folders/0B4TzKg61IkDQblR2TVMyUFNwRE0?usp=sharing
Is there something about these files that is causing this error?
Let me know if there is any more information I can provide.
Thanks for making/maintaining this code, its been super useful!
Best Regards,
-Evan Sirchuk