all Python 3until 3.13Removed from the standard libraryterm
aifc
removed modules
Read and write AIFF and AIFF-C audio files. Removed in Python 3.13 — use wave for WAV files and third-party libraries for AIFF.
Syntax
import aifc # до 3.13
aifc opened AIFF files, an Apple format popular in the 1990s: aifc.open(), then setnchannels/setsampwidth/setframerate and writeframes for writing, getparams() and readframes() for reading. PEP 594 dropped it as an obsolete format with no users left in the standard library. There is no direct stdlib replacement for AIFF. If you choose the file format, switch to WAV: the wave module has the same method names (open, setparams, writeframes, getparams, readframes), so the code is ported by replacing aifc with wave. If you must read AIFF itself, use soundfile or pydub; the standard-aifc package on PyPI brings the old module back unchanged.
Examples
# Python 3.13+
try:
import aifc
except ModuleNotFoundError as e:
print(type(e).__name__) # → ModuleNotFoundError
# Python 3.13+
import wave
with wave.open('tone.wav', 'wb') as w:
w.setnchannels(1)
w.setsampwidth(2)
w.setframerate(8000)
w.writeframes(b'\x00\x00' * 100)
with wave.open('tone.wav', 'rb') as r:
print(r.getnframes(), r.getframerate()) # → 100 8000
import aifc
with aifc.open('tone.aiff', 'wb') as w:
w.setnchannels(1)
w.setsampwidth(2)
w.setframerate(8000)
w.writeframes(b'\x00\x00' * 100)
with aifc.open('tone.aiff', 'rb') as r:
print(r.getnframes(), r.getframerate()) # → 100 8000
See also
Common errors
Open in the full glossarydocs.python.orgReport an inaccuracy