My app under Windows doesn't see audio files

I’ve just compiled in Windows 7 my audio application (simply player). And it works OK on my Mac in home. But here on Windows it doesn’t see audio files. I have code like that:

FileChooser chooser ("Select a Wave file to play...", File::nonexistent, "*.wav, *.mp3");

I compile exactly the same Juce project as on Mac. Just visual studio project

You should try debugging. Should be easy enough to see what happens when your code tries to load the file. Probably just that you’re trying to load an mp3 without enabling support for it (Windows doesn’t have the CoreAudio format to load random types of compressed files)

Out of interest, where did you copy that File::nonexistent from? We deprecated that a long time ago and none of our example code should contain it any more…

The original poster seems to be implying the file dialog itself just doesn’t show audio files with the .wav and .mp3 extensions. (Using File::nonexistent with FileChooser does show the files here, though.)

edit : I can guess the problem is actually probably something that happens after the file dialog. I just sometimes like to take posts literally so the posters will learn to provide more relevant and precise information in their future posts.

I copy File::nonexistent from Juce tutorial example:

tutorial URL:

Ah, OK, ta - we’ll need to tidy that up. (I think it’s probably time we more forcibly mark it as deprecated anyway)

Yes, that’s right after click “choose file” in the dialog box there are no files, just directories. See, in that directory there are a lot of *.wav and *.mp3 files, but dialog box looks like that:

OK, interesting. I have no idea why it would not work. (Unless the File::nonexistent actually does mess it up in some way.)

The string gets passed directly to the win32 file chooser, so it’s probably not parsing it properly. Try without the space, or with a semicolon instead of a comma.

A nice trick is to get the file filters string from the AudioFormatManager itself without manually writing the filter in the code :

String filterstring = aformatmanager->getWildcardForAllFormats();
1 Like

Hello, thanks,
semicolon made the job :slight_smile:

I need try that