@pipedream/openai 0.1.6 → 0.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -22,7 +22,7 @@ const pipelineAsync = promisify(stream.pipeline);
|
|
|
22
22
|
|
|
23
23
|
export default {
|
|
24
24
|
name: "Create Transcription",
|
|
25
|
-
version: "0.0.
|
|
25
|
+
version: "0.0.6",
|
|
26
26
|
key: "openai-create-transcription",
|
|
27
27
|
description: "Transcribes audio into the input language. [See docs here](https://platform.openai.com/docs/api-reference/audio/create).",
|
|
28
28
|
type: "action",
|
|
@@ -108,8 +108,8 @@ export default {
|
|
|
108
108
|
file, $,
|
|
109
109
|
}) {
|
|
110
110
|
const outputDir = join("/tmp", "chunks");
|
|
111
|
-
await execAsync(`mkdir -p ${outputDir}`);
|
|
112
|
-
await execAsync(`rm -f ${outputDir}
|
|
111
|
+
await execAsync(`mkdir -p "${outputDir}"`);
|
|
112
|
+
await execAsync(`rm -f "${outputDir}/*"`);
|
|
113
113
|
|
|
114
114
|
await this.chunkFile({
|
|
115
115
|
file,
|
|
@@ -137,11 +137,11 @@ export default {
|
|
|
137
137
|
const numberOfChunks = Math.ceil(fileSizeInMB / 24);
|
|
138
138
|
|
|
139
139
|
if (numberOfChunks === 1) {
|
|
140
|
-
await execAsync(`cp ${file} ${outputDir}/chunk-000${ext}`);
|
|
140
|
+
await execAsync(`cp "${file}" "${outputDir}/chunk-000${ext}"`);
|
|
141
141
|
return;
|
|
142
142
|
}
|
|
143
143
|
|
|
144
|
-
const { stdout } = await execAsync(`${ffmpegPath} -i ${file} 2>&1 | grep "Duration"`);
|
|
144
|
+
const { stdout } = await execAsync(`${ffmpegPath} -i "${file}" 2>&1 | grep "Duration"`);
|
|
145
145
|
const duration = stdout.match(/\d{2}:\d{2}:\d{2}\.\d{2}/s)[0];
|
|
146
146
|
const [
|
|
147
147
|
hours,
|
|
@@ -152,7 +152,7 @@ export default {
|
|
|
152
152
|
const totalSeconds = (hours * 60 * 60) + (minutes * 60) + seconds;
|
|
153
153
|
const segmentTime = Math.ceil(totalSeconds / numberOfChunks);
|
|
154
154
|
|
|
155
|
-
const command = `${ffmpegPath} -i ${file} -f segment -segment_time ${segmentTime} -c copy ${outputDir}/chunk-%03d${ext}`;
|
|
155
|
+
const command = `${ffmpegPath} -i "${file}" -f segment -segment_time ${segmentTime} -c copy "${outputDir}/chunk-%03d${ext}"`;
|
|
156
156
|
await execAsync(command);
|
|
157
157
|
},
|
|
158
158
|
async transcribeFiles({
|