2012-06-17 23:14:24 -05:00
|
|
|
/**
|
|
|
|
|
* \file
|
|
|
|
|
* \brief Source code to play a test sound
|
|
|
|
|
* \author Copyright (c) 2011 Jonathan Thomas
|
|
|
|
|
*/
|
2012-08-08 12:36:29 -05:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* \mainpage OpenShot Audio Library C++ API
|
|
|
|
|
*
|
|
|
|
|
* Welcome to the OpenShot Audio Library C++ API. This library is used by libopenshot to enable audio
|
|
|
|
|
* features, which powers the <a href="http://www.openshot.org">OpenShot Video Editor</a> application.
|
|
|
|
|
*/
|
2012-06-22 01:29:22 -05:00
|
|
|
|
2012-06-17 23:14:24 -05:00
|
|
|
#include <iostream>
|
2012-06-15 17:45:27 -05:00
|
|
|
#include "../JuceLibraryCode/JuceHeader.h"
|
|
|
|
|
|
2012-06-22 01:29:22 -05:00
|
|
|
#if JUCE_MINGW
|
|
|
|
|
#define sleep(a) Sleep(a * 1000)
|
|
|
|
|
#include <windows.h>
|
|
|
|
|
#endif
|
|
|
|
|
|
2012-06-17 23:14:24 -05:00
|
|
|
using namespace std;
|
|
|
|
|
|
2012-06-15 17:45:27 -05:00
|
|
|
//==============================================================================
|
|
|
|
|
int main()
|
|
|
|
|
{
|
|
|
|
|
|
2012-06-17 23:14:24 -05:00
|
|
|
// Initialize audio devices
|
|
|
|
|
AudioDeviceManager deviceManager;
|
|
|
|
|
deviceManager.initialise ( 0, /* number of input channels */
|
|
|
|
|
2, /* number of output channels */
|
|
|
|
|
0, /* no XML settings.. */
|
|
|
|
|
true /* select default device on failure */);
|
|
|
|
|
|
|
|
|
|
// Play test sound
|
|
|
|
|
deviceManager.playTestSound();
|
|
|
|
|
|
|
|
|
|
// Sleep for 2 seconds
|
|
|
|
|
cout << "Playing test sound now..." << endl;
|
|
|
|
|
sleep(2);
|
|
|
|
|
|
|
|
|
|
// Stop audio devices
|
|
|
|
|
deviceManager.closeAudioDevice();
|
|
|
|
|
deviceManager.removeAllChangeListeners();
|
|
|
|
|
deviceManager.dispatchPendingMessages();
|
|
|
|
|
|
|
|
|
|
return 0;
|
2012-06-15 17:45:27 -05:00
|
|
|
}
|