cancel
Showing results for 
Search instead for 
Did you mean: 

Generating and playing a sound on STM32F746G-Discovery Board

Nhyrane
Associate II

Hello everyone!

I'm currently working on a project where I aim to generate sound solely on the STM32F746G-Discovery board. I work with TouchGFX and STM32CubeIDE. Nearly all audio projects I checked from GitHub have outer signals. (.wav or other file extensions) from USB, SD etc. or outer speakers.

What I trying to do is generate a sine signal on the code and play the same sine signal on boards sterero output.

 

Here is the simple signal that I generated in Screen1View.cpp:

#define PI 3.1415926

	for(int i=0; i<100; i++)
	{
		result = 50+amp*sin(i*2*PI*freq/100);
        }
"amp" and "freq" are constants presented from slider value which control "Amplitude" and "Frequency" 

 

Is there any possible way to play that signal from boards stereo outp? If there I'll be very glad to know. Thanks for your time.

2 REPLIES 2

You've already asked this question, and got the answer:

https://community.st.com/t5/stm32cubeide-mcus/how-to-play-digitally-generated-sine-wave/m-p/701211/highlight/true#M29299

Did you follow the links provided there for the driver and example ?