Closed Shining-Chen closed 2 years ago
Hi Nathan, I wonder if it's time to make a folder for music files.
These sounds are great, thank you!
Hi Nathan, I wonder if it's time to make a folder for music files.
Yes, that's a great idea! Perhaps audio
would be a good name?
What do you think would be a good way to differentiate between the sounds used in the tutorial and the new sounds?
Hi Nathan, one test is failing but I didn't change anything in main.. Should we run the test again or is it something you know how to fix? Btw, I was thinking we should probably not move your original sound files because it would be a hassle for you to re-make your videos just because of new audio files. For new audio contributions, we could have a folder like "audio contribution"?
Hi Nathan, one test is failing but I didn't change anything in main.. Should we run the test again or is it something you know how to fix?
Hmm...yes that was not your doing. I did cargo fmt
and pushed up the commit to fix it.
Btw, I was thinking we should probably not move your original sound files because it would be a hassle for you to re-make your videos just because of new audio files.
That is not something I am worried about. It is fine if the code evolves.
For new audio contributions, we could have a folder like "audio contribution"?
I would like the folder name to be short. Either audio
or sound
would be fine.
The question of how to differentiate between sets of sounds still remains. Do you have any ideas?
I like audio
for the folder name!
Regarding how to differentiate the files used in the course and new contributions, what do you think if we create 2 sub-folders: one original
for your files and one for all new contributions - let's say we give it the name contributions
?
Regarding how to differentiate the files used in the course and new contributions, what do you think if we create 2 sub-folders: one
original
for your files and one for all new contributions - let's say we give it the namecontributions
?
That sounds fine. Go ahead. 👍🏻
Great!
Hi Nathan, Yes, I can fix the program so that it will find the audio files.
Regarding the 2nd point, I thought I will leave it to the users to choose which sound file they would like to use for which feature because music is such an objective thing. One might think file A is more appropriate for shooting while another might like it for hitting a target. But yes, I can make them into WAV format. Concerning similar names, could you give me an example to help me understand better?
Regarding the 2nd point, I thought I will leave it to the users to choose which sound file they would like to use for which feature because music is such an objective thing. One might think file A is more appropriate for shooting while another might like it for hitting a target.
Alright, that's fine.
Concerning similar names, could you give me an example to help me understand better?
What I was thinking, was that there could be different directories with the same audio file names. For example, the startup sound would always be named startup.wav
, but there might be a audio/original/startup.wav
, an audio/instrumental/startup.wav
and (in the future) other audio/somedirectory/startup.wav
. Then, if folks want different sounds, they only need to change the directory they are reading from, and nothing else.
Sounds good at this stage to me. If we need a new way to organise contributions later, we can think of something else. I can work on it this weekend and make another pull request.
- We need to fix the program so it runs without crashing (it is looking for the audio in the wrong place)
☝🏻 We need to fix at least this crash in this pull request
Hi Nathan, I need your help a little bit.
I tried several ways to modify the line that adds the path in main.rs without any success.
Right now I have this line that looks like audio.add(item, &format!("audio/original/{}.wav", item));
I tried /audio/original/{}.wav
and ../audio/original/{}.wav
as well.
Could you tell me what I did wrong?
Right now I have this line that looks like
audio.add(item, &format!("audio/original/{}.wav", item));
🤔 That is correct. If I make that change on my own machine, then it works fine. Perhaps you forgot to save your file when you had that change? Or had a typo? Rarely the cache gets in a bad state -- if that is the case, then cargo clean
would fix the problem.
$ git diff
diff --git a/src/main.rs b/src/main.rs
index 46c0d05..52ed8a2 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -41,7 +41,7 @@ fn reset_game(in_menu: &mut bool, player: &mut Player, invaders: &mut Invaders)
fn main() -> Result<(), Box<dyn Error>> {
let mut audio = Audio::new();
for item in &["explode", "lose", "move", "pew", "startup", "win"] {
- audio.add(item, &format!("{}.wav", item));
+ audio.add(item, &format!("audio/original/{}.wav", item));
}
audio.play("startup");
😂 Yes, you were right. I forgot to save my file in Microsoft Code, which I had to download and use in a hurry because my IntelliJ license expired. Now it works for me too. I will make another pull request today.
adding 7 sound files and updating README.md to give information about these files