Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
02/11/03 06:11
Read: times


 
#38756 - RE: more problems in wave file
Responding to: ???'s previous message
Buffering is pretty easy once you have some degree of concurrency... Receive the chunks in one "thread" and play them in another.

Now I'm not saying using RTOS, all I'd like to point out is that a serial port and timers can run independently. Hence you configure your timer to generate an interrupt 8000 times a second, and in the ISR, simply pick up a value from a circular buffer and output it to the DAC.

Then on the serial port side, you need a protocol to fetch several bytes of data at a go, and feed them into the circular buffer. You need a good pre-buffering algorithm, where-in you check how much of the buffer is left/used up, and request more bytes from the PC accordingly. Buffer overflows and underflows must be checked.

Since it's a pretty simple program, you can use most of the available on-chip RAM as your buffer.

However Menno raises a good point about baud rates. You might be better off using the parallel port. It's actually interesting since you have to develop your own handshake signals, and these signals can actually become part of your wave-data request protocol, hence leading to a more compact communication protocol.

And before you run into problems later on I MUST warn you that any Windows version after Win 95 does NOT allow direct access to the hardware and interrupts. So even if your Turbo C program may run on Win 2K, its actually trapping all hardware calls and routing them through its own abstraction layer... You will notice that there is absolutely no real-time response, and lots of things dont work as u expect them to. Stick to Win 95.

kundi

List of 5 messages in thread
TopicAuthorDate
more problems in wave file            01/01/70 00:00      
   RE: more problems in wave file            01/01/70 00:00      
   RE: more problems in wave file            01/01/70 00:00      
      RE: more problems in wave file            01/01/70 00:00      
         RE: more problems in wave file            01/01/70 00:00      

Back to Subject List