class

WAD::PcSound

Inherits WritingAdditions::PcSound < Reference < Object

A pc speaker sound effect.

Constants

SAMPLE_RATE = 140

Constructors

parse(filename : String | Path) : PcSound

Parses a pc sound lump.

Opens a pc sound file and parses it:

my_pcsound = WAD::PcSound.parse("Path/To/PcSound")
parse(io : IO) : PcSound

Parses a pc sound lump.

Opens a pc sound io and parses it:

File.open("Path/To/PcSound") do |file|
  my_pcsound = WAD::PcSound.parse(file)
end

Class methods

is_pcsound?(name : String)

Checks to see if name is a pc sound with name format 'DPx..x'.

Returns true if the name is a pc sound:

pcsound_name = "DPNOWAY"
if WAD::PcSound.is_pcsound?(pcsound_name)
  puts "Is a Pc Sound"
else
  puts "Is not a Pc Sound"
end

Instance methods

clone

Returns a copy of self with all instance variables cloned.

format_num
format_num=(format_num : UInt16)
samples
samples=(samples : Array(UInt8))
samples_num
samples_num=(samples_num : UInt16)