Skip to content

Add @ffmpeg-installer compatibility with audio-slicer #2

@WillJub

Description

@WillJub

Please add the possibility to use a ffmpeg path set as an env variable to use your package along with the package @ffmpeg-installer/ffmpeg from https://www.npmjs.com/package/@ffmpeg-installer/ffmpeg.

// other imports ...
const dotenv = require('dotenv');
dotenv.config();

In audioToSlice :

    await exec(`${process.env.FFMPEG_PATH} -i ${filename} -f segment -segment_time ${seconds} ${options} ${directory}/document_%03d.${extension}`);

In audioMerge :

await exec(
            `${process.env.FFMPEG_PATH} ${files} -filter_complex concat=n=${audios.length}:v=0:a=1 -strict -2 ${filename}`
        );

In the project of the user :

import dotenv from 'dotenv';
const { audioToSlice } = require('audio-slicer')
const ffmpeg = require('@ffmpeg-installer/ffmpeg');
dotenv.config();
process.env.FFMPEG_PATH = ffmpeg.path;

Metadata

Metadata

Assignees

No one assigned

    Labels

    invalidThis doesn't seem right

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions