[英]Convert Song Object to bytes WP7
I want to save the audio data of Song
object or an audio file as bytes and then read the bytes and save it as as another audio file in WP7 using C#.我想将
Song
object 的音频数据或音频文件保存为字节,然后使用 C# 在 WP7 中读取字节并将其保存为另一个音频文件。
Let me know if question is not clear enough.如果问题不够清楚,请告诉我。
You can either:您可以:
Serialize / deserialize it manually using BinaryReader
/ BinaryWriter
使用
BinaryReader
/ BinaryWriter
手动对其进行序列化/反序列化
OR或者
Save it as XML using DataContractSerializer
and then get the bytes using Encoding.UTF8
使用
DataContractSerializer
将其保存为 XML ,然后使用Encoding.UTF8
获取字节
I'd recommend the first as DataContractSerializer
has overhead in both performance and serialized size.我推荐第一个,因为
DataContractSerializer
在性能和序列化大小方面都有开销。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.