Subject:
|
Re: NXT memory limits
|
Newsgroups:
|
lugnet.robotics
|
Date:
|
Fri, 5 May 2006 16:27:50 GMT
|
Viewed:
|
2718 times
|
| |
| |
In lugnet.robotics, Tim Byrne wrote:
>
> Having no knowledge of the NXT, I'm not sure what a .RSO file is.
Most of the file extensions on the NXT start with .R and end with two characters
which suggest the file type (SO for sound, XE for executable, TM for "try me",
DT for datalog, etc...).
A .RSO file is a massaged .WAV file. The .RSO file format is
byte FormatMSB;
byte FormatLSB;
byte DataBytesMSB;
byte DataBytesLSB;
byte SampleRateMSB;
byte SampleRateLSB;
byte PlayModeMSB;
byte PlayModeLSB;
byte SoundData[];
That is not the same as the .WAV file format so you need to use a conversion
program like my wav2rso executable.
> You can have Bluetooth headphones paired with a Bluetooth laptop, and
> it can stream hours of music to the headphones when the headphones
The only bluetooth service exposed by the NXT is Bluetooth serial port.
> I imagine the way it could possibly work on NXT would be while a program that
> downloads sound data over BT, it plays the buffered data, and deletes it once
> it's played.
No can do. Talking to the NXT via bluetooth involves sending a packet with a
maximum size of 66 bytes where the first bytes are the total packet size. Under
program control the only thing you can do wait for a bluetooth message to
arrive, read it, and then do something with the data. That something might be
to write it to a file with a .rso extension. Your program could theoretically
finally get a message which indicates that all the data has arrived and it could
then attempt to play the .rso it just saved. But it can't play the content of
the bluetooth messages as it receives them unless the data is raw tone frequency
and duration data in which case it could play and discard that sort of data. It
would not be anything like playing a streaming sound file, however.
> Can the NXT do multi-threaded things like that? Download data, while another
> thread is playing some already buffered data?
This might be possible. In theory, you could have one thread checking whether a
file exists and can be opened and playing it if it can while another thread
receives data via bluetooth and writes it to a file. Once the sound has been
played the sound playing thread could delete the file.
Hope this helps,
John Hansen
|
|
Message is in Reply To:
| | Re: NXT memory limits
|
| (...) Having no knowledge of the NXT, I'm not sure what a .RSO file is. (a quick Google search of .RSO and sound takes me to the Raleigh Symphony Orchestra, and that seems way off LOL ) However, let me give an example of technology I am aware of. (...) (19 years ago, 5-May-06, to lugnet.robotics)
|
15 Messages in This Thread:
- Entire Thread on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
|
|
|
|