From: xi <ctr...@fr...> - 2006-07-19 08:24:46
|
Michael Roitzsch a =E9crit : > Hi, >=20 >=20 >>I am using xine-lib to do an audio player. It works fine but I have >>several sound card connected to the computer and I would like to =20 >>select >>which sound card to use. >> >>It works fine with xine-ui, where I use these parameters in config =20 >>file >>: "audio.driver:alsa" and =20 >>"audio.device.alsa_default_device:plughw:D00" >>(D00 is the name of my first sound card). >> >> >>But in my application, I have no config file, so I would like to use >>these parameters with xine_open_audio_driver() function. >>For example, is it possible to do something like this : >>xine_open_audio_driver(xine_ptr, "alsa", "plughw:D00") ? (this example >>obviously doesn't work) >> >>If no, must I use a config file ? xine_config_load(xine_ptr, =20 >>configfile) >>function, right ? >>Does a minimalist config file with just the 2 options above is OK ? >=20 >=20 > You still don't have to use a config file, you can just use the other =20 > functions of the config options API (xine_config_update_entry() may =20 > be your friend here) to change options from the default to something =20 > else at runtime. >=20 > Michael >=20 Hello, Thanks for your really fast answer. I used the line below ; I don't know=20 if they are correct, but it works fine ! It remains one problem however : I volume change has no effect. The same=20 with xine-ui, I can change volume but it has no effect. Using alsamixer=20 to change volume works fine. Any idea ? /* use alsa */ xine_config_register_string(xinePtr, "audio.driver", "alsa", NULL,=20 NULL, 1, NULL, NULL); xine_config_lookup_entry(xinePtr, "audio.driver", ¶metre_xine); xine_config_update_entry(xinePtr, ¶metre_xine); =09 /* use sound device "D00" */ xine_config_register_string(xinePtr,=20 "audio.device.alsa_default_device", "plughw:D00", NULL, NULL, 1, NULL,=20 NULL); xine_config_lookup_entry(xinePtr, "audio.device.alsa_default_device",=20 ¶metre_xine); xine_config_update_entry(xinePtr, ¶metre_xine); Regards, Xavier |