gpt4 book ai didi

html - jRecorder-jQuery

转载 作者:行者123 更新时间:2023-11-28 00:15:59 26 4
gpt4 key购买 nike

我想使用 html5 录制语音,我也尝试过 jRecorder-jQuery。从文档中,它提到二进制文件保存在浏览器缓存中。我的问题是在哪里呢?我检查了 Chrome 的缓存,但看不到临时文件。

最佳答案

host (Mandatory): The PHP file http location where the recorded WAV file is posted.

来自 jRecorder 文档(http://www.sajithmr.me/jrecorder/index.html),文件似乎没有保存在本地,而是通过 post 请求发送到主机设置中提到的 php 页面。 p>

在 jRecorder 设置中添加:

'host': 'acceptfile.php?filename=hello.wav'

并将 acceptfile.php 更改为您将处理发布文件的 php 脚本。

用于处理 wav 文件的示例 php 脚本(也来自文档):

   $upload_path = dirname(__FILE__). '/';

//here assume that filename parameter is passed. or your can write $filename= 'test.wav';
$filename = $_REQUEST['filename'];

$fp = fopen($upload_path."/".$filename.".wav", "wb");

fwrite($fp, file_get_contents('php://input'));

fclose($fp);

exit('done');

此脚本会将音频文件(wav) 保存在脚本文件夹中。

关于html - jRecorder-jQuery,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12113263/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com