Component: WAV Player ROM (File)

From Flowcode Help
Jump to navigationJump to search
Author Matrix TSL
Version 1.0
Category File


WAV Player ROM component

Stores an audio WAV file in ROM and contains component macros to allow the WAV file to be streamed out. Compatible with analogue outputs such as DAC or PWM.

Component Source Code

Please click here to download the component source project: FC_Comp_Source_WAV_Player.fcfx

Please click here to view the component source code (Beta): FC_Comp_Source_WAV_Player.fcfx

Detailed description

No detailed description exists yet for this component

Examples

No additional examples






Macro reference

EndOfFile

Fc9-comp-macro.png EndOfFile
A simple check to see if we are at the end of the file. Returns 0 if we and not yet at the end fo the file. Returns 1 if we are at the end of the file. 
Fc9-bool-icon.png - BOOL Return


GetBitsPerSample

Fc9-comp-macro.png GetBitsPerSample
Returns the number of bits per sample. 
Fc9-u8-icon.png - BYTE Return


GetNextSample

Fc9-comp-macro.png GetNextSample
Retreives the value for the next sample and auto increments the file pointer. Ideally this function should be called as part of a timer interrupt at the sample rate. The value returned should be passed onto a means of analogue output e.g. a DAC or PWM. 
Fc9-u16-icon.png - UINT Return


GetNumChannels

Fc9-comp-macro.png GetNumChannels
Returns the number of audio channels stored in the WAV file. 
Fc9-u8-icon.png - BYTE Return


SetFilePointer

Fc9-comp-macro.png SetFilePointer
Allows direct control of the file pointer. Write the file pointer to 0 to reset the pointer to the beginning of the file. Write the file pointer to 0xFFFFFFFF to force the pointer to the end of the file. 
Fc9-u32-icon.png - ULONG Pointer
Range: 0x0 to 0xFFFFFFFF, 0 = Beginning of file 
Fc9-void-icon.png - VOID Return


Property reference

Fc9-prop-icon.png Properties
Fc9-type-13-icon.png WAV File
WAV File to Embed into the ROM Flash memory. 
Fc9-type-10-icon.png File Status
Displays diagnostic data about the selected file. 
Fc9-type-21-icon.png Num Channels
Number of audio channels encoded in the WAV file. 1 indicates a MONO audio stream. 2 indicates a STEREO autio stream. 
Fc9-type-21-icon.png Sample Rate
The rate in samples per second at which the WAV file was recorded. 
Fc9-type-21-icon.png Bits Per Sample
The number of bits used to store a single sample. 
Fc9-type-21-icon.png Byte Rate
The number of data bytes per second that need to be processed in order to maintain playback. 
Fc9-type-21-icon.png ROM Bytes
Number of bytes of ROM that will be required to store the WAV file.