Read wav files with only Python standard packages

problem

Additional Python packages such as scikits.audiolab and numpy I want to read a wav file in a situation where it cannot be entered.

Solution

Read with wave, ʻarray`.

import wave
import array

wavdata = wave.open(YOUR_WAV_FILE).readframes(-1)
audio = array.array("h", wavdata)   #When the bit width of wav is 16bit

Recommended Posts

Read wav files with only Python standard packages
[Python] POST wav files with requests [POST]
Read files in parallel with Python
Read csv with python pandas
Sorting image files with Python (2)
Sort huge files with python
Sorting image files with Python (3)
Sorting image files with Python
Integrate PDF files with Python
Reading .txt files with Python
Read json data with python
[Python] Use this to read and write wav files [wavio]
[Package cloud] Manage python packages with package cloud
Matrix representation with Python standard input
Recursively unzip zip files with python
Read and use Python files from Python
Decrypt files encrypted with OpenSSL with Python 3
MP3 to WAV conversion with Python
Comply with Python coding standard PEP8
[python] Read information with Redmine API
Handle Excel CSV files with Python
RPC completed with standard Python3 modules
Read fbx from python with cinema4d
I made a library to easily read config files with Python
Calculate and display standard weight with python
[AWS] Using ini files with Lambda [Python]
Play audio files from Python with interrupts
Python to remember only with hello, worlds
Read CSV file with python (Download & parse CSV file)
Update package with pip standard features only
[C] [python] Read with AquesTalk on Linux
Decrypt files encrypted with openssl from python with openssl
Let's read the RINEX file with Python ①
Read and write csv files with numpy
Download files on the web with Python
[Easy Python] Reading Excel files with openpyxl
Read and write JSON files in Python
UnicodeEncodeError struggle with standard output of python3
Convert HEIC files to PNG files with Python
[Easy Python] Reading Excel files with pandas
Read text in images with python OCR
Transcribe WAV files with Cloud Speech API
[Python] Add comments to standard input files
[Automation] Read mail (msg file) with Python
High resolution acoustic signal processing (1) --How to read 24-bit wav file with Python
How to read a CSV file with Python 2/3
[Python] Get the files in a folder with Python
Read data with python / netCDF> nc.variables [] / Check data size
Use additional Python packages with Serverless Framework (v1.x)
Read Python csv data with Pandas ⇒ Graph with Matplotlib
Read JSON with Python and output as CSV
[Python] How to read excel file with pandas
Medical image analysis with Python 1 (Read MRI image with SimpleITK)
Read table data in PDF file with Python
Read Excel name / cell range with Python VBA
Handle zip files with Japanese filenames in Python 3
Character encoding when dealing with files in Python 3
[Python3] Read and write with datetime isoformat with json
Download and import files with Splunk external python
Upload files to Google Drive with Lambda (Python)
Install Python 3 on MacOS Catalina (with Homebrew only)