简体   繁体   English

在Windows Qt项目中将原始pcm音频文件转换为ogg

[英]Raw pcm audio file to ogg inside of a windows Qt project

I need your help today as I'm trying to get to a new area of programming for my project : audio encoding. 今天,在我尝试进入针对我的项目的编程新领域时,我需要您的帮助:音频编码。

I'm currently developing a windows-only Qt C++ project (using msvc compilers). 我目前正在开发一个仅Windows的Qt C ++项目(使用msvc编译器)。 What I can do right now is record audio files from the mic as raw .pcm files. 我现在能做的是将麦克风中的音频文件记录为原始.pcm文件。

What I need to do is either : record directly to .ogg audio files the microphone or just convert the files I can create to ogg files. 我需要做的是:将麦克风直接录制到.ogg音频文件,或者只是将我可以创建的文件转换为ogg文件。

What I have done is read Qt documentation about audio recording, and try to understand vorbis/ogg documentation. 我所做的是阅读有关录音的Qt文档,并尝试了解vorbis / ogg文档。 I couldn't find any raw pcm to ogg code example for vorbis/ogg, but maybe you guys know where I can find code like that. 我找不到vorbis / ogg的任何原始pcm-ogg代码示例,但也许你们知道我在哪里可以找到这样的代码。

What I need to know is if what I want to achieve is possible, and if so, I would really appreciate if you could point me at stuff that will help me achieve my goal. 我需要知道的是,如果我想实现的目标是可能的,那么如果可以,我将不胜感激,如果您能向我介绍可以帮助我实现目标的东西。

Basically, I'm happy because I can get audio files in pcm format of what I want, but now I need to encode those files into .ogg files. 基本上,我很高兴,因为我可以获得所需的pcm格式的音频文件,但是现在我需要将这些文件编码为.ogg文件。 I want to know if it is possible using ogg/vorbis, and if so, which steps should I follow and what should I read to understand what I'm doing. 我想知道是否可以使用ogg / vorbis,如果可以,应该遵循哪些步骤以及应该阅读哪些内容以了解自己在做什么。

Thank you to anyone who took time to read my question, have a nice day, 多谢您花时间阅读我的问题,祝您有美好的一天,

Eyal 艾尔

There's an "examples" directory inside the libvorbis source code distribution. libvorbis源代码分发中有一个“ examples”目录。 You should take a look at encoder_example.c. 您应该看一下encoder_example.c。

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

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