|
13 | 13 | # limitations under the License.
|
14 | 14 |
|
15 | 15 | import ctypes
|
16 |
| -from ._ffi_client import FfiHandle, FfiClient |
| 16 | +from ._ffi_client import FfiHandle |
17 | 17 | from ._proto import audio_frame_pb2 as proto_audio
|
18 |
| -from ._proto import ffi_pb2 as proto_ffi |
19 | 18 | from ._utils import get_address
|
20 | 19 | from typing import Any, Union
|
21 | 20 |
|
@@ -93,28 +92,6 @@ def _from_owned_info(owned_info: proto_audio.OwnedAudioFrameBuffer) -> "AudioFra
|
93 | 92 | FfiHandle(owned_info.handle.id)
|
94 | 93 | return AudioFrame(data, info.sample_rate, info.num_channels, info.samples_per_channel)
|
95 | 94 |
|
96 |
| - def remix_and_resample(self, sample_rate: int, num_channels: int) -> "AudioFrame": |
97 |
| - """Resample the audio frame to the given sample rate and number of channels. |
98 |
| -
|
99 |
| - .. warning:: |
100 |
| - This method is deprecated and will be removed in a future release. |
101 |
| - Please use the `rtc.AudioResampler` class instead. |
102 |
| - """ |
103 |
| - req = proto_ffi.FfiRequest() |
104 |
| - req.new_audio_resampler.CopyFrom(proto_audio.NewAudioResamplerRequest()) |
105 |
| - |
106 |
| - resp = FfiClient.instance.request(req) |
107 |
| - resampler_handle = FfiHandle(resp.new_audio_resampler.resampler.handle.id) |
108 |
| - |
109 |
| - resample_req = proto_ffi.FfiRequest() |
110 |
| - resample_req.remix_and_resample.resampler_handle = resampler_handle.handle |
111 |
| - resample_req.remix_and_resample.buffer.CopyFrom(self._proto_info()) |
112 |
| - resample_req.remix_and_resample.sample_rate = sample_rate |
113 |
| - resample_req.remix_and_resample.num_channels = num_channels |
114 |
| - |
115 |
| - resp = FfiClient.instance.request(resample_req) |
116 |
| - return AudioFrame._from_owned_info(resp.remix_and_resample.buffer) |
117 |
| - |
118 | 95 | def _proto_info(self) -> proto_audio.AudioFrameBufferInfo:
|
119 | 96 | audio_info = proto_audio.AudioFrameBufferInfo()
|
120 | 97 | audio_info.data_ptr = get_address(memoryview(self._data))
|
|
0 commit comments