i'd able audiobufferlist avassetreader has 2 buffers can process left , right audio through audiounit. tried using output settings below not read long specify stereo layout set kaudiochannellayouttag_stereo.
is possible avassetreader return non-interleaved result?
if not, how convert non-interleaved audiobufferlist? have tried use audio converter services cannot accept either the input or output values audiostreambasicdescription. (asbd) if cannot data in format want avassetreader @ least able convert format need.
any tips appreciated.
- (nsdictionary *) getoutputsettings { audiochannellayout channellayout; memset(&channellayout, 0, sizeof(audiochannellayout)); channellayout.mchannellayouttag = kaudiochannellayouttag_stereo; nsdictionary *outputsettings = [nsdictionary dictionarywithobjectsandkeys: [nsnumber numberwithint:kaudioformatlinearpcm], avformatidkey, [nsnumber numberwithfloat:44100.0], avsampleratekey, [nsnumber numberwithint:2], avnumberofchannelskey, [nsdata datawithbytes:&channellayout length:sizeof(audiochannellayout)], avchannellayoutkey, [nsnumber numberwithint:16], avlinearpcmbitdepthkey, [nsnumber numberwithbool:no], avlinearpcmisnoninterleaved, [nsnumber numberwithbool:no],avlinearpcmisfloatkey, [nsnumber numberwithbool:no], avlinearpcmisbigendiankey, nil]; return outputsettings; }
i think kaudiochannellayouttag_stereo requesting interleaved samples, i'd lose it.
it depends on kind of avassetreaderoutput you're creating output settings. avassetreadertrackoutput no conversion beyond decoding lpcm, avassetreaderaudiomixoutput accepts bunch more format keys, in fact avassetreadertrackoutput + audioconverter.
Comments
Post a Comment