audio - Android - High phone resource usage causing low volume on one headphone? -


i using libpd (pure data) on android in order make application can used low budget hearing aid. original design "audio engine" had 7 filters, , volume both headphones same. changed design have 14 filters , right headphone has low volume.

running engine on laptop produces same volume on both ears. tried running audio processing on it's own thread, not sure if did correctly.

so boil question down.

  1. is low volume on 1 ear possible side effect of using many resources?
  2. is implementation of creating new thread correct?

    public class circleoffifths extends activity {  private static final string tag = "guitartuner"; private pduidispatcher dispatcher;  @override public void oncreate(bundle savedinstancestate) {     super.oncreate(savedinstancestate);     initgui();      new thread(new runnable() {          public void run(){                     try {                 initpd();                 loadpatch();             } catch (ioexception e) {                 log.e(tag, e.tostring());                 finish();             }            }     }).start();    }  private void initgui() {     setcontentview(r.layout.main); }  private void initpd() throws ioexception {     // configure audio glue     // int samplerate = audioparameters.suggestsamplerate();      int samplerate = audioparameters.suggestsamplerate();     int inpch = audioparameters.suggestinputchannels();     int outch = audioparameters.suggestoutputchannels();     pdaudio.initaudio(samplerate, inpch, outch, 4, true);      // create , install dispatcher dispatcher = new pduidispatcher();     // pdbase.setreceiver(dispatcher); }  private void loadpatch() throws ioexception {     file dir = getfilesdir();     ioutils.extractzipresource(getresources().openrawresource(r.raw.patch),             dir, true);     file patchfile = new file(dir, "microphone.pd");     pdbase.openpatch(patchfile.getabsolutepath());     pdaudio.startaudio(this); }  @override protected void onresume() {     super.onresume();     pdaudio.startaudio(this); }  @override protected void onpause() {     super.onpause();     pdaudio.stopaudio(); } } 

using cpu shouldn't effect volume @ all. seems more 1 of filters causing gain less 1 on channel.

your thread looks fine me. i'm not 100% sure calling finish on non-ui thread legal, if isn't can add runonuithread there


Comments

Popular posts from this blog

cakephp - simple blog with croogo -

How to group boxplot outliers in gnuplot -

bash - Performing variable substitution in a string -