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

Add basic channels abstraction, ChannelMergerNode, and sink support for channels #54

Merged
merged 6 commits into from Jun 22, 2018

Conversation

Projects
None yet
2 participants
@Manishearth
Copy link
Member

commented Jun 21, 2018

  • Extends Block to support channels.
  • Makes the DestinationNode have two channels by default. We'll later make this something that the user can set.
  • Adds ChannelMergerNode
  • Implements very basic upmixing from one channel to multiple. Proper upmixing will come later.

Channels are stored as a continuous buffer with each FRAMES_PER_BLOCK chunk being one channel. They can also be grouped together via repeat -- e.g. if an oscillator node produces 2 channels of output, it will actually produce one channel with a repeat bit set. Similarly, one-channel blocks will be upmixed to 2-channel repeat blocks.

The iterator is a bit awkward due to the lack of associated type constructors (it's a streaming iterator).

part of #18

@Manishearth Manishearth requested a review from ferjm Jun 21, 2018

@Manishearth

This comment has been minimized.

Copy link
Member Author

commented Jun 21, 2018

We can land this now before everything else is in place just to make things easier

@Manishearth Manishearth changed the title Add basic channels abstraction Add basic channels abstraction, ChannelMergerNode, and sink support for channels Jun 22, 2018

@Manishearth

This comment has been minimized.

Copy link
Member Author

commented Jun 22, 2018

Scratch that, I planned ahead pretty well and the actual stuff was easy to implement with this abstraction in place.

https://twitter.com/ManishEarth/status/1002328167816630272?s=19 strikes again

@ferjm

ferjm approved these changes Jun 22, 2018

Copy link
Member

left a comment

Nice! LGTM

use servo_media::audio::gain_node::GainNodeOptions;
use servo_media::audio::node::{AudioNodeMessage, AudioNodeType};
use servo_media::audio::oscillator_node::OscillatorNodeMessage;
use servo_media::audio::param::UserAutomationEvent;

This comment has been minimized.

Copy link
@ferjm

ferjm Jun 22, 2018

Member

This is not used.

@ferjm ferjm merged commit 9bcae50 into master Jun 22, 2018

@ferjm ferjm deleted the channels branch Jun 22, 2018

@ferjm ferjm referenced this pull request Jun 22, 2018

Closed

Deinterleave decoded audio #55

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.