Use this simple set of utilities for transcoding audio files either in NodeJS code, or as a CLI.
Use of this utility requires ffmpeg installed on your system. If not already installed, download or if on Mac install with Homebrew
brew install ffmpeg
For use as a library in your NodeJS code, run the following from inside your local project:
npm install symbl-media --save
For use as a CLI:
npm install -g symbl-media
To verify that it's installed properly, check with version command:
media version
Currently this utility only supports one feature:
- Transcode Audio file
If using in CLI mode, to print the detailed usage of this utility you can run this command.
media --help
You can simply transcode (convert) an audio file on your file system using this utility.
Use the transcode
command to transcode the file.
media transcode -i ./my-input-file.wav -o ./my-output-file.mp3 -f mp3
`-i`, `--inFile` file Path to the Input File to be transcoded. `-o`, `--outFile` file Path to where the Output File should be saved. `-f`, `--outFormat` format Format of the output file. For example: mp3, wav, aac etc.
You can quickly transcode any audio/video file using transcodeMediaFile
method.
const {transcodeMediaFile} = require('symbl-media');
(async () => {
try {
const result = await transcodeMediaFile('./my-input-file.wav', 'my-output-file.mp3', 'mp3');
console.log('Successfully transcoded to: ', result.outPath);
} catch (e) {
console.error(e);
}
})();
Also checkout the Examples folder for more examples
If you have any questions, feel free to reach out to us at [email protected], through our Community Slack, or developer community
This guide is actively developed, and we love to hear from you! Please feel free to create an issue or open a pull request with your questions, comments, suggestions and feedback. If you liked our integration guide, please star our repo!
This library is released under the MIT License