0

I am trying to make a very simple score writing, but for the beginning I just want to test it out in the console. I know the Beep() method, but my computer doesn't have that type of speaker so Beep() doesn't work. Is there an alternative?

As I said, my computer doesn't have the speaker that Beep() can run on. I have a Dell Inspiron 3521 laptop. Answers & comments are much appreciated!

Stevineon
  • 111
  • 7
  • 1
    [This question](https://stackoverflow.com/questions/4060601/make-sounds-beep-with-c) lists some alternatives. Otherwise [pick your favourite library](https://en.cppreference.com/w/cpp/links/libs) and play a sound file. – nada Jul 16 '19 at 11:48

2 Answers2

0

Since you aim to/want to write a full sound app, Beep() is useless. You have to invest in the lower level APIS.

Michael Chourdakis
  • 10,345
  • 3
  • 42
  • 78
0

An alternative is MIDI output.

Here’s a simple example, a C++ console app which plays a coupe of notes: https://www.daniweb.com/programming/software-development/code/216360/play-a-midi-voice-dev-c-console-program

The sound quality is not great compared to professional VST instruments, or MP3’s made with them, but it’s very easy to play notes, might be good enough for your purpose.

Here's the list of available voices, the numbers on Wikipedia have +1 offset compared to what you need to pass into Sound function in the sample, i.e. pass 0 for Acoustic Grand Piano.

Soonts
  • 20,079
  • 9
  • 57
  • 130