通过matlab从mp4视频中提取音频wav并保存 您所在的位置:网站首页 如何从mp4中提取出来音频 通过matlab从mp4视频中提取音频wav并保存

通过matlab从mp4视频中提取音频wav并保存

2023-08-17 10:15| 来源: 网络整理| 查看: 265

之前用matlab单独读取视频或者音频,这次使用插件下载了视频,想提取其中的音频,不想下载其他软件,现记录所用方法。

matlab 版本

Introduced in R2012b

audioread 和 audiowrite read支持格式

Platform Support File Format All platforms AIFC (.aifc) AIFF (.aiff, .aif) AU (.au) FLAC (.flac) OGG (.ogg) OPUS (.opus) WAVE (.wav) Windows® 7 (or later), Macintosh, and Linux® MP3 (.mp3) MPEG-4 AAC (.m4a, .mp4)

write支持格式

audiowrite supports the following file formats.

Platform Support File Format All platforms FLAC (.flac) OGG (.ogg) OPUS (.opus) WAVE (.wav) Windows® and Mac MPEG-4 AAC (.m4a, .mp4)

demo %% 读取 filepath = 'C:\Users\t\Downloads\[白叔]_少年行(《天宝伏妖录》插曲)\[白叔]_少年行(《天宝伏妖录》插曲).mp4'; [y,Fs] = audioread(filepath ); whos y %% 保存 wav filename = 'test.wav'; audiowrite(filename,y,Fs); %% 播放 sound(y,Fs); %%

不支持写入mp3

reference https://ww2.mathworks.cn/help/matlab/ref/audioread.htmlhttps://www.mathworks.com/matlabcentral/answers/667348-how-to-extract-audio-from-mp4-video-file-with-matlab


【本文地址】

公司简介

联系我们

今日新闻

    推荐新闻

    专题文章
      CopyRight 2018-2019 实验室设备网 版权所有