|
54 | 54 | import os as _os |
55 | 55 | import platform as _platform |
56 | 56 | import sys as _sys |
57 | | -import typing as _t |
58 | 57 | from ctypes.util import find_library as _find_library |
59 | 58 | from _sounddevice import ffi as _ffi |
60 | 59 |
|
|
70 | 69 | break |
71 | 70 | else: |
72 | 71 | raise OSError('PortAudio library not found') |
73 | | - _lib: _t.Any = _ffi.dlopen(_libname) |
| 72 | + _lib: ... = _ffi.dlopen(_libname) |
74 | 73 | except OSError: |
75 | 74 | if _platform.system() == 'Darwin': |
76 | 75 | _libname = 'libportaudio.dylib' |
|
84 | 83 | import _sounddevice_data |
85 | 84 | _libname = _os.path.join( |
86 | 85 | next(iter(_sounddevice_data.__path__)), 'portaudio-binaries', _libname) |
87 | | - _lib: _t.Any = _ffi.dlopen(_libname) |
| 86 | + _lib: ... = _ffi.dlopen(_libname) |
88 | 87 |
|
89 | 88 | _sampleformats = { |
90 | 89 | 'float32': _lib.paFloat32, |
@@ -2659,7 +2658,8 @@ def wait(self, ignore_errors=True): |
2659 | 2658 |
|
2660 | 2659 |
|
2661 | 2660 | def _ffi_string(cdata): |
2662 | | - return _t.cast(bytes, _ffi.string(cdata)) |
| 2661 | + import typing |
| 2662 | + return typing.cast(bytes, _ffi.string(cdata)) |
2663 | 2663 |
|
2664 | 2664 |
|
2665 | 2665 | def _remove_self(d): |
@@ -2736,7 +2736,7 @@ def _get_stream_parameters(kind, device, channels, dtype, latency, |
2736 | 2736 | latency = info['default_' + latency + '_' + kind + '_latency'] |
2737 | 2737 | if samplerate is None: |
2738 | 2738 | samplerate = info['default_samplerate'] |
2739 | | - parameters: _t.Any = _ffi.new('PaStreamParameters*', ( |
| 2739 | + parameters: ... = _ffi.new('PaStreamParameters*', ( |
2740 | 2740 | device, channels, sampleformat, latency, |
2741 | 2741 | extra_settings._streaminfo if extra_settings else _ffi.NULL)) |
2742 | 2742 | return parameters, dtype, samplesize, samplerate |
|
0 commit comments