soxi 命令大全

这篇博客详细介绍了Linux下的soxi命令,包括-V、-T、-t、-r、-c、-s、-d、-D、-b、-B、-p、-e和-a等参数的使用方法和输出内容。soxi命令用于获取音频文件的各种元数据,如采样率、通道数、时长、位深等,是音频处理中的实用工具。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

soxi 命令大全

使用命令

Usage: soxi [-V[level]] [-T] [-t|-r|-c|-s|-d|-D|-b|-B|-p|-e|-a] infile1 ...

参数介绍

-V 显示内容的详细程度,默认是2

-V[n] Increment or set verbosity level (default is 2)

输入(默认值)
soxi FAYUAN60000_0000000.wav
输出
Input File     : 'FAYUAN60000_0000000.wav'
Channels       : 2
Sample Rate    : 16000
Precision      : 16-bit
Duration       : 00:00:04.15 = 66400 samples ~ 311.25 CDDA sectors
File Size      : 266k
Bit Rate       : 512k
Sample Encoding: 16-bit Signed Integer PCM
输入(详细程度为4)
soxi -V4 FAYUAN60000_0000000.wav
输出
soxi INFO formats: detected file format type `wav'
soxi DBUG wav: Searching for 66 6d 74 20
soxi DBUG wav: WAV Chunk fmt 
soxi DBUG wav: Searching for 64 61 74 61
soxi DBUG wav: WAV Chunk data
soxi DBUG wav: Reading Wave file: Microsoft PCM format, 2 channels, 16000 samp/sec
soxi DBUG wav:         64000 byte/sec, 4 block align, 16 bits/samp, 265600 data bytes
soxi DBUG wav:         66400 Samps/chans
soxi DBUG wav: Searching for 4c 49 53 54

Input File     : 'FAYUAN60000_0000000.wav'
Channels       : 2
Sample Rate    : 16000
Precision      : 16-bit
Duration       : 00:00:04.15 = 66400 samples ~ 311.25 CDDA sectors
File Size      : 266k
Bit Rate       : 512k
Sample Encoding: 16-bit Signed Integer PCM

-T 多个文件一起查看,可以通过修改-s, -d和-D的值来显示的文件

-T With -s, -d or -D, display the total across all given files

当-s, -d, -D一起使用的时候,显示的是最后一个参数的值

输入
soxi -T FAYUAN60000_0000000.wav FAYUAN80001_0000000.wav

soxi -T -s FAYUAN60000_0000000.wav FAYUAN80001_0000000.wav

soxi -T -D FAYUAN60000_0000000.wav FAYUAN80001_0000000.wav

soxi -T -s -D FAYUAN60000_0000000.wav FAYUAN80001_0000000.wav
输出
# -T
Input File     : 'FAYUAN60000_0000000.wav'
Channels       : 2
Sample Rate    : 16000
Precision      : 16-bit
Duration       : 00:00:04.15 = 66400 samples ~ 311.25 CDDA sectors
File Size      : 266k
Bit Rate       : 512k
Sample Encoding: 16-bit Signed Integer PCM


Input File     : 'FAYUAN80001_0000000.wav'
Channels       : 2
Sample Rate    : 16000
Precision      : 16-bit
Duration       : 00:00:03.90 = 62400 samples ~ 292.5 CDDA sectors
File Size      : 250k
Bit Rate       : 512k
Sample Encoding: 16-bit Signed Integer PCM

Total Duration of 2 files: 00:00:08.05

# -T -s
128800.000000

# -T -d
00:00:08.05

# -T -D
8.050000

# -T -s -D
8.050000

-t 显示检测到的文件类型

-t Show detected file-type

输入
soxi -t FAYUAN60000_0000000.wav
输出
wav

-r 显示采样率

-r Show sample-rate

输入
soxi -r FAYUAN60000_0000000.wav 
输出
16000

-c 显示通道数

-c Show number of channels

输入
soxi -c FAYUAN60000_0000000.wav
输出
2

-s 显示样本数,如果不可用则为0

-s Show number of samples (0 if unavailable)

输入
soxi -s FAYUAN60000_0000000.wav
输出
66400

-d 显示音频时长,按时分秒的形式显示时间,如果不可用则为0。时间计算方式为样本数除以采样率。

-d Show duration in hours, minutes and seconds (0 if unavailable)

输入
soxi -d FAYUAN60000_0000000.wav
输出
00:00:04.15

-D 显示音频市场,以秒为单位

-D Show duration in seconds (0 if unavailable)

输入
soxi -D FAYUAN60000_0000000.wav
输出
4.150000

-b 显示每个样本的位数

-b Show number of bits per sample (0 if not applicable)

输入
soxi -b FAYUAN60000_0000000.wav FAYUAN80001_0000000.wav
输出
16
16

-B 显示文件的比特率

-B Show the bitrate averaged over the whole file (0 if unavailable)

输入
soxi -B FAYUAN60000_0000000.wav
输出
512K

-p 显示估计的样本位数

-p Show estimated sample precision in bits

输入
soxi -p FAYUAN60000_0000000.wav
输出
16

-e 显示音频的编码格式

-e Show the name of the audio encoding

输入
soxi -e FAYUAN60000_0000000.wav
输出
Signed Integer PCM

-a 如果文件有注释信息则显示

-a Show file comments (annotations) if available

输入
soxi -a FAYUAN60000_0000000.wav
输出
# 我的音频文件没有这个注释
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值