playing sound files w/ RobotC

having troubles playing sound files with RobotC I using the following simple code:
task main()
{
playSoundFile(“gump.wav”);
}

I have loaded the file in the File Management Utility and selected the “download to default slot” button. However I get a Robot C message saying it was unable to locate the following files for download?

Put the sound file in the same folder as the program, so robotc will be able to find it.

And I get this error message:
Error**:Illegal NXT / EV3 filename ‘gump.wav’

The platform type is set to Vex 2.0 Cortex

I copied the .wav file to the same directory where I have the code saved.

Just use the normal download button rather than the download to default slot. If you download to default and then download your code your first file is wiped. Remember the robot code goes into default and is run first.

I get that too, and my sound file plays just fine, just ignore it. It is strange though.

Here is a screenshot of what I have. Seems like I’ve tried everything in this File Mgmt Utility. Not sure where to go :confused:

Are you sure that file is in the right format? ROBOTC is very picky about the format of the wav file, 8 bit mono etc.

Don’t use the file management utility, just make sure the audio file is in the same folder as the program then download the program to the robot. If this doesn’t work you may need to delete the sound file using the file management utility, then download the program.

Have you ever actually gotten RobotC audio to work like this? I have only ever used the file utility. It gives far more control and lets you figure out how much more space you have to fill with sounds. Last year I had a sound board on my robot that I dedicated the left joystick to.

I ran alliance selection by having the robot say the team name because I knew who I wanted to pick and had that as part of the sound board on the joystick.

Just to check JPearman’s idea try this file

https://dl.dropboxusercontent.com/u/90045276/60.wav

We get this same error when we try to do sound. I asked about it many months ago and no one seemed to know why. I know my file met all the requirements of the cortex.

Those of you that are able to play sound…is it correct to assume you are NOT getting this error? Or are you getting this error but it works anyways?

Yes, this is how I normally do it, I just put the sound file in the same folder as the program and let robotc download the sound to the cortex automatically.

I get this error, but the program compiles and downloads anyways, and the sound works.

Thanks jpearman the 60.wav file worked :smiley: My audio obviously isn’t in the right format.

Use a program like audacity to convert it.
http://audacity.sourceforge.net

In addition to ^
I would suggest following this guide
http://www.robotc.net/wikiarchive/Tutorials/VEX_Speaker_module

jpearman and tabor, I tried the 60. wav file and that worked. So the problem I’ m having is getting the wav files converted to the right format. I have tried a freemake audio converter but no luck yet.

Just to make sure the fomat that the cortex likes is:???
8kHz, 8 bit, Mono, 7kb/sec.

Did you remember this step?
http://s3.amazonaws.com/robotc-wiki/wiki-images/6/67/Specify_Uncompressed.png

I am not sure which step is causing you issues. Are you falling this guide step by step?
[http://www.robotc.net/wikiarchive/Tutorials/VEX_Speaker_module

If its just one file I can do it for you really quick and see if some how I run into issues.](http://www.robotc.net/wikiarchive/Tutorials/VEX_Speaker_module )

Yea, put all the audio files into the same folder as your code. It works for me.

The thread is 2 years old.

woops.