@@ -86,7 +86,8 @@ pub fn get_available_audio_devices(mic: bool) -> Vec<String> {
8686 let mut names = Vec :: new ( ) ;
8787 if let Ok ( devices) = devices {
8888 for d in devices {
89- if let Ok ( name) = d. name ( ) {
89+ if let Ok ( desc) = d. description ( ) {
90+ let name = desc. name ( ) . to_string ( ) ;
9091 if is_relevant_audio_device ( & name) {
9192 names. push ( name) ;
9293 }
@@ -103,7 +104,7 @@ pub fn get_default_audio_device_name(mic: bool) -> Option<String> {
103104 } else {
104105 host. default_output_device ( )
105106 } ;
106- default_device. and_then ( |d| d. name ( ) . ok ( ) )
107+ default_device. and_then ( |d| d. description ( ) . ok ( ) . map ( |desc| desc . name ( ) . to_string ( ) ) )
107108}
108109
109110pub fn spawn_dsp_thread (
@@ -1589,8 +1590,9 @@ pub fn start_audio_thread(file_path: &str, mic: bool, shared_state: Arc<Mutex<Ap
15891590 if let Some ( ref name) = selected_device_name {
15901591 if let Ok ( devices) = host. input_devices ( ) {
15911592 for d in devices {
1592- if let Ok ( d_name) = d. name ( ) {
1593- if & d_name == name {
1593+ if let Ok ( desc) = d. description ( ) {
1594+ let d_name = desc. name ( ) ;
1595+ if d_name == name {
15941596 dev = Some ( d) ;
15951597 break ;
15961598 }
@@ -1608,8 +1610,9 @@ pub fn start_audio_thread(file_path: &str, mic: bool, shared_state: Arc<Mutex<Ap
16081610 if let Some ( ref name) = selected_device_name {
16091611 if let Ok ( devices) = host. output_devices ( ) {
16101612 for d in devices {
1611- if let Ok ( d_name) = d. name ( ) {
1612- if & d_name == name {
1613+ if let Ok ( desc) = d. description ( ) {
1614+ let d_name = desc. name ( ) ;
1615+ if d_name == name {
16131616 dev = Some ( d) ;
16141617 break ;
16151618 }
0 commit comments