同步 2 个相似的音频输入(一个通过文件,一个通过麦克风)

发布于 2024-11-09 11:19:49 字数 127 浏览 3 评论 0原文

我有 2 个音乐会的音频输入。 第一个是 wav 文件,第二个是麦克风实时拍摄的。 我需要与麦克风输入同步播放第一个文件。

我可以使用什么库?

有没有任何教程、指南或示例可以做到这一点?

谢谢

i have 2 audio input of a concert.
The first is a wav file and the second is taken by microphone in real time.
I need play the first file in synch with the microphone input.

What library can i use?

Is there any tutorial, guide or example for do this?

thanks

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

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

发布评论

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

评论(1

恰似旧人归 2024-11-16 11:19:49

看一下这里

这是完整的声音 api 文档

http://download.oracle.com/javase/1.5.0/docs/guide/sound/programmer_guide/

另请

  • 参阅第 4 章:在多行上同步播放
  • 第 6 章:使用控件处理音频

但是

这是我在jsresource faq中找到的

如何同步两个或更多播放线?

Mixer中的同步功能没有实现。然而,播放通常保持同步

如何将播放 (SourceDataLines) 与录制 (TargetDataLines) 同步?

与来自同一 Mixer 对象的多个播放行一样,来自同一 Mixer 对象的播放和录制行保持同步一旦启动就同步。实际上,这意味着您只需使用“直接音频设备”混音器即可以这种简单的方式实现同​​步。由于“Java Sound Audio Engine”仅提供播放线,而没有录音线,因此“Java Sound Audio Engine”的播放/录音同步并不那么容易。

如果播放线和录音线源自不同的 Mixer 对象,则需要同步 Mixer 对象所代表的声卡。所以情况与外部同步类似。

主要问题是缓冲和处理麦克风音频点击和实时计时,一种实用的方法是使用外部时钟

这里是一堆java声音资源,我认为你应该看看api文档中的监控声音部分,并尝试根据点击和监控输出触发时间延迟,这有点复杂,我也对此感兴趣我会尝试的问题看看我是否这样做了,我会让你知道

看看这个链接,这会很容易,因为我找到并阅读了这个处理库的描述

Take a look here

This is entire sound api documentation

http://download.oracle.com/javase/1.5.0/docs/guide/sound/programmer_guide/

Also

  • Chapter 4: Synchronizing Playback on Multiple Lines
  • Chapter 6: Processing Audio with Controls

BUT

here is what i found in jsresource faq

How can I synchronize two or more playback lines ?

The synchronization functions in Mixer are not implemented. Nevertheless, playback typically stays in sync

How can I synchronize playback (SourceDataLines) with recording (TargetDataLines)?

As with multiple playback lines from the same Mixer object, playback and recording lines from the same Mixer object stay in sync once they are started. In practice, this means that you can achieve synchronization this easy way only by using the "Direct Audio Device" mixers. Since the "Java Sound Audio Engine" only provides playback lines, but no recording lines, playback/recording sync is not as easy with the "Java Sound Audio Engine".

If playback and recording lines originate from different Mixer objects, you need to synchronize the soundcards that are represented by the Mixer objects. So the situation is similar to external synchronization.

AND

The main problem is buffering and processing mic audio hits and timing realtime , a practical way is using external clock

And here is a bunch of java sound resources , i think u should look at monitoring sound section in api documentation and try to trigger timedelay based on hits and monitor outputs , it's little complicated i also interested in this question i will try to find out if i did i will let u know

Take a look at this links and it's going to be easy as i found and read description of this processing libraries

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