AlkantarClanX12
Current Path : /opt/alt/python39/lib64/python3.9/__pycache__/ |
Current File : //opt/alt/python39/lib64/python3.9/__pycache__/wave.cpython-39.opt-2.pyc |
a R�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/python39/lib64/python3.9/wave.pyr T s r � )N�b�hN�i�_wave_paramsz7nchannels sampwidth framerate nframes comptype compnamec @ s� e Zd Zdd� 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�� dkr0td��| j�d�dkrHtd��d| _d | _d| _ zt| jdd�}W n t y� Y q�Y n0 |�� }|d kr�| �|� d| _n2|d kr�| js�td��|| _|j| j | _d| _ q�|�� qT| jr�| js�td��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} s8 zWave_read.initfpc C sR d | _ t|t�r"t�|d�}|| _ z| �|� W n | j rF|�� � Y n0 d S )N�rb��_i_opened_the_file� isinstance�str�builtinsr r% �close�r"