How to get the audio part of MP4 (video file)?

I am developing a Windows Phone 7 application and recording videos. I would like to get the audio part of the video file (MP4) and make some sound improvements. I believe that sound is saved as AAC frames in MP4. (Correct?) How can I extract the sound of an MP4 video file?

Since this is a video file, it can be a huge file. Thus, uploading to the cloud and processing there is not a good option. Since this is a WP7 application, I can not use unmaged dlls :( Is there a way to do it in pure C #? With any open source tools / samples?

Thanks!

+4
source share
1 answer

MP4 is a container format, and the realistic sound part is not always AAC. It can be MP3 or any other number of different audio formats. Perhaps you are thinking of an M4A, which I believe requires either AAC or ALAC.

In connection with the extraction of the audio file, it should be possible to extract the audio file from MP4 using only managed code. You will need to read in MP4 format ( here , for example, this question is also worth reading), and then search the file for the location of the audio file, and then either copy it to your own buffer, or perform your manipulations in pieces. Even then you will need to know when it is not an audio format that your application will not support.

It is possible that a .net library already exists that can do all this, but I don't know anything. This is probably not very popular, because managed code is definitely not the best angle for this, but given that this is a Windows Phone, it, as you noted, is your only way to approach it.

Good luck

+5
source

Source: https://habr.com/ru/post/1412942/


All Articles