Fortran How can I test my loudspeaker for sound output in Fortran?

  • Thread starter Thread starter jpapa
  • Start date Start date
  • Tags Tags
    Fortran Sound
AI Thread Summary
To produce a sound, such as a simple beep, using Fortran, one suggested method is to use the command "print *, char(7)" followed by "STOP" and "END". However, this approach may not work on all systems. It's important to verify the functionality of the computer's loudspeaker, as issues like a defective speaker, low volume, or distance from the CPU can affect sound output. For Windows users, testing utilities are available in the Sound settings, and a command like "type ctrl-g" can be used in a DOS prompt. For Unix or Linux systems, using "echo ctrl-g" may produce the desired beep sound.
jpapa
Messages
4
Reaction score
0
Hello,

i want to produce a sound, for example a simple beep, with fortran. Can anyone help me please?



John
 
Technology news on Phys.org
Have you tried something like this, it works on my computer:

Code:
      print *, char(7)
      STOP
      END
 
Last edited:
mathmate said:
Have you tried something like this, it works on my computer:

Code:
      print *, char(7)
      STOP
      END


Unfortunately it doesn't work on my computer. Any other ideas?


John
 
I would verify the loudspeaker before going further.
Sometimes it may be defective, turned off, volume too low, or the CPU is too far to be heard.
If you are using Windows, there are utilities to test it. On my computer, I do not even have external speakers, just the one integrated in the computer case. Either way, I would check it first. If you are using unix or linux, you can try "echo ctrl-g". On Windows, you can try the utility from "Sound" in control-panel, or on a DOS-screen, type in "type ctrl-g". Note that ctrl-g is the key-combination, not the individual letters.
 
Dear Peeps I have posted a few questions about programing on this sectio of the PF forum. I want to ask you veterans how you folks learn program in assembly and about computer architecture for the x86 family. In addition to finish learning C, I am also reading the book From bits to Gates to C and Beyond. In the book, it uses the mini LC3 assembly language. I also have books on assembly programming and computer architecture. The few famous ones i have are Computer Organization and...
I have a quick questions. I am going through a book on C programming on my own. Afterwards, I plan to go through something call data structures and algorithms on my own also in C. I also need to learn C++, Matlab and for personal interest Haskell. For the two topic of data structures and algorithms, I understand there are standard ones across all programming languages. After learning it through C, what would be the biggest issue when trying to implement the same data...

Similar threads

Back
Top