Questions tagged [libsndfile]

libsndfile is a cross platform C library for reading and writing digital sampled sound. It supports main common file formats like WAV, PCM, AIFF, AU, as well as FLAC and Ogg/Vorbis.

Tag usage

When asking questions about usage of libsndfile, please include:

  • Target system and compiler information. This includes the compiler name, version and settings used to compile.

  • libsndfile version and release number.


Website: http://www.mega-nerd.com/libsndfile

164 questions
0
votes
0 answers

libsndfile: remove non-audio (artwork) frames

In mp3 files with embedded artwork when getting the number frames from SF_INFO.frames it also seems to calculate the artwork as a frame in the audio file. #include #include void getFrames(char *filePath) { SF_INFO *sfInfo; …
0
votes
1 answer

Python linking to wrong library folder - sndfile library not found

I get the following error when trying to import the librosa library into my python project and running it in the global python environment: Traceback (most recent call last): …
jonasblome
  • 21
  • 4
0
votes
1 answer

Errors when statically linking libsndfile with vcpkg and running sf_open

So here's a bit of example code: #include int main() { SNDFILE* sndfile; SF_INFO sfinfo; sndfile = sf_open("", SFM_READ, &sfinfo); std::cout << "Hello, World!"; } So basically I'm statically linking it from vcpkg, and I…
Olivia Smith
  • 45
  • 2
  • 7
0
votes
1 answer

libsndfile Emscripten environment

I am running just a little code using libsndfile, in the emscripten environment #include #include int main() { SF_INFO info; const char * path = "~/data/somefile.wav"; SNDFILE* sf = sf_open(path,SFM_READ,…
Hrant Nurijanyan
  • 789
  • 2
  • 9
  • 26
0
votes
1 answer

Librosa libray [Python] resample function on Azure Function

I am using librosa to resample the audio data, like below: import librosa filename = "/home/.../example.mp3" audio, samplerate = librosa.load(filename) # samplerate = 48000 target_samplerate = 24000 new_audio = librosa.resample(audio,samplerate…
0
votes
1 answer

Cannot link sndfile library to cmake project (MacOS)

Currently I'm trying to make some spectogram generation for my uni project. I'm trying to build a static library where all the magic will work and just call it from the main() function. This is my cmake file: set(CMAKE_CXX_STANDARD…
Ivan Sobko
  • 21
  • 5
0
votes
1 answer

Integrating Libsndfile with xaudio2

I'm trying to integrate libsndfile with xaudio2. There isn't much I could find on the internet so I'll ask it here. I successfuly integrated libsndfile with OpenAL preatty easly but i'm strugling with xaudio2. It generates pops and crackling. I'm…
0
votes
1 answer

segmentation fault for array of file pointers

I am trying to read from multiple audio files using inputs read from a text file. The files are read using ligand file. I am wondering what is the best way to go about opening an unknown number of audio files. I am trying to use an array of…
0
votes
2 answers

Using librosa in an azure function app written in python

I'm working an an azure function in python that uses librosa to visualize some audio data. It works fine locally on my windows box in vscode. Remote build from the command line with func azure functionapp publish functionappname --build…
mpfog
  • 3
  • 3
0
votes
0 answers

Using libsndfile in an Android Studio project

I'm working on an Android application that requires several MATLAB signal processing functions coded in C. The functions are to be run on the data from various WAV files. Over the past few days, I've come to the conclusion it would be much easier…
wnjl
  • 162
  • 1
  • 10
0
votes
1 answer

libsndfile cannot encode WAV with float array

I'm trying to write a file using libsndfile in C++, with an array of floats: void encode_file (const char *outfilename, int filetype) { static float buffer [BUFFER_LEN] ; for (int i = 0; i< BUFFER_LEN; i++) { buffer[i] =…
William Clark
  • 65
  • 1
  • 5
0
votes
1 answer

reading wave file with hop lengths using libsndfile, or to identify the number of samples in the file

I would like to read a wave file, and process them into fft. this is my current working code: #include #include #include #include #include #include #include #include…
leonardltk1
  • 257
  • 1
  • 4
  • 18
0
votes
2 answers

Creating silence at regular intervals when writing to a wav file

I'm trying to take a wav file and create gaps of silence in it at 1-second intervals. The gaps of silence aren't for pausing the file and then playing it again, they serve a 'mute' function, so if the input wav file was 10 seconds long then the…
0
votes
2 answers

Writing to one channel at a time in libsndfile

I'm trying to generate a sine wave that switches between the left and right channels of a stereo wav file at 1 second intervals, but I can't find any way to write to one channel while keeping the other one silent. Here is the code I've got to write…
0
votes
1 answer

libsnd file on hpc cluster

I have requested that we have libsnd file installed on the hpc cluster. The admin said that I can test this via the following link: https://raw.githubusercontent.com/erikd/libsndfile/master/examples/sndfile-to-text.c $ module load libsndfile/1.0.28…
Perl Del Rey
  • 959
  • 1
  • 11
  • 25