Perform music in the program in C 2

Asked

Viewed 45 times

1

I got good lighting with that answer: Perform music in the program in C

But when executed the command, it is not very interesting as the image below shows:

Programa em c executando com musica

(even using system(clear) does not solve)

Is there any way to hide this information and make the game continue normally, or some other more interesting method, like some library that offers means for handling audio files ?

1 answer

0


By the linked question and answer I see that you are using the mpg123, in the form of:

mpg123 <arquivo_de_som>

If you notice the help of this utility you will see that it has an option to run silently, the -q. Just change the command to:

mpg123 -q <arquivo_de_som>

In which the q comes from quiet.

The help of utility for reference:

usage: mpg123 [option(s)] [file(s) | URL(s) | -]
supported options [defaults in brackets]:
   -v    increase verbosity level       -q    quiet (don't print title)
   -t    testmode (no output)           -s    write to stdout
   -w f  write output as WAV file
   -k n  skip first n frames [0]        -n n  decode only n frames [all]
   -c    check range violations         -y    DISABLE resync on errors
   -b n  output buffer: n Kbytes [0]    -f n  change scalefactor [32768]
   -r n  set/force samplerate [auto]
   -o m  select output module           -a d  set audio device
   -2    downsample 1:2 (22 kHz)        -4    downsample 1:4 (11 kHz)
   -d n  play every n'th frame only     -h n  play every frame n times
   -0    decode channel 0 (left) only   -1    decode channel 1 (right) only
   -m    mix both channels (mono)       -p p  use HTTP proxy p [$HTTP_PROXY]
   -@ f  read filenames/URLs from f     -T get realtime priority
   -z    shuffle play (with wildcards)  -Z    random play
   -u a  HTTP authentication string     -E f  Equalizer, data from file
   -C    enable control keys            --no-gapless  not skip junk/padding in mp3s
   -?    this help                      --version  print name + version

As you see in this help has several other options that may prove to be useful depending on your goal.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.