Simulate soundcard to test audio program - c

I am currently developing an audio application using Portaudio.
To test it, I would like to control the input and thus check the output of my application. However, I would love to achieve this only internally.
Do you know of any software able to emulate a soundcard, whose output would be the input of my Portaudio program and whose input would be the output of my Portaudio program?

Related

C program closes without error while trying to read a file?

I have written a very simple C program with a GTK interface that has allows the user to load an input file.
On some Windows 10 computers, the program crashes without showing any error window while trying to read the input file. But on other computers, it reads files just fine.
Is there a known cause for this kind of inconsistent behavior on Windows?

Printing (in C) to IDE console on STM32CubeIDE

I'm starting to use CubeIDE to program a NUCLEO-F401RE board (with sensors attached) and in one of my projects I had to get the voltage of the board and print it somewhere on my laptop (connected to the board via usb cable).
I got this to work using HAL_UART_Transmit function to send the string and PuTTY, on my laptop, to receive and print the string.
Now, I noticed that there is a Console integrated in the IDE where the IDE automatically prints control information, compilation errors and such and I'd like to print the voltage (possibly using printf since I'm programming in C) here rather than using PuTTY, but it doesn't seem so straightforward (as in many other IDEs that I've used) from what I've read on the internet, for instance, here.
I get that here we have two different computers talking to each other, so printing using printf is not as easy as in other situations where code is written, compiled and executed all on the same computer.
My question is:
why isn't there a "console tab" in the IDE where the result of the printf, generated on the board, is displayed? And if there is, how to set it up? Is it simply some settings configuration in the project properties or do I have to modify the low level I/O C functions as stated in the discussion linked above?
Thank you.
Create a new Command Shell Console.
Configure the new Console just as you did with PuTTY.

Echo variables in terminal after running compiled simulink model

I'm building a real time simulink application to interface with a robot. Is there a way to output variables to the terminal when I run the executable (C code generated by simulink coder and then built)?
I ultimately want to see the output of the axes a joystick I have connected.
As it stands now, when I run the application, the prompt goes blank and the robot's speaker turns on (as intended). Before I start controlling its joints with a controller I want to see actual output of the analog sticks in the terminal so I know that it actually works.
It's just a way for debugging.
So my question is: How do I echo out variables into the terminal using simulink coder?

Spliting screen into ncurses and non ncurses area

I am a beginner C programmer and one of my assignments asks me to write an interpreter for the Logo Programming Language. To that end I was wondering if it was possible, when using the ncurses library, to split the screen up so that half retains basic terminal properties with regular text i/o and the other half is formatted in ncurses mode.
My wish is to create a UI such that in one half users can type in Logo style commands and on the other half, such commands are executed onto a little icon.
There is an application called screen which can split the terminal into multiple areas. What is does is implementing it's own terminal emulator which runs inside another terminal emulator. That's the only way to do it because the terminal itself has no concept of screen areas. So you basically have to implement a terminal emulator on top of ncurses which can be used as a "non ncurses area".
Perhaps a different approach would be easier. Does it need to run in a terminal? If not you could use the terminal for regular I/O only and create a GUI window of some sort beside it. Or not use the terminal at all, instead have some terminal widget embedded in your GUI (most GUI toolkits provide such I suppose).

Produce video from OpenGL C program

I have a C program that runs a scientific simulation and displays a visualisation in an OpenGL window. I want to make this visualisation into a video, which will eventually go on YouTube.
Question: What's the best way to make a video from a C / OpenGL program?
The way I've done it in the past is to use a screen capture program, but this is very labour-intensive (have to start/stop the screen capture program, save the video file, etc...). It seems like there should be a way to automate the process of making a video from within the C program. Then I can leave it running overnight and have 20 videos to look through in the morning, and choose the best one to put on YouTube.
YouTube recommend "MPEG4 (Divx, Xvid) format at 640x480 resolution".
I'm using GLUT 3.7.6_3, if that makes a difference. I can change windowing system if there's a good reason.
I'm running Windows (XP), so would prefer answers that work on Windows, but Linux answers are ok too. I can use Linux if it's not possible to do the video stuff easily on Windows. I have a friend who makes a .png image for each frame of the video and then stitches them together using "mencoder" on Linux.
you can use the glReadPixels function (see example)
But if the stuff you are trying to display is made of simple objects (i.e. spheres, rods, etc..), I would "export" each frame into a POV-ray files, render these, and then make a video out of these pictures. you will reach a much higher quality like that.
Use a 3rd party application like FRAPS to do the job for you.
Fraps can capture audio and video up
to 2560x1600 with custom frame rates
from 1 to 120 frames per second!
All movies are recorded in outstanding
quality.
They have video samples on the site. They seem good.
EDIT:
You could execute a tool to record the screen from your C application by calling it like system("C:\screen_recorder_app.exe -params"). Check camstudio, it has a command line version.

Resources