Monitoring the ESD daemon



Hi, musical friends ;-):

I have some questions regarding ESD and his programming interface.

I attach a program that is able to send to the standard output the sound
produced by the esound sound server.
(The recording is bad, because it depends on the scheduling of my
program, etc. I suppose...).

I have liked a lot how easily I can monitor the sound server stream.

Now the question:
 Can I modify the sound server stream on the fly (not just monitoring
it)?. I mean, I get the server stream and send it back to the server
(modificated, of course), for it to play the modificated version. Can I
do this?
This would be astonishing, because we could add sound filters on the
whole system. Just imagine a echo chorus, or a cathedral-like sound  in
quake, or in the desktop, etc...
Or at least, could I make the server channels mute while still serving
the sound stream so I can monitor it, for sending it in another (not
muted) channel?

Thanks in advance.

Another unrelated questions:

Although I like ESD a lot (I think the future of OS sound systems pass
through sound servers), I find it quite limited in some aspects (like
3D sound (OpenAL?) , filters on the fly like the question above, slow
response (a lot of delay between the sent stream and its playing), a
much improved API (are there sockets in every modern OS out there?),
etc.).
These problems make me think if a replacement have been thought. What
about the new incoming sound server of the KDE project: Arts? Is it
better, faster, etc?.
I think we're still in the point of being able to change the API and
characteristics of ESD without causing a lot of trouble to the
community. What do all of you think?

Some cents of thought,...
#include <esd.h>
#include <stdio.h>
#include <unistd.h> 	// For STDOUT_FILENO

#define BUFFER_SIZE	512

int main(int argc,char **argv)
{
  int server;
  esd_server_info_t *server_info;
  int socket_monitor;
  int real_read;
  char buffer[BUFFER_SIZE];

  server=esd_open_sound(NULL);    // Get the server
  if (server<=0)
    {
      fprintf(stderr,"Can't open ESOUND DEAMON on current host\n");
      return -1;
    }
  server_info=esd_get_server_info( server);
  fprintf(stderr,"Version: %d\n",server_info->version);
  fprintf(stderr,"Sample rate: %d\n",server_info->rate);
  fprintf(stderr,"%s\n",((server_info->format & ESD_STEREO) == ESD_STEREO) ? "stereo":(((server_info->format & ESD_MONO) == ESD_MONO) ? "mono":"unknown"));
  fprintf(stderr,"%s\n",((server_info->format & ESD_BITS16) == ESD_BITS16) ? "16bits":(((server_info->format & ESD_BITS8) == ESD_BITS8) ? "8 bits":"unknown"));

  socket_monitor=esd_monitor_stream(server_info->format,server_info->rate,
   		 	            NULL, // Current host
	                            NULL); //No sample to monitor. Just monitor the esd daemon output...

  while ((real_read=read(socket_monitor,(void *) buffer,BUFFER_SIZE))!=0)
  {
    write(STDOUT_FILENO,(void *) buffer,real_read);
  }

  fprintf(stderr,"\n\nNo more data\n");

  esd_free_server_info(server_info);
  return 0;
}


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]