/** * Retrieves an array of floats whose values represent a * scaling factor that can be applied to linear samples * in each band to provide the equalization represented by * this instance. * * @return an array of factors that can be applied to the * subbands. */ float[] getBandFactors() { float[] factors = new float[BANDS]; for (int i = 0, maxCount = BANDS; i < maxCount; i++) { factors[i] = getBandFactor(settings[i]); } return factors; }
/** * Sets the bands of this equalizer to the value the bands of * another equalizer. Bands that are not present in both equalizers are ignored. */ public void setFrom(Equalizer eq) { if (eq!=this) { setFrom(eq.settings); } }
public void setEqualizer(Equalizer eq) { if (eq == null) eq = Equalizer.PASS_THRU_EQ; equalizer.setFrom(eq); float[] factors = equalizer.getBandFactors(); if (filter1 != null) filter1.setEQ(factors); if (filter2 != null) filter2.setEQ(factors); }
public float setBand(int band, float neweq) { float eq = 0.0f; if ((band>=0) && (band<BANDS)) { eq = settings[band]; settings[band] = limit(neweq); } return eq; }
private void initialize(Header header) throws DecoderException { // REVIEW: allow customizable scale factor float scalefactor = 32700.0f; int mode = header.mode(); int layer = header.layer(); int channels = mode == Header.SINGLE_CHANNEL ? 1 : 2; // set up output buffer if not set up by client. if (output == null) output = new SampleBuffer(header.frequency(), channels); float[] factors = equalizer.getBandFactors(); filter1 = new SynthesisFilter(0, scalefactor, factors); // REVIEW: allow mono output for stereo if (channels == 2) filter2 = new SynthesisFilter(1, scalefactor, factors); outputChannels = channels; outputFrequency = header.frequency(); initialized = true; }
releaseEqualizer(); mEqualizer = new Equalizer(0, 0); mEqualizer.setEnabled(true); mEqualizer.setControlStatusListener(this);
public void setEqualizer(Equalizer eq) { if (eq==null) eq = Equalizer.PASS_THRU_EQ; equalizer.setFrom(eq); float[] factors = equalizer.getBandFactors(); if (filter1!=null) filter1.setEQ(factors); if (filter2!=null) filter2.setEQ(factors); }
public float setBand(int band, float neweq) { float eq = 0.0f; if ((band>=0) && (band<BANDS)) { eq = settings[band]; settings[band] = limit(neweq); } return eq; }
private void initialize(Header header) throws DecoderException { // REVIEW: allow customizable scale factor float scalefactor = 32700.0f; int mode = header.mode(); int layer = header.layer(); int channels = mode==Header.SINGLE_CHANNEL ? 1 : 2; // set up output buffer if not set up by client. if (output==null) output = new SampleBuffer(header.frequency(), channels); float[] factors = equalizer.getBandFactors(); filter1 = new SynthesisFilter(0, scalefactor, factors); // REVIEW: allow mono output for stereo if (channels==2) filter2 = new SynthesisFilter(1, scalefactor, factors); outputChannels = channels; outputFrequency = header.frequency(); initialized = true; }
public void setEqualizer(Equalizer eq) { if (eq==null) eq = Equalizer.PASS_THRU_EQ; equalizer.setFrom(eq); float[] factors = equalizer.getBandFactors(); if (filter1!=null) filter1.setEQ(factors); if (filter2!=null) filter2.setEQ(factors); }
/** * Sets the bands of this equalizer to the value the bands of * another equalizer. Bands that are not present in both equalizers are ignored. */ public void setFrom(Equalizer eq) { if (eq!=this) { setFrom(eq.settings); } }
public float setBand(int band, float neweq) { float eq = 0.0f; if ((band >= 0) && (band < BANDS)) { eq = settings[band]; settings[band] = limit(neweq); } return eq; }
/** * Retrieves an array of floats whose values represent a * scaling factor that can be applied to linear samples * in each band to provide the equalization represented by * this instance. * * @return an array of factors that can be applied to the * subbands. */ float[] getBandFactors() { float[] factors = new float[BANDS]; for (int i=0, maxCount=BANDS; i<maxCount; i++) { factors[i] = getBandFactor(settings[i]); } return factors; }
private void initialize(Header header) throws DecoderException { // REVIEW: allow customizable scale factor float scalefactor = 32700.0f; int mode = header.mode(); int layer = header.layer(); int channels = mode==Header.SINGLE_CHANNEL ? 1 : 2; // set up output buffer if not set up by client. if (output==null) output = new SampleBuffer(header.frequency(), channels); float[] factors = equalizer.getBandFactors(); filter1 = new SynthesisFilter(0, scalefactor, factors); // REVIEW: allow mono output for stereo if (channels==2) filter2 = new SynthesisFilter(1, scalefactor, factors); outputChannels = channels; outputFrequency = header.frequency(); initialized = true; }
public void setEqualizer(Equalizer eq) { if (eq==null) eq = Equalizer.PASS_THRU_EQ; equalizer.setFrom(eq); float[] factors = equalizer.getBandFactors(); if (filter1!=null) filter1.setEQ(factors); if (filter2!=null) filter2.setEQ(factors); }
/** * Sets the bands of this equalizer to the value the bands of * another equalizer. Bands that are not present in both equalizers are ignored. */ public void setFrom(Equalizer eq) { if (eq != this) { setFrom(eq.settings); } }
public float setBand(int band, float neweq) { float eq = 0.0f; if ((band>=0) && (band<BANDS)) { eq = settings[band]; settings[band] = limit(neweq); } return eq; }