| Summary: | audio alarms do not play flac or mp3 files | ||
|---|---|---|---|
| Product: | [Applications] kalarm | Reporter: | Dominick <dominick.allen1989> |
| Component: | sound | Assignee: | David Jarvie <djarvie> |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | CC: | sitter |
| Priority: | NOR | ||
| Version First Reported In: | 3.8.1.1 | ||
| Target Milestone: | --- | ||
| Platform: | Fedora RPMs | ||
| OS: | Linux | ||
| Latest Commit: | https://invent.kde.org/pim/kalarm/-/commit/a3ce5043f2074829156f414cc32075579b3bbf94 | Version Fixed/Implemented In: | 24.08 |
| Sentry Crash Report: | |||
| Attachments: | Tarball of sample file in wav, flac, mp3, and ogg formats | ||
|
Description
Dominick
2024-07-02 12:02:30 UTC
I can confirm that when I set KAlarm to play the mp3 or flac file, libcanberra does not recognise them. It has been previously reported that opus files also don't work. Harald: KAlarm changed from Phonon to libcanberra on your recommendation, but it doesn't handle as many audio formats as Phonon. Is there any way to be able to play MP3, FLAC or OPUS audio, perhaps using some other library, bearing in mind that it must be thread safe? Canberra can use gstreamer as backend at which point it should be able to play anything gstreamer can. Canberra has a gstreamer backend, but because Canberra hasn't been updated in 12 years, at least one of the gstreamer calls is obsolete:
gst_element_factory_make("decodebin2", NULL)
GStreamer no longer recognises decodebin2, so this call returns an error and playback fails. (decodebin and decodebin3 are recognised, but substituting them produces different errors.)
The conclusion is that Canberra can't be used any longer with GStreamer, so some other library is required. One possibility is to use ffmpeg libraries to convert to .wav first, and then continue to use Canberra, but this doesn't seem ideal. Do you have any other suggestions?
> Do you have any other suggestions?
update the gstreamer backend maybe? or write a new one using ffmpeg or libvlc
Ultimately I don't think your idea of converting to wav is a bad one, it makes things work with any plugin. Perhaps cache the result of the conversion though?
KAlarm has now been converted to use the VLC library to play sound files, which fixes this bug. The fix will be in KAlarm version 3.9, which will be in the KDE Gear 24.08 release. Commit https://invent.kde.org/pim/kalarm/-/commit/a3ce5043f2074829156f414cc32075579b3bbf94 |