Questions tagged [wave]

This tag is for questions about the Python module wave - for working with the .wav sound format. FOR GENERAL WAV QUESTIONS, not related to Python, please use the [wav] tag.

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)

498 questions
7
votes
2 answers

Compare voice wav in android or voice tag ( voice commands ) API

I'm developing an app and I need some way to compare 2 voices if they' match or not, I know that Voice Recognizer is a way to do that but since (i think) it needs to translate the voice into string first, it won't be so suitable for other language…
rami
  • 341
  • 2
  • 4
  • 8
7
votes
2 answers

Play a part of a .wav file in python

Is it possible to play a certain part of a .wav file in Python? I'd like to have a function play(file, start, length) that plays the audiofile file from start seconds and stops playing after length seconds. Is this possible, and if so, what library…
Lewistrick
  • 2,649
  • 6
  • 31
  • 42
6
votes
3 answers

Determining Bit-Depth of a wav file

I am looking for a fast, preferably standard library mechanism to determine the bit-depth of wav file e.g. '16-bit' or '24-bit'. I am using a subprocess call to Sox to get a plethora of audio metadata but a subprocess call is very slow and the only…
user3535074
  • 1,268
  • 8
  • 26
  • 48
6
votes
2 answers

How to properly decode .wav with Python

I am coding a basic frequency analisys of WAVE audio files, but I have trouble when it comes to convertion from WAVE frames to integer. Here is the relevant part of my code: import wave track = wave.open('/some_path/my_audio.wav', 'r') byt_depth =…
S_error
  • 75
  • 1
  • 7
6
votes
1 answer

Write numpy array to wave file in buffers using wave (not scipy.io.wavfile) module

This caused me a day's worth of headache, but since I've figured it out I wanted to post it somewhere in case it's helpful. I am using python's wave module to write data to a wave file. I'm NOT using scipy.io.wavfile because the data can be a huge…
Andrew Schwartz
  • 4,440
  • 3
  • 25
  • 58
6
votes
2 answers

Merging two WAVE files on Android (concatenate)

I have been trying to merge two WAVE files on Android for quite some time now but really can't seem to get it working properly. Everything looks fine, the files are read, and written to the output file which is also readable at a later stage and has…
Manuel
  • 10,153
  • 5
  • 41
  • 60
6
votes
2 answers

MATLAB - Plot time-frequency graph of .wav file

I'm working on a project that involves looking at the changes in pitch/frequency over time with a wave file (I'm new to MATLAB, but not to programming). I'm able to see the time-amplitude graph and frequency-amplitude (after an FFT) graph, but how…
airplaneman19
  • 1,139
  • 6
  • 19
  • 32
5
votes
2 answers

Playing sine wave for unknown time

Whole day I was looking for some tutorial or piece of code, "just" to play simple sin wave for "infinity" time. I know it sounds a little crazy. But I want to be able to change frequency of tone in time, for instance - increase it. Imagine that I…
eCorke
  • 858
  • 1
  • 10
  • 24
5
votes
1 answer

Append data to a wave soundfile without loading its currrent content

I'm trying to append data to a sound file without loading its contents(because it may have gigabytes of data), I'm using pysoundfile library currently, I've figured out a way to do it for wave64, but in wav, for some reason it's throwing an…
5
votes
2 answers

Joining .wav files without writing on disk in Python

I have a list of .wav files in binary format (they are coming from a websocket), which I want to join in a single binary .wav file to then do speech recognition with it. I have been able to make it work with the following code: audio = [binary_wav1,…
5
votes
2 answers

wave.error: # channels not specified

I am trying to edit length of wav files using the wave module. However it seems that I can't get anywhere because i keep getting the same error that number of channels is not specified. Still, when i write something to see the number of channels i…
j.doe
  • 51
  • 1
  • 3
5
votes
1 answer

my program reduces music speed by 50% but only in one channel

I am using the wave library in python to attempt to reduce the speed of audio by 50%. I have been successful, but only in the right channel. in the left channel it is a whole bunch of static. import wave,os,math r=wave.open(r"C:\Users\A\My…
5
votes
3 answers

Writing WAV file using Python, Numpy array and WAVE module

I am trying to implement the Karplus-Strong algorithm. All is looking fine when I play (through Jupyter Notebook using Audio(y, rate=Fs)) the collected numpy array (representing guitar accord). Unfortunately, writing the numpy array: y, into wav…
mir0soft
  • 73
  • 1
  • 1
  • 8
5
votes
1 answer

Convert Recorded sound in iphone from one format to another say wav to mp3

I am trying to record some audio and convert them to other sound formats. I am using AVAudioRecorder class to record and these are the recording settings I used.. NSDictionary *recordSetting = [[NSMutableDictionary alloc] init]; [recordSetting…
5
votes
2 answers

Solving for Amplitude and Frequency in WAV files

I've also asked this here on the Sound Design forum, but the question is heavy computer science/math so it might actually belong on this forum: So I'm able to successfully find all the information about a WAV file except the amplitude and the…
Nas Kas
  • 53
  • 4
1 2
3
33 34