class WAD::PcSound

Overview

A pc speaker sound effect.

Included Modules

Defined in:

wa-cr/wad/wad-data/sound.cr
write.cr

Constant Summary

SAMPLE_RATE = 140

Constructors

Class Method Summary

Instance Method Summary

Instance methods inherited from module WritingAdditions::PcSound

write(file : String | Path) : UInt32
write(io : IO) : UInt32
write

Constructor Detail

def self.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")

def self.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 Method Detail

def self.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 Method Detail

def clone #

Returns a copy of self with all instance variables cloned.


def format_num : UInt16 #

def format_num=(format_num : UInt16) #

def samples : Array(UInt8) #

def samples=(samples : Array(UInt8)) #

def samples_num : UInt16 #

def samples_num=(samples_num : UInt16) #