What is Python aifc.getnframe?

What is an audio frame?

An audio frame is a data record containing samples for all the channels available in an audio signal. The size of the audio frame is calculated by multiplying the number of channels by the sample size in bytes the number of channels.

aifc module

The aifc module is a module that supports reading and writing AIFF and AIFF-C files.

AIFF stands for Audio Interchange File Format, a format for storing digital audio samples in a file. Its newer version is AIFF-C, which includes the ability to compress the audio data. It defines many functions such as rewind, getnframes, readframes, getmarkers, readframes, readframes, etc.

aifc.getnframe

aifc.getnframes returns the number of audio frames in the file. It usually returns integer type.

Syntax:

aifc.getnframes()

Importing aifc library:

import aifc

# getting number of frames in audio frame
import aifc
obj = aifc.open('my_sound.aiff','r')
print( "Channels number: ",obj.getnchannels())
# to calculate number of andio frames
print ("Number of frames",obj.getnframes())
# close object
obj.close()

Free Resources