Skip to content

Instantly share code, notes, and snippets.

@Salies
Last active July 24, 2019 16:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Salies/47d4e3739cf6ec969e67ca4b3a90cbbf to your computer and use it in GitHub Desktop.
Save Salies/47d4e3739cf6ec969e67ca4b3a90cbbf to your computer and use it in GitHub Desktop.
Simple audio player using BASS
#include <iostream>
#include "bass.h"
#include "bassflac.h"
HSTREAM s;
int main(void) {
BASS_PluginLoad("bassflac.dll", 0); //if Windows
//BASS_PluginLoad("libbassflac.so", 0); //if Linux
BASS_Init(-1, 44100, 0, 0, NULL);
s = BASS_StreamCreateFile(FALSE, "Ok Goodnight - Rapture.flac", 0, 0, BASS_STREAM_AUTOFREE); //change the string for whatever filename
BASS_ChannelPlay(s, FALSE);
getchar();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment