- Home /
Replacing Audio Files
Hi guys. I'm using a demo for a school project and am just doing the audio. I have loads of the same audio files attached to multiple characters. However, I need to change one of these files. Is there a way that I can change this file without having to painstakingly go through and change each file individually? Can I drag and drop a file with the exact same name in to the program to replace it? Only it will have a different file path. Eg: Sword1 needs to be changed with a new file. If I change the new files name to also be Sword1, will this overwrite the original and change it to be that one file for all the audio sources?
Thanks in advance!
Hi,
Well it depends on how it is coded and how the audio files are loaded. But if it is cleverly done you should just need to place the new file with the right name at the right path and it should work.
I'm pretty certain that it's coded for a play array. So, do I replace the file in the assets folder in the program or in the windows explorer browser/$$anonymous$$ac finder? Thanks :)
If you call the file the same name outside of unity (in windows explorer etc) it will keep all references to it within scripts but change the sound it plays to the new one, I think if you do it inside unity, it will not update the script references and not work.
Alternatively you could write a simple editor script to switch all references to one audio in the scene to a different one.
Thanks guys! Replacing the files in the assets folders in windows explorer worked. I'm very happy! Cheers!