diff --git a/audio_win.c b/audio_win.c index 5cbb39b..c96a00a 100644 --- a/audio_win.c +++ b/audio_win.c @@ -313,10 +313,15 @@ int audio_open (struct audio_s *pa) /* Does config file have a number? */ /* If so, it is an index into list of devices. */ + /* Originally only a single digit was recognized. */ + /* v 1.5 also recognizes two digits. (Issue 116) */ if (strlen(pa->adev[a].adevice_in) == 1 && isdigit(pa->adev[a].adevice_in[0])) { in_dev_no[a] = atoi(pa->adev[a].adevice_in); } + else if (strlen(pa->adev[a].adevice_in) == 2 && isdigit(pa->adev[a].adevice_in[0]) && isdigit(pa->adev[a].adevice_in[1])) { + in_dev_no[a] = atoi(pa->adev[a].adevice_in); + } /* Otherwise, does it have search string? */ @@ -344,6 +349,9 @@ int audio_open (struct audio_s *pa) if (strlen(pa->adev[a].adevice_out) == 1 && isdigit(pa->adev[a].adevice_out[0])) { out_dev_no[a] = atoi(pa->adev[a].adevice_out); } + else if (strlen(pa->adev[a].adevice_out) == 2 && isdigit(pa->adev[a].adevice_out[0]) && isdigit(pa->adev[a].adevice_out[1])) { + out_dev_no[a] = atoi(pa->adev[a].adevice_out); + } if ((UINT)(out_dev_no[a]) == WAVE_MAPPER && strlen(pa->adev[a].adevice_out) >= 1) { num_devices = waveOutGetNumDevs();