Skip to content

Expose RTCAudioSource custom source API on iOS/macOS (parity with Windows/Linux builds) #210

Description

@ihatebeans3000

Summary

The iOS/macOS builds of this WebRTC fork currently do not expose the custom audio source API (CaptureFrame/OnData) that is available in the Windows/Linux builds (libwebrtc). This creates a platform inconsistency that prevents developers from implementing custom audio sources on Apple platforms.

Background

Current Platform Disparity

Windows/Linux (libwebrtc)

  • Publicly exposes RTCAudioSource::CaptureFrame() API
  • Supports SourceType::kCustom for custom audio sources
  • Includes patch: custom_audio_source_m137.patch
  • Header: include/rtc_audio_source.h
class RTCAudioSource : public RefCountInterface {
 public:
  enum SourceType { kMicrophone, kCustom };

  virtual void CaptureFrame(const void* audio_data,
                           int bits_per_sample,
                           int sample_rate,
                           size_t number_of_channels,
                           size_t number_of_frames) = 0;
};

iOS/macOS (CocoaPods WebRTC-SDK)

  • Objective-C wrapper only exposes volume property
  • No way to inject custom audio data
  • Underlying webrtc::AudioSourceInterface not accessible
@interface RTCAudioSource : RTCMediaSource
@property(nonatomic, assign) double volume;
// No CaptureFrame or equivalent method
@end

Questions

  1. Is there a specific reason this API is not exposed on Apple platforms?

I'm happy to contribute the implementation if this approach is acceptable.

Thank you for maintaining this valuable fork of WebRTC!


Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions