|Distributor ID:|Ubuntu| |Description:|Ubuntu 21.04| |Release:|21.04| |Codename:|hirsute|
I tried to initialize the sound driver but it didn't work. Here's the code:
std::cout << SDL_GetNumAudioDrivers() << std::endl;
for (int i = 0; i < SDL_GetNumAudioDrivers(); ++i) { const char* driver_name = SDL_GetAudioDriver(i); if (SDL_AudioInit(driver_name)) { printf(“Audio driver failed to initialize: %s\n”, driver_name); continue; }else{ printf(“Audio driver initialize success: %s\n”, driver_name);
//break; } SDL_AudioQuit();
}gave the conclusion:
3
Audio driver failed to initialize: dsp
Audio driver initialize success: disk
Audio driver initialize success: dummyFirst, it's strange that SDL2 doesn't see pulseaudio. Secondly, even with successful initialization of the dummy and disk drivers, I do not hear any sounds.
have any idea why this is happening?
Reset to default