[bash] update
This commit is contained in:
1 parent
09a0865c5c
commit
423269f538
4 files changed
+58
-22
No files matched your search
@@ -1,10 +1,14 @@
|
||||
import wave
|
||||
# 读取wave文件,并打印采样率、量化位数、声道数
|
||||
# 读取wave文件,并打印data长度
|
||||
with wave.open('output_1708083097.9604511.wav', 'rb') as f:
|
||||
with wave.open('output.wav', 'rb') as f:
|
||||
data = f.readframes(f.getnframes())
|
||||
print(len(data))
|
||||
print(type(data))
|
||||
nchannels, sampwidth, framerate, nframes, comptype, compname = f.getparams()
|
||||
print(framerate, sampwidth, nchannels)
|
||||
|
||||
print("采样率:", framerate)
|
||||
print("量化位数:", sampwidth)
|
||||
print("声道数:", nchannels)
|
||||
print("data长度:", nframes)
|
||||
print("压缩类型:", comptype)
|
||||
print("压缩名称:", compname)
|
||||
Reference in new issue
Block a user