- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
“当前”框架位置实际上是什么意思?文档中未对此进行描述。
如果我刚刚从TargetDataLine读取了一些缓冲区,然后调用了getFramePosition,则这将是
最佳答案
查看文档:
Obtains the current position in the audio data, in sample frames. The frame position measures the number of sample frames captured by, or rendered from, the line since it was opened. This return value will wrap around after 2^31 frames. It is recommended to use getLongFramePosition instead.
getLongFramePosition
代替。
关于java - TargetDataLine.getFramePosition()vs read(),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6265045/
我正在编写一个函数,使用 TargetDataLine 捕获大约 7.5 秒的音频剪辑。代码执行并呈现一个“input.wav”文件,但是当我播放它时没有声音。 如本文底部的代码所示,我的方法是执行以
我有一个麦克风,它使用 48000 采样率、24 位和 1 个 channel 。因此,我将这些数据输入 AudioSystem.isLineSupported() 并得到 false。 我尝试输入
如果我在关闭并停止 TargetDataLine 后尝试使用另一个音频输入设备再次打开它,那么它只会产生噪音而不是信号。为什么? 这是我正在谈论的代码:https://gist.github.com/
我有一个 Runnable,它获取一条通往麦克风的线路,从中读取数据并将其存储在 OutputStream 中。当我启动该线程的第一个实例时,它起作用了。第一个线程完成后(存在 run() 方法),我
根据Javadocs,当我使用javax.sound.sampledTargetDataLine的以下方法时: public void open(AudioFormat format,int buff
目前我正在尝试用 Java 记录麦克风中的声波并实时显示幅度值。我遇到了 Targetdataline,但我在理解从中获取数据时遇到了一些困难。 来自 Oracle 的示例代码指出: line = (
所以,我已经在一个宠物项目上工作了一段时间,我终于让它一切正常......主要是。我的项目代码已经出现在 JAVA audio data streaming 0s (请原谅我忘记启动我的 Target
因此,我一直致力于学习型项目,从线路中获取音频数据并将其呈现到我的扬声器。现在,我已经到了最后一根稻草和最后几行代码,我不知道什么会先发生。设置两条数据线后,我尝试将 TargetDataLine 读
我正在尝试从我的 PC 的线路输入中捕获音频,为此我正在使用 AudioSystem类(class)。静态 AudioSystem.write 方法有两种选择之一:写入文件或写入流。我可以让它很好地写
“当前”框架位置实际上是什么意思?文档中未对此进行描述。 如果我刚刚从TargetDataLine读取了一些缓冲区,然后调用了getFramePosition,则这将是 首先 最后 其他 读取缓冲区中
我有一个程序可以录制麦克风 5 秒,它应该在录制后播放,但是在将它转换到我的线路时出现错误。当 TargetDataLine 被转换为一行时会发生这种情况。 代码: AudioFormat forma
我创建了一个字节数组 WebSocket,它从客户端麦克风 ( navigator.getUserMedia ) 实时接收音频 block 。经过一段时间 WebSocket 停止接收新的字节数组后,
到目前为止, TargetDataLine 对我来说是用 Java 捕获麦克风输入的最简单方法。我想对[在屏幕录像机软件中]使用屏幕视频捕获的音频进行编码,以便用户可以创建教程、幻灯片案例等。 我使用
我的设置如下: 我有一个在浏览器中运行的 Java 小程序,用于录制和播放音频。 我的问题是: 当我刷新浏览器时,SourceDataLine 会在刷新后正确重新打开,而 TargetDataLine
我正在创建一个 VOIP 服务器和客户端系统,但仅播放 1/连接用户数量的语音数据包。我认为这是因为它只能播放来自一个 TargetDataLine 的音频流,并且每个设备只能播放一个 TargetD
我有一个线程,我从 TargetDataLine(麦克风)读取数据并将其写入 ByteArrayOutputStream。我有一个小“计时器”,因为我想录制 10 毫秒的声音,然后将捕获的数据传递给另
我可以通过操作 targetDataLine 生成的字节数组来更改音频内容的音量吗?我知道我无法使用 java 更改操作系统音量级别。所以我问自己是否可以通过操纵信号本身来改变音量。是否可以?如果是的
我为测试目的编写了一个小型 Java 应用程序,它从 ubuntu 12.04 上的混音器中捕获声音。 代码运行良好,我可以捕捉所有应用程序的声音,除了在 Wine 下运行的任何应用程序。 每当我启动
抱歉,如果这看起来是一个简单的问题,但这是我第一次在编程中尝试声音。 我在这里想要实现的是将通过 TargetDataLine 对象获得的数据编码到 .ogg 文件中。我的出发点是官方 Java 文档
我正在尝试找到FFT的输入,以便获取每个音频输入的时频数据。我浏览过一些网站,我知道输入应该从 targetDataLine 获取。我编写了一个程序来捕获音频数据并且它可以工作。 这是我打印targe
我是一名优秀的程序员,十分优秀!