SDL_audio creating SAW Signal but nothing happens

I’ve got a class cSynth which uses SDL_audio for output - i thought…

cSynth::cSynth ()
{
phonems = NULL;
text = NULL;
cntPhonems = 0;

audiodevice = new SDL_AudioSpec;
audiodevice->freq = 44100;
audiodevice->format = AUDIO_S8;
audiodevice->channels = 1;
audiodevice->samples = 4096; // 512 samples per char, 8 chars per buffer
audiodevice->callback = cSynth::fillBuffer;
audiodevice->userdata = (void *)this;

}

int cSynth::play (void)
{
if (text != NULL)
delete text;

text = new char (strlen (string));
strcpy (text, string);
actpos = 0;
if (SDL_OpenAudio (audiodevice, NULL) < 0)
fprintf(stderr, “Fehler beim A*ffnen der Audiodatei\n”);
SDL_PauseAudio(0);
SDL_Delay(3000);
SDL_CloseAudio();
}

void cSynth::fillBuffer (void *userdata, Uint8 *stream, int len)
{
cSynth *This = (cSynth *) userdata;
int i;
float saw = 0;
SDL_LockAudio();
for (i = 0; i < len; i++)
{
saw += 90.0f / (float)This->audiodevice->freq - (int) saw;
stream[i] = (char) ((saw - 0.5) * 256) ;
}
SDL_UnlockAudio();
}

Here’s my main

#include
#include
#include

#include “SDL_synth.h”

using namespace std;

int main(int argc, char *argv[])
{
SDL_Init(SDL_INIT_AUDIO|SDL_INIT_VIDEO);

cSynth *synth = new cSynth;

synth->play();

system(“PAUSE”);

delete synth;
SDL_Quit();
return EXIT_SUCCESS;
}

But nothing to hear but why?

Nutzen Sie Ihr Postfach als virtuelle Festplatte! - Jetzt installieren!