The main class that you will use to create your WAV files.
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
integer, | public, | parameter | :: | MAX_AMPLITUDE | = | 32767 |
Maximum amplitude in a WAV [-32768 ; +32767]: |
integer, | private | :: | status |
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
real(kind=wp), | public | :: | duration |
Duration in seconds: |
|||
character(len=:), | public, | allocatable | :: | filename | |||
integer, | public | :: | fileunit | ||||
real(kind=wp), | public, | dimension(:, :), allocatable | :: | left |
Two arrays stocking the stereo tracks: |
||
real(kind=wp), | public, | dimension(:, :), allocatable | :: | right |
Two arrays stocking the stereo tracks: |
||
integer, | public | :: | samples |
Number of samples: |
|||
integer, | public | :: | tracks |
Number of audio tracks (excluding track 0 reserved for the final mix): |
procedure, public :: clear_tracks | |
procedure, public :: close_WAV_file | |
procedure, public :: copy_section | |
procedure, public :: create_WAV_file | |
procedure, public :: finalize | |
procedure, public :: get_name | |
procedure, public :: mix_tracks | |
procedure, public :: new | |
procedure, private :: write_header | |
procedure, private :: write_normalized_data |
Must be called at the end. It normalizes the channels, writes them in the WAV file and closes it. It also deallocate the tape arrays.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(WAV_file), | intent(inout) | :: | self |
Create a WAV file with a header:
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(WAV_file), | intent(inout) | :: | self | |||
character(len=*), | intent(in) | :: | filename | |||
integer, | intent(in) | :: | tracks | |||
real(kind=wp), | intent(in) | :: | duration |
Creates the 44 bytes WAV header and prints some information:
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(WAV_file), | intent(inout) | :: | self |
WAV parameters: |
This method normalizes the sound amplitude on track 0, before saving the left and right channels in the WAV file.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(WAV_file), | intent(inout) | :: | self |