Also created a constructor which allows a byte[] to be passed in as initialization versus just a stream.
There is a issue when you create a stream using a byte[], the stream created is not writable.
So this changes converts the byte[] properly to a stream so it is writable.
I also added a property to the FileAbstraction that lets you get a byte[] of the new data so the users don't need to convert the stream themselves.
var abs = new StreamFileAbstraction(filename, songData);
using (var file = File.Create(abs))
{
file.Tag.Album = Album;
file.Tag.Title = SongTitle;
file.Tag.AlbumArtists = new[] {Artist};
file.Tag.AmazonId = Song.AmazonTrackId;
file.Save();
}
StorageFile sf = await folder.CreateFileAsync(filename, CreationCollisionOption.FailIfExists);
sf.WriteAllBytes(abs.TaggedMediaData);
Switched Stream out with MemoryStream,
Also created a constructor which allows a byte[] to be passed in as initialization versus just a stream.
There is a issue when you create a stream using a byte[], the stream created is not writable. So this changes converts the byte[] properly to a stream so it is writable. I also added a property to the FileAbstraction that lets you get a byte[] of the new data so the users don't need to convert the stream themselves.
var abs = new StreamFileAbstraction(filename, songData); using (var file = File.Create(abs)) { file.Tag.Album = Album; file.Tag.Title = SongTitle; file.Tag.AlbumArtists = new[] {Artist}; file.Tag.AmazonId = Song.AmazonTrackId; file.Save(); } StorageFile sf = await folder.CreateFileAsync(filename, CreationCollisionOption.FailIfExists); sf.WriteAllBytes(abs.TaggedMediaData);