Skip to content
Snippets Groups Projects

Fix channel reading for non-native playback

Open Metehan Arslan requested to merge metehan-arslan/vlc.js:kiwi into incoming

This patch fixes the playback issues in stereo file played in multichannel setup.

Now channel count is always passed as mediafile's STREAMINFO channel count. In the next steps upmixing and downmixing handled by browser side.

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Metehan Arslan changed target branch from master to incoming

    changed target branch from master to incoming

  • Hi,

    I think your MR will break the 5.1 samples played on stereo hardware. Unless the point 3.1 of the spec is not enforced https://webaudio.github.io/web-audio-api/#configuring-channels-with-audioworkletnodeoptions. If maxChannelCount is 2 I don't think you can set channels in the audioworkletnode(awn) to more than 2. In that case, if aout_FormatNbChannels is more than maxChannelCount an exception will be thrown.

    To sumup, as we discussed with @alaric, we can fix the current issue in two ways:

    1. Use vlc to handle up/down-mixing:

    We consider that the awn is an output node and we always set the channels variable to maxChannelCount. For downmixing, we change change fmt-> after initialization of the awn, in Start(). For upmixing, we use a filter so that the blocks we send to the awn have the desired number of channels.

    1. Use webaudio's channelInterpretation feature:

    We don't use the awn as an output node, which means we need to add one with the desired number of channels based on maxChannelCount. The awn node will have the file channel number, and the other node (GainNode, for example) will have maxChannelCount as the number of channels.

    Edited by Mehdi Sabwat
Please register or sign in to reply
Loading