方法一: 在项目开发过程中,需要获取音视频文件时长.查询资料后发现 JAVE能够完美得到想要的结果,JAVE项目简介如下: The JAVE (Java Audio Video Encoder) library is Java wrapper on the ffmpeg project. Developers can take take advantage of JAVE to transcode audio and video files from a format to another. I
C# 获取 mp3文件信息[包括:文件大小.歌曲长度.歌手.专辑] 第一种方式:[代码已验证] // http://bbs.csdn.net/topics/390392612 string file = @"E:\滴答.mp3"; ShellClass sh = new ShellClass(); Folder dir = sh.NameSpace(Path.GetDirectoryName(file)); F
C# 获取 mp3文件信息[包括:文件大小.歌曲长度.歌手.专辑] 第一种方式:[代码已验证] // http://bbs.csdn.net/topics/390392612 string file = @"E:\滴答.mp3"; ShellClass sh = new ShellClass(); Folder dir = sh.NameSpace(Path.GetDirectoryName(file)); F
添加命名空间: using Shell32; using System.Text.RegularExpressions;添加引用:COM组件的Microsoft Shell Controls And Automation string dirName = Path.GetDirectoryName(SongPath);SongName = Path.GetFileName(SongPath);//获得歌曲名称FileInfo fInfo = new FileInfo(SongPath
import wave import os.path # 音频存放文件夹绝对路径 filedir = '/Users/111/PycharmProjects/TextClassify/wav' list = os.listdir(filedir) time_count = 0 for file in list: if '.wav' in file: wav_path = filedir+'/'+file with wave.open(wav_path,'rb') as f: f = wave.o