Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IDSK-2547 Re-writing AVPlayerExample #406

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

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.

None yet

1 participant