0

This is what I have and I keep getting no available audio devices when trying to run the program.

By the way I'm on ubuntu 11.04.

#include <iostream>
#include <stdio.h>
#include <smpeg.h>
#include <SDL.h>
#include <SDL_mixer.h>
int main(){
        std::cout << "TEST" << std::endl;

        int sdlret = SDL_Init(SDL_INIT_AUDIO);
        if(sdlret == -1){
                std::cout << "SDL value: " << sdlret << std::endl;
                std::cout << SDL_GetError();
        }
        int mixret = Mix_OpenAudio(44100, MIX_DEFAULT_FORMAT, 2, 1024);
        std::cout << "Mix value: " << mixret << std::endl;
        std::cout << Mix_GetError() << std::endl;
        return 0;
}
genpfault
  • 51,148
  • 11
  • 85
  • 139
csteifel
  • 2,854
  • 6
  • 35
  • 61
  • What does `cat /proc/asound/card` give you? Is `libsdl1.2debian-pulseaudio` installed? – genpfault Jan 06 '12 at 07:18
  • This may sound a bit obvious, but I get this error if my system is muted. –  Jan 06 '12 at 08:58
  • I ran into similar issues. SDL_Mixer used to work fine for me, but it abruptly stopped in my recent attempts to use it in Linux. I gave up and moved to OpenAL, which is better overall anyway. It turned out to be fairly simple in the long run. – TheBuzzSaw Jan 06 '12 at 15:20
  • @genfault the cat /proc/asound/card gives me no such file or directory. Yes the pulseaudio package is installed – csteifel Jan 07 '12 at 06:33

0 Answers0