Questions tagged [wave]

WAVE - this tag refers to the python module for the WAV sound format.

The wave module provides a convenient interface to the WAV sound format. It does not support compression/decompression, but it does support mono/stereo.

It's recommended to use this tag in connection with , due to the colloquial meaning of wave (ex. in math or physics)

507 questions
12
votes
2 answers

AVAudioRecorder doesn't write out proper WAV File Header

I'm working on a project on the iPhone where I'm recording audio from the device mic using AVAudioRecorder, and then will be manipulating the recording. To ensure that I'm reading in the samples from the file correctly, I'm using python's wave…
ch3rryc0ke
  • 2,763
  • 1
  • 19
  • 28
12
votes
3 answers

How to read stream of .wav bytes in python

Is there a way to read frames of .wav format binary data? I am streaming .wav binary to a python server which I want to be able to read and use from processing by pyaudio, which complains about the frame size. Since I cannot use…
user7993435
10
votes
9 answers

Software to convert audio to MIDI

Does any one know if there is good software to perform conversion from (wave or mp3 or other known format) to MIDI? I understand that conversion from audio file to MIDI is a very complex process. I'm currently developing a course project for my…
aumanets
  • 3,483
  • 8
  • 36
  • 59
10
votes
4 answers

Wave Simulation with Python

I want to simulate a propagating wave with absorption and reflection on some bodies in three dimensional space. I want to do it with python. Should I use numpy? Are there some special libraries I should use? How can I simulate the wave? Can I use…
kame
  • 16,824
  • 28
  • 95
  • 142
10
votes
5 answers

reading a WAV file from TIMIT database in python

I'm trying to read a wav file from the TIMIT database in python but I get an error: When I'm using wave: wave.Error: file does not start with RIFF id When I'm using scipy: ValueError: File format b'NIST'... not understood. and when I'm using…
okuoub
  • 864
  • 1
  • 17
  • 38
10
votes
2 answers

Opening a wave file in Python: unknown format: 49. What's going wrong?

I try to open a wave file with the wave module, but I keep getting the same error whatever I try. The line with the error is the following: wav = wave.open(f) This is the error message: Traceback (most recent call last): File "annotate.py", line…
Lewistrick
  • 1,918
  • 5
  • 26
  • 41
9
votes
2 answers

remove silence at the beginning and at the end of wave files with PyDub

How can I remove the silence from the beginning and the end of wave files with PyDub? I guess I should access segment by segment and check whether it's silent or not (but I'm not able to do it) :/ e.g. I have a wave file with silence at the…
DaniPaniz
  • 988
  • 2
  • 10
  • 18
8
votes
8 answers

What is the easiest way to read wav-files using Python [summary]?

I want to use Python to access a wav-file and write its content in a form which allows me to analyze it (let's say arrays). I heard that "audiolab" is a suitable tool for that (it transforms numpy arrays into wav and vica versa). I have installed…
Roman
  • 97,757
  • 149
  • 317
  • 426
7
votes
4 answers

how to convert wav file to float amplitude

so I asked everything in the title: I have a wav file (written by PyAudio from an input audio) and I want to convert it in float data corresponding of the sound level (amplitude) to do some fourier transformation etc... Anyone have an idea to…
user995673
  • 71
  • 1
  • 1
  • 2
7
votes
2 answers

NAudio playing a sine wave for x milliseconds using C#

I am using NAudio to play a sinewave of a given frequency as in the blog post Playback of Sine Wave in NAudio. I just want the sound to play() for x milliseconds and then stop. I tried a thread.sleep, but the sound stops straightaway. I tried a…
amcashcow
  • 694
  • 1
  • 5
  • 16
7
votes
6 answers

why am i getting error when importing AudioSegment?

i'm trying to use pydub, but when i import it to python with AudioSegment it will give me an error saying it doesn't recognize it. i tried using pip install and searching online. any help?? i'm using python 2.7 from pydub import AudioSegment
Sh0z
  • 107
  • 1
  • 2
  • 7
7
votes
4 answers

Python Wave byte data

I'm trying to read the data from a .wav file. import wave wr = wave.open("~/01 Road.wav", 'r') # sample width is 2 bytes # number of channels is 2 wave_data = wr.readframes(1) print(wave_data) This gives: b'\x00\x00\x00\x00' Which is the "first…
jameh
  • 1,009
  • 3
  • 11
  • 19
6
votes
4 answers

Playing an arbitrary sound on Windows?

How do I, say, play a sound with a given amplitude and a given frequency makeup (say, consisting of frequencies 2 kHz and 3 kHz) natively on Windows (32-bit and 64-bit, up to Windows 7)? (By natively I mean without using an external library.) I…
user541686
  • 189,354
  • 112
  • 476
  • 821
6
votes
3 answers

C++ - Play back a tone generated from a sinusoidal wave

Hey everyone, I'm currently trying to figure out how to play back a tone I have generated using a sinusoidal wave. Here's my code: #include #include #include #include using namespace std; int main…
Moonlight293
  • 177
  • 1
  • 5
  • 13
6
votes
1 answer

Audio Frequencies in Python

I'm writing a code to analyse a single audio frequency sung by a voice. I need a way to analyse the frequency of the note. Currently I am using PyAudio to record the audio file, which is stored as a .wav, and then immediately play it back. import…
Ollie
  • 85
  • 1
  • 1
  • 7
1
2
3
33 34