@wyz92 wrote:
Greetings, I’m trying to load an audio file with ofSystemLoadDialog and to play it with sound.load and sound.play
This is my code in ofApp.cpp:ofSoundPlayer sound;
string FN;
string path;
ofFileDialogResult result = ofSystemLoadDialog(“Load file”);
if (result.bSuccess) {
string path = result.getPath();
string FN = ofFilePath::getFileName(path);
}sound.load(FN);
sound.play();
sound.setLoop(true);I’m trying to access the file by opening it with a dialog window, then assigning its name to FN string variable and then loading it with sound.load
I can’t find a way…Any help will be appreciated! Cheers!
Posts: 1
Participants: 1