AudioSample program from tutorial

Hello everyone! I’ve started learning the JUCE few days ago. I’ve tried to run some of the programs given in official tutorial, and here I got questions.
Firstly: Did someone tried to run Tutorial playing sound files - simple mp3 player recently? I can only open the file, but nothing is being played.
Secondly: Audio Sample Buffer. When I open the file, the sound is played, also it’s looped, but I hear like it would be speeded up 2x times.
My workstation is Windows 8.1 with VisualStudio 2015.
Regards, Elleshar.

Hi Elleshar,

Hmmm this example should not be able to play mp3s - it only supports wav files. Could you try loading a wav file? Otherwise you could change the file extension of the file chooser in MainComponent.cpp to *.mp3 and make sure that you have enabled the mp3 format in the Projucer:


This is expected. The code does not take care of any sample rate conversions. The sample rate of the wav function that you are loading should match the sample rate of the audio device. You could use the ResamplingAudioSource to convert between sample rates.

Thanks for your reply!
Ad.1 question, it’s my mistake that I called it " Simple MP3 player", I got in mind “Simple music player”. Of course, I was loading the .wav file and nothing happend. Any advices what could go wrong?
Ad. 2 So, if I want to play a sample audio ( < 2 sec), also looped in proper speed rate, ResamplingAudioSource is everything what I need?

Hi Ellshar,

Really hard to say. Can you maybe step through the code with the debugger and see what’s going wrong.