llkaresort.blogg.se

Vlc media player extract audio from video
Vlc media player extract audio from video








vlc media player extract audio from video

I've looked at how long each song is in milliseconds, len(sound) for pydub and sound.get_length() for python-vlc is different usually by 10 or so seconds.It only reads WAV files, and for a live analyzer, converting to a WAV first would take too long. It appears that pydub.AudioSegment doesn't line up properly. Using sound.get_time() with an average offset that increases over time.

vlc media player extract audio from video

I cannot tell you why but it is still desynced. Scaling from sound.get_time() in py-vlc to len(sound) in pydub. It appears that pydub.AudioSegment is not in sync whatsoever. I tried using an external timer using the threading module. I've gotten a difference of 195ms, 294ms and 217ms. As time progresses, the get_time() wildly varies from the timer. I can start a timer from when it starts playing using time.monotonic(). The issue with this command is not that it only updates every half a second or so but that it doesn't return the accurate time. Python-vlc has sound.get_time() which returns the last updated time in milliseconds. You can look at the python-vlc docs here: What I've tried īasically, is there a python-vlc equivalent to _array_of_samples()? I have made the two literally in sync, pydub just so happens to read out of it. My issue is that I am currently using pydub to get the samples from the song, but as the song gets longer, the more out of sync the two become. I am working on a music player with a sample analyzer.










Vlc media player extract audio from video