From: Steve K. <st...@st...> - 2003-07-21 14:50:04
|
Mike, That seems like what I'd expect; The "devices" list should stay the same after you call iaxc_audio_devices_set, but the integers returned into *input, *output, *ring should indicate the currently selected devices. hmm, maybe I should document these better :) +/* Get audio device information: + * **devs: a pointer to an array of device structures, as declared above. function + * will give you a pointer to the proper array, which will be valid as long as iaxc is + * initialized. + * + * *nDevs: a pointer to an int, to which the count of devices in the array devs will be + * written + * + * *input, *output, *ring: the currently selected devices for input, output, ring will + * be written to the int pointed to by these pointers. + */ +int iaxc_audio_devices_get(struct iaxc_audio_device **devs, int *nDevs, int *input, int *output, int *ring); So, here's some code to use this: int input, output, ring, nDevs; struct iaxc_audio_devices *devs; /* get the current settings */ iaxc_audio_devices_get(&devs, &nDevs, &input, &output, &ring); /* now: devs[] is the array of devices, nDevs is the number of devices in devs[], input is the currently selected input device output is the currently selected output device ring is the currently selected ring device */ /* set them to something else */ iaxc_audio_devices_set(2, 3, 4); /* get the new settings */ iaxc_audio_devices_get(&devs, &nDevs, &input, &output, &ring); /* now, input should be 2, output 3, and ring 4 */ -SteveK On Mon, 2003-07-21 at 10:32, Michael Van Donselaar wrote: > On Mon, 21 Jul 2003 10:04:21 -0400, Steve wrote: > > >On Mon, 2003-07-21 at 09:46, Michael Van Donselaar wrote: > > > >> Has anyone lese been messing with setting audio devices under windows? > >> I'm not sure if I have a cross platform issue, or if the real problem is > >> between the chaid and keyboard. > >> > >> I called iaxc_audio_devices_get() and find that device 4 has > >> capabilities for IAXC_AD_OUTPUT and IAXC_AUDIO_AD_RING. > >> > >> Then I call iaxc_audio_devices_set(0,4,4) to set input to default > >> (Microsoft Sound Mapper - Input) and output and ring to deviceid 4 > >> (Avance AC97 Audio). > >> > >> Calling iaxc_audio_devices_get() shows no change to audio device > >> assignment. > >> > >> Any ideas? > > > > > >Hmm, those calls eventually end up here, in audio_portaudio.c: > > > > 349 int pa_select_devices (struct iaxc_audio_driver *d, int input, > >int output, int ring) { > > 350 selectedInput = input; > > 351 selectedOutput = output; > > 352 selectedRing = ring; > > 353 if(running) { > > 354 pa_stop(d); > > 355 pa_start(d); > > 356 } > > 357 return 0; > > 358 } > > 359 > > 360 int pa_selected_devices (struct iaxc_audio_driver *d, int > >*input, int *output, int *ring) { > > 361 *input = selectedInput; > > 362 *output = selectedOutput; > > 363 *ring = selectedRing; > > 364 return 0; > > 365 } > > > >so, I'm not sure how they could fail; we don't even check that the > >choices you give us are valid.. > > > >The only other place those variables are assigned to is in the > >initialize method, which should only get called from iaxc_initialize(). > > > >-SteveK > > Could you take a look at this code and output? -- Steve Kann - Chief Engineer - 520 8th Ave #2300 NY 10018 - (212) 533-1775 HorizonLive.com - collaborate . interact . learn "The box said 'Requires Windows 95, NT, or better,' so I installed Linux." |