Jump to content

Component: WAV Player ROM (File): Difference between revisions

From Flowcode Help
m Text replacement - "class="wikitable" style="width:60%; background-color:#FFFFFF;"" to "class="mtx-class-macrotable wikitable""
m Text replacement - "width="90%" style="background-color:#D8C9D8; color:#4B008D;"" to "width="90%" class="mtx-class-macrohead""
 
(2 intermediate revisions by the same user not shown)
Line 68: Line 68:
{| class="mtx-class-macrotable wikitable"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''EndOfFile'''
| width="90%" class="mtx-class-macrohead" | '''EndOfFile'''
|-
|-
| colspan="2" | 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. 
| colspan="2" | 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. 
Line 82: Line 82:
{| class="mtx-class-macrotable wikitable"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetBitsPerSample'''
| width="90%" class="mtx-class-macrohead" | '''GetBitsPerSample'''
|-
|-
| colspan="2" | Returns the number of bits per sample. 
| colspan="2" | Returns the number of bits per sample. 
Line 96: Line 96:
{| class="mtx-class-macrotable wikitable"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetNextSample'''
| width="90%" class="mtx-class-macrohead" | '''GetNextSample'''
|-
|-
| colspan="2" | 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. 
| colspan="2" | 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. 
Line 110: Line 110:
{| class="mtx-class-macrotable wikitable"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetNumChannels'''
| width="90%" class="mtx-class-macrohead" | '''GetNumChannels'''
|-
|-
| colspan="2" | Returns the number of audio channels stored in the WAV file. 
| colspan="2" | Returns the number of audio channels stored in the WAV file. 
Line 124: Line 124:
{| class="mtx-class-macrotable wikitable"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetFilePointer'''
| width="90%" class="mtx-class-macrohead" | '''SetFilePointer'''
|-
|-
| colspan="2" | 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. 
| colspan="2" | 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. 
Line 144: Line 144:
{| class="mtx-class-macrotable wikitable"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-prop-icon.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-prop-icon.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Properties'''  
| width="90%" class="mtx-class-macrohead" | '''Properties'''  
|-
|-
|-
|-

Latest revision as of 14:23, 13 July 2026

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.