Another program stop working
sun zongjun <szj <at> ccoss.com.cn>
2002-08-26 03:07:59 GMT
Hi:
I am a newbie to audio play .Now I write one file to play some
wave files with libaudio .
First I open the wave file using afOpenFile and get some parameters from
the wave files.
and construct a socket on local computer with esd_play_stream function.
The last thing
I want to do is to read frames from the wave files and write them to
audio device (
in my computer is /dev/dsp) by system call "write(esd,buf,frame_length)"
Oh. It seems working fine. But when I run another program, f.e .
mpg123 , to listen
some music, then run my own program after write the frame into the dsp
device. The
mpg123 stop producing any sound. Only run my own program again, mpg123
can produce
sound too. What happend to my program.
(Note. I modified the original the esd_play_file function. After I
open socket, I don't close it immediately ,on the contrary keep it
open. untill I force it close. )
Thank you for your help and great work.
Sun Zongun