本文整理汇总了PHP中DocumentManager::addAndConvertWavToMp3方法的典型用法代码示例。如果您正苦于以下问题:PHP DocumentManager::addAndConvertWavToMp3方法的具体用法?PHP DocumentManager::addAndConvertWavToMp3怎么用?PHP DocumentManager::addAndConvertWavToMp3使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DocumentManager
的用法示例。
在下文中一共展示了DocumentManager::addAndConvertWavToMp3方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: ob_get_contents
$fileInfo['basename'],
'wav',
0,
'overwrite',
false,
$output
);
$contents = ob_get_contents();
if (!empty($documentData)) {
$newDocId = $documentData['id'];
$documentData['comment'] = 'mp3';
$newMp3DocumentId = DocumentManager::addAndConvertWavToMp3(
$documentData,
$courseInfo,
api_get_session_id(),
api_get_user_id(),
'overwrite',
true
);
if ($newMp3DocumentId) {
$newDocId = $newMp3DocumentId;
}
if (isset($_REQUEST['lp_item_id']) && !empty($_REQUEST['lp_item_id'])) {
$lpItemId = $_REQUEST['lp_item_id'];
/** @var learnpath $lp */
$lp = isset($_SESSION['oLP']) ? $_SESSION['oLP'] : null;
if (!empty($lp)) {
$lp->set_modified_on();
示例2: die
die(get_lang('UplNotEnoughSpace'));
}
//erase temporal file
unlink($tmpfname);
// Add to disk
$fh = fopen($documentPath, 'w') or die("can't open file");
fwrite($fh, $content);
fclose($fh);
error_log($documentPath);
$fileInfo = pathinfo($documentPath);
$courseInfo = api_get_course_info();
$file = array('file' => array('name' => $fileInfo['basename'], 'tmp_name' => $documentPath, 'size' => filesize($documentPath), 'from_file' => true));
$output = true;
$documentData = DocumentManager::upload_document($file, $wamidir, null, null, 0, 'overwrite', false, $output);
if (!empty($documentData)) {
$newDocId = $documentData['id'];
$newMp3DocumentId = DocumentManager::addAndConvertWavToMp3($documentData, $courseInfo, api_get_user_id());
if ($newMp3DocumentId) {
$newDocId = $newMp3DocumentId;
}
if (isset($_REQUEST['lp_item_id']) && !empty($_REQUEST['lp_item_id'])) {
$lpItemId = $_REQUEST['lp_item_id'];
/** @var learnpath $lp */
$lp = isset($_SESSION['oLP']) ? $_SESSION['oLP'] : null;
if (!empty($lp)) {
$lp->set_modified_on();
$lpItem = new learnpathItem($lpItemId);
$lpItem->add_audio_from_documents($newDocId);
}
}
}