-
Notifications
You must be signed in to change notification settings - Fork 24
Closed
Description
hi I am using Gracnote api and when i run te app i got following errors
public class MainActivity extends Activity {
private GNConfig config;
private TextView song_info;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
try {//15107328-58B83FDB921CA5AFDD161404C26D6FFF
//16072960-FF9781ED0708966A31B940EEA9F5259B
config = GNConfig.init("16072960-FF9781ED0708966A31B940EEA9F5259B",this.getApplicationContext());
RecognizeFromMic task = new RecognizeFromMic();
task.doFingerprint();
} catch (Exception e) {
// TODO Auto-generated catch block
Log.e("Exception", e.toString());
}
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.main, menu);
return true;
}
class RecognizeFromMic implements GNSearchResultReady {
public void doFingerprint(){
GNOperations.recognizeMIDStreamFromMic(this,config);
}
public void GNResultReady(GNSearchResult result) {
try {
song_info = (TextView) findViewById(R.id.song_info);
if (result.isFingerprintSearchNoMatchStatus()) {
song_info.setText("no match");
} else {
GNSearchResponse response = result.getBestResponse();
song_info.setText(response.getTrackTitle() + " by " + response.getArtist());
}
RecognizeFromMic task = new RecognizeFromMic();
task.doFingerprint();
} catch (Exception e) {
// TODO Auto-generated catch block
Log.e("Exceptionssss", e.toString());
}
}
}
}
Metadata
Metadata
Assignees
Labels
No labels