How to draw the audio track from a video which contains audio?

4 ビュー (過去 30 日間)
Weiqian Jiang
Weiqian Jiang 2016 年 8 月 17 日
回答済み: Raghava S N 2024 年 10 月 28 日 5:14
Hi there, I want to draw the audio track and analyze it from a video which has audio, but it seems that the "videoreader" cannot do this function, so I wanna whether there is any method that can do this function? Many thanks!

回答 (1 件)

Raghava S N
Raghava S N 2024 年 10 月 28 日 5:14
Hi,
As you are looking to extract audio data from a video file, the function “audioread can be used. The “audioread” function can take a MPEG-4 AAC (.m4a” or.mp4) video file as input, from which the audio data can be extracted. Refer to the documentation of “audioread” for more information - https://www.mathworks.com/help/matlab/ref/audioread.html#:~:text=.mp3)%2C-,MPEG%2D4%20AAC%20(.m4a%2C%20.mp4),-%2C%20OGG%20(.ogg.
Here is a code snippet that displays this functionality –
>> [y,Fs] = audioread('<path_to_your_video/your_video>.mp4');
>> audiowrite('outputfile.WAV',y,Fs);
The extracted audio can be stored in a format supported by MATLAB. Refer to this documentation link for the list of audio formats supported by MATLAB - https://www.mathworks.com/help/matlab/import_export/supported-video-file-formats.html#:~:text=in%20MATLAB%20again.-,Audio%20Data%20in%20MATLAB,-What%20Are%20Audio.
For additional details on extracting audio from videos, refer to this MATLAB Answers post - https://www.mathworks.com/matlabcentral/answers/437261-how-to-extract-audio-from-mp4.
Hope this helps!

カテゴリ

Help Center および File ExchangeAudio and Video Data についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by