Adding Sound to Fortran

I have a rather boring Fortran program used by students for some heavy computing, and I thought the program might be a little more interesting if I could add some sounds here and there. Is there any utility for making sounds that can be called from Fortran? I would like to name a procedure using, for example, several MP3 files.
I don’t like programs that give sound signals and sound signals in general, but this is the last resort to warn students ...

+4
source share
2 answers

I would go with the C library (e.g. How to play MP3 files in C? ).

lib (, , - mp3-) Fortran.

, .

+2

system , .

program main
    implicit none
    integer i
    character(100) :: message(3)

    message(1) = "hi"
    message(2) = "yo"
    message(3) = "done!"

    do i = 1, 3
        call system( "say " // trim( message(i) ) )
    enddo
end

say Mac OSX. MP3 ( Windows, Mac, Linux). demo, , (: !).

+1

Source: https://habr.com/ru/post/1623468/


All Articles