简体   繁体   English

将 .mp3 转换为 .ogg opus/telegram bot/node js

[英]convert .mp3 to .ogg opus / telegram bot / node js

I need a way that converts audio messages to voice messages in a telegram bot.我需要一种在电报机器人中将音频消息转换为语音消息的方法。
can you please suggest me a way to do that in nodeJS.你能给我建议一种在nodeJS中做到这一点的方法吗?

If you can suggest me a way that can converts .MP3 files to .OGG files in a simple script.如果您能建议我一种可以在简单脚本中将 .MP3 文件转换为 .OGG 文件的方法。

You can utilise ffmpeg.您可以使用 ffmpeg。 Simply find a NodeJS wrapper for this command line utility.只需找到此命令行实用程序的 NodeJS 包装器即可。

After you have that, you can run an ffmpeg command such as ffmpeg -i input.mp3 -c:a libvorbis -q:a 4 output.ogg to convert your input to your desired output format.完成后,您可以运行 ffmpeg 命令,例如ffmpeg -i input.mp3 -c:a libvorbis -q:a 4 output.ogg将您的输入转换为您想要的输出格式。

I'd recommend trying https://github.com/fluent-ffmpeg/node-fluent-ffmpeg我建议尝试https://github.com/fluent-ffmpeg/node-fluent-ffmpeg

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM