A
A
Alexander2016-04-12 10:57:06
Python
Alexander, 2016-04-12 10:57:06

Why can there be a problem when playing audio files through pyglet?

Good afternoon.
I'm trying to write a script that plays audio files. Googled this code:
import pyglet
song = pyglet.media.load(filename)
song.play()
pyglet.app.run()
Installed pyglet and avbin. But the sound is played incorrectly - instead of the contents of the file, there is some kind of humming and rattling noise.
Tried on mp3 and wav - the problem exists in both cases.
Moreover, on some files, the duration of the noise is approximately equal to the duration of the file, and on some - 10 times less.
Python 3.5 on Win7x64
UPD: Now I tried it with pygame - same problem. But if the files are run manually, they play normally.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question