Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

my one confusion in pro0 #6

Open
skiesclear opened this issue Mar 18, 2023 · 0 comments
Open

my one confusion in pro0 #6

skiesclear opened this issue Mar 18, 2023 · 0 comments

Comments

@skiesclear
Copy link

在类StdAudio中,我本想直接使用StdAudio.play(String filename);去播放一个音频,但是总是报错audio ./audio/2001.mid not found,并且在StdAudio源代码中play(String filename)函数中有这样一个报错AudioClip clip = Applet.newAudioClip(url);,很不幸这个问题我解决不了。
所以我换了一种方法:先用StdAudio.read(String filename)将音频文件读入后,利用StdAudio.play(double[] input)开始演奏,并且成功了。但是直接的方法却不可行令我很困惑,希望得到解答。

English:

In class StdAudio, I wanted to use StdAudio.play(String filename) to play a audio, but there are always errors audio ./audio/2001.mid not found, and there is a error in play(String filename) of StdAudio source code :AudioClip clip = Applet.newAudioClip(url);, and unfortunely I could't slove it.
so after thinking , I change a method: use StdAudio.read(String filename) to read audio file, and use StdAudio.play(double[] input) to play, and it do. but the confident method is no way, which confuse me.
please help me!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant