Hi,
So, the PlaySound routine opens a file from the local drive and inserts the data into the program. I'd like to do this but parse a text file (really, a YAML file) and create variables according to what's in the file. I haven't the foggiest clue how to start doing this except some vague notion that I'll probably need to use a "Program Memory Data Item" as described in section 2.10 of the ZBasic Reference manual. Where do I go from there?
Thanks!
opening and parsing local computer files
Re: opening and parsing local computer files
Not quite. The PlaySound routine simply uses a block of data from Program Memory containing the sound data to recreate the sound waveform. How that block of data gets created/defined is a completely separate issue.wulftone wrote:So, the PlaySound routine opens a file from the local drive and inserts the data into the program.
For this, you'll have to write a program to run on your PC to convert the data in the YAML file to one or more data files. The format of the data file will likely be in the form of initialization data for Program Memory Data Items.wulftone wrote:I'd like to do this but parse a text file (really, a YAML file) and create variables according to what's in the file.
Perhaps you could describe the content of the YAML file and the types of data you intend to extract from it. With that, someone may be able to show some example code.
- Don Kinzer