Difference between revisions of "Component: WAV Player ROM (File)"
From Flowcode Help
Jump to navigationJump to searchLine 17: | Line 17: | ||
==Component Source Code== | ==Component Source Code== | ||
− | Please click here to download the component source project: [https://www.flowcode.co.uk/ | + | Please click here to download the component source project: [https://www.flowcode.co.uk/wiki/componentsource/FC_Comp_Source_WAV_Player.fcfx FC_Comp_Source_WAV_Player.fcfx] |
Please click here to view the component source code (Beta): [https://www.flowcode.co.uk/FlowchartView/?wfile=componentsource/FC_Comp_Source_WAV_Player.fcfx FC_Comp_Source_WAV_Player.fcfx] | Please click here to view the component source code (Beta): [https://www.flowcode.co.uk/FlowchartView/?wfile=componentsource/FC_Comp_Source_WAV_Player.fcfx FC_Comp_Source_WAV_Player.fcfx] | ||
==Detailed description== | ==Detailed description== | ||
+ | |||
+ | |||
Line 34: | Line 36: | ||
==Examples== | ==Examples== | ||
+ | |||
+ | |||
Line 46: | Line 50: | ||
==Macro reference== | ==Macro reference== | ||
+ | |||
+ | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
+ | |- | ||
+ | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
+ | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''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. | ||
+ | |- | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u32-icon.png]] - ULONG | ||
+ | | width="90%" | Pointer | ||
+ | |- | ||
+ | | colspan="2" | Range: 0x0 to 0xFFFFFFFF, 0 = Beginning of file | ||
+ | |- | ||
+ | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID | ||
+ | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
+ | |} | ||
+ | |||
+ | |||
+ | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
+ | |- | ||
+ | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
+ | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''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. | ||
+ | |- | ||
+ | |- | ||
+ | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-bool-icon.png]] - BOOL | ||
+ | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
+ | |} | ||
+ | |||
+ | |||
+ | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
+ | |- | ||
+ | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
+ | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetNumChannels''' | ||
+ | |- | ||
+ | | colspan="2" | Returns the number of audio channels stored in the WAV file. | ||
+ | |- | ||
+ | |- | ||
+ | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE | ||
+ | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
+ | |} | ||
+ | |||
+ | |||
+ | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
+ | |- | ||
+ | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
+ | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetBitsPerSample''' | ||
+ | |- | ||
+ | | colspan="2" | Returns the number of bits per sample. | ||
+ | |- | ||
+ | |- | ||
+ | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE | ||
+ | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
+ | |} | ||
+ | |||
+ | |||
+ | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
+ | |- | ||
+ | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
+ | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''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. | ||
+ | |- | ||
+ | |- | ||
+ | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u16-icon.png]] - UINT | ||
+ | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
+ | |} | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | ==Property reference== | ||
+ | |||
+ | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
+ | |- | ||
+ | | width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-prop-icon.png]] | ||
+ | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Properties''' | ||
+ | |- | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-type-13-icon.png]] | ||
+ | | width="90%" | WAV File | ||
+ | |- | ||
+ | | colspan="2" | WAV File to Embed into the ROM Flash memory. | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-type-10-icon.png]] | ||
+ | | width="90%" | File Status | ||
+ | |- | ||
+ | | colspan="2" | Displays diagnostic data about the selected file. | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-type-21-icon.png]] | ||
+ | | width="90%" | Num Channels | ||
+ | |- | ||
+ | | colspan="2" | Number of audio channels encoded in the WAV file. 1 indicates a MONO audio stream. 2 indicates a STEREO autio stream. | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-type-21-icon.png]] | ||
+ | | width="90%" | Sample Rate | ||
+ | |- | ||
+ | | colspan="2" | The rate in samples per second at which the WAV file was recorded. | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-type-21-icon.png]] | ||
+ | | width="90%" | Bits Per Sample | ||
+ | |- | ||
+ | | colspan="2" | The number of bits used to store a single sample. | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-type-21-icon.png]] | ||
+ | | width="90%" | Byte Rate | ||
+ | |- | ||
+ | | colspan="2" | The number of data bytes per second that need to be processed in order to maintain playback. | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-type-21-icon.png]] | ||
+ | | width="90%" | ROM Bytes | ||
+ | |- | ||
+ | | colspan="2" | Number of bytes of ROM that will be required to store the WAV file. | ||
+ | |}==Macro reference== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" |
Revision as of 10:00, 27 January 2023
Author | Matrix TSL |
Version | 1.0 |
Category | File |
Contents
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 |
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. | |
![]() |
Return |
![]() |
GetNumChannels |
Returns the number of audio channels stored in the WAV file. | |
![]() |
Return |
![]() |
GetBitsPerSample |
Returns the number of bits per sample. | |
![]() |
Return |
Property reference
==Macro reference==
![]() |
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. | |
![]() |
Return |
![]() |
GetNumChannels |
Returns the number of audio channels stored in the WAV file. | |
![]() |
Return |
![]() |
GetBitsPerSample |
Returns the number of bits per sample. | |
![]() |
Return |
Property reference
==Macro reference==
![]() |
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. | |
![]() |
Return |
![]() |
GetNumChannels |
Returns the number of audio channels stored in the WAV file. | |
![]() |
Return |
![]() |
GetBitsPerSample |
Returns the number of bits per sample. | |
![]() |
Return |
Property reference
==Macro reference==
![]() |
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. | |
![]() |
Return |
![]() |
GetNumChannels |
Returns the number of audio channels stored in the WAV file. | |
![]() |
Return |
![]() |
GetBitsPerSample |
Returns the number of bits per sample. | |
![]() |
Return |