Apologies for spam; we've changed our policy by requiring approval for accounts, and deleted all existing spam and user - thanks for your help flagging content. We continue to test our forums and Vanilla software, aiming for release early in 2013. If you need to give us feedback outside the forum, contact us via http://createdigitalmusic.com/contact/ or on Facebook
android code for pdcore
  • ========source code============ public void startRecording() { Log.d("startRecoding", "recordStart" ); String openPath = "/mnt/sdcard/mp3/lolypoly.wav"; String recPath = openPath; recPath = recPath.substring(0, recPath.length()-4); recPath += "_rec.wav"; recFile = new File(recPath).getAbsolutePath();

    PdBase.sendMessage("#play_and_record", "play", 1);
    PdBase.sendMessage("#play_and_record", "openpf", openPath);
    
        PdBase.sendMessage("#play_and_record", "openrf", recPath);
    PdBase.sendMessage("#play_and_record", "record", 1);
    

    }

    public void stopRecording() { PdBase.sendMessage("#play_and_record", "record", 0); PdBase.sendMessage("#play_and_record", "play", 0); }

    ========pd file ==============

    N canvas 2073 787 790 577 10;

    X obj -132 61 r #play_and_record;

    X msg -130 254 open \$1;

    X obj -39 330 writesf~ 2;

    X obj -54 169 sel 1;

    X msg -58 212 start;

    X msg -1 211 stop;

    X obj -132 118 route openrf record openpf play;

    X obj 115 164 sel 1;

    X msg 129 208 start;

    X msg 181 209 stop;

    X obj 103 262 readsf~ 2;

    X obj 106 301 dac~ 1 2;

    X obj -131 171 symbol;

    X obj 27 165 symbol;

    X msg 61 208 open \$2;

    X obj -59 268 s android;

    X connect 0 0 6 0;

    X connect 1 0 2 0;

    X connect 3 0 4 0;

    X connect 3 1 5 0;

    X connect 4 0 15 0;

    X connect 4 0 2 0;

    X connect 5 0 2 0;

    X connect 6 0 12 0;

    X connect 6 1 3 0;

    X connect 6 2 13 0;

    X connect 6 3 7 0;

    X connect 7 0 8 0;

    X connect 7 1 9 0;

    X connect 8 0 10 0;

    X connect 9 0 10 0;

    X connect 10 0 11 0;

    X connect 10 0 2 0;

    X connect 10 1 11 1;

    X connect 10 1 2 1;

    X connect 12 0 1 0;

    X connect 13 0 14 0;

    X connect 14 0 10 0;

    ============================

    Hello, i have question about android code with pdcore.

    My source code and pd file are like above. it looks working because the lolypoly.wav file has created. but, the size is 44kb and when the startRecording function called, i can not hear sound from mobile.

    i can see a few warnning when the pdservice has been started - info/warning (1,44) - mediaplayer went away with unhandled events - no input buffer available

    is it releavant to this warnning?

    i don't know why, could somebody let me know how to solve ths problem.

  • The warnings are harmless, I think. Based on what you've written, it's hard to tell what's going wrong. You can look at the ScenePlayer project in Pd for Android if you want to see some sample code that records wav files.