MCPcopy Create free account
hub / github.com/ARM-software/AVH / _setDevice

Method _setDevice

interface/vstream/python/vsi_audio_server.py:130–153  ·  view source on GitHub ↗

Set the streaming device index for input/output. Sets the device index to the specified value, or scans for the default device if -1 (0xFFFFFFFF) is given. Args: device: The device index to set. Returns: Device index actually set.

(self, device)

Source from the content-addressed store, hash-verified

128 return self.mode
129
130 def _setDevice(self, device):
131 """
132 Set the streaming device index for input/output.
133
134 Sets the device index to the specified value, or
135 scans for the default device if -1 (0xFFFFFFFF) is given.
136
137 Args:
138 device: The device index to set.
139 Returns:
140 Device index actually set.
141 """
142 logger.debug(f"_setDevice: device={device}")
143
144 if (device == 4294967295): # -1 as unsigned 32-bit
145 # Set device index to point to default device for the selected mode
146 self.device = self._scan_audio_devices()
147 else:
148 # Set device index to the specified value
149 self.device = device
150
151 logger.info(f"_setDevice: streaming device set to {self.device}")
152
153 return self.device
154
155 def _setFilename(self, base_dir, filename):
156 """

Callers 1

runMethod · 0.95

Calls 1

_scan_audio_devicesMethod · 0.95

Tested by

no test coverage detected