On this page
wave.open
Prev: wave.Error | Up: wave | Next: wave.Wave_read
Rel: wave.Error, wave.Wave_read, wave.Wave_write
Ref: docs.python.org — wave.open
Tags: #public #python3 #stdlib #wave
Import
import wave
from wave import open
Signature & Overview
wave.open(f, mode=None)
wave.open() function.
Usage
import io, wave
buf = io.BytesIO()
with wave.open(buf, 'wb') as wf:
wf.setparams((1, 2, 16000, 0, 'NONE', 'not compressed'))
wf.writeframes(b'\x00\x00' * 10)
buf.seek(0)
with wave.open(buf, 'rb') as rf:
assert rf.getnframes() == 10
Gotchas
- Uncompressed PCM WAV only (no MP3/FLAC/ADPCM).
REPL Inspect
from wave import open
help(open)
Linked from
Related notes
- tuts/python3/stdlib_module/wave/Error Linked here; links to this page; shared tags: #stdlib, #wave
- tuts/python3/stdlib_module/wave/Wave_read Linked here; links to this page; shared tags: #stdlib, #wave
- tuts/python3/stdlib_module/wave/Wave_write Linked here; links to this page; shared tags: #stdlib, #wave
- tuts/python3/stdlib_module/wave Linked here; links to this page; shared tags: #stdlib
- tuts/c/stdlib shared tags: #stdlib
- tuts/c/stdlib/assert shared tags: #stdlib
- tuts/c/stdlib/assert/assert shared tags: #stdlib
- tuts/c/stdlib/assert/static_assert shared tags: #stdlib
- tuts/c/stdlib/ctype shared tags: #stdlib
- tuts/c/stdlib/ctype/isalpha shared tags: #stdlib