Skip to content

feat(AudioStreaming): Add multichannel audio playback groundwork - #149

Closed
ollisulopuisto wants to merge 1 commit into
dimitris-c:mainfrom
ollisulopuisto:main
Closed

ollisulopuisto wants to merge 1 commit into
dimitris-c:mainfrom
ollisulopuisto:main

Conversation

@ollisulopuisto

Copy link
Copy Markdown

Configure the canonical PCM stream, renderer buffers, and converter layouts for MPEG 5.1 audio instead of forcing a fixed stereo output.

Changes:

  • AudioPlayer: canonical output format is now 6-channel kAudioChannelLayoutTag_MPEG_5_1_A PCM Float32 @ 44.1 kHz
  • AudioFileStreamProcessor: set converter input layout (from codec channel count) and force output layout to MPEG 5.1 A
  • AudioRendererContext: size render buffers from actual channel count (was hardcoded stereo)
  • AudioPlayerRenderProcessor: read mNumberChannels from outputAudioFormat (was hardcoded 2)
  • VorbisFileDecoder: tag 6-channel Vorbis as kAudioChannelLayoutTag_Ogg_5_1 (Vorbis order FL,FC,FR,RL,RR,LFE differs from MPEG 5.1 A)
  • OggVorbisStreamProcessor: build output AVAudioFormat with explicit MPEG 5.1 A channel layout

Vorbis and MPEG 5.1 use different channel orders; the AudioConverter maps between them.

This is the multichannel groundwork previously kept in the amperfy-spatial fork's vendored AudioStreaming copy, now contributed upstream per the maintainer's request.

Configure canonical PCM stream, renderer buffers, and converter layouts
for MPEG 5.1 audio. Use output format channel count throughout render
callback. Tag six-channel Vorbis streams with Ogg 5.1 channel layout;
Vorbis and MPEG 5.1 use different channel orders, converter maps between
them.
@ollisulopuisto

Copy link
Copy Markdown
Author

Closing per request — targeting ollisulopuisto repos only, not upstream.

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