简体   繁体   English

将 Song Object 转换为字节 WP7

[英]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.如果问题不够清楚,请告诉我。

As of now i don't see any way to do this.You can also check this post on msdn with the same query.到目前为止,我看不到任何方法可以做到这一点。您也可以使用相同的查询在 msdn 上查看此帖子

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM