How to use the File class to load audio file located within project directory

I’m building a metronome application and would like to provide a default .wav audio ‘click’ sound in my project rather than relying on the user to import their own.
I’ve added the file in a separate data directory outside the source folder using the Projucer. But am not sure how best to use the File class to access it. So far I’ve only used the File::SpecialLocationType which doesn’t appear to work for what I need.
Any suggestions are welcome :slight_smile:

Easiest would be to import your file as BinaryData using Projucer. This way you can avoid dealing with file location being different between different targets (platforms).

1 Like