deltachat / deltachat-core-rust

Delta Chat Rust Core library, used by Android/iOS/desktop apps, bindings and bots 📧
https://delta.chat/en/contribute
Other
633 stars 81 forks source link

WAV files are not displayed in the audio tab #Desktop #5633

Closed Raiden-GH closed 1 month ago

Raiden-GH commented 1 month ago

WAV files are not displayed in the audio tab but in the files tab. In DC-Android and DC-iOS WAV files are displayed in the audio tab.

DC-Desktop 1.45 macOS 14.5

Simon-Laux commented 1 month ago

I investigated a bit and it depends on how they are send/received it seems. Like core sometimes sets the view type to file and sometimes audio.

Like I sent from iPhone: record audio message, is audio on the sending side and received by desktop as audio attached wav file, is file on the sending side and received by desktop as audio

I sent from desktop as file and it is received by iPhone as audio.

iequidoo commented 1 month ago

It's not only for wav, for "weba" the core uses Viewtype::File too. This is done for all file formats that are not supported on all officially supported platforms (Android, iOS, Linux etc.), otherwise you can't play such a file format. But it's strange that wav is unsupported somewhere, maybe we need to review viewtypes used for file formats.

Anyway this is the core issue, so should be moved there even if we decide to leave things as is.

iequidoo commented 1 month ago

I've reviewed audio formats in guess_msgtype_from_suffix() and i have no idea for "weba", but for other formats mapped to File e.g. "opus" it seems to be done for reasons. But i think at least "wav" should be Audio, it can be played on my Android and Desktop at least :)

Simon-Laux commented 1 month ago

wav can also be played on iOS, though in theory we should probably differentiate compressed and uncompressed (like we do on sending for images, not sure what we do on receiving)

iequidoo commented 1 month ago

wav can also be played on iOS, though in theory we should probably differentiate compressed and uncompressed (like we do on sending for images, not sure what we do on receiving)

What do you suggest for uncompressed audios? Compress if they are sent as audio, but don't do that if as file?

link2xt commented 1 month ago

though in theory we should probably differentiate compressed and uncompressed (like we do on sending for images, not sure what we do on receiving)

For images we care about this because core has JPEG encoder and may reencode images. But for audio the core does not do its own reencoding.