When I run:
self.stream=sd.InputStream(device=self.device, channels=1, samplerate=self.fs, blocksize=self.block_size, callback=cb)
self.stream.start()
self.stream.time
on my laptop it works.. but when I run it on a raspbery pi I get:
│ /home/monil/repos/silo/tools/scripts/.venv/lib/python3.12/site-packages/sounddevice.py:1078intime │
│ │
│ 1075 │ │ """ ╭───────────────────────── locals ──────────────────────────╮ │
│ 1076 │ │ time=_lib.Pa_GetStreamTime(self._ptr) │ self=<sounddevice.InputStreamobjectat0x7fff5eb3d040> │ │
│ 1077 │ │ ifnottime: │ time=0.0 │ │
│ ❱ 1078 │ │ │ raisePortAudioError('Error getting stream time') ╰───────────────────────────────────────────────────────────╯ │
│ 1079 │ │ returntimeThis probably happens because the raspberry is slow and the time is literally 0.0 which is falsybreaking this check.
I think that is the case because adding a tiny sleep(0.1) before reading the property fixes the issue..
When I run:
on my laptop it works.. but when I run it on a raspbery pi I get:
This probably happens because the raspberry is slow and the time is literally
0.0which isfalsybreaking this check.I think that is the case because adding a tiny
sleep(0.1)before reading the property fixes the issue..