/* call-seq: * audio_driver -> string * * Returns the name of the audio driver that SDL is using. * * May raise an SDLError if initialization fails. */ VALUE rbgm_mixer_audiodriver(VALUE module) { if( ensure_open_audio() != 0 ) { rb_raise(eSDLError, "Could not initialize audio: %s", Mix_GetError()); } char driver_name[1024]; if(SDL_AudioDriverName(driver_name, sizeof(driver_name)) == NULL) { rb_raise(eSDLError, "Could not get audio driver name: %s", Mix_GetError()); } return rb_str_new2(driver_name); }