Tag Archives: gcc

A simple way to read and write audio and video files in C using FFmpeg (part 2: video)

In my previous post, I demonstrated how FFmpeg can be used to pipe raw audio samples in and out of a simple C program to or from media files such as WAV files (based on something similar for Python I … Continue reading

Posted in Uncategorized | Tagged , , , , , , , , , , , , , , , , , , , , | Leave a comment

A simple way to read and write audio and video files in C using FFmpeg (part 1: audio)

C is my favourite programming language and the one I use most often. However, I have tended to shy away from using it for quick one-off signal processing tasks where I needed to read or write audio or video files … Continue reading

Posted in Uncategorized | Tagged , , , , , , , , , , , , , , , , , , , , , | 1 Comment

Using SendInput to type unicode characters

I received a query from reader Partha D about generating unicode keystrokes using the SendInput function in Windows. As I understand it, Partha wants to generate one or more unicode keystrokes when a particular keyboard shortcut is pressed. The following … Continue reading

Posted in Uncategorized | Tagged , , , , , , , , , , , , , , , , | 2 Comments

Simple ARM example for LPC1114

My colleagues Frank Duignan and Richard Hayes have been experimenting with an ARM Cortex M0 microcontroller in a dual inline package (DIP) which can be plugged straight into a breadboard. The chip they’re using is LPC1114FN28/102, which is made by … Continue reading

Posted in Uncategorized | Tagged , , , , , , , , , , , | 16 Comments

Writing bytes to a serial port in C

This is a (relatively) simple example of a C program to send five bytes to a serial port in Windows. In this case, I’m sending the five characters “hello” via COM22 at 38400 baud, but of course the program can … Continue reading

Posted in Uncategorized | Tagged , , , , , , , , , , , , , , , | 36 Comments

Creating a shadow template of a PGM image

I’ve just been cleaning up a scanned copy of a line drawing on paper. The background of the scanned image is quite dark and the shadowing is a bit uneven over the full image region, which makes it difficult to … Continue reading

Posted in Uncategorized | Tagged , , , , , , , , , , , , | 1 Comment

Simulating a Ctrl-V keystroke in Win32 (C or C++) using SendInput

This short example program simulates pressing Ctrl-V on the keyboard (the Windows shortcut for “Paste”) once every second. It’s a modified version of an earlier example I posted on keystroke simulation using the Win32 SendInput function. What’s different this time … Continue reading

Posted in Uncategorized | Tagged , , , , , , , , | 39 Comments