Skip to content

Instantly share code, notes, and snippets.

Created December 1, 2017 13:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/008f0c3acdbcae886a19868a0554987b to your computer and use it in GitHub Desktop.
Save anonymous/008f0c3acdbcae886a19868a0554987b to your computer and use it in GitHub Desktop.
int printf(char*, ...);
int snd_mixer_open(void**, int);
int snd_mixer_attach(void* mixer, char*);
int snd_mixer_selem_register(void*, void*, void**);
int snd_mixer_load(void* mixer);
void* snd_mixer_first_elem(void*);
void* snd_mixer_elem_next(void*);
char *snd_mixer_selem_get_name(void*);
int snd_mixer_selem_get_playback_volume_range(void*, long*, long*);
int snd_mixer_close(void*);
char* snd_mixer_selem_get_name(void*);
int snd_mixer_selem_set_playback_volume_all(void*, long);
int main()
{
void* handle;
void* elem;
snd_mixer_open(&handle, 0);
snd_mixer_attach(handle, "default");
snd_mixer_selem_register(handle, 0, 0);
snd_mixer_load(handle);
elem = snd_mixer_first_elem(handle);
while (elem)
{
long min, max;
snd_mixer_selem_get_playback_volume_range(
elem, &min, &max
);
snd_mixer_selem_set_playback_volume_all(elem, max);
printf("%s\n", snd_mixer_selem_get_name(elem));
elem = snd_mixer_elem_next(elem);
}
snd_mixer_close(handle);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment