Skip to main content
Associate
July 26, 2024
Question

Generating and playing a sound on STM32F746G-Discovery Board

  • July 26, 2024
  • 2 replies
  • 1121 views

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.

    This topic has been closed for replies.

    2 replies

    Andrew Neil
    Super User
    July 26, 2024

    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 ?

    A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
    Andrew Neil
    Super User
    July 26, 2024
    A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.