class WAD::PcSound
- WAD::PcSound
- Reference
- Object
Overview
A pc speaker sound effect.
Included Modules
Defined in:
wa-cr/wad/wad-data/sound.crwrite.cr
Constant Summary
-
SAMPLE_RATE =
140
Constructors
-
.parse(filename : String | Path) : PcSound
Parses a pc sound lump.
-
.parse(io : IO) : PcSound
Parses a pc sound lump.
Class Method Summary
-
.is_pcsound?(name : String)
Checks to see if name is a pc sound with name format 'DPx..x'.
Instance Method Summary
-
#clone
Returns a copy of
self
with all instance variables cloned. - #format_num : UInt16
- #format_num=(format_num : UInt16)
- #samples : Array(UInt8)
- #samples=(samples : Array(UInt8))
- #samples_num : UInt16
- #samples_num=(samples_num : UInt16)
Instance methods inherited from module WritingAdditions::PcSound
write(file : String | Path) : UInt32write(io : IO) : UInt32 write
Constructor Detail
Parses a pc sound lump.
Opens a pc sound file and parses it:
my_pcsound = WAD::PcSound.parse("Path/To/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