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

decoder, stereo / mono? #141

Closed
iamyellow opened this issue Jun 27, 2016 · 3 comments
Closed

decoder, stereo / mono? #141

iamyellow opened this issue Jun 27, 2016 · 3 comments

Comments

@iamyellow
Copy link

hi! i'm starting to work w/ your SDK and so far so (very) good. I was able to fill an AudioBufferList in an AudioUnit input callback like this:
decode to short int buffer > SuperpoweredShortIntToFloat to float buffer > SuperpoweredDeInterleave to mData of each channel from the float buffer.
My question is: since w/ mono files the flow changes a bit (no need to deinterleaving), how could I know if the wav file is stereo or mono? I inspected the docs but I wasn't able to find anything. I must say I'm really a newbie in audio stuff, and sometimes I'm still a bit confused w/ some terms (frames, samples, sample frames...) so hope don't bother you if it seems a really basic question. A hunch tells me that with decoder->samplesPerFrame, decoder->samplerate and some very basic maths I should know it. e.g. my wav is stereo and I'm getting 1024 samplesPerFrame (44100 samplerate). If it were mono, maybe I should get 512?

thanks in advance!

@svenoaks
Copy link

I'm pretty sure the decoder resamples it to 16-bit stereo interleaved with varying sample rate no matter what.

@superpoweredSDK
Copy link
Collaborator

The SuperpoweredDecoder will always emit stereo audio, even for mono sources.

@weepy
Copy link

weepy commented Feb 17, 2017

it would be nice to indicate the number of channels on the source.

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

No branches or pull requests

3 participants