My app under Windows doesn't see audio files


#1

Hello,
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


#2

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…


#3

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.


#4

I copy File::nonexistent from Juce tutorial example:

https://docs.juce.com/tutorials/ZIPs/PlayingSoundFilesTutorial.zip

tutorial URL: https://docs.juce.com/master/tutorial_playing_sound_files.html


#5

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


#6

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:


#7

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


#8

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.


#9

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();

#10

Hello, thanks,
semicolon made the job :slight_smile:


#11

I need try that