To register and login, use your Google, Twitter, Facebook, LinkedIn, or OpenID credentials.

This is allowing us to stop most spam registrations. We've deleted most of the spam accounts that got through, and we're closely watching for more.

android code for pdcore

jiyongjiyong Posts: 3
edited November 2012 in Pd Everywhere

========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.

Answers

Sign In or Register to comment.