11//! Traits, functions and type definitions for functioning audio I/O. 
22//! The I/O feature provides types and functions for recording and playbacking audio aswell as handling the data. 
33
4- use  cpal:: { 
4+ use  :: cpal:: { 
55    traits:: { DeviceTrait ,  HostTrait } , 
66    DefaultStreamConfigError ,  Device ,  Host ,  SupportedStreamConfig , 
77} ; 
@@ -15,16 +15,19 @@ pub type OutputDevice = Device;
1515/// Wrapper type for differentiating [`OutputDevice`] from [`InputDevice`] granted the user passes them in right when creating an [`AudioDevice`]. 
1616pub  type  InputDevice  = Device ; 
1717
18+ //Re-export the cpal crate. 
19+ pub  use  cpal; 
20+ 
1821/// The host's audio input and output devices. 
1922#[ allow( missing_debug_implementations) ]  
20- pub  struct  AudioDevice  { 
23+ pub  struct  HostDevice  { 
2124    /// The output device of the host. 
2225pub  output :  Option < OutputDevice > , 
2326    /// The input device of the host. 
2427pub  input :  Option < InputDevice > , 
2528} 
2629
27- impl  AudioDevice  { 
30+ impl  HostDevice  { 
2831    /// Creates a new [`AudioDevice`] instance. 
2932pub  fn  new ( output :  Option < Device > ,  input :  Option < Device > )  -> Self  { 
3033        Self  {  output,  input } 
@@ -52,8 +55,8 @@ impl AudioDevice {
5255pub  use  cpal:: { available_hosts,  default_host,  host_from_id} ; 
5356
5457/// Get the default audio devices of the host. If one doesn't exist it will get initialized with `None`. 
55- pub  fn  get_audio_device ( device :  Host )  -> AudioDevice  { 
56-     AudioDevice  { 
58+ pub  fn  get_audio_device ( device :  Host )  -> HostDevice  { 
59+     HostDevice  { 
5760        input :  device. default_input_device ( ) , 
5861        output :  device. default_output_device ( ) , 
5962    } 
0 commit comments