サウンドをダウンロードして、次の.mp3
ような拡張子で保存します。
var response = await client.GetStreamAsync(fileUrl);
using (IsolatedStorageFileStream fileStream = new IsolatedStorageFileStream(filePath, FileMode.Create, isolatedStorage))
{
using (BinaryWriter binaryWriter = new BinaryWriter(fileStream))
{
await response.CopyToAsync(fileStream);
}
}
IsolatedStorage
分離ストレージ ビューアで見ると、そこにファイルが表示され、再生することもできます。
アクセスして再生したい:
IsolatedStorageFile isolatedStorage = IsolatedStorageFile.GetUserStoreForApplication();
IsolatedStorageFileStream fileStream = isolatedStorage.OpenFile(filePath, FileMode.Open, FileAccess.Read);
musicMediaElement.SetSource(fileStream);
musicMediaElement.Play();
}
何も聞こえません。何が悪いのかわかりません。