Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support reading the audio track of the video file as #MP3 #272

Closed
bohning opened this issue Dec 15, 2021 · 6 comments · Fixed by #433
Closed

Support reading the audio track of the video file as #MP3 #272

bohning opened this issue Dec 15, 2021 · 6 comments · Fixed by #433

Comments

@bohning
Copy link
Contributor

bohning commented Dec 15, 2021

Issue type: Feature request

Actual behaviour

USDX supports reading the audio track from the video file by setting, e.g.

#MP3:videofile.mp4
#VIDEO:videofile.mp4

If the video contains audio and is synchronous (this is probably the default), then a single video file with audio track is sufficient without the need to extract the audio track from the video file into a separate mp3 file.

UltraStar Play currently does not support this, resulting in an error:

[WRN] Unsupported audio format: videofile.mp4

Expected behaviour

It would be great if that feature was supported by UltraStar Play as well.

@achimmihca
Copy link
Collaborator

Sadly, getting an AudioClip from an mp4 file is not as easy with Unity as I expected.
I asked on their forums how to do it (if it can be done at all): https://forum.unity.com/threads/get-audioclip-from-mp4.1212537/

@bohning
Copy link
Contributor Author

bohning commented Dec 15, 2021

Interesting, I would as well have thought that this would be a rather easy feature to implement. Thanks for following up on it in the unity forums.

@achimmihca
Copy link
Collaborator

achimmihca commented Dec 18, 2021

Can't we create a Temp folder and conversion it?

This would be (a) the most complicated and (b) inefficient approach.

  • (a) because there is no conversion tool that we could ship or assume on all target platforms. Thus, we would have to write a converter ourself. Or the feature would be only available on some platforms with some configurations which IMO is not worth the effort.
  • (b) because instead of extracting audio once by the song creator, it is extracted by every user again. Wasted energy.
    • Further, there would still be a redundant audio file, wasting memory.
    • Plus the initial conversion would take some time, which results in bad user experience.

Thus, I argue that it's better to use a separate audio file in the first place if we cannot use the video file's audio "on the fly".

@achimmihca
Copy link
Collaborator

I close this as won't fix.
It is not supported by Unity and we do not want to implement media file decoding.

Workaround: Songs have to be created with a separate audio file.

@achimmihca
Copy link
Collaborator

To be more specific: it is not supported to get an AudioClip from a video file.

The AudioClip is expected in the current implementation. However, it might be possible to add an abstraction and make it work with a VideoPlayer as well (one VideoPlayer for the video, other VideoPlayer for the audio).

Need to look into this again.

@achimmihca achimmihca reopened this Apr 26, 2022
@achimmihca achimmihca moved this to Selected For Development in UltraStar Play - Roadmap & Backlog (2024) ⭐ Jan 30, 2023
@achimmihca achimmihca moved this from Selected For Development to Done - private repo (Steam release) in UltraStar Play - Roadmap & Backlog (2024) ⭐ Feb 20, 2023
@marwin89 marwin89 moved this from Done - private repo (Steam release) to ✅ Done in UltraStar Play - Roadmap & Backlog (2024) ⭐ Jan 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging a pull request may close this issue.

3 participants
@bohning @achimmihca and others