I have a buffer of length 1024 coming over the network filled with single channel audio data at 48000Hz in S32LE format. I’m able to play this back using SDL2 however I need change this to use the ALSA API. I’ve followed countless tutorials but all I’m getting is static. This is the setup code ..
Category : alsa
I am trying to make a call using PJSUA2, play a wav file to the callee, and callee should record this file to wav. I created two programs for that (caller and callee). And when caller starts playing wav file into AudioMedia object, console of callee program just spams out "alsa.c pb_thread_func: underrun!" and nothing ..
I am writing a C++ project in which I want to get frequences from surrandings. It is based on Raspberry Pi. I run some code using Alsa to record sound to .pcm. I am stuck in getting data which I have to put in FFT function. My idea was to collect data: `snd_pcm_readi (capture_handle, buffer, ..
Here is code: if (!BASS_Init(-1, 44100, 0, NULL, NULL)) { return 0; } DWORD chan = BASS_StreamCreateFile(FALSE, argv[1] , 0, 0, BASS_SAMPLE_LOOP); BASS_ChannelPlay(chan, FALSE); After compiling and running program i get following error: ALSA lib pcm_dmix.c:1075:(snd_pcm_dmix_open) unable to open slave How can i fix it? Source: Windows Que..
I want to play arbitrary sounds programatically using aplay on linux. Besides playing I want to use the interactive mode to pause the playback which can be achived by pressing space key when running aplay from a terminal. I thougth this can be achived by sending ‘ ‘ througth the pipe to the process which ..
Depending on what I do I either get "No such audio device" if I leave determining my audio device up to SDL2 or I get Failed loading libasound.a: /home/aypahyo/.conan/data/libalsa/1.2.4///package/d48130e0dd76369b1338deb3b2372c5a649f9f2d/lib/libasound.a: invalid ELF header when I set SDL_AUDIODRIVER=alsa. (The error message is actually cut off, I added an r at the end). Here is an implementation that ..
I’m trying to record microphone with alsa api on linux, but result is strange sounds like freezed glitchy robot. Recorded pcm data sended by UDP protocol to pcm player endpoint. char* device = "default"; unsigned int rate = 44100; unsigned int channels = 2; snd_pcm_uframes_t frames{}; snd_pcm_t* capture_handle{}; snd_pcm_hw_params_t* hw_params{}; if (snd_pcm_open(&capture_handle, device, SND_PCM_STREAM_CAPTURE, 0) ..
I am trying to record sound using microphone and sox library in C/C++. sox_open_read("default", &_input->signal, NULL, NULL) I am trying to use default input device. I am getting the error formats: can’t open input file `default’: No such file or directory Which I guess is caused because I did not pass the last argument: filetype ..
I have an app which is using Alsa to play sounds. Below I show fragments of my code. The problem is that if my software is run as a systemd service, the range in the stVolume method is between 0 and 31. When I run my software as a standard application from the command line, ..
Background I used to make simple Arduino UNO programs doing sound processing and just needed to play raw PCM samples. Topic I would like to make the minimal working code to generate any kind of PCM sound using ALSA in C++ for a Linux computer. Issues Alsa Project’s Website is not very easy to understand. ..
Recent Comments