# Audio Device Manager, playing file problem

**URL:** <https://forum.juce.com/t/audio-device-manager-playing-file-problem/6810>\
**Category:** General JUCE discussion\
**Created:** [May 4, 2011, 12:10pm UTC](https://forum.juce.com/t/audio-device-manager-playing-file-problem/6810 "2011-05-04T12:10:50Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sergex](https://avatars.discourse-cdn.com/v4/letter/s/6bbea6/32.png) [@Sergex](https://forum.juce.com/u/Sergex)\
**Post date:** [May 4, 2011, 12:10pm UTC](https://forum.juce.com/t/audio-device-manager-playing-file-problem/6810/1 "2011-05-04T12:10:50Z")

</div>

hi,

I’m having some problems making a wav file play. I made a class that creates my Interface (buttons, sliders, etc called MainUi). Then in this class I have added the audio functionality as in the Jucedemo audioPlayBack page. So I have:

AudioDeviceManager& deviceManager;  
AudioSourcePlayer audioSourcePlayer;  
AudioTransportSource transportSource;  
ScopedPointer currentAudioFileSource;

At first My constructor was just: MainUi();  
so in the constructor of the MainAppClass generated by the jucer to put the component in the document window I added it like this:

MainUi \*dMain = new MainUi();

Up to this point it worked fine and I was loading a file and painting the waveform on a thumbnail perfectly. Then I added the deviceManager, audioSourePlayer,etc like above. I ,odified the constructor for it to get an AudioDeviceManager, so the constructor is MainUi(AudioDeviceManager& deviceManager);

What I don’t understand now is how can I add this component to the constructor of the MainApp Class. When I add it as MainUi \*dMain = new MainUi(AudioDeviceManager& deviceManager);  
I get the error “Data Formatters temporarliy unavailable”…Any help greatly appreciated!  
Thanks.
