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.

wave
Filter by
Sorted by
Tagged with
0 votes
1 answer
1k views

.WAV Audio Produced by PyDub AudioSegment.split_on_silence() has no RIFF ID when reading with wave.open

I am currently taking a large audio file and splitting it based on silence using PyDub's split_on_silence function. However, when I go to open this file using wave.open I get an error saying the .wav ...
Coldchain9's user avatar
  • 1,541
1 vote
1 answer
3k views

How to convert a wav audio file format (sample width) into 8 bits format?

I am using a Python gui that records the voice and I need to set the Width format of the wav file into 8 bits. When I run the recording has nothing but noise! import tkinter as tk import threading ...
wiss's user avatar
  • 11
0 votes
1 answer
2k views

What are the differences between a WAV file (.wav) and a WAVE audio file (.wave)?

I am trying to use the PyAudio library to record guitar audio through my USB audio interface in a python project. When I use audio applications such as Audacity to save the audio I get a WAV (.wav) ...
Caolan's user avatar
  • 11
1 vote
2 answers
1k views

SVG not filling whole Viewport on mobile view

I have a problem with all wave SVG’s across my website. Does anyone know how to make an SVG fill the whole viewport/width of the screen? I used Wave SVG generator I used to make the waves, and uses a ...
Frei's user avatar
  • 53
1 vote
2 answers
3k views

how to read number of channels without ffmpeg or wave?

This code works: import wave f1 = wave.open(file1, "r") num_channels_file1 = int(f1.getnchannels()) but it does not work when reading a wav file with a diff bitrate or other property. I can't ...
ERJAN's user avatar
  • 24.2k
1 vote
1 answer
2k views

Create and use WAV file as an object Python

I am creating a personal assistant in Python. I am using Snowboy to record audio, and it works very well. Snowboy has a saveMessage() method that creates and writes a wav file to the disk. This wav ...
marc.soda's user avatar
  • 418
0 votes
1 answer
8k views

Octave - Generate Square Wave (Signal/Pulse)

I want to generate a periodic square wave (Signal/Pulse) in Octave/Matlab with the following properties: Amplitude of 0.5 Period of 0.02 seconds Average (Mittelwert) of 0.5 So far I have this: T = ...
IvanNickSim's user avatar
3 votes
1 answer
543 views

How to adjust pitch using python wave module

so I changed the playback speed of my output.wav file using python wave module frame rate method and multiplying previous frame rate by 2, but I want to keep the pitch of the new output.wav the same, ...
Gjison Giocf's user avatar
2 votes
0 answers
279 views

Smoothly transitioning audio sinewave using python

I‘m a python noobie and I‘m looking to create a sinewave tone generator in python. I would like it to transition smoothly (between frequencies) in realtime. Pseudo-Code: i = 1 while i <= 1000: ...
Syirrus's user avatar
  • 61
3 votes
0 answers
425 views

Change audio sampling rate without affecting playback speed

I'm just trying to change the sampling rate of a audio dataset (in .wav format) from 32000Hz to 44100Hz but, doing this, the playback speed is changed too (very acceptable and logical). My point is, ...
Desc133's user avatar
  • 41
1 vote
0 answers
456 views

How to create a WAV file from a sqlite BLOB field with python

