开发者

Silverlight for WP7: Trim an existing media file

WP7 Mango is making it possible to save custom ringtones from apps. That's great and all, but not if your source material is too long in length (ringtones must be < 40 seconds or so).

I'm hoping it is possible to take an existing audio file (wma, lets say) and trim it by setting a start/end point, so you can export just a part of the audio for ringtone use.

I gather from other SO questions that audio encoding directly in silverlight is not really feasible. 开发者_运维知识库But I don't really want full encoding capabilities, just the ability to trim an existing already encoded file. Any pointers?


I was thinking about doing this as well (until I discovered that we have no access to the music already on the phone).

An mp3 should be pretty easy to do by checking the header (see here: http://www.mpgedit.org/mpgedit/mpeg_format/mpeghdr.htm) and then using the bit rate and frame size to calculate the number of bytes to copy using BinaryReader and BinaryWriter.

I haven't looked into wma but after glancing over the specifications it looks like it may be more complicated (specs: http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=14995).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