1. Summary
  2. Files
  3. Support
  4. Report Spam
  5. Create account
  6. Log in

RSO file structure

Discussion specific to NXT-G, NXC, NBC, RobotC, Lejos, and more.

RSO file structure

Postby twodotzero » 11 Oct 2012, 13:25

Where can I find description of RSO file structure?
Posts: 2
Joined: 11 Oct 2012, 13:06

Re: RSO file structure

Postby afanofosc » 11 Oct 2012, 14:52

RSO files contain PCM or ADPCM mono samples with a default sample rate of 8k. You can look at my Pascal source code for converting from/to WAV format to/from RSO format.

http://bricxcc.svn.sourceforge.net/svnr ... RsoCvt.pas

The file starts with a short header containing 4 big-endian Words (8 bytes total). These are the format (0x0101 = adpcm, 0x0100 = pcm), the chunk size (total byes of sample data), the sample rate, and the play mode (ignored). So the file length will always be #sample bytes+8.

You can also look in the firmware source code, either as posted by LEGO or my enhanced version of that same code.

http://mindboards.svn.sourceforge.net/v ... /c_sound.c

See also the d_sound.c, d_sound.r, and d_sound_adpcm.r files for the low level details.

John Hansen
Multi-platform LEGO MINDSTORMS programming
User avatar
Site Admin
Posts: 1256
Joined: 26 Sep 2010, 19:36
Location: Nashville, TN

Re: RSO file structure

Postby twodotzero » 12 Oct 2012, 15:28

Thank you very much.
Posts: 2
Joined: 11 Oct 2012, 13:06

Return to Mindstorms Software

Who is online

Users browsing this forum: No registered users and 1 guest