Make file previewer to support .wav audio files?

41 views
Skip to first unread message

Philipp at UiT

unread,
Mar 4, 2020, 2:36:39 AM3/4/20
to Dataverse Users Community
After our latest upgrade, we have now activated the file previewers in our Dataverse installation, and we really like this new feature! I have tested several file formats (.txt,.pdf, .xlsx, .mp3, .png), and they all work well.

Would it be possible to include WAVE (.wav) to the supported file formats for audio files?

The status of .wav as a preferred file format for long-term preservation is somewhat debated (it's not recommended by e.g. DANS, but recommended by e.g. the British Library), but for the time being, we still accept .wav files, and it would be nice for our users to be able to preview (or rather prelisten to) these files.

Best, Philipp

James Myers

unread,
Mar 4, 2020, 7:18:53 AM3/4/20
to dataverse...@googlegroups.com

Philipp,

 

It looks like audio/wav should work in the latest version of any browser except Internet Explorer just by registering the existing audio previewer for that mime type. That’s a change since we first created them, so I’ll go ahead and add it to the default set in the README file on github. You should just be able to change the mimetype in the existing example and run that locally (rather than wait for me).

 

In general (since we’re on the community list), the question of ‘can you preview format X’ involves a few things:

·         Whether a way to view that type in a browser exists somewhere (or can be built),

·         Whether someone has made the small wrapper required to launch it as a previewer from Dataverse (or can do so),

·         Whether you have registered the tool for that mimetype in your instance

 

In Tromso, I was showing how easy the second step is. The first step is the potentially difficult one. Many of the existing previewers leverage the basic support built into HTML5 (image, video, audio formats). PDF support leverages an externally developed previewer. The others involve some custom code that calls existing libraries (i.e. the text/html previewers filter scripts and potentially malicious tags via a library, the table previewer configures an underlying tabular display library).

 

The last step is basically a policy question at your installation which seems straight forward (to preview or not) but can be complicated due to the limitations of the underlying previewer. In the case of audio, support for all the formats varies by browser (see https://en.wikipedia.org/wiki/HTML5_audio for example) and by the browser version and in some cases on whether they have a given extension/plug-in. Further, some previewers have limitations/bugs – I think I’ve seen rewind not work on some video types, there are probably text/html/tabular files that display but may not look like the original (e.g. the html previewer won’t allow javascript to run and that may be part of the display). If your installation has many files in these categories, or you have more users on browsers that don’t support some mimetypes well, you may not want to register those previewers for the involved mimetypes. (Or you may want to send an issue or pull request to the previewers repository that identifies and/or fixes the issue! (or that adds messaging – e.g. “This format not supported in IE – try another browser to preview this file”))

 

My basic advice is that, if you’ve seen a file viewable in some website, it shouldn’t be hard to get a preview in Dataverse (unless there’s a licensing issue) – possible something that could be done in limited time at a hack-a-thon. If the preview involves multiple files or the file isn’t really in a website but the entire website is a custom tool, it’s still possible but more work (Dataverse now supports tools at the Dataset level which would help if multiple files are involved). And if there’s no example to start from, you can probably still build one if you/someone knows the details of the file format.

 

Cheers,

   -- Jim

--
You received this message because you are subscribed to the Google Groups "Dataverse Users Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dataverse-commu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dataverse-community/18d464de-1ccb-4706-a9f0-353bb7d36841%40googlegroups.com.

Philip Durbin

unread,
Mar 4, 2020, 8:53:48 AM3/4/20
to dataverse...@googlegroups.com
Philipp, thanks for telling us your needs and Jim, thanks for delivering so quickly!!

Has Dataverse File Previewers really matured to the point that milestones and/or a changelog might be beneficial?! That's great! I just opened this issue to discuss: https://github.com/GlobalDataverseCommunityConsortium/dataverse-previewers/issues/44



--

Philipp at UiT

unread,
Mar 12, 2020, 4:01:29 AM3/12/20
to Dataverse Users Community
Thanks, Jim and Phil, for following up on this, and sorry for my late reply. We are trying to get this working in our installation.
Best, Philipp

To unsubscribe from this group and stop receiving emails from it, send an email to dataverse-community+unsub...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Dataverse Users Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dataverse-community+unsub...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages