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
3
votes
1 answer

stm32L4 : How to generate triangular wave using DAC DMA, uneven slopes

I am trying to generate a triangular wave of frequency 8kHz using DAC and DMA. DAC is triggered using a timer so that the DAC speed will be 1 MSPS. I am working on stm32L476 discovery board. I am using stm32CUBEMX for code initialization. My…
user8398475
  • 61
  • 2
  • 7
3
votes
1 answer

Generate Sine Wave between 10 and 20000Hz using SoundPool

I attempted to generate a Sine Wave using AudioTrack initially. The result was not satisfactory. I then moved to the Soundpool class. I used Audacity to create audiofiles of 1 second and then modified the playback speed (.5 - 2.0) to get the desired…
Flying Swissman
  • 818
  • 2
  • 14
  • 39
3
votes
2 answers

16bit WAVE value range

I have come across this MSDN link: Intro to Audio Programming, Part 2: Demystifying the WAV Format. The post says that: 16-bit samples range from -32760 to 32760 which is not +/-(2^16)/2 because of some crazy business involving Endianness and…
user1146657
  • 194
  • 3
  • 15
3
votes
1 answer

How to convert a wav file -> bytes-like object?

I'm trying to programmatically analyse wav files with the audioop module of Python 3.5.1 to get channel, duration, sample rate, volumes etc. however I can find no documentation to describe how to convert a wav file to the 'fragment' parameter which…
user3535074
  • 1,268
  • 8
  • 26
  • 48
3
votes
2 answers

Plot a Wave files Audio Visually In Python

I am trying to figure out how to plot the audio visually of a wav file. In my code if I do a wavefile.readframe(-1) I get the whole wav file plotted, the way my code works now is I just get a silver (one frame!) I'd like to show 24 frames of audio…
Fight Fire With Fire
  • 1,626
  • 3
  • 19
  • 28
3
votes
1 answer

Writing bytes to wave file?

I have some data in Python which I want to output to a WAV file. Right now I'm generating all of the samples as shorts and putting them into a buffer. Then whenever that buffer hits a certain length, I pack the data and send it to writeframes…
Draconis
  • 3,209
  • 1
  • 19
  • 31
3
votes
2 answers

Why do I get this error "EMCIDeviceError" when opening some wav files in my program

Hey I have this program that has been working fine until I tried to open this one wav file? Not sure what the problem is or that I understand it? Do I need to find a new component to use for this file or what? I am using Delphi 4 Pro and the…
Roy
  • 51
  • 1
  • 3
3
votes
1 answer

CSCore library using in Windows Forms Application

Here: C# recording audio from soundcard is example implementation using CSCore library, but it works only in console application. Is it possible to use this in Windows Forms Application?
stockDevelopers
  • 53
  • 1
  • 3
  • 8
3
votes
2 answers

Play the contents of a sound retrieved from an url?

I am retrieving the sound from: http://translate.google.com/translate_tts and writing it to a WAV file, when i double-click the file the sound plays ok, but when i use the WAVE module from python to open it, it gives me this error: wave.Error:…
R3D57R34K
  • 69
  • 2
  • 7
3
votes
1 answer

read wav file, calculation fo duration / data_size always wrong

i am trying to read a wav file generated by ffmpeg with ffmpeg -i av FFmpeg generates a wav file with a header size of 18 but without any extension data. This are my data structures: struct wav_header { uint32_t chunk_id; uint32_t…
markus_p
  • 574
  • 8
  • 25
3
votes
4 answers

Wav file convert to byte array in java

My project is 'Speech Recognition of Azeri speech'. I have to write a program that converts wav files to byte array. How to convert audio file to byte[]?
user1367678
  • 41
  • 1
  • 1
  • 2
2
votes
3 answers

Identify component frequencies and calculate integrals for curves

I have 1200 data samples of amplitude data over a 5-minute period, with 4-5 "spikes" in the data. These can be nearby to each other, so "shoulders" can appear. The data can be somewhat noisy as well. I need to: Programmatically determine the times…
Sam Barnum
  • 10,559
  • 3
  • 54
  • 60
2
votes
1 answer

Wave vector in 2 dimensions

So I'm trying to make the player shoot a bullet that goes towards the mouse in a wavey pattern. I can get the bullet to move in a wavey pattern (albeit not really how I predicted), but not towards the mouse. Vector2 BulletFun::sine(Vector2 vec) { …
SpaceFace
  • 1,492
  • 3
  • 15
  • 29
2
votes
2 answers

Correctly understanding amplitude of waveforms - in librosa or other libraries

I lack a background in acoustics, but need to work on a data-science project in acoustics. Please help me understand how to correctly interpret what amplitude of waveform represent, correctly set the metrics, and possibly set correct sampling rate…
user305883
  • 1,635
  • 2
  • 24
  • 48
2
votes
1 answer

Exception: Failed to process waveform

Error: Traceback (most recent call last): File "c:\Programming\New_assistant\speech_to_text.py", line 18, in if rec.AcceptWaveform(data): File…
DarMaster
  • 85
  • 6