Allow selecting only supported audio files
ClosedPublic

Authored by broulik on Mar 16 2019, 1:29 PM.

Details

Summary

While Phonon could play all the files, libcanberra as a low-latency notification sound library only supports WAV and OGG*.

*) I didn't find documentation on this but ca_sound_file_open in libcanberra only has a wav and vorbis handler

BUG: 405470

Test Plan
  • Can no longer select MP3 as audio file

Diff Detail

Repository
R305 KNotifyConfig
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
broulik created this revision.Mar 16 2019, 1:29 PM
Restricted Application added a project: Frameworks. · View Herald TranscriptMar 16 2019, 1:29 PM
Restricted Application added a subscriber: kde-frameworks-devel. · View Herald Transcript
broulik requested review of this revision.Mar 16 2019, 1:29 PM
apol added a subscriber: apol.Mar 16 2019, 4:09 PM

How do we know that's the only ones supported?

bruns added a subscriber: bruns.Mar 16 2019, 4:31 PM

According to http://0pointer.de/public/sound-theme-spec.html (linked from https://freedesktop.org/wiki/Specifications/sound-theme-spec/)

wav and ogg/vorbis are mandatory, but this does not rule out other formats in general.

unfortunately, there is no API in libcanberra to check the supported types, save trying to open the file:
http://git.0pointer.net/libcanberra.git/tree/src/read-sound-file.c

Non-support for e.g. MP3 is likely historical due to patents. but this has changed, and could now be added. On the other hand, libcanberra is dormant since 2012. I think it is save to assume no MP3 support for now, adding it back is trivial.

So, +1 from me.

bruns accepted this revision.Mar 18 2019, 5:28 PM
This revision is now accepted and ready to land.Mar 18 2019, 5:28 PM
This revision was automatically updated to reflect the committed changes.