void AudioClock::play_impl( const TimeValue& t, Engine::Execution::BaseScenarioElement& bs) { auto stream = m_audioPlug.makeStream(); if(!stream) { qDebug("No stream!"); return; } m_default.play(t); AudioStream finals = MakeIScoreExecutor(stream, *bs.baseConstraint()->OSSIAConstraint()); auto& player = m_audioPlug.audioContext.audio.player; StartSound(player, finals, GenRealDate(player, 0)); StartAudioPlayer(player); }
int main(int argc, char* argv[]) { printf("----------------------------\n"); printf("LibAudioStream based Player \n"); printf("----------------------------\n\n"); int res = LibVersion(); ///int samplerate = 96000; int samplerate = 44100; #ifndef WIN32 SetMaximumFiles(1024); printf("sysconf id_max %ld\n", sysconf(_SC_OPEN_MAX)); #endif // Try to open Jack version AudioPlayerPtr player = OpenAudioPlayer(IN_CHANNELS, OUT_CHANNELS, CHANNELS, samplerate, 512, 65536 * 8, 131072 * 4, kJackRenderer, 1); // If failure opens PortAudio version if (!player) { player = OpenAudioPlayer(IN_CHANNELS, OUT_CHANNELS, CHANNELS, samplerate, 1024, 65536 * 8, 131072 * 8, kPortAudioRenderer, 1); } // If failure opens CoreAudio version if (!player) { player = OpenAudioPlayer(IN_CHANNELS, OUT_CHANNELS, CHANNELS, samplerate, 1024, 65536 * 8, 131072 * 8, kCoreAudioRenderer, 1); } StartAudioPlayer(player); printf("Type 'b' to start playing from the begining\n"); printf("Type 's' to stop playing\n"); printf("Type 'p' to play from the current position\n"); printf("Type '+' to raise volume\n"); printf("Type '-' to lower volume\n"); printf("Type '1' to pan left\n"); printf("Type '2' to pan right\n"); printf("Type 'n' to go to next test\n"); /* ExecTest(player, test0()); ExecTest(player, test0()); ExecTest(player, test0()); ExecTest(player, test0()); ExecTest(player, test0()); ExecTest(player, test0()); ExecTest(player, test0()); */ ExecTest(player, test0()); ExecTest(player, test1()); ExecTest(player, test1()); ExecTest(player, test2()); ExecTest(player, test3()); ExecTest(player, test4()); ExecTest(player, test5()); ExecTest(player, test6()); ExecTest(player, test7()); ExecTest(player, test8()); ExecTest(player, test9()); ExecTest(player, test9bis()); //ExecTest(player, test10()); ExecTest(player, test10bis()); //ExecTest(player, test11()); ExecTest(player, test11bis()); ExecTest(player, test12()); ExecTest(player, test13()); /* test20(); test21(); */ //ExecTest(player, test0()); StopAudioPlayer(player); CloseAudioPlayer(player); printf("Quit\n"); return 0; }