March 19, 2019 at 9:08 pm #2970robertoGuest
I need to use a zipped folder of audio files for my Ibex/PennController script and I have a few questions.
1. Are wav files supported? The on-line documentation refers to ogg files (which are not supported by Safari) and mp3 files (which seem to be more widely supported), but I could find no mention of the wav format.
2. The tutorial says that a FTP server is required to use zipped folders. That means that file sharing services (GDrive, Dropbox, etc.) won’t be of any use. I have no server I could FTP-upload my files – Is there any alternative way to do this?
2′. From what I could understand from the tutorial, one could potentially refer to GDrive/Dropbox (unzipped) folders in the script. I have tried to do that as well, but the audio files wouldn’t play either.
Many thanks in advance for your help!
-robertoMarch 19, 2019 at 9:25 pm #2977JeremyKeymaster
1. Thank you for this question and you feedback about the documentation, I have added a link to an external page listing audio support in HTML5. You surely can use WAV files, which actually appear to be compatible with the most browsers.
2. There currently is no alternative to using your own servers, since download takes place automatically in the background (as opposed to manually, at the initiative of the participant) which requires the servers where the ZIP file is hosted to grant the domain where the experiment is hosted (e.g. spellout.net) such automatic distant access to your ZIP file (e.g. using a .htaccess file, as described in the documentation).
2′. I am sorry if the documentation is unclear: one cannot refer to GDrive/Dropbox folders, but one can directly refer to GDrive/Dropbox files directly (and inidividually) as long as they have a public-access URL. With Dropbox, you can click “Copy Link” next to the file you want to use and replace the
?dl=0bit at the end with
?raw=1and use the URL in a
Let me know if you have further questions or requests.
March 20, 2019 at 6:15 pm #2978robertoGuest
- This reply was modified 4 years, 8 months ago by PennController.
Thank you for your reply, Jeremy. This is very helpful.
We are in the process of getting access to a server, I will let you know if we run in any problems.
-RobertoMarch 22, 2019 at 3:09 am #2981robertoGuest
my code makes use of both
PennController.Template(). Basically, what I want PennController to do is, preload the zip from a folder in my server (where there is also the system file
.htaccessas explained in the tutorial) and play the files in the zip by referring to the row of my csv file (uploaded in the
chunks_includesdirectory. Here is an excerpt of my code:
PennController.Sequence( "intro", "instructions", shuffle(randomize("exp"), startsWith("filler_question")), "exit", "send" ); PennController.ResetPrefix(null); PennController.PreloadZip("https://sprouse.uconn.edu/downloads/syllabicity/mixed.zip"); PennController.CheckPreloaded(); // FURTHER PROPRIETIES OF THE HTML PAGES [...]. // PENNCONTROLLER TEMPLATE PennController.Template( row => PennController("exp", newText("intro", "Press PLAY to listen to the audio. You can listen to it only once.") .settings.cssContainer("margin-bottom", "10px") .settings.center() .print() , newAudio("sound", row.Item) .settings.cssContainer("margin-bottom","20px") .settings.center() .print() //.wait("first") , getAudio("sound") .settings.disable() ... ) )// Call .log .log("sound", row.Item) .log("Prime", row.Prime) .log("PrimeCompressType", row.PrimeCompressType) .log("PrimeCompressValue", row.PrimeCompressValue) .log("PrimeOnset", row.PrimeOnset) .log("BwmOnset", row.BwmOnset) .log("condition", row.condition) );
This does not seem to work (the audio files won’t play). Any idea of why it is so?
thank you in advance!
-robertoMarch 22, 2019 at 3:35 am #2982JeremyKeymaster
When I try to use your
PreloadZipcommand with the URL that you give, my browser gives me a CORS error, suggesting that there might be a problem with your .htaccess configuration. Did you make sure that the .htaccess file is in the exact same folder as your zip file? (i.e. https://sprouse.uconn.edu/downloads/syllabicity/)
Also, did you check that your file is indeed named .htaccess and has no extension that could be hidden when you’re browsing your files? For example, if you created it using a text editor, it could be that its actual name is .htaccess.txt. The initial
.is necessary as well.
A note on
PennController.CheckPreloaded: this command creates a trial labeled unlabeled by default. You must indicate when in your sequence the CheckPreloaded trial should appear (i.e. at what point in the experiment it becomes crucial that the resources are preloaded before proceeding). If you want to use a specific label, use the
- You must be logged in to reply to this topic.