RTCAudioCustomProcessingDelegate.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /*
  2. * Copyright 2023 LiveKit
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. #import <Foundation/Foundation.h>
  17. #import <WebRTC/RTCMacros.h>
  18. NS_ASSUME_NONNULL_BEGIN
  19. @class RTC_OBJC_TYPE(RTCAudioBuffer);
  20. RTC_OBJC_EXPORT @protocol RTC_OBJC_TYPE (RTCAudioCustomProcessingDelegate)<NSObject>
  21. /**
  22. * (Re-)initialize the audio processor.
  23. * This method can be invoked multiple times.
  24. */
  25. - (void)audioProcessingInitializeWithSampleRate : (size_t)sampleRateHz channels
  26. : (size_t)channels NS_SWIFT_NAME(audioProcessingInitialize(sampleRate:channels:));
  27. /**
  28. * Process (read or write) the audio buffer.
  29. * RTCAudioBuffer is a simple wrapper for webrtc::AudioBuffer and the valid scope is only inside
  30. * this method. Do not retain it.
  31. */
  32. - (void)audioProcessingProcess:(RTCAudioBuffer *)audioBuffer
  33. NS_SWIFT_NAME(audioProcessingProcess(audioBuffer:));
  34. // TOOD:
  35. // virtual void SetRuntimeSetting(AudioProcessing::RuntimeSetting setting);
  36. /**
  37. * Suggests releasing resources allocated by the audio processor.
  38. */
  39. - (void)audioProcessingRelease;
  40. @end
  41. NS_ASSUME_NONNULL_END