Audio File: Playing data through one Speaker Only?

2019-09-19 05:48发布

问题:

I am working on a simple application which does speaker test. It is intended to first play on the Left Speaker then on Right one (or based on selection). As there is no way of achieving it directly, I am trying to overwrite alternate bytes. I checked out in Hex Editor, and bytes are do repeating in alternate pairs (2 bytes). When worked out with overwriting, it is still playing sound in both speakers.

I am currently using

16 bit signed Little Endian

Am I doing something wrong?

These are the available formats I can use while recording the sound:

Unsigned 8-bit samples 
Signed 8-bit samples
Unsigned 16-bit little-endian samples
Unsigned 16-bit big-endian samples
Signed 16-bit little-endian samples
Signed 16-bit big-endian samples

回答1:

I think that you want to look into using AUPannerUnit, or aupn, which controls the left and right stereo channels. There should be an AUPannerUnits.txt tutorial file that is helpful.

Source: Apple Audio Unit Documentation