Skip to content

Instantly share code, notes, and snippets.

@jberkel
Created May 29, 2011 11:36
Show Gist options
  • Save jberkel/997676 to your computer and use it in GitHub Desktop.
Save jberkel/997676 to your computer and use it in GitHub Desktop.
mhd 2011 autotune intent code snippet
public void process(File input) {
Intent process = new Intent(Intent.ACTION_SEND);
process.setType("audio/wav");
process.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(input));
Bundle config = new Bundle();
config.putFloat("pitchShift", -1.0f);
config.putInt("sampleRate", 44100);
process.putExtra("autoTalentConfig", config);
startActivityForResult(Intent.createChooser(process, "Process Audio"), 0);
}
@Override protected void onActivityResult(int requestCode, int resultCode, Intent intent) {
if (resultCode == RESULT_OK) {
File result = new File(intent.getData().getPath());
// do something with result
//
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment