How to add media file (audio, pictures, videos)

Hi everyone, I'm still progressing in ODK by reading some documents. But I can't add file audio, I don't know if I've to indicate the path of media or just I've to put the media file in the same repository with the file XLS.

this is an example from the main website of xlsform, example media . I don't understand very well what to put in the media::audio

Thanks

You'll want to put a filename in the cell in your XLSForm. Then you'll need to upload the file(s) with the matching name(s) after putting the form to your server.

The documentation for Kobo is here and here [EDIT: dead link] and the button in the interface looks like:
01 AM

ODK Aggregate, etc will all have a similar option to attach files to your uploaded form.

2 Likes

Thank @danbjoseph for your prompt answer.

1 Like

You need to add a column with media::audio as the header. And then you put the filename of the desired file in that column of the row for the desired question.

For example, if you upload this survey:

+------+----------------+--------------------------------------------------------------+--------------+
| type |      name      |                            label                             | media::audio |
+------+----------------+--------------------------------------------------------------+--------------+
| text | identify-sound | Play the sound and ask the respondent to identify the sound. | birds001.wav |
+------+----------------+--------------------------------------------------------------+--------------+

And also upload a birds001.wav audio file.

Then the question in the form should show a button to play the sound. Screenshot_20170928-195204

1 Like

Thank you, I get it. The type of audio must be only in "wav"?
If I must put 3 audios in a select_one question how can I do it? I've to separate the name audio by "AND" or what I've to do?
like this:
audio
Thanks

I have tested .wav files. I haven't tested other files types so don't know for sure. Audacity may be a good choice for any audio file editing you need to do.

If you want the media associated with answer option(s) instead of with a question, then you will need to edit the choices sheet. These options on your choices sheet:

+-----------+-------+--------+--------------+
| list name | name  | label  | media::audio |
+-----------+-------+--------+--------------+
| birdsongs | bird1 | bird 1 | birds001.wav |
| birdsongs | bird2 | bird 2 | birds002.wav |
| birdsongs | bird3 | bird 3 | birds003.wav |
+-----------+-------+--------+--------------+

With this question on your survey sheet:

+----------------------+------+-----------------+
|         type         | name |      label      |
+----------------------+------+-----------------+
| select_one birdsongs | bird | Select a sound. |
+----------------------+------+-----------------+

Will give you this screen in ODK Collect:

2 Likes

Impecable, THANK you very much @danbjoseph. I understand it well.
I've another question about table (How to implement it). I'll create new topic.

2 Likes