bug in esound-0.2.35

Stanley Gambarin <[email protected]>
Newsgroups gmane.comp.gnome.multimedia
Message-ID <[email protected]>
Hello,

  just ran into this using Ubuntu.  I was trying to
play a simple .au file using ESD and everything worked
is i use 'esdplay'.  Using combination 'esdctl cache
...' 
and 'esdctl play ...' resulted in audio being clipped.
The problem especially was evident when using 
'esdctl loop ...' to play file in a loop.

  After looking at the code i was able to find and fix
the problem (please note that i have no idea of how
sound files are working).  The function
'esd_send_file' 
(esdfile.c) is used to send file contents to the
server.  In my case, it sends 2*filesize bytes 
since bytes_per_frame = 2.  'esdplay' works since 
it just reads the socket (i.e. file contents) until
it hits the end.  'esdctl cache' does not work since
it read (and stores) filesize bytes (and not 
2*filesize bytes), resulting in only half of sound
sample.  The fix is to change line esdfile.c:198
from:

    sample_id = esd_sample_cache( esd, out_format,    
                
     out_rate, length, name);

to:

    sample_id = esd_sample_cache( esd, out_format, 
     out_rate, length*bytes_per_frame, name);

  I can provide a test file is you need to.  The
output
of 'file pump.au' shows:
pump.au: Sun/NeXT audio data: 8-bit ISDN mu-law, mono,
8000 Hz

thanks,
-- stanley
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.