mirror of
https://github.com/ScrelliCopter/VGM-Tools
synced 2025-02-21 04:09:25 +11:00
wavetable stuff
This commit is contained in:
@@ -1,8 +1,11 @@
|
||||
# wavewriter.py -- Extensible WAVE writing framework
|
||||
# (C) 2023 a dinosaur (zlib)
|
||||
|
||||
import struct
|
||||
from abc import abstractmethod
|
||||
from enum import Enum
|
||||
from typing import BinaryIO, List
|
||||
from riffwriter import RiffFile, AbstractRiffChunk
|
||||
from common.riffwriter import RiffFile, AbstractRiffChunk
|
||||
|
||||
|
||||
class WaveSampleFormat(Enum):
|
||||
@@ -46,6 +49,11 @@ class WaveAbstractFormatChunk(AbstractRiffChunk):
|
||||
self.bitdepth()))
|
||||
|
||||
|
||||
class WaveFile(RiffFile):
|
||||
def __init__(self, format: WaveAbstractFormatChunk, chunks: List[AbstractRiffChunk]):
|
||||
super().__init__(b"WAVE", [format] + chunks)
|
||||
|
||||
|
||||
class WavePcmFormatChunk(WaveAbstractFormatChunk):
|
||||
def sampleformat(self) -> WaveSampleFormat: return WaveSampleFormat.PCM
|
||||
|
||||
@@ -88,8 +96,3 @@ class WaveCommentChunk(AbstractRiffChunk):
|
||||
|
||||
def __init__(self, comment: bytes):
|
||||
self._comment = comment
|
||||
|
||||
|
||||
class WaveFile(RiffFile):
|
||||
def __init__(self, format: WaveAbstractFormatChunk, chunks: List[AbstractRiffChunk]):
|
||||
super().__init__(b"WAVE", [format] + chunks)
|
||||
|
||||
Reference in New Issue
Block a user