On this page
  1. wave.Wave_read
  2. Import
  3. Signature & Overview
  4. Methods & Attributes
  5. Usage
  6. Gotchas
  7. REPL Inspect

wave.Wave_read

Prev: wave.open | Up: wave | Next: wave.Wave_write
Rel: wave.Error, wave.open, wave.Wave_write
Ref: docs.python.org — wave.Wave_read
Tags: #public #python3 #stdlib #wave


Import

import wave
from wave import Wave_read

Signature & Overview

wave.Wave_read(f)

Variables used in this class: These variables are available to the user though appropriate methods of this class:

Methods & Attributes

Usage

import io, wave

buf = io.BytesIO()
with wave.open(buf, 'wb') as wf:
    wf.setnchannels(1); wf.setsampwidth(2); wf.setframerate(8000); wf.writeframes(b'\x00\x00')
buf.seek(0)
with wave.open(buf, 'rb') as rf:
    assert isinstance(rf, wave.Wave_read) and rf.getnframes() == 1

Gotchas

REPL Inspect

from wave import Wave_read
help(Wave_read)

Linked from

Related notes