@@ -48,7 +48,7 @@ def get_default_host_api(verbose: bool = False) -> int:
4848 """Returns the integer representing the system default Host API.
4949
5050 Params:
51- :param verbose: (bool) whether to print the results to the console.
51+ :param verbose: (bool) whether to print the hostAPI's _PaDeviceInfo object to the console.
5252 Returns:
5353 :returns int: the system default host API."""
5454
@@ -65,10 +65,6 @@ def get_default_host_api(verbose: bool = False) -> int:
6565frames_per_buffer : int = config ["audio" ]["chunk_size" ] * config ["audio" ]["mystery_number" ]
6666interface = pyaudio .PyAudio ()
6767host_api = interface .get_default_host_api_info ()
68- speaker_id : int | None = config ["audio" ]["speaker_id" ]
69- if speaker_id is None :
70- speaker_id = int (get_default_speakers ()["index" ])
71- channel_count : int = int (interface .get_device_info_by_index (speaker_id )["maxOutputChannels" ])
7268silence_value : int = 0
7369bogus_data : bytes = silence_value .to_bytes (2 , byteorder = "little" ) * config ["audio" ]["chunk_size" ]
7470
@@ -147,7 +143,7 @@ def play_stream(stream: queue.Queue) -> threading.Thread:
147143
148144 playback_stream = interface .open (
149145 format = pyaudio .paInt16 ,
150- channels = channel_count ,
146+ channels = 1 ,
151147 rate = config ["audio" ]["sample_rate" ],
152148 output = True ,
153149 frames_per_buffer = frames_per_buffer ,
@@ -156,7 +152,7 @@ def play_stream(stream: queue.Queue) -> threading.Thread:
156152
157153 def _play ():
158154 while True :
159- data = stream .get () * channel_count
155+ data = stream .get () # * channel_count
160156 if data is None :
161157 break
162158 playback_stream .write (data )
0 commit comments