gpt4 book ai didi

java - Android/java echo Nest文件上传错误

转载 作者:太空宇宙 更新时间:2023-11-04 14:37:48 25 4
gpt4 key购买 nike

所以我一直试图弄清楚如何将文件上传到 echoNest 服务器上进行分析,但我无法做到,实际上在 :Track track = echoNest.uploadTrack(file,true); 之后什么也没有发生

String[] args={"/storage/sdcard1/Music/Drive soundtrack/A Real Hero (feat. Electric Youth).mp3"};
File file = new File(args[0]);

if(!file.canRead())
{
printUsage();
System.out.println("Insert a valid path!");
}

System.out.println("validd path!");
EchoNestAPI echoNest = new EchoNestAPI("080NXJV4Y....");
System.out.println("hello!");
Track track = echoNest.uploadTrack(file,true);

System.out.println("uploaded!");
track.waitForAnalysis((60*1000)/2);


System.out.println("ID: "+track.getID());
System.out.println("Artist: "+track.getArtistName());
System.out.println("Title: "+track.getTitle());

我在网上搜索时遇到了类似的问题,但没有找到解决方案。

http://archive-com.com/page/3694036/2014-02-11/http://developer.echonest.com/forums/thread/365

http://developer1072.rssing.com/chan-22893681/all_p31.html#item617

http://developer.echonest.com/forums/thread/1624

这是我收到的错误

08-17 02:27:28.555: I/System.out(2776): EchoNestAPI Error: java.net.UnknownHostException: Unable to resolve host "developer.echonest.com": No address associated with hostname cmd: http://developer.echonest.com/api/v4/track/profile?md5=2fff2dc89742ea6aadf89a96590a2174&api_key=080NXJV4YHVLIVBFA
08-17 02:27:28.555: I/System.out(2776): EchoNestAPI retry failure cmd: http://developer.echonest.com/api/v4/track/profile?md5=2fff2dc89742ea6aadf89a96590a2174&api_key=080NXJV4YHVLIVBFA

最佳答案

您的 api key 似乎无效,并且您的 jar 导入相互冲突。您必须确保在 AsyncTask 内进行该调用。之后,一切都会正常进行。

关于java - Android/java echo Nest文件上传错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25341403/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com