WAVE Sample Files

本文提供了多种类型的WAV文件样本,包括不同采样率、位深度及压缩格式等,适用于测试和研究各种WAV文件格式。

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

关于画wav文件声音数据波形图,  见上篇日志 http://blog.csdn.net/touzani/archive/2007/06/17/1654943.aspx

下面这篇文章有各种格式的wav文件地址, 可以做为素材..以供测试..

原文地址: http://www-mmsp.ece.mcgill.ca/Documents/AudioFormats/WAVE/Samples.html

The following are WAVE files with various data types.

  • The files marked with an asterisk (*) will not play with Windows Media Player.
  • The file marked with a plus sign (+) plays as noise with Windows Media Player.

Sample Files from CopyAudio

The CopyAudio program (part of the AFsp package) can produce output files of a number of different types. Samples files produced by converting stereo 16-bit data are as follows. All of these files have information chunks at the end of the file after the sampled data.

Sample Files from GoldWave

The following file were created by Goldwave. The µ-law and A-law formats differ slightly from those produced by CopyAudio (The ITU-T standard is permissive as to which way to quantize sample values which fall exactly mid-way between output values.)

Multi-Channel Examples (WAVE_FORMAT_EXTENSIBLE)

A six channel (5.1 channel) audio file from the Microsoft site: 5.1 Audio

6_Channel_ID.wav (3.0 MB) Warning: LARGE file
A 6-channel WAVE file with speaker locations (FL FR FC LF BL BR)
44100 Hz, 16-bit, 5.8 s
- This file has a "cue " chunk with a count of zero cue points, followed by two empty cue point structures.

An eight channel (7.1 channel) audio file from the Microsoft site: Creating 7.1 Audio

8_Channel_ID.wav (8.8 MB) Warning: LARGE file
An 8-channel WAVE file with speaker locations (FL FR FC LF BL BR - -)
48000 Hz, 24-bit, 8.05 s
- The voice annotation and tone for this file appear in the channels in the recording as follows. The relative times of the voice annotation in the different channels is indicated by the ordinal number.
  Channel 1: 1st:  "Front Left"
  Channel 2: 2nd: "Front  Right"
  Channel 3: 3rd: "Centre"
  Channel 4: 6th:  tone
  Channel 5: 4th: "Back Left"
  Channel 6: 5th: "Back Right"
  Channel 7: 7th: "Auxiliary Left"
  Channel 8: 8th: "Auxiliary Right"

SoundCard Attrition Files (including WAVE_FORMAT_EXTENSIBLE files)

These files are taken from Soundcard Attrition Page.

  • stereol.wav (116 kB)
    A standard 16-bit stereo WAVE file, but with a long header
    22050 Hz, 16-bit, 1.32 s
    stereofl.wav (229 kB) +
    The same, but in TYPE-3 32-bit floats
    22050 Hz, 1.32 s
    4ch.wav (1,321 kB)
    Speech idents, in LCRS surround format
    44100 Hz, 3.83 s (from Microsoft)
    drmapan.wav (825 kB)
    Drum, panned ambisonically in a circle in quad format (LF, RF, LR, RR)
    22050 Hz, 4.78 s (created with CDP Multi-Channel Toolkit)

Perverse Files

The following WAVE files are perverse or have problems.

  • Pmiscck.wav (1 kB)
    WAVE file (9 samples) with an odd length intermediate chunk (type " XxXx").
    Ptjunk.wav (1 kB)
    WAVE file with trailing junk after the RIFF chunk.
    GLASS.WAV (79 kB)
    WAVE file with a RIFF chunk length larger than the file size (originally from www.sipro.com).
    Utopia Critical Stop.WAV (6 kB)
    WAVE file, PCM data, with a Fact chunk following the data. The Fact chunk contains the four characters " FILT" and not the number of samples. (From C:/WINNT/Media on a Windows 2000 system).

Other WAVE files

These files are from CCRMA at Stanford: ftp://ftp-ccrma.stanford.edu/pub/Lisp/sf.tar.gz.


width="728" scrolling="no" height="90" frameborder="0" align="middle" src="http://download1.csdn.net/down3/20070601/01184120111.htm" marginheight="0" marginwidth="0">
### 使用Python `wave`模块创建和编辑音频文件 #### 创建简单的正弦波音频文件 为了使用Python的`wave`模块来创建一个基本的声音文件,比如一段持续时间为1秒钟、频率为1kHz的正弦波音调,可以通过下面的方式实现[^2]: ```python import math import struct import wave sample_rate = 44100.0 # 音频采样率 (samples per second) frequency = 1000.0 # 正弦波的频率, Hz num_samples = int(sample_rate) audio_data = [] for i in range(num_samples): value = int(32767 * math.sin(frequency * math.pi * float(i) / sample_rate)) packed_value = struct.pack('h', value) audio_data.append(packed_value) with wave.open('sine_wave.wav', 'wb') as wf: wf.setnchannels(1) # 单声道 wf.setsampwidth(2) # 设置样本宽度为两个字节 wf.setframerate(int(sample_rate)) # 设定帧速率 wf.writeframes(b''.join(audio_data)) ``` 这段代码首先定义了一些参数,如采样率(`sample_rate`)、要生成的正弦波的频率(`frequency`)以及总的样本数量(`num_samples`)。接着计算每个时间点上的振幅值并将其转换成二进制数据存储到列表中。最后,通过设置通道数、样本宽度及帧速率等属性,并将之前准备好的原始音频数据写入新的`.wav`文件。 #### 编辑现有的WAV文件 对于已有音频文件的操作,可以采用不同的方式对其进行修改或拼接。例如,在不改变原有内容的基础上向现有音频结尾追加另一段声音片段。这里展示了一个简单的方法来完成这项工作[^1]: ```python def append_audio_files(output_filename, input_filenames): with wave.open(output_filename, 'wb') as out_wav: first_file = True for filename in input_filenames: with wave.open(filename, 'rb') as wavin: if first_file: out_wav.setparams(wavin.getparams()) first_file = False frames = wavin.readframes(wavin.getnframes()) out_wav.writeframes(frames) input_files = ['part1.wav', 'part2.wav'] # 假设有两部分待组合的音频文件 output_combined = 'combined_output.wav' append_audio_files(output_combined, input_files) ``` 此函数接收目标输出路径名和一系列输入文件名称作为参数。它会遍历给定的所有源文件并将它们依次复制到一个新的输出文件里。注意,只有第一次遇到的有效音频头信息会被应用到最终的结果上。 #### 处理多轨或多声道音频 如果涉及到更复杂的场景,像处理立体声或其他形式的多声道音频,则需调整相应的配置项,如增加通道数目至2(即双声道),同时确保每次写入的数据量也相应扩大一倍以适应额外的信息流[^4]。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值