Jump to content

Component: WAV Player ROM (File)

From Flowcode Help
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

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. 
- BOOL Return


GetBitsPerSample

GetBitsPerSample
Returns the number of bits per sample. 
- BYTE Return


GetNextSample

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. 
- UINT Return


GetNumChannels

GetNumChannels
Returns the number of audio channels stored in the WAV file. 
- BYTE Return


SetFilePointer

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. 
- ULONG Pointer
Range: 0x0 to 0xFFFFFFFF, 0 = Beginning of file 
- VOID Return


Property reference

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