View unanswered posts | View active topics It is currently Fri Aug 29, 2014 2:27 pm






Reply to topic  [ 17 posts ]  Go to page Previous  1, 2
Bug when using random and PlayTone 
Author Message
Rookie

Joined: Sat Aug 09, 2008 7:18 pm
Posts: 17
Post Re: Bug when using random and PlayTone
By the way, I pretty much understood all of your explanation of the hardware/firmware except for one thing:

"For WAV files, the NXT hardware is interrupted for every sample. The sample is 8-bits. The sample value is translated into a 256-bit pattern with the number of ones in the pattern equal to the sample value."

I'm not sure what you mean when you say that an 8 bit sample is translated into a 256 bit pattern. Can you elaborate on this a bit more? I understand that you have an 8 bit number with values in the range 0-255. Why is that translated into a 256 bit pattern?


Mon Aug 18, 2008 11:26 pm
Profile
Rookie

Joined: Sat Aug 09, 2008 7:18 pm
Posts: 17
Post Re: Bug when using random and PlayTone
Wait, I think I get it. The sample size is 8 bits, which makes for sounds that are approximately telephone quality. Larger sample size would result in larger data for wav files so we keep it to 8 bits, but DMA buffer is 256 bits, so thats why we do the conversion. Am I on the right track? If I were working with a smaller data set than a wav file, ("real time" samples like square waves, for example), It's conceivable that I could use 16 bit samples if I wanted... I really think there are a lot of possibilities here. How hard do you think it would be to expose the functionality for what you described in #4 of your post:

4. Instead of playing a WAV file, provide an interface where user program provides a sample rate and an array of values to output. With/without a continuous looping option. That way, user application could calculate the samples at its leisure without regard to real-time and then have them played back in real-time.


Mon Aug 18, 2008 11:44 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 17 posts ]  Go to page Previous  1, 2

Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  



Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.