This is basically what the core of the program is:
ioctl(fd, KIOCSOUND, static_cast<int>(CLOCK_RATE / frequency)); std::this_thread::sleep_for(std::chrono::milliseconds(duration)); ioctl(fd, KIOCSOUND, 0);Where
fdis the file descriptor of the audio device,CLOCK_RATEis the clock rate of the PC speaker,frequencyis the frequency of the sound, anddurationis the duration of the sound.The
KIOCSOUNDconstant is set inlinux/kd.h.
./run.sh- For SoundCloud importing, you need an OAuth token from SoundCloud. You can get
one here. Set the
SOUNDCLOUD_API_KEYenvironment variable to that OAuth token. - A workaround is to play a track on SoundCloud in your browser, then open developer tools and copy the value of
the
oauth_tokencookie. This is your OAuth token as well.