-
Notifications
You must be signed in to change notification settings - Fork 3
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
Question about running Praat scripts using speakr #12
Comments
Hi Ruohan! Glad to hear you find speakr helpful. :) A file path should be a simple string, which shouldn't create issues. Can I see the R code where you call |
Hi Stefano, Good afternoon! Thank you so much for your response, and I'm so sorry for my late reply. Please see attached a snapshot of the code I used and the warning I got from R. It seems that R detected 15 arguments although I only specified 11 (which is the number of arguments required for the script). Thank you so much! Best wishes, |
Can you post the Praat code of the form in your script? |
Hi Stefano, Hope you had a nice weekend! Thank you so much for your reply. The Praat code I used can be accessed here (https://sites.google.com/view/uhm-o-meter/scripts/syllablenuclei_v3?authuser=0). I apologize that I could not attach the code to this post because it is soooo long and the markdown is a bit annoying. Last week, I attempted to debug the script and discovered a major issue. When passing the file directory to R, the audio files in the directory were each treated as individual arguments. For example, the directory I specified (shown in Snapshot 1) contains two audio files. This directory worked fine when I used Praat directly (please see Snapshot 2, which features the arguments I used to run the Praat script). However, when I tried to pass the same arguments to the Praat script via R, I received the warning: "Error: Found 12 arguments but expected only 11." After several test runs where I manipulated the number of audio files in the folder, I realized that R, for some reason, treated each individual file in the directory as an argument. This issue also occurs with other types of arguments. For example, the argument "Pre processing" requires one of three options: "None," "Reduce noise," or "Band pass (300..3000 Hz)." If I pass the "Reduce noise" argument from R to Praat, it is treated as two arguments instead of one. I have modified the Praat script (mainly the directory part) so it is now compatible with R. However, I am still curious as to why the issues described above occurred. I look forward to your advice. Thank you so much for your time and patience. Best wishes, |
Hi! Sorry for the massive delay, I am happy that you find a solution in the meantime. I wonder if R is interpreting the blob in the file name. Have you tried escaping |
Hi Stefano, Thank you for the suggestion about escaping the "/*", I ended up modifying how the script (from: https://sites.google.com/view/uhm-o-meter/scripts/syllablenuclei_v3?authuser=0) handles directory paths and file extensions. I've updated the input directory handling portion below, though this might differ from your suggested approach: procedure processArgs if nrObjects and nrStr == 0 if nrFiles Looking forward to hearing your insights next semester when you have time to investigate. I sincerely appreciate your patience and time on this issue. Best wishes, |
Hi Stefano,
I hope this message finds you well. My name is Ruohan, and I am a second-year PhD student at UCL.
I am using speakr to run Praat scripts and extract data from the outcomes. Your tutorial on passing arguments to Praat forms (https://cran.r-project.org/web/packages/speakr/vignettes/run-praat.html) has been incredibly helpful, and I have successfully set most field types in Praat forms, such as option and boolean.
However, I encountered an issue when trying to run a specific Praat script using speakr. The script (https://sites.google.com/view/uhm-o-meter/scripts/syllablenuclei_v3?authuser=0) measures speech rate and requires 11 arguments. The first argument needs a directory path to the audio files (please see the attached snapshots), and I haven't been able to get this right in R.
Could you please advise me on how to pass this type of argument to Praat scripts from R? I can provide the code I used if that would help with the diagnosis.
Thank you in advance for your assistance.
Best wishes,
Ruohan
The text was updated successfully, but these errors were encountered: