Skip to content
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

praatcon.exe no longer available tmp fix #2

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

raphywink
Copy link

Hi,

because a colleague of mine just needed an old Gist I put together that uses PraatR under her Windows 10 machine (see here for that Gist: https://gist.github.com/raphywink/2512752a1efa56951f04) I discovered that PraatR doesn't work under Windows any more as praatcon.exe no longer exists and it's functionality has been integrated into the praat.exe (see section 5 here: http://www.fon.hum.uva.nl/praat/download_win.html).

Here http://www.aaronalbin.com/praatr/ under Step 2 you say to place the praatcon.exe into the PraatR installation directory and here https://github.com/usagi5886/PraatR/blob/master/R/praat.R#L384 you assemble the path to that .exe. I simply replaced the praatcon.exe string with the praat.exe which means the user has to place a copy of the praat.exe into the PraatR directory. This seems to work...

Generally I think it is a bit hacky to place something within the installation folder of an R package (have fun explaining that to the CRAN gods ;-)). A better solution would maybe be to search the Program Files / Program Files(x86) directories for the praat.exe and let the user optionally pass in the path to the executable as an argument to the praat(..., path2exe="C:/path/2/praat.ext") command.

greetings from EMU-SDMS land :-)

Raphael

bit hacky as PraatR/praat.exe is probably not a good place for people
to have their default praat.ext installed. (Will probably lead to
multiple praat versions on the same system... using
Programs/Programs(x86) Folder is probably a better option in my opinion)
@davebraze
Copy link

davebraze commented Jun 16, 2016

An alternative might be to require package users to do something like
option(praat_path = "/path/to/praat.exe"). If done in a user script that calls PraatR, the setting will be in effect for the duration of the R session. If done in the user's .Rprofile file, the setting will automatically be set in every R session. Then, in PraatR you can do getOption("praat_path").

@raphywink
Copy link
Author

Yep! That might be a good way to do it in a platform independent way. You could either do it .onAttach/.onLoad or the first time praat() is called. And by "it" I mean check if the .Rprofile has the entry option(praat_path = "/path/to/praat/depending/on/platform") and if not... look for Praat -> if you find it autogen. the .Rprofile entry, if not prompt the user to enter the path to the praat executable.

@davebraze
Copy link

davebraze commented Jun 17, 2016

Do you really think it will be useful to try to programmatically locate the praat executable? This would seem a heavy lift given the loosey goosey installation recommendations provided with praat and the lack of a proper installer. My experience (mostly with Windows users) is that the exe ends up almost anywhere but in the conventional application folder. I'd guess it's similar on OSX and Linux.

@raphywink
Copy link
Author

Probably not, but currently PraatR seems to do exactly that on every call of the praat() function:

https://github.com/usagi5886/PraatR/blob/master/R/praat.R#L375

You could also just tell the user that it is obligatory to place 'option(praat_path = "/path/to/praat/depending/on/platform")' into their .Rprofile if they want to use PraatR. Then you wouldn't have any programmatical guesswork to do, but you would also require the user to know where their Praat executable is located. You'd think they'd know... but I am sure some of them don't and also don't know how to find out either :-)

@davebraze
Copy link

davebraze commented Jun 17, 2016

Yeah. The code you cite seems to me to be wasted effort, especially placed within praat() rather than .onLoad(), but even in the latter case the return would be too small to be worth the trouble. I think putting the burden on the user is the right way to go.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants