Skip to content

IDSK-2547 Re-writing AVPlayerExample #406

Open
piyushtank wants to merge 9 commits intomasterfrom
task/ISDK-2547-Local-Audio-Mixing
Open

IDSK-2547 Re-writing AVPlayerExample #406
piyushtank wants to merge 9 commits intomasterfrom
task/ISDK-2547-Local-Audio-Mixing

Conversation

@piyushtank
Copy link
Contributor

@piyushtank piyushtank commented Jun 25, 2019

Contributing to Twilio

All third-party contributors acknowledge that any contributions they provide will be made under the same open-source license that the open-source project is provided under.

  • I acknowledge that all my contributions will be made under the project's license.

This pull requests replaces re-implements the AVPlayerExample -

  1. AVPlayerExample is implemented in Swift
  2. Since volume gets supressed by iOS while playing audio from AVPlayer and VoiceProcessing IO, the example does audio mixing while attaching an MTAudioProcessingTap on AVPlayer.

The example uses the AudioDevice implemented in Co-Viewing example #325 .

co-viewing architecture-5

TODOs

  • Toggle audio mixing while in a call

@piyushtank piyushtank requested a review from ceaglest June 25, 2019 02:04
@piyushtank piyushtank changed the title Task/isdk 2547 local audio mixing IDSK-2547 Re-writing AVPlayerExample Jun 25, 2019
#import "TPCircularBuffer+AudioBufferList.h"

// We want to get as close to 20 msec buffers as possible, to match the behavior of TVIDefaultAudioDevice.
static double const kPreferredIOBufferDuration = 0.01;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use kPreferredIOBufferDuration as 0.02

// We want to get as close to 20 msec buffers as possible, to match the behavior of TVIDefaultAudioDevice.
static double const kPreferredIOBufferDuration = 0.01;
// We will use stereo playback where available. Some audio routes may be restricted to mono only.
static size_t const kPreferredNumberOfChannels = 1;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we use hint from AVPlayer to determine mono vs stereo

framesToCopy,
&sourceRange,
kPreferredNumberOfChannels);
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets make sure we are not turning on the capturing sample rate conversion stream on the tap.

rootVC.connect(contentUrl: videoUrl)
}
return true
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Lets use Twilio's video
  2. Do not launch with URL, remove plist entry.

videoPlayerView?.removeFromSuperview()
videoPlayerView = nil
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a comment why we are doing prerollVideoPlayer


@IBAction func toggleAudioMixing(_ sender: Any) {
// TODO: Pause/stop audio mixing on demand
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

toggleAudioMixing

@sylven sylven mentioned this pull request Apr 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant