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

Values of a wav file

In C, I am using the Libsndfile library to help me read the values of a wav file so that I can do some computations to them after. Although, when I get the output of the file, I am not sure what these numbers mean. Why are the numbers in the…
VedhaR
  • 495
  • 5
  • 21
2
votes
1 answer

In C, how do I convert 1-channel PCM into 2-channel PCM?

I am using libao and libsndfile to read and play audio. I would like to convert a monaural stream into a stereo stream by copying one channel into two. This test code will play a stereo clip correctly, but will play a monaural one very fast and…
Frotz
  • 535
  • 4
  • 21
2
votes
1 answer

Playing wav file with portaudio and sndfile

I have written a function to play a sound file using portaudio and sndfile. Unfortunately the sound quality is terrible. The sound is more like a hiss. The following is the source code of the function I am using. #define _GLIBCXX_USE_C99_MATH…
Benilda Key
  • 2,836
  • 1
  • 22
  • 34
2
votes
1 answer

libao: Playing blocks of audio as sequenze stutters

Heyho, so I'm trying to play pcm audio with libao. My target is to make the playback pausable and cancelable. For some reason the output over the alsa driver stutters and is played back very very fast. It's like if you're scrubbing the output. If I…
maxammann
  • 1,018
  • 3
  • 11
  • 17
2
votes
2 answers

Trying to mix two PCM audio sources

I have two audio files I read in using libsndfile. SNDFILE* file1 = sf_open("D:\\audio1.wav", SFM_READ, &info); SNDFILE* file2 = sf_open("D:\\audio2.wav", SFM_READ, &info2); After I've done the previous I sample x-number of samples: //Buffers that…
Dries
  • 995
  • 2
  • 16
  • 45
2
votes
1 answer

How to find the right RAW format

I have this code SNDFILE *sf; SF_INFO info; int num_channels; int num, num_items; int *buf; int f,sr,c; int i,j; FILE *out; /* Open the WAV file. */ info.format = (SF_FORMAT_RAW | SF_FORMAT_PCM_16); info.samplerate = 44100; info.channels = 2;…
Brutus Cruciatus
  • 404
  • 3
  • 18
2
votes
3 answers

audio delay making it work

I am trying to implement a simple audio delay in C. i previously made a test delay program which operated on a printed sinewave and worked effectively. I tried incorporating my delay as the process in the SFProcess - libsndfile- replacing the…
2
votes
2 answers

How to compile libsndfile into a project?

I am trying to use libsndfile. I am also not very good with g++. The way to install libsndfile seems to be use "make install." I can really do that so I compiled it in a directory. I was trying to compile the tutorial…
SamFisher83
  • 3,937
  • 9
  • 39
  • 52
2
votes
1 answer

Trouble Linking libsndfile in Visual Studio 2010 Express

I've been attempting to use libsndfile (it is the windows 64 bit version) for the first time, and have encountered a problem while trying to link it. Whenever I try to compile the program, I get this error: error LNK2019: unresolved external symbol…
Msquared
  • 21
  • 3
2
votes
4 answers

How can I use libsndfile to load a .wav file into an array?

I have looked at sample programs that use libsndfile, but could not get any of them to compile. I want to be able to read a .wav file into an array of integers (or doubles) without having to worry about what kind of .wav file it is, or even about…
Jackson Dean Goodwin
  • 617
  • 3
  • 11
  • 20
2
votes
1 answer

Audio samplerate converter using libsndfile and libsamplerate. Not sure if using function src_simple correctly

I have been building a simple samplerate converter in c using libsndfile and libsamplerate. I just cant seem to get the src_simple function of libsamplerate to work, whatever I try. I have striped back my code to be as simple as possible and it now…
OliD
  • 37
  • 1
  • 2
  • 5
1
vote
2 answers

Using libsndfile to play sound real time c++ in qt

I am using using libsndfile read and manipulate sound files. I am wandering what whould be the simplest way to play these sounds in real time in Qt. I have tried to look at QtAudioOutput, however has to use QtAudioFormat, which is quite cumbersome…
Anton
  • 1,181
  • 2
  • 17
  • 27
1
vote
2 answers

Adding a .dll to a NetBeans 7.0 C project. Unable to view .dll

I am trying to read a .wav file and hence need to include the libsndfile binary in my project. I am using NetBeans 7.0 and the Tools->Library->Add new library option doesnt work since the Add library button is disabled. I tried adding the path of…
neeraj baji
  • 211
  • 2
  • 12
1
vote
1 answer

Title: I'm encountering a CUDA out of memory error while trying to fine-tune the Whisper model in Arabic using PyTorch

The error message is as follows:CUDA out of memory. Tried to allocate 26.00 MiB (GPU 0; 23.65 GiB total capacity; 21.91 GiB already allocated; 25.56 MiB free; 22.62 GiB reserved in total by PyTorch) If reserved memory is >> allocated memory try…
1
vote
1 answer

Python sndfile library not found on newly installed Mac

(my first post here) I have a problem with the librosa python library, which produces the following error. OSError: sndfile library not found. I installed the librosa library and the SoundFile library with pip install and with conda install -c…
jonasblome
  • 21
  • 4