繁体   English   中英

无法播放下载的.mp3文件

[英]Can't play the downloaded .mp3 file

我正在应用程序中下载.mp3,但不能仅在Windows Media Player上播放。 我尝试使用Microsoft Groove音乐播放器,手机上的内置音乐播放器Google Play Music进行尝试,但都无法打开它……只是媒体播放器:D那么您是否有问题的根源?

DownloadManager.Request request = new DownloadManager.Request(Uri.parse(mediaURL));
    request.allowScanningByMediaScanner();
    request.setNotificationVisibility(DownloadManager.Request.VISIBILITY_VISIBLE_NOTIFY_COMPLETED);
    request.setMimeType("audio/MP3");
    request.setDestinationInExternalPublicDir(Environment.DIRECTORY_DOWNLOADS, nameOfTheFile + "." + extension);

    DownloadManager manager = (DownloadManager) mContext.getSystemService(Context.DOWNLOAD_SERVICE);
    manager.enqueue(request);

如果我删除“ request.setMimeType(“ audio / MP3”);“ 行,Media Player仍可以播放。

好的,问题是我在文件名中有一个冒号...

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM