0

我想影响我在 Microsoft.FrameWorck.Media.Song 中读取的隔离存储流,我已经完成了以下代码:

  public void Restory()
{
        `  Media.ClearValue(MediaElement.SourceProperty);
          using (IsolatedStorageFile ISF = solatedStorageFile.GetUserStoreForApplication())
          {
              if (ISF.FileExists(MainPage.filename))
                  using (IsolatedStorageFileStream FS = ISF.OpenFile(MainPage.filename,FileMode.Open))
                  {

                      this.Media.SetSource(FS);
                      Media.Play();
                  //Media is Mediaenlement But in this step
                     i want to put that stream in Microsoft.Xna.FrameWorck.Media.Song
                  }
          }
        }
4

2 回答 2

0

那是不可能的。Song仅适用于存储在用户的MediaLibrary、远程 URI 或 XAP 文件本身中的曲目,而不是存储在隔离存储中的曲目。

于 2012-10-09T13:13:04.603 回答
0

听起来像 tee-stream(为 2 个消费者拆分一个流)在这里可能很有用,尽管如果读取以不同的速率发生,您将消耗内存。

这是一个实现这是另一个

于 2012-10-09T12:51:16.833 回答