[英]send audio file over http
Soo i need to send a audio file (WAV/MP3) file over the internet to a client browser, that then is used inside a client script to be played back/processed. Soo 我需要通过 Internet 将音频文件 (WAV/MP3) 文件发送到客户端浏览器,然后在客户端脚本中使用该文件进行播放/处理。 the server will be running ac# application.
服务器将运行 ac# 应用程序。 I initially approached it by using sending the file as a download to the clients hard-drive... but i had problems with accessing the file and i needed to clear the file when the client leaves the web page.
我最初通过使用将文件作为下载发送到客户端硬盘驱动器来接近它......但是我在访问文件时遇到了问题,我需要在客户端离开网页时清除文件。 I'm looking for the good advice of the community for a library or any specific methodology or course of action to tackle this problem cheers....
我正在寻找社区对图书馆或任何特定方法或行动方案的好建议来解决这个问题欢呼....
使用 Ajax 请求将文件从 JavaScript 下载为 JSON 或 XML blob。
Encode the audio file into a base 64 string (binary to text).将音频文件编码为 base 64 字符串(二进制到文本)。 Once you recieve it at the server you can decode it back to it's original format.
一旦您在服务器上收到它,您就可以将其解码回原来的格式。 Hope this helps!
希望这可以帮助!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.