Questions tagged [soundfile]

This is for the python Soundfile package

58 questions
1
vote
0 answers

external libraries on lambda - is efs mount and layer working in different?

I'm currently trying to use python librosa package on AWS lambda and following this blog. https://gianlucazuccarelli.medium.com/librosa-and-aws-lambda-20e48f23b57e According to this blog, even after installing the librosa package on mounted EFS, the…
1
vote
2 answers

Resampling audio file does not produce desired result

I want to resample a recording in 32000 KHz to 16000 KHz. I have done this with the code below. But the output audio is somewhat messed up. You can find the original audio as well output in the following…
imantha
  • 2,676
  • 4
  • 23
  • 46
1
vote
0 answers

Extract audio segments of onsets using peak picking

I have a couple of .wav sound files with very similar percussive signals of ~60ms duration. I can identify their onset times using libROSA's onset detection quite well. I would now like to extract the associated audio segments of ~60ms from the…
VGF
  • 55
  • 8
1
vote
0 answers

How to work with big WAV files in Python without getting memory error?

When working with Python's soundfile for reading and writing audio WAV files that are longer than 9 minutes (size > 500 MB) I am getting a memory error ("cannot allocate 1.1 GBi"). How can I work with such big files without splitting them into…
Triceratops
  • 741
  • 1
  • 6
  • 15
1
vote
1 answer

OSError when tried to load librosa (import soundfile error)

When I ran import librosa, I got the following error message: OSError: cannot load library 'C:\ProgramData\Anaconda3\Library\bin\sndfile.dll': error 0x7e and OSError: cannot load library…
alpha
  • 173
  • 1
  • 2
  • 12
1
vote
1 answer

Installing libsndfile1 on docker container

I'm trying to install soundfile over pip install on my docker container. Sadly i need to install libsndfile1 manually over apt get by myself. This fails somehow and i don't really get why and does anyone know how to install it. I'm running docker…
Synoon
  • 2,297
  • 4
  • 22
  • 37
1
vote
0 answers

Attempting to use python-sounddevice lower level "stream" classes to play and record with NumPy arrays giving errors

I'm trying to split the audio file into a given number of NumPy blocks and put those into RAM to play, just like play_a_very_long_sound_file. Unfortunately, I believe my knowledge of NumPy arrays and audio files in general is lacking. Once this code…
LarryF
  • 13
  • 3
1
vote
1 answer

Raw sound files editors, 8bit

I was wondering if anyone knows how to open and edit a raw sound file (raw unsigned 8-bit). I am making my own game and trying to create original 8-bit music. I could not open SoX, and all other editors I have cannot play these frequencies…
Kat
  • 35
  • 6
1
vote
1 answer

What is returning after executing command to extract mfcc?

I have been learning Sound Analysis and i have encountered term mfcc in it. So when i execute librosa.feature.mfcc(y=X, sr=sample_rate, n_mfcc=40) I get numpy array of shape 40 by 216. So i get that I have extracted 40 features over 216…
Pratik
  • 51
  • 1
  • 6
1
vote
1 answer

How to solve OS Error to import soundfile library

I am struggling to rectify this error from __future__ import print_function import numpy as np import matplotlib.pyplot as plt import soundfile as sf Traceback (most recent call last): File "", line 4, in
1
vote
1 answer

Why is mp3/wav duration different when I convert a numpy array with ffmpeg into audiofile (python)?

I want to convert a numpy array which should contain 60s of raw audio into .wav and .mp3 file. With ffmpeg (version 3.4.6) I try to convert the array to the desired formats. For comparison I also use the modul soundfile. Only the .wav-file created…
Mips
  • 111
  • 2
  • 6
1
vote
1 answer

How can I add gaussian noise with a specified SNR to an audio file with Soundfile in Python?

print('Processing: ', filepath) path, file = os.path.split(filepath) noisy_path = path.replace('dev-clean', 'dev-noise-gassian') print(path, file) if not os.path.exists(noisy_path): os.makedirs(noisy_path) …
Shamoon
  • 41,293
  • 91
  • 306
  • 570
0
votes
1 answer

Saving multichannel audio to one channel per file

I am recording from a multichannel audio device using pyaudio and struggle saving each channel in a separate file. I use pyaudio since I am playing back audio simultaneously with the recording, and both use different audio devices. It works fine…
anton
  • 51
  • 1
  • 2
0
votes
0 answers

Machine Learning, SoundFile module problem

I am trying to load an audio file using librosa for an audio classification project. However, when I run the code, I get an OSError with the message cannot load library 'C:\Users\beek6\anaconda3\envs\tensorflow2\Library\bin\sndfile.dll': error 0x7e.…
0
votes
1 answer

I want to change a wav file with 44100 sr to 22050 sr with out change in pitch and speed in python

This is my code: list_ = os.listdir("All_wavs") for i,val in enumerate(list_): y, sr = librosa.load(f"All_wavs/{val}") data = librosa.resample(y, orig_sr =44100,target_sr= 22050) sf.write(f"wavs/{val}",data, samplerate =22050) it…