-
Notifications
You must be signed in to change notification settings - Fork 2
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
WIP: Use ffmpeg when sox binary is missing #64
Conversation
Codecov Report
|
print(os.environ['PATH']) | ||
os.environ['PATH'] = path | ||
print(os.environ['PATH']) | ||
assert shutil.which(program) == local_command |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@frankenjoe in principle the code works, but I cannot make Windows find a program at a custom system path when symlinking it there. For Linux and Mac it works. If I copy the file instead of using symlink it does also not work under Linux.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe the copying solution does not work due to missing dependencies? We probably have to copy some shared libraries as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Locally it works for me when doing it with Unix commands.
In the Github runner it does not fail when executing ffmpeg
, but it cannot find it in the path: https://github.com/audeering/audiofile/runs/5756308827?check_suite_focus=true
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you try with .exe
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
According to https://stackoverflow.com/questions/56399696/shutil-which-not-finding-programs-without-appending-file-extension: shutil.which('ffmpeg')
will look for ffmpeg.EXE
in PATH
, but I guess the executable is called ffmpeg.exe
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not a big fan of skipping the tests. But as we seem to need a fix as soon as possible and we don't have time to first investigate #65 it might be ok for an intermediate release to skip the test.
I will take a look and update the code accordingly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On the other hand this problem would disappear when we just remove sox
.
I started running the benchmarks with and without sox
, let's first see what the outcome will be.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, so we agree to stick with sox
but skip the failing tests on Windows, correct?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I solved it in #69 by using Github runners with and without sox
installed. Then we don't need to mess around with the path as we do here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hehe, I also thought about using different Github runners, but was afraid to suggest it after you had already spent so much effort on hiding sox
from PATH :)
Nice tests! The |
1 similar comment
Nice tests! The |
Hehe, yes, I copied from @ChristianGeng who used it in #56 |
|
It might be that it is faster in reading MP3 files and accessing it's metadata than |
I'm not suggesting to use |
I created #65 to track the issue of removing |
Looking at the results from #65 (comment) I would be in favor of sticking with I also updated the installation instructions accordingly and added it to the description of this pull request. |
d3895e0
to
b2d989e
Compare
Closing in favor of #69. |
Closes #62.
This falls back to
ffmpeg
if thesox
binary is missing on the system aspysox
does not ensure the binary to be present.In addition, it adds tests to make sure the error messages a user gets for broken or missing files are the same if the
sox
binary is missing or not.I also updated the installation instructions, highlighting that
sox
is only needed for faster MP3 file handling: