Category : alsa

So Im trying to play a wave file on raspberry pi in C++ with this code #include <alsa/asoundlib.h> #include <stdio.h> #define PCM_DEVICE "default" int main(int argc, char **argv) { unsigned int pcm, tmp, dir; int rate, channels, seconds; snd_pcm_t *pcm_handle; snd_pcm_hw_params_t *params; snd_pcm_uframes_t frames; char *buff; int buff_size, loops; if (argc < 4) { printf("Usage: ..

Read more

I am working on a Game Library for C++, now I am on audio part. After a lots of topic read, I obtained for using PortAudio with libsndfile. Header: #ifndef AUDIO_H #define AUDIO_H #include "sndfile.h" #include "portaudio.h" #include <iostream> #define FRAMES_PER_BUFFER (512) typedef struct { SNDFILE *file; SF_INFO info; } callback_data_s; static int callback( const ..

Read more

I am new to alsa, pulseAudio, needed help with this issue. This is the truncated output of pacmd command on my system pacmd list-sources: name: <alsa_input.pci-0000_00_1f.3.analog-stereo> properties: alsa.resolution_bits = "16" device.profile.name = "analog-stereo" device.profile.description = "Analog Stereo" device.description = "Built-in Audio Analog Stereo" module-udev-detect.discovered = "1" device.icon_name = "audio-card-pci" I want to fetch the field: ..

Read more