/// <SUMMARY>
/// 下载保存多媒体文件,返回多媒体保存路径
/// </SUMMARY>
/// <PARAM name="ACCESS_TOKEN"></PARAM>
/// <PARAM name="MEDIA_ID"></PARAM>
/// <RETURNS></RETURNS>
public string GetMultimedia(HttpContext context)
{
//下面都是为了获取微信token,我是存在xml中的。
string filepath = HttpContext.Current.Server.MapPath("/AK.xml");
StreamReader str = new StreamReader(filepath, System.Text.Encoding.UTF8);
XmlDocument xml = new XmlDocument();
xml.Load(str);
str.Close();
str.Dispose();
var Token = xml.SelectSingleNode("xml").SelectSingleNode("Access_Token").InnerText;
string file = string.Empty;
string content = string.Empty;
string strpath = string.Empty;
string savepath = string.Empty;
string MEDIA_ID = context.Request["MEDIA_ID"];
//上面都是为了获取token MEDIA_ID是微信的文件ID,需要在前台用wx.uploadVoice上传
string stUrl = "http://file.api.weixin.qq.com/cgi-bin/media/get?access_token=" + Token + "&media_id=" + MEDIA_ID;
HttpWebRequest req = (HttpWebRequest)HttpWebRequest.Create(stUrl);
req.Method = "GET
微信下载录音文件(音轨分离 ffmpeg视频合成)
最新推荐文章于 2025-01-20 10:01:20 发布