Generate Tone C++ Visual Studio 2010 Express

I would like to make an application that generate a tone of a frequency of choice at 48000hz.

I don´t have a code, as i can´t program at all, even though i did some at school, i totally sucked.

Would be glad if i still could get some assistance or hints.

Thanks:)
Depends on the os. For windows you can do Beep() or '\a' on any os I think but that isn't a custom freq. I forgot what the function was on linux haven't used that in a while.
I am on Windows 8 64 bit.
then use the Beep function.
http://msdn.microsoft.com/en-us/library/windows/desktop/ms679277(v=vs.85).aspx

Beep( hz , time ); //I am pretty sure of
Okay, is it possible to set the time to unlimited?

Thanks
I suppose you could put a long amount of time for the time. Or maybe use a loop that goes for ever.
1
2
3
4
while( true )
{
    Beep( hz , 1000 );
}

Also after looking at the Beep function again it seems that the max hz is 32767 so might have to use something else for 48kHz.
Maybe get a mp3 or wav that is 48khz beep and then keep playing that via a loop.
Beep() seems to reset all the time.
I am trying to get a constant sound, as i am trying to reproduce a sync issue.

And Beep() seems to reset after every sec or less, like BEEP(click)BEEP(click), so i don´t seem to get any sync issues.


Is it possible to make it have a rendered window?
Like Direct3D, and that the window goes white when it beeps, and black when it doesn´t?

Cause then i can easily keep track of the sync.
Last edited on
Topic archived. No new replies allowed.