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

FormatConverter discards 2nd channel when going from 2 to 1 channels #2900

Open
quantamrhino opened this issue Feb 26, 2024 · 1 comment
Open
Labels

Comments

@quantamrhino
Copy link

macOS Version(s) Used to Build

macOS 13 Ventura

Xcode Version(s)

Xcode 14

Description

Using formatConverter.Options as follows:

options.format = .caf
options.sampleRate = 48000
options.bitDepth = 16
options.channels = 1 // mono.

if I have a stereo file with 1 channel (left), this converts it to a mono file correctly.
But a stereo file with 1 channel (right) converts it to an empty file.
is this expected behavior - to discard the second channel?

If so, how does one convert a 1-channel stereo file to a mono file (with the non empty channel) as the first channel? (effectively flatten it).

Crash Logs, Screenshots or Other Attachments (if applicable)

No response

@NickCulbertson
Copy link
Member

It sounds like it is just grabbing the first channel (left) and making it into a mono file. I wouldn't think that is the expected behavior, but it would take some digging to find where this is occurring and how to mix the two channels. If you want to make a minimal GitHub example I can take a look.

I think there is a Stereo Limiter AudioKit node that could be used to make an incoming stream Mono.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants