I am putting together a motion sensor and camera. To test the effectiveness of the motion sensor, I would like to temporarily have the system make a beep in the speaker which is integral to my monitor connected via a HDMI cable to the Pi.

I would be grateful for help in how I go about programming this.


  • Have you been able to play other audio from the monitor speakers? Perhaps try playing an audio file with a media player to test. If that works, then all you'll have to do is generate a beep in your favourite programming language. Otherwise, it'd be useful if you could edit explaining what happens when you try to play audio. – Aurora0001 Jan 12 '18 at 19:55
  • The monitor speakers work with my Windows PC. I've only just started working with the PI. I've set up the night vision system with an IR camera and a PIR sensor at a very basic level hich works. I would like ot tet the moition sensor by having a beep every time it picks up movement. I have no idea how to go about this, and hope that someone can provde me with simple code. – epzcaw Jan 12 '18 at 20:03
  • Have you even bother to search for an answer/code? – MatsK Jan 12 '18 at 22:09

Does the display have on-board speakers? If so, audio should play back over HDMI without any special configuration.

  • Yes the display has on-board speakers. But I don't know how to generate audio from the Raspberry Pi. I was hoping there might be some simple command whihc would generate a sound. I've found out how to get the sound to go via the HDMI. I just need the sound now! – epzcaw Jan 12 '18 at 20:07
  • 2
    If I play videos using omxplayer /path/to/video.mp4 to my TV using an HDMI cable, the audio plays through the TV speakers with no additional configuration. Audio playback goes through the TV speakers as well. – bobstro Jan 12 '18 at 20:11

Not the answer you're looking for? Browse other questions tagged or ask your own question.