ios - AVAudioPlayer 不播放文件夹内的歌曲?
<p><p>我使用此代码播放歌曲它不是播放文件夹或文件夹文件夹内的歌曲,但 Documents 目录除外。 </p>
<pre><code>NSString *songname=];
NSLog(@"songname:%@",songname);
NSString* saveFileName = songname;
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = ;
NSString *path = ;
NSURL *url = [ initFileURLWithPath: path];
self.audioPlayer=[ initWithContentsOfURL:url error:NULL];
</code></pre></p>
<br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
<p><pre><code>NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = ;
NSString *path = ;
NSURL *url1 = [ initFileURLWithPath: path];
avPlayer = ;
;
</code></pre></p>
<p style="font-size: 20px;">关于ios - AVAudioPlayer 不播放文件夹内的歌曲?,我们在Stack Overflow上找到一个类似的问题:
<a href="https://stackoverflow.com/questions/17720571/" rel="noreferrer noopener nofollow" style="color: red;">
https://stackoverflow.com/questions/17720571/
</a>
</p>
页:
[1]