PolyPhonicChannel::PolyPhonicChannel(axAudioBuffer* waveTableAudioBuffer) { // std::cout << "Init poly voice." << std::endl; /// @todo Change this. _processBuffer = new double*[2]; _processBuffer[0] = new double[8192]; _processBuffer[1] = new double[8192]; for(int i = 0; i < 8192; i++) { _processBuffer[0][i] = 0.0; _processBuffer[1][i] = 0.0; } // std::string sndFile("/Users/alexarse/Project/axLib/axProjects/axVstSynth/build/UninstalledProducts/Piano.wav"); // axAudioBuffer* audioBuffer = new axAudioBuffer(sndFile); // axApp* app = axApp::GetInstance(); //// app->GetResourceManager()->Lock(); // std::cout << "Init poly voice 2." << std::endl; // axAudioBuffer* buf = app->GetResourceManager()->GetResource("wf1"); // std::cout << "Init poly voice 3." << std::endl; // _waveTable = new axAudioWaveTable(buf); // std::cout << "Init poly voice 4." << std::endl; // app->GetResourceManager()->Unlock(); std::string sndFile("/Users/alexarse/Project/axLib/axProjects/axVstSynth/build/UninstalledProducts/Piano.wav"); axAudioBuffer* audioBuffer = new axAudioBuffer(sndFile, 0); _waveTable = new axAudioWaveTable(audioBuffer); // _waveTable->SetWaveformType(axAudioWaveTable::axWAVE_TYPE_SQUARE); _filter = new axAudioFilter(); _filter->SetFreq(5000.0); _filter->SetQ(0.707); _filter->SetGain(1.0); _env = new axAudioEnvelope(); _env->SetAttack(0.001); _env->SetDecay(0.8); }
/** Play a 44100Hz mono 16bit PCM sound from a file */ void Audio::playMono16Sound(const char *path) { QFile sndFile(path); sndFile.open(QIODevice::ReadOnly); playMono16Sound(sndFile.readAll()); }
/** Play a 44100Hz mono 16bit PCM sound from a file */ void Audio::playMono16Sound(const QString& path) { QFile sndFile(path); sndFile.open(QIODevice::ReadOnly); playMono16Sound(QByteArray(sndFile.readAll())); }