我想从本地数据库表 (LINQ) 创建背景音频 _playlist。这是 PlaybackAudio 项目中 AudioPlayer.cs 中的代码:
private static List<AudioTrack> _playList = new List<AudioTrack> { new AudioTrack( new Uri("Ring01.mp3", UriKind.Relative), "Some song", // can be an empty string if no song title "Some artist", // can be an empty string if no artist name null, // album null // album art ) };
我想将其转换为:
private static List<AudioTrack> _playList = from SongsItem song in songsDB.Items select new AudioTrack( new Uri(SongsItem.url, UriKind.Relative), "SongsItem.title", // can be an empty string if no song title "SongsItem.artist", // can be an empty string if no artist name null, // album null // album art );
为此,我需要将播放音频连接到本地数据库。如果不可能,我可以从主项目创建播放列表吗?