Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Combine both stereo channels into mono?

Tags:

android

audio

I combed the AudioManager and couldn't find any API or setting to switch from stereo to mono (both channels having a signal that's the sum of the two stereo channels).

Is it possible at all to accomplish this in Android?

like image 907
an00b Avatar asked Aug 09 '11 14:08

an00b


People also ask

How do I turn my stereo into mono?

Select the Start button, then select Settings > Ease of Access > Audio, and then switch on the toggle under Turn on mono audio.

How do I combine left and right audio channels?

Member. Its pretty simple. You connect the two signal grounds together and then connect a resistor to each signal live and then connect those two together.

What does mix stereo down to mono mean?

Mix Stereo Down to MonoConverts the selected stereo track(s) into the same number of mono tracks, combining left and right channels equally by averaging the volume of both channels. The tracks will be rendered with any amplitude envelope or gain and pan settings applied.


1 Answers

There is a method in the AudioManager class called setParameters that might do that. Unfortunately, the API is not very clear about what it does:

public void setParameters (String keyValuePairs)

Sets a variable number of parameter values to audio hardware.

Parameters

keyValuePairs list of parameters key value pairs in the form: key1=value1;key2=value2;...

If we look at the source code for this method in AudioManager.java:

/**
 * Sets a variable number of parameter values to audio hardware.
 *
 * @param keyValuePairs list of parameters key value pairs in the form:
 *    key1=value1;key2=value2;...
 *
 */
public void setParameters(String keyValuePairs) {
    AudioSystem.setParameters(keyValuePairs);
}

And looking at AudioSystem.java:

/*
 * Sets a group generic audio configuration parameters. The use of these parameters
 * are platform dependant, see libaudio
 *
 * param keyValuePairs  list of parameters key value pairs in the form:
 *    key1=value1;key2=value2;...
 */
public static native int setParameters(String keyValuePairs);

Not much information there. It looks like the parameters might be hardware-specific, and I'm not even sure the parameters would do what you're looking to do.

Are you trying to set this system-wide or just in one app? I assumed system-wide, but if that's not the case, I'd imagine it would be easier.

like image 72
Jason Plank Avatar answered Sep 18 '22 00:09

Jason Plank