我如何对音频文件(例如 .wav )进行采样,特别是将其导入到数组中并将其分成块。 (在 Lua 中)

发布于 2024-12-05 00:22:13 字数 198 浏览 2 评论 0原文

我不太擅长编程,我需要对通过手机录制的音频文件进行采样,我知道移动设备会记录语音,并且有采样率,每个样本都有 8 位或 16 位样本大小。我需要 8khz 的 8 位样本大小。编程环境是 lua,但这并不重要,基本的事情是采样。任何帮助将不胜感激。我可以以 8khz 获取它,这不是问题,但我如何将它获取到数组中,以便我可以将它分开,简而言之,我如何在数组中采样音频 .wav 文件

am not that big on programming and i need to sample an audio file that is recorded via a mobile, i understand that the mobile device records the voice, and there are sample rates and each sample has a 8bit or 16 bit sample size. i need 8 bit sample size in 8khz. the programming environment is lua but that doesnt matter really the basic deal is sampling. Any help would be appreciated. I can get it in 8khz not a problem but how can i get it in an array so that i can divide it hence in short how do i sample an audio .wav file in an array

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

一笔一画续写前缘 2024-12-12 00:22:13

音频是什么格式?一个 wav 文件?如果是这样,您需要阅读 RIFF 标头。
然后只需将文件读入一个数组,其中每个元素都是一个样本。

what format is the audio in? a wav file? if so, you need to read the RIFF header.
Then just read the file into an array where each element is a sample.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文