NXT Speaker Add-on/ Solution?

This is where you talk about the NXJ hardware related topics such as the brick, sensors, LEGO pieces, etc

Moderators: roger, 99jonathan, imaqine

NXT Speaker Add-on/ Solution?

Postby chrismikehogan » Thu Mar 29, 2012 6:25 pm

I am trying to develop a bot that can be used in child social experiments. One of the more important aspects is that the bot should be able to speak pre-recorded lines.

Between the paltry on-board memory and the dinky speaker of the NXT brick, simply putting the audio files on the brick and playing them locally is not going to work.

My question: Is there a hack anyone has tried to give the NXT a more robust speaker? My only planned solution has included using an android phone that talked to the bot via bluetooth, and the bot could just issue commands to the phone to play certain files when desired. Any other or similar solutions?
chrismikehogan
New User
 
Posts: 6
Joined: Sat Mar 24, 2012 11:26 pm

Re: NXT Speaker Add-on/ Solution?

Postby gloomyandy » Thu Mar 29, 2012 9:32 pm

It is possible to stream audio to the NXT... You have to work quite hard to do it though and this won't help with the speaker...
http://www.youtube.com/watch?list=UUhrY ... xD0qeLHEpM

Andy
User avatar
gloomyandy
leJOS Team Member
 
Posts: 3003
Joined: Fri Sep 28, 2007 2:06 pm
Location: UK

Re: NXT Speaker Add-on/ Solution?

Postby chrismikehogan » Thu Mar 29, 2012 10:27 pm

Do you have the code, or the steps you took, available publicly?
chrismikehogan
New User
 
Posts: 6
Joined: Sat Mar 24, 2012 11:26 pm

Re: NXT Speaker Add-on/ Solution?

Postby gloomyandy » Fri Mar 30, 2012 9:41 am

No sorry. I basically hacked it together from the btsend and btreceive sample programs to test the Sound.playSample api:
http://lejos.sourceforge.net/nxt/nxj/ap ... ample(byte[], int, int, int, int)
It's not that hard, you just need to take care to use largish I/O buffers and use the lower level I/O routines to minimize the amount of data copying that goes on... Then it is just a case of convert the sound file into a suitable format (in my base 8 bit mono, 16KHz sample rate), and opening the file on the pc and sending it to the NXT over USB/BT. On the NXT read the data buffers and feed them into playSample. You may have to play around a little with the various buffer sizes to get smooth play back...

Andy
User avatar
gloomyandy
leJOS Team Member
 
Posts: 3003
Joined: Fri Sep 28, 2007 2:06 pm
Location: UK


Return to NXJ Hardware

Who is online

Users browsing this forum: No registered users and 0 guests

more stuff