Yellow-Dog-Man / Resonite-Issues

Issue repository for Resonite.
https://resonite.com
131 stars 2 forks source link

MP3s should make music, not videos #216

Open FlameSoulis opened 10 months ago

FlameSoulis commented 10 months ago

Describe the bug?

Uploading an MP3 will offer to upload as a video file rather than an audio file.

To Reproduce

  1. Upload your favorite MP3 file.
  2. Be greeted by the upload dialog.
  3. Don't see Audio as an option.
  4. Be disapointed.

Expected behavior

Uploading an MP3 offers to upload as an audio file.

Screenshots

https://github.com/Yellow-Dog-Man/Resonite-Issues/assets/6835457/c552e4a1-3344-4b88-baec-329288427e0a

image

Resonite Version Number

Beta 2023.10.13.743

What Platforms does this occur on?

Windows, Linux

What headset if any do you use?

Desktop, Index, Quest

Log Files

No response

Additional Context

The MP3 file format is no longer requiring a license to use, and has been a very popular question on why music files aren't working in Resonite, when those files were MP3. Resolving this issue could potentially resolve 'false bugs' on 'audio not working/importing.'

Reporters

flamesoulis (U-Flame-Soulis)

maksim789456 commented 10 months ago

The same story with m4a, aac, ac3, aif, aiff, opus audio formats

FrooxEnigne recognize this audio formats as video, it's shows at logs on early FrooxEngine init 0:06:31.836 ( -1 FPS) Supported audio formats: wav, wave, flac, fla, ogg, aiff, aif, aifc 0:06:31.836 ( -1 FPS) Supported video formats: mp4, mpeg, avi, mov, mpg, mkv, flv, webm, mts, 3gp, bik, m2v, m2s, wmv, m3u8, m3u, pls, m4a, mp3, mpeg3, aac, ac3, aif, aiff, ape, au, it, mka, mod, mp1, mp2, opus, s3m, sid, w64, wma, xm, nsf, nsfe, gbs, vgm, vgz, spc, gym

gameboycjp commented 10 months ago

For context on why this happens, the library that handles audio doesn't support these formats, so the engine defers to video player libraries instead. That's paraphrasing on what I've been told, at least. Giving the user the option to convert to a supported audio format would be nice as a stopgap, but full support would be awesome too.

Frooxius commented 10 months ago

This one is a bit tricky. The goal is to treat them as audio clip assets, but right now we lack a good miltiplatform library to achieve this, that wouldn't add much development/dependency burden.

We tried a few C# implementations, but they had severe issues (screeching audio with some files, locking up with others).

We can look into native libs, where the support is better, but it also adds more development burden, as we have to cross compile on multiple platforms.

We'd probably look into one's that support a large number of formats, so it's not just specifically for MP3.

We're open to suggestions for libs that we can, look at. Ideally pure C#. We already tried NLayer and MP3Sharp.

FlameSoulis commented 10 months ago

Wouldn't a humble update to assimp resolve the issue?

ProbablePrime commented 10 months ago

Wouldn't a humble update to assimp resolve the issue?

AssImp doesn't support MP3. (https://assimp-docs.readthedocs.io/en/latest/about/introduction.html)

FlameSoulis commented 10 months ago

Oh... hmm... I thought that was handling the media stuff as well. My bad.

gentlecolts commented 10 months ago

is ffmpeg not a viable solution to this?

ProbablePrime commented 10 months ago

FFmpeg might work as an auto-convert, but we'd have to integrate that carefully, thanks for the suggestion.

Frooxius commented 10 months ago

FFmpeg wouldn't help here either, that would act as a "media player" too, just like libVLC does. It's essentially a big huge box that does everything, just like libVLC.

What we need is a very specific, low level access to decode the data, in line how our other audio decoding functions are for WAV, OGG Vorbis or FLAC.

sveken commented 8 months ago

In regards to OPUS. Doesn't reso already support opus for audio streams with an opus library? if so why not as audio clips? It would be the best format to replace OGG vorbis as it is the successor lossy audio format to it.

shiftyscales commented 7 months ago

Updating the labels as this is not a bug. As highlighted above by Frooxius- we just do not have a suitable decoder library to handle mp3, and other formats. As Frooxius noted above:

We're open to suggestions for libs that we can, look at. Ideally pure C#. We already tried NLayer and MP3Sharp.

Until we find a suitable library to handle this purpose, this issue is not as likely to be prioritized.

Frooxius commented 7 months ago

It's definitely not a bug, but this issue shouldn't be "blocked". The only thing blocking it is us deciding to invest time into it.

There are some libraries for this and part of the work would be re-searching and integrating those, which we can do at any time - it just makes it a bigger chunk of work.

If someone from the community wants to do this research and find good options, that would make this smaller chunk of work on our end and more likely to prioritize it.

KyuubiYoru commented 2 months ago

Would it be possible to add an option to convert unsupported audio formats like MP3 to supported formats (OGG, FLAC, WAV) in the import dialog using FFmpeg?

FlameSoulis commented 2 months ago

Would it be possible to add an option to convert unsupported audio formats like MP3 to supported formats (OGG, FLAC, WAV) in the import dialog using FFmpeg?

Hmm... so, VLC can do conversations... is this extended also to libVLC?

Frooxius commented 2 months ago

Would it be possible to add an option to convert unsupported audio formats like MP3 to supported formats (OGG, FLAC, WAV) in the import dialog using FFmpeg?

I wouldn't introduce FFmpeg as dependency just for this - it's pretty big.

However in general, it's possible - we could even use the C# library, since it's main issue seems to be that it freaks out when seeking, so it could be a possible approach, but would lead to slower import.

Hmm... so, VLC can do conversations... is this extended also to libVLC?

Unfortunately not with the version we're using (UMP).