I have a rather dull Fortran program that are used by students for some heavy calculations and I thought the program might be a little more interesting if I could add some sounds here and there. Is there any utility to generate sounds that is callable from a Fortran program? I would like to call a routine with for example a selection of MP3 files.
I do not like programs which beeps and plings in general but this is a kind of last resort to keep the students alert ...
I'd go with C library (e.g. How to play MP3 files in C?).
I'd create shared lib with your routine (e.g. code playing some sort of mp3 list) and called it from Fortran code.
Question is, whether this is what you are looking for.
It may be interesting to try the system
call together with a command-line tool, e.g.
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
which says any message via speech synthesis on Mac OSX. A similar thing may be achieved for MP3 files with some audio commands (on Windows, Mac, and Linux). This demo seems to be using such an approach (Note: music starts from the page!).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With