java - 为什么在 java 音频中使用 thread.sleep?
问题描述
{
File sound=new File("audiocheck.net_whitenoisegaussian.wav");
Clip clip=AudioSystem.getClip();
clip.open(AudioSystem.getAudioInputStream(sound));
clip.start();
Thread.sleep((clip.getMicrosecondLength()/1000));//
} catch(UnsupportedAudioFileException | IOException | ex);
为什么在这段代码中使用 Thread.sleep !!!?有声音
解决方案
推荐阅读
- sql - 如何以及在何处添加两个实体表的更具体的连接
- c# - 有没有人可以解决这个 if 语句
- tfs - 如何处理基于主干的开发中的错误修复?
- c++ - 删除 AVL 树中的指针
- python - 有效地管道许多生成器而不会出现递归错误
- grammar - 为什么 JFlap 无法从我的计算器语法构建可用的 LL(1) 解析器?
- react-native - 如何在 React-Native 的侦听器上导航?
- java - AWS S3 响应失败,即使文件已完全上传
- python - sqlalchemy.exc.OperationalError:(sqlite3.OperationalError)没有这样的表:mytable
- php - 如何使用从使用 php 和 Soap 的抽象复杂类型派生的复杂类型