file in abyss
フォーマット一覧へ戻る

Audio

WAV Waveform Audio File Format

非圧縮PCM音声で広く使われるRIFFベースの音声形式。先頭RIFFと8バイト目のWAVEで識別します。

Extensions .wav
MIME audio/wav, audio/x-wav

マジックナンバー

ファイルを解析
オフセット 0 RIFF container with WAVE form type
52 49 46 46
RIFF

構造

  1. RIFF header
  2. WAVE form type
  3. fmt chunk
  4. data chunk

注意点

  • RIFFはAVIやWebPなどにも使われるため、WAVE form typeの確認が必要です。

判定コード例

SIGNATURE = bytes.fromhex("52494646")
OFFSET = 0

def is_wav(path: str) -> bool:
    with open(path, "rb") as f:
        f.seek(OFFSET)
        head = f.read(len(SIGNATURE))
    return head == SIGNATURE

実践的な使い方

ユースケース

Waveform Audio File Format は再生、波形処理、アップロードチェック、再生時間の処理、ビットレート検証などで使われます。短いクリップ・無音・環境音はプレイヤーや変換の境界条件を洗い出すのに役立ちます。

よくある判定ミス

  • .wav という拡張子だけではファイルの中身を保証できません。アップロードや変換の処理では、拡張子・MIMEタイプ・先頭バイト・形式固有の構造チェックを組み合わせるべきです。
  • Waveform Audio File Format は 52 49 46 46 のようなシグネチャで始まりますが、関連するコンテナや破損ファイルでは追加の検証が必要になる場合があります。

セキュリティ上の注意

メディアファイルも、壊れたメタデータ・極端な寸法・長い再生時間・異常なチャンクでデコーダに負荷をかけることがあります。処理前にサイズ・寸法・長さを読み取ってください。

サンプルの活用

11 個のサンプルで、再生時間の処理・再生開始・メタデータ読み取り・ダウンロード挙動をテストできます。

サンプルファイル

11 / 11 files
Sample Traits Size Source / license / SHA-256
Aud

1s Silence WAV

1s Silence WAV is a Waveform Audio File Format sample generated for file format testing. It can be used to test downloads, parsers, previews, and file type detection.

silence-1s.wav
Type Sample
86 KB
Generated CC0 1.0
SHA-256 00e509b455e8b32ef45849156e35bd62b17470ff4d22820bd39621f84a110e05
Download
Aud

Lake Waves WAV 0.25s

Lake Waves WAV 0.25s is a Waveform Audio File Format sample based on Wikimedia Commons, 0.25s. It can be used to test downloads, parsers, previews, and file type detection.

01-lake-waves.wav
Duration 0.25s
Short clip
43 KB
SHA-256 e3db27b5f78e5cfe841ec076fac78d32b7152e1dfe645b341be7707415b5ddf3
Download
Aud

Lake Waves WAV 0.5s

Lake Waves WAV 0.5s is a Waveform Audio File Format sample based on Wikimedia Commons, 0.5s. It can be used to test downloads, parsers, previews, and file type detection.

02-lake-waves.wav
Duration 0.5s
Short clip
84 KB
SHA-256 f0f0c576ff8e5de3e7c92521333838570d005963278faf986853ea8030f74f9f
Download
Aud

Lake Waves WAV 1s

Lake Waves WAV 1s is a Waveform Audio File Format sample based on Wikimedia Commons, 1s. It can be used to test downloads, parsers, previews, and file type detection.

03-lake-waves.wav
Duration 1s
1s media
172 KB
SHA-256 ee2bccd91cfb9a1d490a4ce39672e79ba5559d716ab6f2f8311fa01d1e4af13f
Download
Aud

Lake Waves WAV 1.5s

Lake Waves WAV 1.5s is a Waveform Audio File Format sample based on Wikimedia Commons, 1.5s. It can be used to test downloads, parsers, previews, and file type detection.

04-lake-waves.wav
Duration 1.5s
1.5s media
258 KB
SHA-256 afea543ba345a6d597f4e1a6902fd295da40cc664b530d96559399d8fc8ecd1b
Download
Aud

Lake Waves WAV 2s

Lake Waves WAV 2s is a Waveform Audio File Format sample based on Wikimedia Commons, 2s. It can be used to test downloads, parsers, previews, and file type detection.

05-lake-waves.wav
Duration 2s
2s media
345 KB
SHA-256 e52d7191fb7249eecf97a1da6c46f52c6211d5a726c55752ee9202713d7950a5
Download
Aud

Lake Waves WAV 3s

Lake Waves WAV 3s is a Waveform Audio File Format sample based on Wikimedia Commons, 3s. It can be used to test downloads, parsers, previews, and file type detection.

06-lake-waves.wav
Duration 3s
3s media
517 KB
SHA-256 d142d896d3b6e0770131aad952142bf3df79da3ce52a6eacbe6b559c65a88660
Download
Aud

Lake Waves WAV 4s

Lake Waves WAV 4s is a Waveform Audio File Format sample based on Wikimedia Commons, 4s. It can be used to test downloads, parsers, previews, and file type detection.

07-lake-waves.wav
Duration 4s
4s media
689 KB
SHA-256 ac2b914c0e5a24fe51bdd3eef57e5ccc2ca70292a6bc7f651d1ae95d7deafaf2
Download
Aud

Lake Waves WAV 6s

Lake Waves WAV 6s is a Waveform Audio File Format sample based on Wikimedia Commons, 6s. It can be used to test downloads, parsers, previews, and file type detection.

08-lake-waves.wav
Duration 6s
6s mediaLarge file
1.01 MB
SHA-256 0c89fc574fc778f9459f288acb7b19efb684a17af9ae65aadf94ede31b00883b
Download
Aud

Lake Waves WAV 8s

Lake Waves WAV 8s is a Waveform Audio File Format sample based on Wikimedia Commons, 8s. It can be used to test downloads, parsers, previews, and file type detection.

09-lake-waves.wav
Duration 8s
8s mediaLarge file
1.34 MB
SHA-256 1032ad0b84d973270c3ad472cbdc990217f6c31718a8c8c81f430dcc377c52d8
Download
Aud

NASA TV Audio WAV

NASA TV Audio WAV is a Waveform Audio File Format sample based on NASA Image and Video Library, 2s. It can be used to test downloads, parsers, previews, and file type detection.

nasa-tv-audio.wav
Duration 2s
2s media
345 KB
SHA-256 0140391d3296e40a0f5770ae2a51fe675e71aad7a2dd45421ac9edb1a6e5e03c
Download

よくある質問

Waveform Audio File Format のマジックナンバー(ファイルシグネチャ)は?

Waveform Audio File Format ファイルはバイトシグネチャ 52 49 46 46 ("RIFF") で始まります。拡張子に頼らず、この先頭バイトを読み取って形式を判定してください。

Waveform Audio File Format のMIMEタイプは?

Waveform Audio File Format のMIMEタイプは audio/wav, audio/x-wav です。

Waveform Audio File Format の拡張子は?

Waveform Audio File Format ファイルは .wav 拡張子を使います。拡張子は慣習にすぎず中身を保証しないため、シグネチャや構造のチェックと組み合わせてください。

関連フォーマット