I get a blob out of a ms access database which contains mono wav data from an instrument. It's just 1 second. It begins with different values, so I mean it is pure wav Data b'\\f_?\xb2\xca^??;]?\xa9(...
Papageno's user avatar
  • 335
0 votes
0 answers
21 views

Playback start of wave file from memory and the rest from disk

I'm looking for a way to improve the performance of a python-based musical instrument (a midi keyboard that triggers .wav samples on a Raspberry Pi3). Currently all samples are loaded into memory for ...
mrsnrub's user avatar
  • 13
2 votes
1 answer
482 views

Advice for decoding binary/hex WAV file metadata - Pro Tools UMID chunk

Pro Tools (AVID's DAW software) has a process for managing and linking to all of it's unique media using a Unique ID field, which gets embedded in to the WAV file in the form of a umid metadata chunk. ...
Andrew Moore's user avatar
2 votes
1 answer
528 views

Sawtooth wave Function for integers Javascript

Saby people, I'm trying to write the function which will map this --> ...-5|-4|-3|-2|-1| 0| 1| 2| 3| 4| 5| 6| 7| 8| 9... to this --> ... 3| 0| 1| 2| 3| 0| 1| 2| 3| 0| 1| 2| 3| 0| 1... ...
Manvel A.'s user avatar
2 votes
2 answers
5k views

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('...
Ari's user avatar
  • 21
1 vote
1 answer
300 views

PCM / WAVE file sample to actual sound/frequency

i started to get into digital audio and the wave file format / pcm i think i understood it. But i did not understood the part how you translate from the values in the file to "actual" audio get a ...
user avatar
0 votes
1 answer
1k views

How to fix an empty button for accessibility?

I'm building a chat UI using React and it needs to be accessible. I am using the Wolox/react-chat-widget. I do not want to use the badge function. When testing it using the WAVE tool, tt triggers an ...
Raphael Bustamante's user avatar
0 votes
0 answers
65 views

Cracking In Audio Using Wave Python Module

I'm using the code below to try to make a simple song, but every time the pitch changes, my speaker has an audible crack. It only happens when I change the duration below 1. The duration is ...
user avatar
0 votes
1 answer
24 views

How to extend token_ids to accept more keywords in Boost::wave library

I am working on a syntax highlighting task using Boost/wave library. We get the tokens by dereferencing the lex-token-iterator and then we process these tokens for custom highlighting. Out of the box,...
Karan Mehta's user avatar
-1 votes
2 answers
438 views

Is that any way I can avoid this warning (text too small) on WAVE accessibility tool, but keep the font size unchanged?

My HTML: <p id="text">test</p> My CSS: #test { margin-top: 0; margin-bottom: 0; font-size: 0.7em; text-align: center; } How do I avoid this warning on WAVE accessibility tool? ...
Shank's user avatar
  • 414
0 votes
0 answers
361 views

How to change a wave.open file to a normal file object without saving the file

I am trying to use the python speech_recognition to get text from a set of frames in a wave file got from a client. I have tried to use speech_recognition on a wave object but this doesn't work and ...
A_K's user avatar
  • 16
0 votes
1 answer
324 views

problem with rewriting a wav file in python

I have a problem with rewriting a .wav file (wave audio file). my project involves converting a wave file data into bytes of data and then reassembling a new audio file which sounds the same. For ...
momi tm's user avatar
  • 13
0 votes
1 answer
712 views

Convert an audio file to 8000Hz 16Bit Mono Wav in UWP

How to convert an audio file to 8000Hz 16Bit Mono Wav in UWP C# to be used in ACRcloud UWP SDK
Ahmed Walid's user avatar
1 vote
1 answer
3k views

Why is the 'sample width not specified' error being thrown?

I'm trying to write to a wav file in Python 3 using the wave module, but I get a 'sample width not specified' exception. Why is this? def write_sample(path, sample): """Writes a sample to a file ...
W. Albuquerque's user avatar
0 votes
1 answer
415 views

What does wave_read.readframes() return if there are multiple channels?

I understand how the readframes() method works for mono audio input, however I don't know how it will work for stereo input. Would it give a tuple of two byte objects?
W. Albuquerque's user avatar
2 votes
2 answers
239 views

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 ...
SpencerLS's user avatar
  • 361
1 vote
1 answer
927 views

Error using PyDub: pcm_s8 codec not supported in WAVE format

Tried to read in a WAVE file. Pydub has been working perfectly for the past few months, until I have encountered a specific WAVE file format where I could not import into Python (but it has no issue ...
thf9527's user avatar
  • 71
0 votes
1 answer
96 views

Python scipy.io.wavefile doesn't find read() function

The Python IDE doesn't import read() function from scipy.io.wavefile. I'm using Python 3 and Eclipse import scipy.io.wavfile Fs,data=scipy.io.wavfile.read(FileName) and getting the following error (...
Rolaro's user avatar
  • 1
0 votes
2 answers
957 views

Perlin Noise wave effect on a 3d sphere

I have been trying to figure out how to create wave effect on a 3d sphere using Perlin Noise I have found some tutorials on how to do it on a plane, however, none on a 3d object, This code works just ...
Gauthier Barbosa's user avatar
0 votes
1 answer
678 views

Generating a 2-channel wave file from two independent streams of audio data

I am streaming audio data from two clients on a network into a common server software, that needs to take said audio data and combine it into a two-channel wave file. Both client and server are ...
TheKewlStore's user avatar
1 vote
0 answers
879 views

Flutter - Audio Recording - How to achieve the sin wave form according to frequency when a user hits the record button?

I want to achieve this look when the user starts recording his voice, the wave act accordingly to the frequencies. How to achieve this using flutter? what's the concept? Sin frequency wave example
Ismaeil Ghouneim's user avatar
-1 votes
1 answer
186 views

How to re-order the .wav file channels

I need to change the order of channels in .wav file. for example if .wav file contains 16 channel like "0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15" then need to change this order to "13 14 15 0 1 ...
Varada's user avatar
  • 827
0 votes
1 answer
1k views

scipy.io.wavfile.read cannot read 16-bits .wav files

I have a problem with reading a wav file with 2bytes. I saw scipy.io.wavfile.read cannot read 24-bits .wav files and Unexpected end of file wavfile.read python . but both of them relate to reading ...
hdiz's user avatar
  • 1,161
1 vote
0 answers
333 views

Multiple gaussian auto-fitting in Python

The problem is to fitter on all my wavelength peaks a Gaussian in order to make a medium adjustment as accurate as possible My question is how to make the Gaussian adjustment on all my peaks ...
Silvestri's user avatar
1 vote
1 answer
2k views

How to record audio using audioWorklet and AudioWorkletProcessor in javascript?

I have below logic to record (set samplerate = 16000 in AudioContext, mono channel recording by considering only one channel) I set a parameter shouldRecord from AudioWorklet, and depending on that ...
Sadanand Upase's user avatar
0 votes
0 answers
150 views

I try to read a sound, but the result is something like that \x00?\x00

I'm trying to read an audio file, and then process it and get its energy, frequency .... But when I read it, I know how to translate it into the format in which it is found. import numpy as np ...
Benghy's user avatar
  • 1
3 votes
2 answers
3k views

"wave.Error: unknown format: 3" after using librosa.resample. Is there anything wrong with the output of librosa?

I have a .wav file with a sample rate of 44.1khz, I want to resample it into 16khz by using librosa.resample. Though the output.wav sounds great, and it is 16khz, but I got an error when I'm trying to ...
Range's user avatar
  • 31
1 vote
0 answers
215 views

What is "/ 2.**15" doing in this line of code?

Here is the line of code: x = np.frombuffer(wave, np.int16)[24:] / 2.**15 My understanding is that I am filling a numpy array with data from the buffer. The data is categorized as wave of type ...
PaperRockBazooka's user avatar
0 votes
1 answer
604 views

Turning Audio into integers then back into Audio

import pyaudio import struct import numpy as np import wave #gather information from data n=(1024*4) sound = wave.open('test.wav','rb') num_sample = sound.getnframes() sample_rate = ...
Juan Ramos's user avatar
0 votes
1 answer
459 views

How to play infinitely a ".wav" file using python

I'm trying to play the ".wav" file infinitely to use in my experiment. I'm using the script of the pyaudio website (http://people.csail.mit.edu/hubert/pyaudio/), however it plays for only 5 seconds. ...
juniorcl's user avatar
-1 votes
1 answer
96 views

Mismatched start values on x-axis on python matplotlib plot

I'm trying to plot a selected number of samples after reading a wave file. I wrote the following code to achieve that: import numpy as np import matplotlib.pyplot as plt from scipy.io.wavfile import ...
skrowten_hermit's user avatar
5 votes
1 answer
1k views

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 ...
Manel Pereira's user avatar
0 votes
1 answer
53 views

UITextField flickers and gets wavy when size is scaled down

I've got a UITextField with "llllllllll" as text in it. I use a pinch gesture to scale it down by decreasing view's transform.a from 1 down to 0.001 or lower. When the text field gets smaller I ...
AKV's user avatar
  • 1
0 votes
0 answers
2k views

Reducing non-speech noise in a WAV file using NAudio

I'm new to DSP. I have searched the internet to no avail for days now. I wrote an WAVE file player using NAudio and other SDKs. It has a number of features that are working fine. I just need one ...
Paul McMillan's user avatar
0 votes
0 answers
415 views

How to export wave slices to the same bits per sample as the original file

I am looping through a large wave file, via a dictionary of new file names, lengths and versions. The loop exports the individual slices as files: mix.export(key, format='wav') However, it ...
tzujan's user avatar
  • 186
2 votes
1 answer
2k views

How to plot the wave equation with fixed boundary

I have tried to plot 3d wave equation with fixed boundary at z=0. import matplotlib.pyplot as plt import numpy as np import pylab from mpl_toolkits.mplot3d import Axes3D def makeData (): x = np....
Zhanna T's user avatar
1 vote
1 answer
4k views

Remove file header from a .wav file in python3

I have been doing a project on encrypting .wav files using RSA algo and for that, I need to remove the file header to read the file properly. I need the sound data as a numpy array. Now I've searched ...
Sandipan's user avatar
  • 703
2 votes
1 answer
67 views

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 ...
LolliPop's user avatar
  • 107
0 votes
1 answer
86 views

AudioTrack signal generator listening from gyroscope

I am trying to create signal generator which frequency is controlled from gyroscope senzor data (by moving the phone). The problem is, I am calling the AudioTrack inside onSensorChanged and I have "...
Filip Barák's user avatar
0 votes
1 answer
85 views

Dependency between wave data format and input buffer size

I do some quick solution using VFW. At the stage of preparing to receive audio data I ask VFW to give me the default wave data format for the attached WEBcam. It returns me WAVEFORMATEX struct, pls, ...
LolliPop's user avatar
  • 107

1 2
3
4 5
11