0 votes
by (8.2k points)
edited by

I'm currently working on the development I extracted a .mp3 file with MediaMuxer because I need to extract audio from my video file. However, for .mp3 files extracted with MediaMuxer, they could not be called up to UnityWebRequest or WWW. extracted with MediaMuxerIt felt like I was like changed only in video file extension of the mp3. Is there any other way besides MediaMuxer? FFmpeg may not be used due to license problem.

1 Answer

0 votes
by (8.2k points)
edited by

The question was, "Are you looking to extract out the audio to play it inside unity itself as an audio source or do you want to save it to disk?" It is important because you have two completely different answers. If you want to play the video inside an AudioSource, you can do it by changing the AudioSourceOutput to AudioSource and setting the AudioSource. If you want to save the audio from the video to the disk. You can extract the audio while playing the video, but it means a lot of GPU is wasted on decoding the video. After that, you would need to save it in a good formated MP3 which is not trivial and would need an external library.

upload_2022-7-25_23-17-4.png
Make sure you have a video clip selected if the source is Video Clip or you will not see the AudioSource field.

TechXR runs courses in AR / VR / Metaverse / Game Development. Some of the popular Q&A in our courses are available here for easy discovery.

113 questions

117 answers

55 comments

105k users

...