To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.roboticsOpen lugnet.robotics in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / 8541
8540  |  8542
Subject: 
Re: legOS 0.2.2 dsound_play ?
Newsgroups: 
lugnet.robotics, lugnet.robotics.rcx.legos
Date: 
Thu, 25 Nov 1999 05:37:57 GMT
Viewed: 
1295 times
  
One of my first goals for the RCX was to try and get it to speak.  I talked
to Markus about this a long time ago.  At the time, he had written the
speaker driver but was unable to get much more than noise to come out of
it.  Perhaps the digital resolution of the speaker is such that it can only
produce beeps.

I would be very interested if you can get it to do more than beep.

At 04:15 AM 11/25/99 +0000, you wrote:
hello again,
has anybody got anything else than noise from legOS 0.2.2 dsound_play ?

i'm able to compile and dll this little application:

#include <dsound.h>
#include "sample.h"

int main(int argc, char *argv[])
{
   dsound_play(sample,sizeof(sample));
   return 0;
}

( sample.h was produced by running : sample-convert fuenfte.wav )

However, everything i hear when i press RUN is a short burst of noise.

What i'm wondering about: as far as i understand currently, dsound_play
works as follows:
8-Bit-Timer0 (whose output is wired to the speaker ?) is programmed to
output 1 on compare A match, and 0 on compare B match. IRQ is enabled on
A match, and the IRQ handler puts a new sample into compare B register
on every 4.th interrupt. The level of A match is fixed to 0xff-20 = 235
( maybe the speaker needs some DC ??).
Timer base frequency is set to system/2 making 8 Mhz, what results in
8000000/256 = 31250 IRQ frequency. Because only every 4.th interrupt
gets a new sample, actual playback frequency is 31250/4 = 7812.5,
approximately 8000.
Thus, the average voltage that is output to the speaker will be
following the samples, as long as the value of the samples won't exceed
235. However, the converted sample.h contains many values larger than
235, so i think this can't work.
Thanks for any hints (or a .wav file that plays nicely),        Martin


Joel Shafer    joel@connect.net



1 Message in This Thread:

Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    
Active threads in Robotics

 
Verified and Trusted Team of Hackers
11 hours ago
Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR