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
Command line #1
Comments
I've been thinking about that for a while as well, I'll look into it. The way spek parses the commandline is a bit weird (and somewhat broken under Windows, doesn't print version at all), but at least you can already open files directly. I'm not sure yet how related the actual window and the spectrogram are, but I think it should be possible to not show the window and instead directly save it to png. I'm assuming you'd also want commandline parameters for width and height, and if none given use default (or the hidden preferences values)? |
Having optional width and height parameters would be awesome, but for me, even fixed 640x480 will be enough. |
I was able to implement it somewhat hackily. Since Spek is no true commandline program, in fact, it won't even start in a true terminal with no graphical output whatsoever, and the whole program is Window-based, I had to implement it the following way: Spek still opens a Window (I tried hiding the Window, but it won't actually parse the file and write the png then), but after it finishes analyzing the file it writes the output png and then closes instantly. The focus also remains on the CMD (at least under Windows, will have to test under macOS and some linux). Implementing it without it opening a Window whatsoever would require rewriting basically the entire way the spectrograph gets drawn from what I can tell. Does that sound at least somewhat allright? It means you can't start analyzing for example a whole folder and do something else on the same computer in the meantime, but it would still be significantly faster than opening and saving each file by hand. |
The solution you propose will be great. I have no problem with "flickering" window at all. In fact, I was trying to implement the same logic you described (open-save-close) using AppleScript, but I failed. |
Glad that works for you. You're on macOS then? Allright, I'll make a build for that once I'm done. I still need to finish up checking at least somewhat if the output file will be writable (and actually test the commandline saving on Mac, so far I only tested on debian and Windows) and add height and width commandline parameters, so you can probably expect it in the next few days. |
Great news. Thanks. |
Allright, finally ironed out a weird issue on Mac where Spek tried to open the last commandline argument as a file, meaning it analyzed the png as wav if no height and width parameters were given and then saved that completely useless spec to file ... should be fixed now, though. I'll just sleep another night over the PNG saving changes and if everything seems allright I'll commit it and upload a build tomorrow. |
Here you go: https://morten.with.de/spek-builds/spek-alternative-cf02f3c4c4bf794a479dcb8939546c3d06a83786.dmg Let me know if there are any problems, you can check the usage with For Windows users happening to stumble upon this: https://morten.with.de/spek-builds/spek-alternative-cf02f3c4c4bf794a479dcb8939546c3d06a83786.msi VERY IMPORTANT for Windows users: Call the programm with |
I've just tested it on my Mac. It works great. Thanks a lot. |
Good to know, glad it works! |
Checked it on Windows. Also works great, thanks! |
If anyone plans to output graphs via Powershell this might save you a few mins typing it up yourself: |
Can you provide a ready-made example for processing multiple files? |
I use this to do it for all flac files for example. for %%f in (*.flac) do (
echo %%~nf
"Spek.exe" "%%f" "%%~nf.png" 640 480
) |
Hi, My earlier post with the Powershell Script will (now!) do what you ask. |
KoalaBear84 thanks for the example. Several ready-made .bat files for automatic processing of tracks in Spek-alternative 0.8.2.3 [Command line version] I added a little code to make it more convenient to use. Place tracks in the "Music" folder.
Extended .bat file, with input of the path to the music folder and output of the log. Convenient when processing a large number of tracks.
.bat files should be next to Spek.exe |
Hi,
This is not an issue, just a question. Is it possible to add a command line support?
The main functionality that I'm missing is to be able to save the result in PNG directly through the command line.
The text was updated successfully, but these errors were encountered: