Go Back   VEX Forum > Community > Technical Discussion

Technical Discussion Open Technical Discussion of the VEX Robotics System.

Reply
 
Thread Tools
  #31  
Old 05-06-2012, 06:06 PM
jpearman's Avatar
jpearman jpearman is offline
Senior Member
VEX # 8888
 
Join Date: Apr 2011
Location: Los Angeles
Posts: 3,349
Images: 2
Re: Vex Speaker

Quote:
Originally Posted by jpearman View Post
I'm on a Mac so I just exported from Quicktime player. I will look for a PC converter tomorrow or perhaps just hack something together, the wave file format is very simple.
I spent a little time looking for a good free wave file converter and could not find one that will create a wave file that ROBOTC will play (without further modification). If it had worked, this looked about the best.

Name:  switch_audio_converter.jpg
Views: 584
Size:  47.5 KB

The problem seems to be probably a bug in the way ROBOTC parses the wave header. I created a short 1000Hz sine wave sampled at 8K, 8 bit mono in quicktime, this played OK. I then tried converting that using the switch sound converter software, the only change to the file was to the "fmt" chuck which was two bytes longer but still valid, this will not play in ROBOTC. I also had a look at the files on the ROBOTC blog, these have an extra (unneeded) chunk in the header, I tried modifying the converted file by adding this and adjusting the data size field, the file would now play. Here is a hex dump of the header of each of these three files, 1k_qt.wav plays, 1k_switch.wav will not play, 1k_switch_a.wav will play. Guess I will send this info the CMU and report as a bug.

Name:  wavefile.jpg
Views: 716
Size:  41.6 KB
Reply With Quote
  #32  
Old 05-06-2012, 08:17 PM
TheBlackSheeba's Avatar
TheBlackSheeba TheBlackSheeba is offline
Junior Member
VEX # 1241Q
 
Join Date: Apr 2012
Location: Rick Hansen Secondary School
Posts: 20
Re: Vex Speaker

Can you use any .wav file ? If yes, then how would I get that to robot c or download it to my cortex ?
__________________
VEX Regional Tournament Champion 2011-2012 | VEX Regional Think Award Recipient 2011-2012
VEX Regional Tournament Champion 2011-2012 | VEX Regional Programming Skills Champion 2011-2012
VEX Regional Tournament Champion 2011-2012 | VEX Regional Excellence Award Recipient 2011-2012
VEX World Champion Think Award Recipient 2011-2012 | VEX Regional Think Award Recipient 2012-2013
VEX Regional Tournament Finalist 2012-2013 | VEX Regional Tournament Champion 2012-2013
VEX Regional Build Award 2012-2013 | VEX Regional Tournament Champion 2012-2013
VEX Regional Design Award 2012-2013
VEX World Championship Arts Division Finalists 2012-2013


1241Q The Black Sheeba!
Reply With Quote
  #33  
Old 05-07-2012, 12:22 AM
Quazar's Avatar
Quazar Quazar is offline
Senior Member
 
Join Date: Aug 2007
Location: SF Bay Area
Posts: 1,240
Images: 16
Re: Vex Speaker

Quote:
Originally Posted by TheBlackSheeba View Post
Can you use any .wav file ?
Read the last dozen or so posts on this thread - it covers what WAV files will and won't play.

Quote:
Originally Posted by TheBlackSheeba View Post
If yes, then how would I get that to robot c or download it to my cortex ?
This wiki page shows how to upload files to the Cortex via ROBOTC.

Cheers,
- Dean
Reply With Quote
  #34  
Old 05-07-2012, 06:54 AM
Team80_Giraffes's Avatar
Team80_Giraffes Team80_Giraffes is offline
Senior Member
VEX # 80
 
Join Date: Feb 2011
Location: Downingtown, PA
Posts: 601
Re: Vex Speaker

Quote:
Originally Posted by Rick TYler View Post
Maybe there needs to be an Online Challenge for "best music?" I would give an automatic first prize (kidding) to the first person (kidding) who was able to play all of "Bohemian Rhapsody" (kidding).
I guess this may be for the college challenge since they have both robots.

What would be even cooler is each robot "singing" it's own part. Galileo coming from one robot and then answered by the other? That'd be sweet! Maybe all the pauses will reduce the file size enough to work.

I guess now we'll see exactly how in sync robots really are from when they get the autonomous switched on or driver controlled loops.

Come on KTOR, get programming!
__________________
Vexmen Teams 80[A-Z]$|81[A-Z]$|90[A-Z]$|91[A-Z]$ Downingtown, PA, USA

The Vexmen, Downingtown, PA, USA
Reply With Quote
  #35  
Old 05-07-2012, 07:04 AM
magicode's Avatar
magicode magicode is offline
Senior Member
VEX # 4542
 
Join Date: Sep 2010
Posts: 608
Images: 8
Re: Vex Speaker

In college, at least in gateway, you were allowed to hook anything into the partner port of the joystick. This means unlimited memory, as you can hook a laptop into the partner port, and bit bang out data to the Cortex.
__________________
It's not a bug, it's a feature.
Reply With Quote
  #36  
Old 05-07-2012, 06:05 PM
MarkGlover's Avatar
MarkGlover MarkGlover is offline
Senior Member
 
Join Date: Mar 2010
Location: New Zealand
Posts: 130
Images: 11
Send a message via Skype™ to MarkGlover
Re: Vex Speaker

Quote:
Originally Posted by 1069E View Post
Well, when we were at Worlds we rigged up the speaker to play "Still Alive" with relatively good quality!

I found the MIDI equivalent of the song and then used this to convert it.
I used this multiple times when converting MIDI files, but it always gave me errors in the code
Reply With Quote
  #37  
Old 05-07-2012, 07:04 PM
jpearman's Avatar
jpearman jpearman is offline
Senior Member
VEX # 8888
 
Join Date: Apr 2011
Location: Los Angeles
Posts: 3,349
Images: 2
Re: Vex Speaker

Mark

It occurred to me today that I did not actually try audacity as a converter. This was mostly due to the fact that the version on my Mac was old (V1.3) and I did not realize that it did indeed have the option of exporting wav files as 8 bit. So I downloaded V2.0 for PC and created a test wav file, it works with no problems and the header looks similar to the quicktime version.

One other thing I did not mention yesterday is that there is currently a 128K file size limit for files on the cortex, anything larger fails to download, perhaps this is your problem. It means that audio files are limited to 15.9 seconds in 8 bit mono 8KHz sampling.
Reply With Quote
  #38  
Old 05-07-2012, 10:25 PM
1069E's Avatar
1069E 1069E is offline
Member
VEX # 1069E
 
Join Date: Jan 2012
Location: Berthoud, Colorado
Posts: 39
Re: Vex Speaker

Quote:
Originally Posted by MarkGlover View Post
I used this multiple times when converting MIDI files, but it always gave me errors in the code
I had to *shudder* manually enter the code by hand, otherwise it threw errors for me as well.
Reply With Quote
  #39  
Old 05-08-2012, 12:56 AM
MarkGlover's Avatar
MarkGlover MarkGlover is offline
Senior Member
 
Join Date: Mar 2010
Location: New Zealand
Posts: 130
Images: 11
Send a message via Skype™ to MarkGlover
Re: Vex Speaker

Quote:
Originally Posted by jpearman View Post
Mark

It occurred to me today that I did not actually try audacity as a converter. This was mostly due to the fact that the version on my Mac was old (V1.3) and I did not realize that it did indeed have the option of exporting wav files as 8 bit. So I downloaded V2.0 for PC and created a test wav file, it works with no problems and the header looks similar to the quicktime version.

One other thing I did not mention yesterday is that there is currently a 128K file size limit for files on the cortex, anything larger fails to download, perhaps this is your problem. It means that audio files are limited to 15.9 seconds in 8 bit mono 8KHz sampling.
Ok so the file I have been trying is less that 5 seconds long is 8 bit mono 8KHz but when I try it the speaker just plays white noise (not the song, it would be cool if it were playing the song)
Reply With Quote
  #40  
Old 01-28-2013, 08:11 AM
sbdrobotics's Avatar
sbdrobotics sbdrobotics is offline
Senior Member
VEX # 4080
 
Join Date: Jan 2013
Location: Rockwall, TX
Posts: 813
Re: Vex Speaker

I have the Star Wars "Imperial March" converted to where it plays on the Cortex. Now if I can learn a bit more about RobotC to get it to work while the autonomous mode is going. I placed the code in my competition template, but have not discovered which command will let it play simultaneously during the autonomous period. Right now it plays all the way through and then begins to execute the rest of the code. Any advice from someone who has a good grasp on RobotC would be appreciated!
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -6. The time now is 02:38 PM.


VEX and VEX Robotics are trademarks or service marks of Innovation First International, Inc.
Copyright © 2002-2013. All Rights Reserved. VEX Robotics, Inc. is a subsidiary of Innovation First International, Inc.
All other product names/marks of others are the property of their respective owners.