Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/freealut-1.1.0/test_suite/test_waveforms.c @ 14

Last change on this file since 14 was 14, checked in by landauf, 17 years ago

added freealut

File size: 640 bytes
Line 
1#include <stdlib.h>
2#include <AL/alut.h>
3
4/*
5 * This program plays a 440Hz tone using a variety of waveforms.
6 */
7
8static void
9playTone (ALenum waveshape)
10{
11  ALuint buffer, source;
12  buffer = alutCreateBufferWaveform (waveshape, 440, 0, 1);
13  alGenSources (1, &source);
14  alSourcei (source, AL_BUFFER, buffer);
15  alSourcePlay (source);
16  alutSleep (1);
17}
18
19int
20main (int argc, char **argv)
21{
22  alutInit (&argc, argv);
23
24  playTone (ALUT_WAVEFORM_SINE);
25  playTone (ALUT_WAVEFORM_SQUARE);
26  playTone (ALUT_WAVEFORM_SAWTOOTH);
27  playTone (ALUT_WAVEFORM_WHITENOISE);
28  playTone (ALUT_WAVEFORM_IMPULSE);
29
30  alutExit ();
31  return EXIT_SUCCESS;
32}
Note: See TracBrowser for help on using the repository browser.