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
2
votes
2 answers

Plot audio waveform and spectrogram overlap

I am working with audio using librosa, and I need to plot the spectrogram and waveform in the same display. My code: plt.figure(figsize=(14, 9)) plt.figure(1) plt.subplot(211) plt.title('Spectrogram') librosa.display.specshow(stft_db,…
Ari
  • 21
  • 1
  • 3
2
votes
2 answers

Gaps in between waveforms after generating wave file using numpy and scipy

I made a program using python 3.7, numpy, and scipy that generates waveforms using the digits of pi, and stitches them together to make a "song". My only problem is that there are gaps between each note. I have tried using mathematical functions…
SpencerLS
  • 361
  • 5
  • 16
2
votes
1 answer

Generating .wav Sound Data in Haskell

I'm trying to programatically generate .wav files from a file with the format "Note Octave Note Octave" (e.g. A 4 F# 1) in Haskell using the Data.WAVE library, and I've reached a problem: I can't figure out how exactly to calculate what to store as…
Andy
  • 3,132
  • 4
  • 36
  • 68
2
votes
1 answer

One sample value in 16 bits 11025 mono WAVE data

I do recording of incoming raw wave data from mic. The FORMAT is supported by WebCamera and it's 16 bits per sample, 11025 samples per second, mono. The level of mic is on the very low.. just for purpose, to make sure the zero values are coming…
LolliPop
  • 107
  • 1
  • 7
2
votes
1 answer

java drawing 2 (multiple) waveform using AudioWaveformCreator

This question is regarding the code used to answer on this thread. I am using the code posted by Nicholas DiPiazza and later the variant by Andrew Thompson. I am adding a second AudioWaveformCreator to this code and the result is the same for the…
2
votes
1 answer

What kind of files can gTTS save?

I want to make WAVE files by using gTTS module. I downloaded gTTS module from https://pypi.python.org/pypi/gTTS` I could make some files by it and stream the sounds by clicking these files. But I want to know what kind of files can gTTS save? Here…
Haru
  • 1,884
  • 2
  • 12
  • 30
2
votes
1 answer

Modify the volume frame by frame in a wave file

I want to modulate a wave file frame-by-frame using Python. The wave file is composed of brown noise, so pseudo-random noise. The idea would be: Open the file Mmodulate it with a 40Hz modulation frequency Save the new file I saw that there were…
Pyxel
  • 107
  • 11
2
votes
1 answer

how to save a wav file that plays two tracks at the same time? at different volumes

I'm coding in python and using the "wave" library. I've managed to save new wave files with this library, but not with two sound files overlapping - they will be played one after another when saved. if anyone could help with how to save a file where…
Sh0z
  • 127
  • 1
  • 2
  • 7
2
votes
2 answers

Can you re-use buffers with Windows wave audio input?

I'm using the Windows multimedia APIs to record and process wave audio (waveInOpen and friends). I'd like to use a small number of buffers in a round robin fashion. I know that you're supposed to use waveInPrepareHeader before adding a buffer to…
Adrian McCarthy
  • 45,555
  • 16
  • 123
  • 175
2
votes
1 answer

python:requests, how do I post MULTIPART/FORM-DATA and stream large file?

I need to POST a .wav file in MULTIPART/FORM-DATA. my script so far is : import requests import json import wave def get_binwave(filename): w = wave.open(filename, "rb") binary_data = w.readframes(w.getnframes()) w.close() return…
Nir Karpati
  • 23
  • 1
  • 4
2
votes
2 answers

Simulink Sine Wave with Increasing Freqency

I'd like to create a sine wave with an increasing frequency, my approach was is as follows: And this is the result: Now, the frequency is increasing, but it increases too much. After 1 sec, though, it has the final and right frequency. Hope you…
tenneck
  • 21
  • 1
  • 2
2
votes
2 answers

Send wav files through socket

I am trying to send a wav file through a socket. I get the error: TypeError: must be string or buffer, not instance waveFile = wave.open(WAVE_OUTPUT_FILENAME, 'rb') my_socket.sendall(waveFile)
user4719989
  • 107
  • 1
  • 4
  • 11
2
votes
1 answer

converter wave 24 bit to 16 bit

i wish to convert some wavs that are 48kHz 24 bit file.wav to 48kHz 16 bit file-2.wav import wave origAudio = wave.open("Sample_5073.wav","r") frameRate = origAudio.getframerate() nChannels = origAudio.getnchannels() sampWidth =…
Ibrahima Khalil
  • 121
  • 1
  • 12
2
votes
1 answer

RtAudio - Playing samples from wav file

I am currently trying to learn audio programming. My goal is to open a wav file, extract everything and play the samples with RtAudio. I made a WaveLoader class which let's me extract the samples and meta data. I used this guide to do that and I…
onurhb
  • 1,151
  • 2
  • 15
  • 31
2
votes
1 answer

Java code derived from Javascript logic is not working properly

I am using NetBeans8 IDE . Here is a java scrippt function from this Fiddle function animate() { xnow = parseInt(item.style.left); item.style.left = (xnow+1)+'px'; ynow = parseInt(item.style.top); item.style.top =…