i am trying to use the afconvert command for the first time, to convert AAC audio files added to a specific folder in finder to WAV files. I have done a bit of searching about but can't work out how to write the afconvert command.

ultimately i would like to have a script with the afconvert command which would run as a folder action when AAC files are added to the folder, and ideally I would like the original AAC files to be deleted, but first off i need to get the afconvert command working.

i would be grateful if someone could let me know how to write the command line