esd help
- From: Timothy Chan <timothyc MIT EDU>
- To: <desktop-devel-list gnome org>
- Subject: esd help
- Date: Wed, 4 Sep 2002 13:08:12 -0400 (EDT)
why doesn't this code work? output is:
mark1
but 'mark2' is not printed out. it seems to hang at esd_get_latency.
#include <iostream>
#include <esd.h>
#include <stdlib.h>
#include <unistd.h>
void main(){
esd_format_t format = ESD_BITS16 | ESD_STEREO | ESD_STREAM | ESD_PLAY;
int _fd = esd_play_stream_fallback(format, 8000, NULL, NULL);
//write to esound
//short buffer = calloc(256, (sizeof)short);
int elements = 512;
short* buffer = (short*) calloc (elements,sizeof(short));
size_t size = elements * sizeof(short);
int wrote = write(_fd, buffer, size);
//flush(_fd);
cerr << "mark1\n";
int lag = esd_get_latency(_fd);
cerr << "lag = " << lag << "\n";
cerr << "mark2\n";
}
-Tim
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]