Recent

Author Topic: Sound from a microphone  (Read 320 times)

SDRed

  • Newbie
  • Posts: 1
Sound from a microphone
« on: September 10, 2025, 06:32:30 pm »
Hello,

I am new to Pascal (but not new to programming).
My current programming need is not well suited for the "HMG/Harbour" (xBase) programming languages in which I normally code.

QUESTION: Would anyone be willing to give me guidance as to the potential suitably of FreePascal for the following?

In a program I need for a microphone to listen for (and identify) a "sharp" sound such as a:
       Single hand clap?
       Thunder?
       Starter pistol shot?
(Here background sounds would be quite low).

Also, might there be any FreePascal "sound/audio" sample code?
Any and all of your suggestions or guidance here would be most greatly appreciated!

Thank you in advance,
Spencer (SDRed)

Curt Carpenter

  • Hero Member
  • *****
  • Posts: 669
Re: Sound from a microphone
« Reply #1 on: September 10, 2025, 07:25:47 pm »
Check out:
  PortAudio --  https://www.portaudio.com/
  https://wiki.freepascal.org/ACS#Screenshot

Hope you find them helpful as starting points -- and that you enjoy learning to use Lazarus and Free Pascal! 

Fred vS

  • Hero Member
  • *****
  • Posts: 3716
    • StrumPract is the musicians best friend
Re: Sound from a microphone
« Reply #2 on: September 10, 2025, 08:28:06 pm »
You may try uos audio library.

If you use Lazarus, there is the demo: /uos/examples/simplerecorder.prj
« Last Edit: September 10, 2025, 09:25:30 pm by Fred vS »
I use Lazarus 2.2.0 32/64 and FPC 3.2.2 32/64 on Debian 11 64 bit, Windows 10, Windows 7 32/64, Windows XP 32,  FreeBSD 64.
Widgetset: fpGUI, MSEgui, Win32, GTK2, Qt.

https://github.com/fredvs
https://gitlab.com/fredvs
https://codeberg.org/fredvs

 

TinyPortal © 2005-2018