我正在研究一个Java程序,我真的需要能够以一定的频率和持续时间播放声音,类似于c#方法System.Beep,我知道如何在C#中使用它,但我找不到一种在Java中执行此操作的方法.是否有一些等效或其他方式来做到这一点?
using System;
class Program
{
static void Main()
{
// The official music of Dot Net Perls.
for (int i = 37; i <= 32767; i += 200)
{
Console.Beep(i, 100);
}
}
}
Run Code Online (Sandbox Code Playgroud) 在Java中以任何频率生成正弦波声音的最简单方法是什么?样本大小超过2个字节会有所帮助,但这并不重要.
谢谢
只是想知道Java中是否存在像Python中的PyAudiere模块中的库,它只是允许您创建音调并播放它们,就像这个示例Python代码:
device = audiere.open_device()
tone = device.create_tone(500) #create a 500hz tone
tone.play()
tone.stop()
Run Code Online (Sandbox Code Playgroud)
这只是为您的默认声音设备分配一个变量,然后为该设备发出音调然后播放它然后停止它.这样的库是否易于使用?
我感谢任何反馈,谢谢!:-D
虽然我在这个网站上有很多关于音高检测概念的问题......但它们都处理了我不熟悉的神奇FFT.我正在尝试构建一个需要实现音调检测的Android应用程序.我完全不了解用于执行此操作的算法.
这可不是那么难吗?毕竟,Android市场上有大约80亿个吉他调谐器应用程序.
有人可以帮忙吗?
我的java程序中有三个按钮可以播放三种不同的声音.看看我的代码:
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
import java.io.File;
import java.io.IOException;
import javax.sound.sampled.*;
import java.awt.datatransfer.*;
public class VueEditeurEmail extends JFrame implements ActionListener {
private JPanel container = new JPanel();
private JPanel containerHaut = new JPanel();
private JPanel containerAction = new JPanel();
private JButton boutonEnvoyer = new JButton("Envoi");
private JButton boutonAnnuler = new JButton("Annuler");
private JButton contacts = new JButton("Contacts");
private JButton coller = new JButton("Coller");
private JTextArea textArea = new JTextArea();
private ChampsTexte champs1 = new ChampsTexte("Expéditeur :", "");
private …Run Code Online (Sandbox Code Playgroud)