관리-도구
편집 파일: wave.cpython-310.opt-2.pyc
o 6��fTF � @ s� d dl mZ d dlmZ d dlZd dlZd dlZd dlZg d�ZG dd� de �Z dZdZed d �Z G dd� d�ZG d d� d�Zddd�ZdS )� )�Chunk)� namedtupleN)�open�Error� Wave_read� Wave_writec @ s e Zd ZdS )r N)�__name__� __module__�__qualname__� r r �+/opt/alt/python310/lib64/python3.10/wave.pyr T s r � )N�b�hN�i�_wave_paramsz7nchannels sampwidth framerate nframes comptype compnamec @ s� e Zd Z dd� Zdd� Zdd� Zdd� Zd d � Zdd� Zd d� Z dd� Z dd� Zdd� Zdd� Z dd� Zdd� Zdd� Zdd� Zdd � Zd!d"� Zd#d$� Zd%d&� Zd'd(� Zd)d*� Zd+S ),r c C s� d | _ d| _t|dd�| _| j�� dkrtd��| j�d�dkr$td��d| _d | _ d| _ z t| jdd�}W n t y@ Y n0w |�� }|d krR| �|� d| _n|d krk| js]td��|| _|j| j | _d| _ n|�� q+| jrv| jsztd��d S ) Nr )Z bigendian� RIFFz file does not start with RIFF id� � WAVEznot a WAVE filer � fmt � datazdata chunk before fmt chunkz#fmt chunk and/or data chunk missing)�_convert� _soundposr �_fileZgetnamer �readZ_fmt_chunk_read�_data_chunk�_data_seek_needed�EOFError�_read_fmt_chunkZ chunksize� _framesize�_nframes�skip)�self�file�chunkZ chunknamer r r �initfp} s@ � ��zWave_read.initfpc C �J d | _ t|t�rt�|d�}|| _ z| �|� W d S | j r$|�� � )N�rb��_i_opened_the_file� isinstance�str�builtinsr r% �close�r"