Answer the question
In order to leave comments, you need to log in
Setting up OpenAL on Ubuntu?
In alsoft.conf I registered
drivers = port, alsa
Installed OpenAL, ALSA, compiled and installed PortAudio
If you register only alsa, you get
AL lib: (WW) alc_initconfig: No playback backend available!
AL lib: (WW) alc_initconfig: No capture backend available!
AL lib: (EE) ALCportPlayback_open: Pa_OpenStream() returned an error: Invalid device
AL lib: (EE) ALCplaybackOSS_open: Could not open /dev/dsp: No such file or directory
Target ...................... x86_64-unknown-linux-gnu
C++ bindings ................ no
Debug output ................ no
ALSA ........................ yes
ASIHPI ..... ................. no
OSS ........................ yes
JACK .... .................... no
#include <AL/al.h>
#include <AL/alc.h>
#include <AL/alut.h>
#include <stdio.h>
// gcc -o simplealut simplealut.c `pkg-config --libs freealut`
//
#define FILENAME "sample.wav"
int main(int argc, char **argv) {
ALuint buffer, source;
ALint state;
// Initialize the environment
alutInit(0, NULL);
// Capture errors
alGetError();
// Load pcm data into buffer
/* buffer = alutCreateBufferFromFile(FILENAME);
// Create sound source (use buffer to fill source)
alGenSources(1, &source);
alSourcei(source, AL_BUFFER, buffer);
// Play
alSourcePlay(source);
// Wait for the song to complete
do {
alGetSourcei(source, AL_SOURCE_STATE, &state);
} while (state == AL_PLAYING);
// Clean up sources and buffers
alDeleteSources(1, &source);
alDeleteBuffers(1, &buffer);
*/
// Exit everything
alutExit();
return 0;
}
Answer the question
In order to leave comments, you need to log in
And in less than 10 minutes, after installing ALSA, I rebuilt and reinstalled OpenAL, and this solved the problem
. P.S. It's not the first time
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question